{
  "version": 3,
  "sources": ["../../node_modules/leaflet/src/core/Util.js", "../../node_modules/leaflet/src/core/Class.js", "../../node_modules/leaflet/src/core/Events.js", "../../node_modules/leaflet/src/geometry/Point.js", "../../node_modules/leaflet/src/geometry/Bounds.js", "../../node_modules/leaflet/src/geo/LatLngBounds.js", "../../node_modules/leaflet/src/geo/LatLng.js", "../../node_modules/leaflet/src/geo/crs/CRS.js", "../../node_modules/leaflet/src/geo/crs/CRS.Earth.js", "../../node_modules/leaflet/src/geo/projection/Projection.SphericalMercator.js", "../../node_modules/leaflet/src/geometry/Transformation.js", "../../node_modules/leaflet/src/geo/crs/CRS.EPSG3857.js", "../../node_modules/leaflet/src/layer/vector/SVG.Util.js", "../../node_modules/leaflet/src/core/Browser.js", "../../node_modules/leaflet/src/dom/DomEvent.Pointer.js", "../../node_modules/leaflet/src/dom/DomEvent.DoubleTap.js", "../../node_modules/leaflet/src/dom/DomUtil.js", "../../node_modules/leaflet/src/dom/DomEvent.js", "../../node_modules/leaflet/src/dom/PosAnimation.js", "../../node_modules/leaflet/src/map/Map.js", "../../node_modules/leaflet/src/control/Control.js", "../../node_modules/leaflet/src/control/Control.Layers.js", "../../node_modules/leaflet/src/control/Control.Zoom.js", "../../node_modules/leaflet/src/control/Control.Scale.js", "../../node_modules/leaflet/src/control/Control.Attribution.js", "../../node_modules/leaflet/src/control/index.js", "../../node_modules/leaflet/src/core/Handler.js", "../../node_modules/leaflet/src/core/index.js", "../../node_modules/leaflet/src/dom/Draggable.js", "../../node_modules/leaflet/src/geometry/PolyUtil.js", "../../node_modules/leaflet/src/geometry/LineUtil.js", "../../node_modules/leaflet/src/geo/projection/Projection.LonLat.js", "../../node_modules/leaflet/src/geo/projection/Projection.Mercator.js", "../../node_modules/leaflet/src/geo/projection/index.js", "../../node_modules/leaflet/src/geo/crs/CRS.EPSG3395.js", "../../node_modules/leaflet/src/geo/crs/CRS.EPSG4326.js", "../../node_modules/leaflet/src/geo/crs/CRS.Simple.js", "../../node_modules/leaflet/src/geo/crs/index.js", "../../node_modules/leaflet/src/layer/Layer.js", "../../node_modules/leaflet/src/layer/LayerGroup.js", "../../node_modules/leaflet/src/layer/FeatureGroup.js", "../../node_modules/leaflet/src/layer/marker/Icon.js", "../../node_modules/leaflet/src/layer/marker/Icon.Default.js", "../../node_modules/leaflet/src/layer/marker/Marker.Drag.js", "../../node_modules/leaflet/src/layer/marker/Marker.js", "../../node_modules/leaflet/src/layer/vector/Path.js", "../../node_modules/leaflet/src/layer/vector/CircleMarker.js", "../../node_modules/leaflet/src/layer/vector/Circle.js", "../../node_modules/leaflet/src/layer/vector/Polyline.js", "../../node_modules/leaflet/src/layer/vector/Polygon.js", "../../node_modules/leaflet/src/layer/GeoJSON.js", "../../node_modules/leaflet/src/layer/ImageOverlay.js", "../../node_modules/leaflet/src/layer/VideoOverlay.js", "../../node_modules/leaflet/src/layer/SVGOverlay.js", "../../node_modules/leaflet/src/layer/DivOverlay.js", "../../node_modules/leaflet/src/layer/Popup.js", "../../node_modules/leaflet/src/layer/Tooltip.js", "../../node_modules/leaflet/src/layer/marker/DivIcon.js", "../../node_modules/leaflet/src/layer/marker/index.js", "../../node_modules/leaflet/src/layer/tile/GridLayer.js", "../../node_modules/leaflet/src/layer/tile/TileLayer.js", "../../node_modules/leaflet/src/layer/tile/TileLayer.WMS.js", "../../node_modules/leaflet/src/layer/tile/index.js", "../../node_modules/leaflet/src/layer/vector/Renderer.js", "../../node_modules/leaflet/src/layer/vector/Canvas.js", "../../node_modules/leaflet/src/layer/vector/SVG.VML.js", "../../node_modules/leaflet/src/layer/vector/SVG.js", "../../node_modules/leaflet/src/layer/vector/Renderer.getRenderer.js", "../../node_modules/leaflet/src/layer/vector/Rectangle.js", "../../node_modules/leaflet/src/layer/vector/index.js", "../../node_modules/leaflet/src/layer/index.js", "../../node_modules/leaflet/src/map/handler/Map.BoxZoom.js", "../../node_modules/leaflet/src/map/handler/Map.DoubleClickZoom.js", "../../node_modules/leaflet/src/map/handler/Map.Drag.js", "../../node_modules/leaflet/src/map/handler/Map.Keyboard.js", "../../node_modules/leaflet/src/map/handler/Map.ScrollWheelZoom.js", "../../node_modules/leaflet/src/map/handler/Map.TapHold.js", "../../node_modules/leaflet/src/map/handler/Map.TouchZoom.js", "../../node_modules/leaflet/src/map/index.js", "../../node_modules/maplibre-gl/node_modules/tslib/tslib.es6.js", "../../node_modules/maplibre-gl/node_modules/@mapbox/point-geometry/index.js", "../../node_modules/maplibre-gl/node_modules/@mapbox/unitbezier/index.js", "../../node_modules/maplibre-gl/src/util/offscreen_canvas_supported.ts", "../../node_modules/maplibre-gl/src/util/offscreen_canvas_distorted.ts", "../../node_modules/maplibre-gl/src/util/util.ts", "../../node_modules/maplibre-gl/src/util/abort_error.ts", "../../node_modules/maplibre-gl/src/util/config.ts", "../../node_modules/maplibre-gl/src/source/protocol_crud.ts", "../../node_modules/maplibre-gl/src/util/ajax.ts", "../../node_modules/maplibre-gl/src/util/evented.ts", "../../node_modules/maplibre-gl/node_modules/@maplibre/maplibre-gl-style-spec/dist/index.mjs", "../../node_modules/maplibre-gl/src/style/validate_style.ts", "../../node_modules/maplibre-gl/src/util/transferable_grid_index.ts", "../../node_modules/maplibre-gl/src/util/web_worker_transfer.ts", "../../node_modules/maplibre-gl/src/style/zoom_history.ts", "../../node_modules/maplibre-gl/src/util/is_char_in_unicode_block.ts", "../../node_modules/maplibre-gl/src/util/script_detection.ts", "../../node_modules/maplibre-gl/src/source/rtl_text_plugin_worker.ts", "../../node_modules/maplibre-gl/src/style/evaluation_parameters.ts", "../../node_modules/maplibre-gl/src/style/properties.ts", "../../node_modules/maplibre-gl/src/style/style_layer.ts", "../../node_modules/maplibre-gl/src/util/struct_array.ts", "../../node_modules/maplibre-gl/src/data/array_types.g.ts", "../../node_modules/maplibre-gl/src/data/bucket/circle_attributes.ts", "../../node_modules/maplibre-gl/src/data/segment.ts", "../../node_modules/maplibre-gl/src/shaders/encode_attribute.ts", "../../node_modules/maplibre-gl/src/data/bucket/pattern_attributes.ts", "../../node_modules/maplibre-gl/node_modules/murmurhash-js/murmurhash3_gc.js", "../../node_modules/maplibre-gl/node_modules/murmurhash-js/murmurhash2_gc.js", "../../node_modules/maplibre-gl/node_modules/murmurhash-js/index.js", "../../node_modules/maplibre-gl/src/data/feature_position_map.ts", "../../node_modules/maplibre-gl/src/render/uniform_binding.ts", "../../node_modules/maplibre-gl/src/data/program_configuration.ts", "../../node_modules/maplibre-gl/src/data/extent.ts", "../../node_modules/maplibre-gl/src/data/load_geometry.ts", "../../node_modules/maplibre-gl/src/data/evaluation_feature.ts", "../../node_modules/maplibre-gl/src/data/bucket/circle_bucket.ts", "../../node_modules/maplibre-gl/src/util/intersection_tests.ts", "../../node_modules/maplibre-gl/src/style/query_utils.ts", "../../node_modules/maplibre-gl/src/style/style_layer/circle_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/common.js", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat4.js", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec4.js", "../../node_modules/maplibre-gl/src/style/style_layer/circle_style_layer.ts", "../../node_modules/maplibre-gl/src/data/bucket/heatmap_bucket.ts", "../../node_modules/maplibre-gl/src/style/style_layer/heatmap_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/util/image.ts", "../../node_modules/maplibre-gl/src/util/color_ramp.ts", "../../node_modules/maplibre-gl/src/style/style_layer/heatmap_style_layer.ts", "../../node_modules/maplibre-gl/src/style/style_layer/hillshade_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/style_layer/hillshade_style_layer.ts", "../../node_modules/maplibre-gl/src/data/bucket/fill_attributes.ts", "../../node_modules/maplibre-gl/node_modules/earcut/src/earcut.js", "../../node_modules/maplibre-gl/src/data/bucket/pattern_bucket_features.ts", "../../node_modules/maplibre-gl/src/data/bucket/fill_bucket.ts", "../../node_modules/maplibre-gl/src/style/style_layer/fill_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/style_layer/fill_style_layer.ts", "../../node_modules/maplibre-gl/src/data/bucket/fill_extrusion_attributes.ts", "../../node_modules/maplibre-gl/node_modules/@mapbox/vector-tile/lib/vectortilefeature.js", "../../node_modules/maplibre-gl/node_modules/@mapbox/vector-tile/lib/vectortilelayer.js", "../../node_modules/maplibre-gl/node_modules/@mapbox/vector-tile/lib/vectortile.js", "../../node_modules/maplibre-gl/node_modules/@mapbox/vector-tile/index.js", "../../node_modules/maplibre-gl/src/data/bucket/fill_extrusion_bucket.ts", "../../node_modules/maplibre-gl/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/style_layer/fill_extrusion_style_layer.ts", "../../node_modules/maplibre-gl/src/data/bucket/line_attributes.ts", "../../node_modules/maplibre-gl/src/data/bucket/line_attributes_ext.ts", "../../node_modules/maplibre-gl/src/data/bucket/line_bucket.ts", "../../node_modules/maplibre-gl/src/style/style_layer/line_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/style_layer/line_style_layer.ts", "../../node_modules/maplibre-gl/src/data/bucket/symbol_attributes.ts", "../../node_modules/maplibre-gl/src/symbol/transform_text.ts", "../../node_modules/maplibre-gl/src/util/verticalize_punctuation.ts", "../../node_modules/maplibre-gl/src/symbol/one_em.ts", "../../node_modules/maplibre-gl/node_modules/pbf/index.js", "../../node_modules/maplibre-gl/node_modules/ieee754/index.js", "../../node_modules/maplibre-gl/src/style/parse_glyph_pbf.ts", "../../node_modules/maplibre-gl/node_modules/potpack/index.js", "../../node_modules/maplibre-gl/src/render/image_atlas.ts", "../../node_modules/maplibre-gl/src/symbol/shaping.ts", "../../node_modules/maplibre-gl/src/symbol/symbol_size.ts", "../../node_modules/maplibre-gl/src/style/style_layer/overlap_mode.ts", "../../node_modules/maplibre-gl/src/data/bucket/symbol_bucket.ts", "../../node_modules/maplibre-gl/src/symbol/merge_lines.ts", "../../node_modules/maplibre-gl/src/style/style_layer/symbol_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/format_section_override.ts", "../../node_modules/maplibre-gl/src/style/style_layer/symbol_style_layer.ts", "../../node_modules/maplibre-gl/src/util/resolve_tokens.ts", "../../node_modules/maplibre-gl/src/style/style_layer/background_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/style_layer/background_style_layer.ts", "../../node_modules/maplibre-gl/src/style/style_layer/raster_style_layer_properties.g.ts", "../../node_modules/maplibre-gl/src/style/style_layer/raster_style_layer.ts", "../../node_modules/maplibre-gl/src/style/style_layer/custom_style_layer.ts", "../../node_modules/maplibre-gl/src/util/throttled_invoker.ts", "../../node_modules/maplibre-gl/src/geo/lng_lat.ts", "../../node_modules/maplibre-gl/src/geo/mercator_coordinate.ts", "../../node_modules/maplibre-gl/node_modules/@mapbox/whoots-js/index.mjs", "../../node_modules/maplibre-gl/src/source/tile_id.ts", "../../node_modules/maplibre-gl/src/util/world_bounds.ts", "../../node_modules/maplibre-gl/src/data/dem_data.ts", "../../node_modules/maplibre-gl/src/util/dictionary_coder.ts", "../../node_modules/maplibre-gl/src/util/vectortile_to_geojson.ts", "../../node_modules/maplibre-gl/src/data/feature_index.ts", "../../node_modules/maplibre-gl/src/symbol/clip_line.ts", "../../node_modules/maplibre-gl/src/symbol/anchor.ts", "../../node_modules/maplibre-gl/src/symbol/check_max_angle.ts", "../../node_modules/maplibre-gl/src/symbol/get_anchors.ts", "../../node_modules/maplibre-gl/src/symbol/quads.ts", "../../node_modules/maplibre-gl/src/symbol/collision_feature.ts", "../../node_modules/maplibre-gl/node_modules/tinyqueue/index.js", "../../node_modules/maplibre-gl/src/util/find_pole_of_inaccessibility.ts", "../../node_modules/maplibre-gl/src/style/style_layer/variable_text_anchor.ts", "../../node_modules/maplibre-gl/src/symbol/symbol_layout.ts", "../../node_modules/maplibre-gl/node_modules/kdbush/index.js", "../../node_modules/maplibre-gl/src/util/performance.ts", "../../node_modules/maplibre-gl/src/util/actor.ts", "../../node_modules/maplibre-gl/src/style/create_style_layer.ts", "../../node_modules/maplibre-gl/src/style/style_layer_index.ts", "../../node_modules/maplibre-gl/src/render/glyph_atlas.ts", "../../node_modules/maplibre-gl/src/source/worker_tile.ts", "../../node_modules/maplibre-gl/src/source/vector_tile_worker_source.ts", "../../node_modules/maplibre-gl/src/source/raster_dem_tile_worker_source.ts", "../../node_modules/maplibre-gl/node_modules/@mapbox/geojson-rewind/index.js", "../../node_modules/maplibre-gl/src/source/geojson_wrapper.ts", "../../node_modules/maplibre-gl/node_modules/vt-pbf/lib/geojson_wrapper.js", "../../node_modules/maplibre-gl/node_modules/vt-pbf/index.js", "../../node_modules/maplibre-gl/node_modules/supercluster/index.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/simplify.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/feature.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/convert.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/clip.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/wrap.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/transform.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/tile.js", "../../node_modules/maplibre-gl/node_modules/geojson-vt/src/index.js", "../../node_modules/maplibre-gl/src/source/geojson_source_diff.ts", "../../node_modules/maplibre-gl/src/source/geojson_worker_source.ts", "../../node_modules/maplibre-gl/src/source/worker.ts", "../../node_modules/maplibre-gl/src/util/browser.ts", "../../node_modules/maplibre-gl/src/util/dom.ts", "../../node_modules/maplibre-gl/src/util/webp_supported.ts", "../../node_modules/maplibre-gl/src/util/image_request.ts", "../../node_modules/maplibre-gl/src/util/request_manager.ts", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec3.js", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/vec2.js", "../../node_modules/maplibre-gl/src/util/style.ts", "../../node_modules/maplibre-gl/src/style/load_sprite.ts", "../../node_modules/maplibre-gl/src/render/texture.ts", "../../node_modules/maplibre-gl/src/style/style_image.ts", "../../node_modules/maplibre-gl/src/render/image_manager.ts", "../../node_modules/maplibre-gl/node_modules/@mapbox/tiny-sdf/index.js", "../../node_modules/maplibre-gl/src/render/glyph_manager.ts", "../../node_modules/maplibre-gl/src/style/load_glyph_range.ts", "../../node_modules/maplibre-gl/src/style/light.ts", "../../node_modules/maplibre-gl/src/style/sky.ts", "../../node_modules/maplibre-gl/src/render/line_atlas.ts", "../../node_modules/maplibre-gl/src/util/worker_pool.ts", "../../node_modules/maplibre-gl/src/util/web_worker.ts", "../../node_modules/maplibre-gl/src/util/global_worker_pool.ts", "../../node_modules/maplibre-gl/src/util/dispatcher.ts", "../../node_modules/maplibre-gl/src/source/query_features.ts", "../../node_modules/maplibre-gl/src/source/load_tilejson.ts", "../../node_modules/maplibre-gl/src/geo/lng_lat_bounds.ts", "../../node_modules/maplibre-gl/src/source/tile_bounds.ts", "../../node_modules/maplibre-gl/src/source/vector_tile_source.ts", "../../node_modules/maplibre-gl/src/source/raster_tile_source.ts", "../../node_modules/maplibre-gl/src/source/raster_dem_tile_source.ts", "../../node_modules/maplibre-gl/src/source/geojson_source.ts", "../../node_modules/maplibre-gl/src/data/raster_bounds_attributes.ts", "../../node_modules/maplibre-gl/src/source/image_source.ts", "../../node_modules/maplibre-gl/src/source/video_source.ts", "../../node_modules/maplibre-gl/src/source/canvas_source.ts", "../../node_modules/maplibre-gl/src/source/source.ts", "../../node_modules/maplibre-gl/src/source/rtl_text_plugin_status.ts", "../../node_modules/maplibre-gl/src/source/rtl_text_plugin_main_thread.ts", "../../node_modules/maplibre-gl/src/source/tile.ts", "../../node_modules/maplibre-gl/src/data/bucket.ts", "../../node_modules/maplibre-gl/src/source/tile_cache.ts", "../../node_modules/maplibre-gl/src/source/source_state.ts", "../../node_modules/maplibre-gl/src/source/source_cache.ts", "../../node_modules/maplibre-gl/src/symbol/path_interpolator.ts", "../../node_modules/maplibre-gl/src/symbol/grid_index.ts", "../../node_modules/maplibre-gl/src/symbol/projection.ts", "../../node_modules/maplibre-gl/src/symbol/collision_index.ts", "../../node_modules/maplibre-gl/src/source/pixels_to_tile_units.ts", "../../node_modules/maplibre-gl/src/symbol/placement.ts", "../../node_modules/maplibre-gl/src/geo/projection/projection.ts", "../../node_modules/maplibre-gl/src/style/pauseable_placement.ts", "../../node_modules/maplibre-gl/src/symbol/cross_tile_symbol_index.ts", "../../node_modules/maplibre-gl/src/style/style.ts", "../../node_modules/maplibre-gl/src/data/pos_attributes.ts", "../../node_modules/maplibre-gl/src/shaders/shaders.ts", "../../node_modules/maplibre-gl/src/shaders/_prelude.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/_prelude.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/background.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/background.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/background_pattern.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/background_pattern.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/circle.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/circle.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/clipping_mask.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/clipping_mask.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/heatmap.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/heatmap.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/heatmap_texture.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/heatmap_texture.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/collision_box.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/collision_box.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/collision_circle.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/collision_circle.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/debug.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/debug.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_outline.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_outline.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_outline_pattern.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_outline_pattern.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_pattern.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_pattern.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_extrusion.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_extrusion.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/hillshade_prepare.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/hillshade_prepare.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/hillshade.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/hillshade.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line_gradient.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line_gradient.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line_pattern.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line_pattern.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line_sdf.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/line_sdf.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/raster.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/raster.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/symbol_icon.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/symbol_icon.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/symbol_sdf.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/symbol_sdf.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/terrain.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/terrain.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/terrain_depth.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/terrain_depth.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/terrain_coords.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/terrain_coords.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/sky.fragment.glsl.g.ts", "../../node_modules/maplibre-gl/src/shaders/sky.vertex.glsl.g.ts", "../../node_modules/maplibre-gl/src/render/vertex_array_object.ts", "../../node_modules/maplibre-gl/src/render/program/terrain_program.ts", "../../node_modules/maplibre-gl/src/render/program.ts", "../../node_modules/maplibre-gl/src/render/program/pattern.ts", "../../node_modules/maplibre-gl/src/render/program/fill_extrusion_program.ts", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat3.js", "../../node_modules/maplibre-gl/src/render/program/fill_program.ts", "../../node_modules/maplibre-gl/src/render/program/circle_program.ts", "../../node_modules/maplibre-gl/src/render/program/collision_program.ts", "../../node_modules/maplibre-gl/src/render/program/debug_program.ts", "../../node_modules/maplibre-gl/src/render/program/clipping_mask_program.ts", "../../node_modules/maplibre-gl/src/render/program/heatmap_program.ts", "../../node_modules/maplibre-gl/src/render/program/hillshade_program.ts", "../../node_modules/maplibre-gl/src/render/program/line_program.ts", "../../node_modules/maplibre-gl/src/render/program/raster_program.ts", "../../node_modules/maplibre-gl/src/render/program/symbol_program.ts", "../../node_modules/maplibre-gl/src/render/program/background_program.ts", "../../node_modules/maplibre-gl/src/render/program/program_uniforms.ts", "../../node_modules/maplibre-gl/src/render/program/sky_program.ts", "../../node_modules/maplibre-gl/src/gl/index_buffer.ts", "../../node_modules/maplibre-gl/src/gl/vertex_buffer.ts", "../../node_modules/maplibre-gl/src/gl/webgl2.ts", "../../node_modules/maplibre-gl/src/gl/value.ts", "../../node_modules/maplibre-gl/src/gl/framebuffer.ts", "../../node_modules/maplibre-gl/src/gl/color_mode.ts", "../../node_modules/maplibre-gl/src/gl/context.ts", "../../node_modules/maplibre-gl/src/gl/depth_mode.ts", "../../node_modules/maplibre-gl/src/gl/stencil_mode.ts", "../../node_modules/maplibre-gl/src/gl/cull_face_mode.ts", "../../node_modules/maplibre-gl/src/render/draw_collision_debug.ts", "../../node_modules/maplibre-gl/src/render/draw_symbol.ts", "../../node_modules/maplibre-gl/src/render/draw_heatmap.ts", "../../node_modules/maplibre-gl/src/render/update_pattern_positions_in_program.ts", "../../node_modules/maplibre-gl/src/render/draw_fill.ts", "../../node_modules/maplibre-gl/src/render/draw_fill_extrusion.ts", "../../node_modules/maplibre-gl/src/render/draw_hillshade.ts", "../../node_modules/maplibre-gl/src/render/draw_raster.ts", "../../node_modules/maplibre-gl/src/render/draw_debug.ts", "../../node_modules/maplibre-gl/src/render/draw_terrain.ts", "../../node_modules/maplibre-gl/src/render/mesh.ts", "../../node_modules/maplibre-gl/src/render/painter.ts", "../../node_modules/maplibre-gl/src/render/draw_sky.ts", "../../node_modules/maplibre-gl/src/render/draw_circle.ts", "../../node_modules/maplibre-gl/src/render/draw_line.ts", "../../node_modules/maplibre-gl/src/render/draw_background.ts", "../../node_modules/maplibre-gl/src/render/draw_custom.ts", "../../node_modules/maplibre-gl/src/util/primitives.ts", "../../node_modules/maplibre-gl/src/geo/edge_insets.ts", "../../node_modules/maplibre-gl/src/geo/transform.ts", "../../node_modules/maplibre-gl/node_modules/gl-matrix/esm/mat2.js", "../../node_modules/maplibre-gl/src/util/throttle.ts", "../../node_modules/maplibre-gl/src/ui/hash.ts", "../../node_modules/maplibre-gl/src/ui/handler_inertia.ts", "../../node_modules/maplibre-gl/src/ui/events.ts", "../../node_modules/maplibre-gl/src/ui/handler/map_event.ts", "../../node_modules/maplibre-gl/src/ui/handler/transform-provider.ts", "../../node_modules/maplibre-gl/src/ui/handler/box_zoom.ts", "../../node_modules/maplibre-gl/src/ui/handler/handler_util.ts", "../../node_modules/maplibre-gl/src/ui/handler/tap_recognizer.ts", "../../node_modules/maplibre-gl/src/ui/handler/tap_zoom.ts", "../../node_modules/maplibre-gl/src/ui/handler/drag_handler.ts", "../../node_modules/maplibre-gl/src/ui/handler/drag_move_state_manager.ts", "../../node_modules/maplibre-gl/src/ui/handler/mouse.ts", "../../node_modules/maplibre-gl/src/ui/handler/touch_pan.ts", "../../node_modules/maplibre-gl/src/ui/handler/two_fingers_touch.ts", "../../node_modules/maplibre-gl/src/ui/handler/keyboard.ts", "../../node_modules/maplibre-gl/src/ui/handler/scroll_zoom.ts", "../../node_modules/maplibre-gl/src/ui/handler/shim/dblclick_zoom.ts", "../../node_modules/maplibre-gl/src/ui/handler/click_zoom.ts", "../../node_modules/maplibre-gl/src/ui/handler/tap_drag_zoom.ts", "../../node_modules/maplibre-gl/src/ui/handler/shim/drag_pan.ts", "../../node_modules/maplibre-gl/src/ui/handler/shim/drag_rotate.ts", "../../node_modules/maplibre-gl/src/ui/handler/shim/two_fingers_touch.ts", "../../node_modules/maplibre-gl/src/ui/handler/cooperative_gestures.ts", "../../node_modules/maplibre-gl/src/ui/handler_manager.ts", "../../node_modules/maplibre-gl/src/ui/camera.ts", "../../node_modules/maplibre-gl/src/ui/control/attribution_control.ts", "../../node_modules/maplibre-gl/src/ui/control/logo_control.ts", "../../node_modules/maplibre-gl/src/util/task_queue.ts", "../../node_modules/maplibre-gl/src/data/pos3d_attributes.ts", "../../node_modules/maplibre-gl/src/source/terrain_source_cache.ts", "../../node_modules/maplibre-gl/src/render/terrain.ts", "../../node_modules/maplibre-gl/src/gl/render_pool.ts", "../../node_modules/maplibre-gl/src/render/render_to_texture.ts", "../../node_modules/maplibre-gl/src/ui/default_locale.ts", "../../node_modules/maplibre-gl/src/ui/map.ts", "../../node_modules/maplibre-gl/src/ui/handler/one_finger_touch_drag.ts", "../../node_modules/maplibre-gl/src/ui/control/navigation_control.ts", "../../node_modules/maplibre-gl/src/util/geolocation_support.ts", "../../node_modules/maplibre-gl/src/util/smart_wrap.ts", "../../node_modules/maplibre-gl/src/ui/anchor.ts", "../../node_modules/maplibre-gl/src/ui/marker.ts", "../../node_modules/maplibre-gl/src/ui/control/geolocate_control.ts", "../../node_modules/maplibre-gl/src/ui/control/scale_control.ts", "../../node_modules/maplibre-gl/src/ui/popup.ts", "../../node_modules/maplibre-gl/src/index.ts", "../../node_modules/maplibre-gl/src/ui/control/fullscreen_control.ts", "../../node_modules/maplibre-gl/src/ui/control/terrain_control.ts", "../../node_modules/maplibre-gl/build/rollup/maplibregl.js", "../../node_modules/@maplibre/maplibre-gl-leaflet/leaflet-maplibre-gl.js", "../../node_modules/leaflet.markercluster/src/MarkerClusterGroup.js", "../../node_modules/leaflet.markercluster/src/MarkerCluster.js", "../../node_modules/leaflet.markercluster/src/MarkerOpacity.js", "../../node_modules/leaflet.markercluster/src/DistanceGrid.js", "../../node_modules/leaflet.markercluster/src/MarkerCluster.QuickHull.js", "../../node_modules/leaflet.markercluster/src/MarkerCluster.Spiderfier.js", "../../node_modules/leaflet.markercluster/src/MarkerClusterGroup.Refresh.js", "../../node_modules/geohash/lib/geohash.js", "../../node_modules/htmx.org/dist/htmx.min.js", "../../jssrc/copytext.js", "../../jssrc/tables.js", "../../node_modules/alpinejs/dist/module.esm.js", "../../node_modules/@alpinejs/mask/dist/module.esm.js", "../../node_modules/@fylgja/alpinejs-dialog/dist/index.mjs", "../../node_modules/@kurkle/color/dist/color.esm.js", "../../node_modules/chart.js/src/helpers/helpers.core.ts", "../../node_modules/chart.js/src/helpers/helpers.math.ts", "../../node_modules/chart.js/src/helpers/helpers.collection.ts", "../../node_modules/chart.js/src/helpers/helpers.extras.ts", "../../node_modules/chart.js/src/helpers/helpers.easing.ts", "../../node_modules/chart.js/src/helpers/helpers.color.ts", "../../node_modules/chart.js/src/core/core.animations.defaults.js", "../../node_modules/chart.js/src/core/core.layouts.defaults.js", "../../node_modules/chart.js/src/helpers/helpers.intl.ts", "../../node_modules/chart.js/src/core/core.ticks.js", "../../node_modules/chart.js/src/core/core.scale.defaults.js", "../../node_modules/chart.js/src/core/core.defaults.js", "../../node_modules/chart.js/src/helpers/helpers.canvas.ts", "../../node_modules/chart.js/src/helpers/helpers.options.ts", "../../node_modules/chart.js/src/helpers/helpers.config.ts", "../../node_modules/chart.js/src/helpers/helpers.curve.ts", "../../node_modules/chart.js/src/helpers/helpers.dom.ts", "../../node_modules/chart.js/src/helpers/helpers.interpolation.ts", "../../node_modules/chart.js/src/helpers/helpers.rtl.ts", "../../node_modules/chart.js/src/helpers/helpers.segment.js", "../../node_modules/chart.js/src/core/core.animator.js", "../../node_modules/chart.js/src/core/core.animation.js", "../../node_modules/chart.js/src/core/core.animations.js", "../../node_modules/chart.js/src/core/core.datasetController.js", "../../node_modules/chart.js/src/controllers/controller.bar.js", "../../node_modules/chart.js/src/controllers/controller.bubble.js", "../../node_modules/chart.js/src/controllers/controller.doughnut.js", "../../node_modules/chart.js/src/controllers/controller.line.js", "../../node_modules/chart.js/src/controllers/controller.polarArea.js", "../../node_modules/chart.js/src/controllers/controller.pie.js", "../../node_modules/chart.js/src/controllers/controller.radar.js", "../../node_modules/chart.js/src/controllers/controller.scatter.js", "../../node_modules/chart.js/src/core/core.adapters.ts", "../../node_modules/chart.js/src/core/core.interaction.js", "../../node_modules/chart.js/src/core/core.layouts.js", "../../node_modules/chart.js/src/platform/platform.base.js", "../../node_modules/chart.js/src/platform/platform.basic.js", "../../node_modules/chart.js/src/platform/platform.dom.js", "../../node_modules/chart.js/src/platform/index.js", "../../node_modules/chart.js/src/core/core.element.ts", "../../node_modules/chart.js/src/core/core.scale.autoskip.js", "../../node_modules/chart.js/src/core/core.scale.js", "../../node_modules/chart.js/src/core/core.typedRegistry.js", "../../node_modules/chart.js/src/core/core.registry.js", "../../node_modules/chart.js/src/core/core.plugins.js", "../../node_modules/chart.js/src/core/core.config.js", "../../node_modules/chart.js/src/core/core.controller.js", "../../node_modules/chart.js/src/elements/element.arc.ts", "../../node_modules/chart.js/src/elements/element.line.js", "../../node_modules/chart.js/src/elements/element.point.ts", "../../node_modules/chart.js/src/elements/element.bar.js", "../../node_modules/chart.js/src/plugins/plugin.colors.ts", "../../node_modules/chart.js/src/plugins/plugin.decimation.js", "../../node_modules/chart.js/src/plugins/plugin.filler/filler.segment.js", "../../node_modules/chart.js/src/plugins/plugin.filler/filler.helper.js", "../../node_modules/chart.js/src/plugins/plugin.filler/filler.options.js", "../../node_modules/chart.js/src/plugins/plugin.filler/filler.target.stack.js", "../../node_modules/chart.js/src/plugins/plugin.filler/simpleArc.js", "../../node_modules/chart.js/src/plugins/plugin.filler/filler.target.js", "../../node_modules/chart.js/src/plugins/plugin.filler/filler.drawing.js", "../../node_modules/chart.js/src/plugins/plugin.filler/index.js", "../../node_modules/chart.js/src/plugins/plugin.legend.js", "../../node_modules/chart.js/src/plugins/plugin.title.js", "../../node_modules/chart.js/src/plugins/plugin.subtitle.js", "../../node_modules/chart.js/src/plugins/plugin.tooltip.js", "../../node_modules/chart.js/src/scales/scale.category.js", "../../node_modules/chart.js/src/scales/scale.linearbase.js", "../../node_modules/chart.js/src/scales/scale.linear.js", "../../node_modules/chart.js/src/scales/scale.logarithmic.js", "../../node_modules/chart.js/src/scales/scale.radialLinear.js", "../../node_modules/chart.js/src/scales/scale.time.js", "../../node_modules/chart.js/src/scales/scale.timeseries.js", "../../node_modules/chart.js/src/index.ts", "../../node_modules/chart.js/auto/auto.js", "../../node_modules/chartjs-plugin-datalabels/dist/chartjs-plugin-datalabels.esm.js", "../../jssrc/charts-html-legend.js", "../../node_modules/chartjs-plugin-annotation/dist/chartjs-plugin-annotation.esm.js", "../../jssrc/charts.js", "../../jssrc/maps-dashboard.js", "../../node_modules/d3-array/src/ascending.js", "../../node_modules/d3-array/src/descending.js", "../../node_modules/d3-array/src/bisector.js", "../../node_modules/d3-array/src/number.js", "../../node_modules/d3-array/src/bisect.js", "../../node_modules/d3-array/src/ticks.js", "../../node_modules/d3-dispatch/src/dispatch.js", "../../node_modules/d3-selection/src/namespaces.js", "../../node_modules/d3-selection/src/namespace.js", "../../node_modules/d3-selection/src/creator.js", "../../node_modules/d3-selection/src/selector.js", "../../node_modules/d3-selection/src/selection/select.js", "../../node_modules/d3-selection/src/array.js", "../../node_modules/d3-selection/src/selectorAll.js", "../../node_modules/d3-selection/src/selection/selectAll.js", "../../node_modules/d3-selection/src/matcher.js", "../../node_modules/d3-selection/src/selection/selectChild.js", "../../node_modules/d3-selection/src/selection/selectChildren.js", "../../node_modules/d3-selection/src/selection/filter.js", "../../node_modules/d3-selection/src/selection/sparse.js", "../../node_modules/d3-selection/src/selection/enter.js", "../../node_modules/d3-selection/src/constant.js", "../../node_modules/d3-selection/src/selection/data.js", "../../node_modules/d3-selection/src/selection/exit.js", "../../node_modules/d3-selection/src/selection/join.js", "../../node_modules/d3-selection/src/selection/merge.js", "../../node_modules/d3-selection/src/selection/order.js", "../../node_modules/d3-selection/src/selection/sort.js", "../../node_modules/d3-selection/src/selection/call.js", "../../node_modules/d3-selection/src/selection/nodes.js", "../../node_modules/d3-selection/src/selection/node.js", "../../node_modules/d3-selection/src/selection/size.js", "../../node_modules/d3-selection/src/selection/empty.js", "../../node_modules/d3-selection/src/selection/each.js", "../../node_modules/d3-selection/src/selection/attr.js", "../../node_modules/d3-selection/src/window.js", "../../node_modules/d3-selection/src/selection/style.js", "../../node_modules/d3-selection/src/selection/property.js", "../../node_modules/d3-selection/src/selection/classed.js", "../../node_modules/d3-selection/src/selection/text.js", "../../node_modules/d3-selection/src/selection/html.js", "../../node_modules/d3-selection/src/selection/raise.js", "../../node_modules/d3-selection/src/selection/lower.js", "../../node_modules/d3-selection/src/selection/append.js", "../../node_modules/d3-selection/src/selection/insert.js", "../../node_modules/d3-selection/src/selection/remove.js", "../../node_modules/d3-selection/src/selection/clone.js", "../../node_modules/d3-selection/src/selection/datum.js", "../../node_modules/d3-selection/src/selection/on.js", "../../node_modules/d3-selection/src/selection/dispatch.js", "../../node_modules/d3-selection/src/selection/iterator.js", "../../node_modules/d3-selection/src/selection/index.js", "../../node_modules/d3-color/src/define.js", "../../node_modules/d3-color/src/color.js", "../../node_modules/d3-interpolate/src/basis.js", "../../node_modules/d3-interpolate/src/basisClosed.js", "../../node_modules/d3-interpolate/src/constant.js", "../../node_modules/d3-interpolate/src/color.js", "../../node_modules/d3-interpolate/src/rgb.js", "../../node_modules/d3-interpolate/src/numberArray.js", "../../node_modules/d3-interpolate/src/array.js", "../../node_modules/d3-interpolate/src/date.js", "../../node_modules/d3-interpolate/src/number.js", "../../node_modules/d3-interpolate/src/object.js", "../../node_modules/d3-interpolate/src/string.js", "../../node_modules/d3-interpolate/src/value.js", "../../node_modules/d3-interpolate/src/round.js", "../../node_modules/d3-interpolate/src/transform/decompose.js", "../../node_modules/d3-interpolate/src/transform/parse.js", "../../node_modules/d3-interpolate/src/transform/index.js", "../../node_modules/d3-timer/src/timer.js", "../../node_modules/d3-timer/src/timeout.js", "../../node_modules/d3-transition/src/transition/schedule.js", "../../node_modules/d3-transition/src/interrupt.js", "../../node_modules/d3-transition/src/selection/interrupt.js", "../../node_modules/d3-transition/src/transition/tween.js", "../../node_modules/d3-transition/src/transition/interpolate.js", "../../node_modules/d3-transition/src/transition/attr.js", "../../node_modules/d3-transition/src/transition/attrTween.js", "../../node_modules/d3-transition/src/transition/delay.js", "../../node_modules/d3-transition/src/transition/duration.js", "../../node_modules/d3-transition/src/transition/ease.js", "../../node_modules/d3-transition/src/transition/easeVarying.js", "../../node_modules/d3-transition/src/transition/filter.js", "../../node_modules/d3-transition/src/transition/merge.js", "../../node_modules/d3-transition/src/transition/on.js", "../../node_modules/d3-transition/src/transition/remove.js", "../../node_modules/d3-transition/src/transition/select.js", "../../node_modules/d3-transition/src/transition/selectAll.js", "../../node_modules/d3-transition/src/transition/selection.js", "../../node_modules/d3-transition/src/transition/style.js", "../../node_modules/d3-transition/src/transition/styleTween.js", "../../node_modules/d3-transition/src/transition/text.js", "../../node_modules/d3-transition/src/transition/textTween.js", "../../node_modules/d3-transition/src/transition/transition.js", "../../node_modules/d3-transition/src/transition/end.js", "../../node_modules/d3-transition/src/transition/index.js", "../../node_modules/d3-ease/src/cubic.js", "../../node_modules/d3-transition/src/selection/transition.js", "../../node_modules/d3-transition/src/selection/index.js", "../../node_modules/d3-brush/src/brush.js", "../../node_modules/d3-format/src/formatDecimal.js", "../../node_modules/d3-format/src/exponent.js", "../../node_modules/d3-format/src/formatGroup.js", "../../node_modules/d3-format/src/formatNumerals.js", "../../node_modules/d3-format/src/formatSpecifier.js", "../../node_modules/d3-format/src/formatTrim.js", "../../node_modules/d3-format/src/formatPrefixAuto.js", "../../node_modules/d3-format/src/formatRounded.js", "../../node_modules/d3-format/src/formatTypes.js", "../../node_modules/d3-format/src/identity.js", "../../node_modules/d3-format/src/locale.js", "../../node_modules/d3-format/src/defaultLocale.js", "../../node_modules/d3-format/src/precisionFixed.js", "../../node_modules/d3-format/src/precisionPrefix.js", "../../node_modules/d3-format/src/precisionRound.js", "../../node_modules/d3-scale/src/init.js", "../../node_modules/d3-scale/src/constant.js", "../../node_modules/d3-scale/src/number.js", "../../node_modules/d3-scale/src/continuous.js", "../../node_modules/d3-scale/src/tickFormat.js", "../../node_modules/d3-scale/src/linear.js", "../../node_modules/d3-zoom/src/transform.js", "../../jssrc/charts-dashboard.js", "../../node_modules/@alpinejs/persist/dist/module.esm.js", "../../jssrc/setupAlpine.js", "../../jssrc/setupHtmx.js", "../../jssrc/htmx-toast.js", "../../jssrc/sidebarcards.js", "../../jssrc/charts-charity-overview.js", "../../jssrc/charts-charity-finances.js", "../../jssrc/charts-checks-finances.js", "../../jssrc/main.js"],
  "sourcesContent": ["/*\r\n * @namespace Util\r\n *\r\n * Various utility functions, used by Leaflet internally.\r\n */\r\n\r\n// @function extend(dest: Object, src?: Object): Object\r\n// Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut.\r\nexport function extend(dest) {\r\n\tvar i, j, len, src;\r\n\r\n\tfor (j = 1, len = arguments.length; j < len; j++) {\r\n\t\tsrc = arguments[j];\r\n\t\tfor (i in src) {\r\n\t\t\tdest[i] = src[i];\r\n\t\t}\r\n\t}\r\n\treturn dest;\r\n}\r\n\r\n// @function create(proto: Object, properties?: Object): Object\r\n// Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create)\r\nexport var create = Object.create || (function () {\r\n\tfunction F() {}\r\n\treturn function (proto) {\r\n\t\tF.prototype = proto;\r\n\t\treturn new F();\r\n\t};\r\n})();\r\n\r\n// @function bind(fn: Function, …): Function\r\n// Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).\r\n// Has a `L.bind()` shortcut.\r\nexport function bind(fn, obj) {\r\n\tvar slice = Array.prototype.slice;\r\n\r\n\tif (fn.bind) {\r\n\t\treturn fn.bind.apply(fn, slice.call(arguments, 1));\r\n\t}\r\n\r\n\tvar args = slice.call(arguments, 2);\r\n\r\n\treturn function () {\r\n\t\treturn fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments);\r\n\t};\r\n}\r\n\r\n// @property lastId: Number\r\n// Last unique ID used by [`stamp()`](#util-stamp)\r\nexport var lastId = 0;\r\n\r\n// @function stamp(obj: Object): Number\r\n// Returns the unique ID of an object, assigning it one if it doesn't have it.\r\nexport function stamp(obj) {\r\n\tif (!('_leaflet_id' in obj)) {\r\n\t\tobj['_leaflet_id'] = ++lastId;\r\n\t}\r\n\treturn obj._leaflet_id;\r\n}\r\n\r\n// @function throttle(fn: Function, time: Number, context: Object): Function\r\n// Returns a function which executes function `fn` with the given scope `context`\r\n// (so that the `this` keyword refers to `context` inside `fn`'s code). The function\r\n// `fn` will be called no more than one time per given amount of `time`. The arguments\r\n// received by the bound function will be any arguments passed when binding the\r\n// function, followed by any arguments passed when invoking the bound function.\r\n// Has an `L.throttle` shortcut.\r\nexport function throttle(fn, time, context) {\r\n\tvar lock, args, wrapperFn, later;\r\n\r\n\tlater = function () {\r\n\t\t// reset lock and call if queued\r\n\t\tlock = false;\r\n\t\tif (args) {\r\n\t\t\twrapperFn.apply(context, args);\r\n\t\t\targs = false;\r\n\t\t}\r\n\t};\r\n\r\n\twrapperFn = function () {\r\n\t\tif (lock) {\r\n\t\t\t// called too soon, queue to call later\r\n\t\t\targs = arguments;\r\n\r\n\t\t} else {\r\n\t\t\t// call and lock until later\r\n\t\t\tfn.apply(context, arguments);\r\n\t\t\tsetTimeout(later, time);\r\n\t\t\tlock = true;\r\n\t\t}\r\n\t};\r\n\r\n\treturn wrapperFn;\r\n}\r\n\r\n// @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number\r\n// Returns the number `num` modulo `range` in such a way so it lies within\r\n// `range[0]` and `range[1]`. The returned value will be always smaller than\r\n// `range[1]` unless `includeMax` is set to `true`.\r\nexport function wrapNum(x, range, includeMax) {\r\n\tvar max = range[1],\r\n\t    min = range[0],\r\n\t    d = max - min;\r\n\treturn x === max && includeMax ? x : ((x - min) % d + d) % d + min;\r\n}\r\n\r\n// @function falseFn(): Function\r\n// Returns a function which always returns `false`.\r\nexport function falseFn() { return false; }\r\n\r\n// @function formatNum(num: Number, precision?: Number|false): Number\r\n// Returns the number `num` rounded with specified `precision`.\r\n// The default `precision` value is 6 decimal places.\r\n// `false` can be passed to skip any processing (can be useful to avoid round-off errors).\r\nexport function formatNum(num, precision) {\r\n\tif (precision === false) { return num; }\r\n\tvar pow = Math.pow(10, precision === undefined ? 6 : precision);\r\n\treturn Math.round(num * pow) / pow;\r\n}\r\n\r\n// @function trim(str: String): String\r\n// Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim)\r\nexport function trim(str) {\r\n\treturn str.trim ? str.trim() : str.replace(/^\\s+|\\s+$/g, '');\r\n}\r\n\r\n// @function splitWords(str: String): String[]\r\n// Trims and splits the string on whitespace and returns the array of parts.\r\nexport function splitWords(str) {\r\n\treturn trim(str).split(/\\s+/);\r\n}\r\n\r\n// @function setOptions(obj: Object, options: Object): Object\r\n// Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut.\r\nexport function setOptions(obj, options) {\r\n\tif (!Object.prototype.hasOwnProperty.call(obj, 'options')) {\r\n\t\tobj.options = obj.options ? create(obj.options) : {};\r\n\t}\r\n\tfor (var i in options) {\r\n\t\tobj.options[i] = options[i];\r\n\t}\r\n\treturn obj.options;\r\n}\r\n\r\n// @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String\r\n// Converts an object into a parameter URL string, e.g. `{a: \"foo\", b: \"bar\"}`\r\n// translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will\r\n// be appended at the end. If `uppercase` is `true`, the parameter names will\r\n// be uppercased (e.g. `'?A=foo&B=bar'`)\r\nexport function getParamString(obj, existingUrl, uppercase) {\r\n\tvar params = [];\r\n\tfor (var i in obj) {\r\n\t\tparams.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i]));\r\n\t}\r\n\treturn ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&');\r\n}\r\n\r\nvar templateRe = /\\{ *([\\w_ -]+) *\\}/g;\r\n\r\n// @function template(str: String, data: Object): String\r\n// Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'`\r\n// and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string\r\n// `('Hello foo, bar')`. You can also specify functions instead of strings for\r\n// data values — they will be evaluated passing `data` as an argument.\r\nexport function template(str, data) {\r\n\treturn str.replace(templateRe, function (str, key) {\r\n\t\tvar value = data[key];\r\n\r\n\t\tif (value === undefined) {\r\n\t\t\tthrow new Error('No value provided for variable ' + str);\r\n\r\n\t\t} else if (typeof value === 'function') {\r\n\t\t\tvalue = value(data);\r\n\t\t}\r\n\t\treturn value;\r\n\t});\r\n}\r\n\r\n// @function isArray(obj): Boolean\r\n// Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray)\r\nexport var isArray = Array.isArray || function (obj) {\r\n\treturn (Object.prototype.toString.call(obj) === '[object Array]');\r\n};\r\n\r\n// @function indexOf(array: Array, el: Object): Number\r\n// Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf)\r\nexport function indexOf(array, el) {\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tif (array[i] === el) { return i; }\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\n// @property emptyImageUrl: String\r\n// Data URI string containing a base64-encoded empty GIF image.\r\n// Used as a hack to free memory from unused images on WebKit-powered\r\n// mobile devices (by setting image `src` to this string).\r\nexport var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';\r\n\r\n// inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/\r\n\r\nfunction getPrefixed(name) {\r\n\treturn window['webkit' + name] || window['moz' + name] || window['ms' + name];\r\n}\r\n\r\nvar lastTime = 0;\r\n\r\n// fallback for IE 7-8\r\nfunction timeoutDefer(fn) {\r\n\tvar time = +new Date(),\r\n\t    timeToCall = Math.max(0, 16 - (time - lastTime));\r\n\r\n\tlastTime = time + timeToCall;\r\n\treturn window.setTimeout(fn, timeToCall);\r\n}\r\n\r\nexport var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer;\r\nexport var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') ||\r\n\t\tgetPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); };\r\n\r\n// @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number\r\n// Schedules `fn` to be executed when the browser repaints. `fn` is bound to\r\n// `context` if given. When `immediate` is set, `fn` is called immediately if\r\n// the browser doesn't have native support for\r\n// [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame),\r\n// otherwise it's delayed. Returns a request ID that can be used to cancel the request.\r\nexport function requestAnimFrame(fn, context, immediate) {\r\n\tif (immediate && requestFn === timeoutDefer) {\r\n\t\tfn.call(context);\r\n\t} else {\r\n\t\treturn requestFn.call(window, bind(fn, context));\r\n\t}\r\n}\r\n\r\n// @function cancelAnimFrame(id: Number): undefined\r\n// Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame).\r\nexport function cancelAnimFrame(id) {\r\n\tif (id) {\r\n\t\tcancelFn.call(window, id);\r\n\t}\r\n}\r\n", "import * as Util from './Util';\r\n\r\n// @class Class\r\n// @aka L.Class\r\n\r\n// @section\r\n// @uninheritable\r\n\r\n// Thanks to John Resig and Dean Edwards for inspiration!\r\n\r\nexport function Class() {}\r\n\r\nClass.extend = function (props) {\r\n\r\n\t// @function extend(props: Object): Function\r\n\t// [Extends the current class](#class-inheritance) given the properties to be included.\r\n\t// Returns a Javascript function that is a class constructor (to be called with `new`).\r\n\tvar NewClass = function () {\r\n\r\n\t\tUtil.setOptions(this);\r\n\r\n\t\t// call the constructor\r\n\t\tif (this.initialize) {\r\n\t\t\tthis.initialize.apply(this, arguments);\r\n\t\t}\r\n\r\n\t\t// call all constructor hooks\r\n\t\tthis.callInitHooks();\r\n\t};\r\n\r\n\tvar parentProto = NewClass.__super__ = this.prototype;\r\n\r\n\tvar proto = Util.create(parentProto);\r\n\tproto.constructor = NewClass;\r\n\r\n\tNewClass.prototype = proto;\r\n\r\n\t// inherit parent's statics\r\n\tfor (var i in this) {\r\n\t\tif (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') {\r\n\t\t\tNewClass[i] = this[i];\r\n\t\t}\r\n\t}\r\n\r\n\t// mix static properties into the class\r\n\tif (props.statics) {\r\n\t\tUtil.extend(NewClass, props.statics);\r\n\t}\r\n\r\n\t// mix includes into the prototype\r\n\tif (props.includes) {\r\n\t\tcheckDeprecatedMixinEvents(props.includes);\r\n\t\tUtil.extend.apply(null, [proto].concat(props.includes));\r\n\t}\r\n\r\n\t// mix given properties into the prototype\r\n\tUtil.extend(proto, props);\r\n\tdelete proto.statics;\r\n\tdelete proto.includes;\r\n\r\n\t// merge options\r\n\tif (proto.options) {\r\n\t\tproto.options = parentProto.options ? Util.create(parentProto.options) : {};\r\n\t\tUtil.extend(proto.options, props.options);\r\n\t}\r\n\r\n\tproto._initHooks = [];\r\n\r\n\t// add method for calling all hooks\r\n\tproto.callInitHooks = function () {\r\n\r\n\t\tif (this._initHooksCalled) { return; }\r\n\r\n\t\tif (parentProto.callInitHooks) {\r\n\t\t\tparentProto.callInitHooks.call(this);\r\n\t\t}\r\n\r\n\t\tthis._initHooksCalled = true;\r\n\r\n\t\tfor (var i = 0, len = proto._initHooks.length; i < len; i++) {\r\n\t\t\tproto._initHooks[i].call(this);\r\n\t\t}\r\n\t};\r\n\r\n\treturn NewClass;\r\n};\r\n\r\n\r\n// @function include(properties: Object): this\r\n// [Includes a mixin](#class-includes) into the current class.\r\nClass.include = function (props) {\r\n\tvar parentOptions = this.prototype.options;\r\n\tUtil.extend(this.prototype, props);\r\n\tif (props.options) {\r\n\t\tthis.prototype.options = parentOptions;\r\n\t\tthis.mergeOptions(props.options);\r\n\t}\r\n\treturn this;\r\n};\r\n\r\n// @function mergeOptions(options: Object): this\r\n// [Merges `options`](#class-options) into the defaults of the class.\r\nClass.mergeOptions = function (options) {\r\n\tUtil.extend(this.prototype.options, options);\r\n\treturn this;\r\n};\r\n\r\n// @function addInitHook(fn: Function): this\r\n// Adds a [constructor hook](#class-constructor-hooks) to the class.\r\nClass.addInitHook = function (fn) { // (Function) || (String, args...)\r\n\tvar args = Array.prototype.slice.call(arguments, 1);\r\n\r\n\tvar init = typeof fn === 'function' ? fn : function () {\r\n\t\tthis[fn].apply(this, args);\r\n\t};\r\n\r\n\tthis.prototype._initHooks = this.prototype._initHooks || [];\r\n\tthis.prototype._initHooks.push(init);\r\n\treturn this;\r\n};\r\n\r\nfunction checkDeprecatedMixinEvents(includes) {\r\n\t/* global L: true */\r\n\tif (typeof L === 'undefined' || !L || !L.Mixin) { return; }\r\n\r\n\tincludes = Util.isArray(includes) ? includes : [includes];\r\n\r\n\tfor (var i = 0; i < includes.length; i++) {\r\n\t\tif (includes[i] === L.Mixin.Events) {\r\n\t\t\tconsole.warn('Deprecated include of L.Mixin.Events: ' +\r\n\t\t\t\t'this property will be removed in future releases, ' +\r\n\t\t\t\t'please inherit from L.Evented instead.', new Error().stack);\r\n\t\t}\r\n\t}\r\n}\r\n", "import {Class} from './Class';\r\nimport * as Util from './Util';\r\n\r\n/*\r\n * @class Evented\r\n * @aka L.Evented\r\n * @inherits Class\r\n *\r\n * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event).\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * map.on('click', function(e) {\r\n * \talert(e.latlng);\r\n * } );\r\n * ```\r\n *\r\n * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function:\r\n *\r\n * ```js\r\n * function onClick(e) { ... }\r\n *\r\n * map.on('click', onClick);\r\n * map.off('click', onClick);\r\n * ```\r\n */\r\n\r\nexport var Events = {\r\n\t/* @method on(type: String, fn: Function, context?: Object): this\r\n\t * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`).\r\n\t *\r\n\t * @alternative\r\n\t * @method on(eventMap: Object): this\r\n\t * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\t */\r\n\ton: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t/* @method off(type: String, fn?: Function, context?: Object): this\r\n\t * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener.\r\n\t *\r\n\t * @alternative\r\n\t * @method off(eventMap: Object): this\r\n\t * Removes a set of type/listener pairs.\r\n\t *\r\n\t * @alternative\r\n\t * @method off: this\r\n\t * Removes all listeners to all events on the object. This includes implicitly attached events.\r\n\t */\r\n\toff: function (types, fn, context) {\r\n\r\n\t\tif (!arguments.length) {\r\n\t\t\t// clear all listeners if called without arguments\r\n\t\t\tdelete this._events;\r\n\r\n\t\t} else if (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\tthis._off(type, types[type], fn);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tvar removeAll = arguments.length === 1;\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tif (removeAll) {\r\n\t\t\t\t\tthis._off(types[i]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis._off(types[i], fn, context);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// attach listener (without syntactic sugar now)\r\n\t_on: function (type, fn, context, _once) {\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// check if fn already there\r\n\t\tif (this._listens(type, fn, context) !== false) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tvar newListener = {fn: fn, ctx: context};\r\n\t\tif (_once) {\r\n\t\t\tnewListener.once = true;\r\n\t\t}\r\n\r\n\t\tthis._events = this._events || {};\r\n\t\tthis._events[type] = this._events[type] || [];\r\n\t\tthis._events[type].push(newListener);\r\n\t},\r\n\r\n\t_off: function (type, fn, context) {\r\n\t\tvar listeners,\r\n\t\t    i,\r\n\t\t    len;\r\n\r\n\t\tif (!this._events) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlisteners = this._events[type];\r\n\t\tif (!listeners) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (arguments.length === 1) { // remove all\r\n\t\t\tif (this._firingCount) {\r\n\t\t\t\t// Set all removed listeners to noop\r\n\t\t\t\t// so they are not called if remove happens in fire\r\n\t\t\t\tfor (i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tlisteners[i].fn = Util.falseFn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// clear all listeners for a type if function isn't specified\r\n\t\t\tdelete this._events[type];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tconsole.warn('wrong listener type: ' + typeof fn);\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// find fn and remove it\r\n\t\tvar index = this._listens(type, fn, context);\r\n\t\tif (index !== false) {\r\n\t\t\tvar listener = listeners[index];\r\n\t\t\tif (this._firingCount) {\r\n\t\t\t\t// set the removed listener to noop so that's not called if remove happens in fire\r\n\t\t\t\tlistener.fn = Util.falseFn;\r\n\r\n\t\t\t\t/* copy array in case events are being fired */\r\n\t\t\t\tthis._events[type] = listeners = listeners.slice();\r\n\t\t\t}\r\n\t\t\tlisteners.splice(index, 1);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method fire(type: String, data?: Object, propagate?: Boolean): this\r\n\t// Fires an event of the specified type. You can optionally provide a data\r\n\t// object — the first argument of the listener function will contain its\r\n\t// properties. The event can optionally be propagated to event parents.\r\n\tfire: function (type, data, propagate) {\r\n\t\tif (!this.listens(type, propagate)) { return this; }\r\n\r\n\t\tvar event = Util.extend({}, data, {\r\n\t\t\ttype: type,\r\n\t\t\ttarget: this,\r\n\t\t\tsourceTarget: data && data.sourceTarget || this\r\n\t\t});\r\n\r\n\t\tif (this._events) {\r\n\t\t\tvar listeners = this._events[type];\r\n\t\t\tif (listeners) {\r\n\t\t\t\tthis._firingCount = (this._firingCount + 1) || 1;\r\n\t\t\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\t\t\tvar l = listeners[i];\r\n\t\t\t\t\t// off overwrites l.fn, so we need to copy fn to a var\r\n\t\t\t\t\tvar fn = l.fn;\r\n\t\t\t\t\tif (l.once) {\r\n\t\t\t\t\t\tthis.off(type, fn, l.ctx);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfn.call(l.ctx || this, event);\r\n\t\t\t\t}\r\n\r\n\t\t\t\tthis._firingCount--;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// propagate the event to parents (set with addEventParent)\r\n\t\t\tthis._propagateEvent(event);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method listens(type: String, propagate?: Boolean): Boolean\r\n\t// @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean\r\n\t// Returns `true` if a particular event type has any listeners attached to it.\r\n\t// The verification can optionally be propagated, it will return `true` if parents have the listener attached to it.\r\n\tlistens: function (type, fn, context, propagate) {\r\n\t\tif (typeof type !== 'string') {\r\n\t\t\tconsole.warn('\"string\" type argument expected');\r\n\t\t}\r\n\r\n\t\t// we don't overwrite the input `fn` value, because we need to use it for propagation\r\n\t\tvar _fn = fn;\r\n\t\tif (typeof fn !== 'function') {\r\n\t\t\tpropagate = !!fn;\r\n\t\t\t_fn = undefined;\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tvar listeners = this._events && this._events[type];\r\n\t\tif (listeners && listeners.length) {\r\n\t\t\tif (this._listens(type, _fn, context) !== false) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (propagate) {\r\n\t\t\t// also check parents for listeners if event propagates\r\n\t\t\tfor (var id in this._eventParents) {\r\n\t\t\t\tif (this._eventParents[id].listens(type, fn, context, propagate)) { return true; }\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t},\r\n\r\n\t// returns the index (number) or false\r\n\t_listens: function (type, fn, context) {\r\n\t\tif (!this._events) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar listeners = this._events[type] || [];\r\n\t\tif (!fn) {\r\n\t\t\treturn !!listeners.length;\r\n\t\t}\r\n\r\n\t\tif (context === this) {\r\n\t\t\t// Less memory footprint.\r\n\t\t\tcontext = undefined;\r\n\t\t}\r\n\r\n\t\tfor (var i = 0, len = listeners.length; i < len; i++) {\r\n\t\t\tif (listeners[i].fn === fn && listeners[i].ctx === context) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t},\r\n\r\n\t// @method once(…): this\r\n\t// Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed.\r\n\tonce: function (types, fn, context) {\r\n\r\n\t\t// types can be a map of types/handlers\r\n\t\tif (typeof types === 'object') {\r\n\t\t\tfor (var type in types) {\r\n\t\t\t\t// we don't process space-separated events here for performance;\r\n\t\t\t\t// it's a hot path since Layer uses the on(obj) syntax\r\n\t\t\t\tthis._on(type, types[type], fn, true);\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// types can be a string of space-separated words\r\n\t\t\ttypes = Util.splitWords(types);\r\n\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tthis._on(types[i], fn, context, true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method addEventParent(obj: Evented): this\r\n\t// Adds an event parent - an `Evented` that will receive propagated events\r\n\taddEventParent: function (obj) {\r\n\t\tthis._eventParents = this._eventParents || {};\r\n\t\tthis._eventParents[Util.stamp(obj)] = obj;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeEventParent(obj: Evented): this\r\n\t// Removes an event parent, so it will stop receiving propagated events\r\n\tremoveEventParent: function (obj) {\r\n\t\tif (this._eventParents) {\r\n\t\t\tdelete this._eventParents[Util.stamp(obj)];\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_propagateEvent: function (e) {\r\n\t\tfor (var id in this._eventParents) {\r\n\t\t\tthis._eventParents[id].fire(e.type, Util.extend({\r\n\t\t\t\tlayer: e.target,\r\n\t\t\t\tpropagatedFrom: e.target\r\n\t\t\t}, e), true);\r\n\t\t}\r\n\t}\r\n};\r\n\r\n// aliases; we should ditch those eventually\r\n\r\n// @method addEventListener(…): this\r\n// Alias to [`on(…)`](#evented-on)\r\nEvents.addEventListener = Events.on;\r\n\r\n// @method removeEventListener(…): this\r\n// Alias to [`off(…)`](#evented-off)\r\n\r\n// @method clearAllEventListeners(…): this\r\n// Alias to [`off()`](#evented-off)\r\nEvents.removeEventListener = Events.clearAllEventListeners = Events.off;\r\n\r\n// @method addOneTimeEventListener(…): this\r\n// Alias to [`once(…)`](#evented-once)\r\nEvents.addOneTimeEventListener = Events.once;\r\n\r\n// @method fireEvent(…): this\r\n// Alias to [`fire(…)`](#evented-fire)\r\nEvents.fireEvent = Events.fire;\r\n\r\n// @method hasEventListeners(…): Boolean\r\n// Alias to [`listens(…)`](#evented-listens)\r\nEvents.hasEventListeners = Events.listens;\r\n\r\nexport var Evented = Class.extend(Events);\r\n", "import {isArray, formatNum} from '../core/Util';\r\n\r\n/*\r\n * @class Point\r\n * @aka L.Point\r\n *\r\n * Represents a point with `x` and `y` coordinates in pixels.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var point = L.point(200, 300);\r\n * ```\r\n *\r\n * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```js\r\n * map.panBy([200, 300]);\r\n * map.panBy(L.point(200, 300));\r\n * ```\r\n *\r\n * Note that `Point` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function Point(x, y, round) {\r\n\t// @property x: Number; The `x` coordinate of the point\r\n\tthis.x = (round ? Math.round(x) : x);\r\n\t// @property y: Number; The `y` coordinate of the point\r\n\tthis.y = (round ? Math.round(y) : y);\r\n}\r\n\r\nvar trunc = Math.trunc || function (v) {\r\n\treturn v > 0 ? Math.floor(v) : Math.ceil(v);\r\n};\r\n\r\nPoint.prototype = {\r\n\r\n\t// @method clone(): Point\r\n\t// Returns a copy of the current point.\r\n\tclone: function () {\r\n\t\treturn new Point(this.x, this.y);\r\n\t},\r\n\r\n\t// @method add(otherPoint: Point): Point\r\n\t// Returns the result of addition of the current and the given points.\r\n\tadd: function (point) {\r\n\t\t// non-destructive, returns a new point\r\n\t\treturn this.clone()._add(toPoint(point));\r\n\t},\r\n\r\n\t_add: function (point) {\r\n\t\t// destructive, used directly for performance in situations where it's safe to modify existing point\r\n\t\tthis.x += point.x;\r\n\t\tthis.y += point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method subtract(otherPoint: Point): Point\r\n\t// Returns the result of subtraction of the given point from the current.\r\n\tsubtract: function (point) {\r\n\t\treturn this.clone()._subtract(toPoint(point));\r\n\t},\r\n\r\n\t_subtract: function (point) {\r\n\t\tthis.x -= point.x;\r\n\t\tthis.y -= point.y;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method divideBy(num: Number): Point\r\n\t// Returns the result of division of the current point by the given number.\r\n\tdivideBy: function (num) {\r\n\t\treturn this.clone()._divideBy(num);\r\n\t},\r\n\r\n\t_divideBy: function (num) {\r\n\t\tthis.x /= num;\r\n\t\tthis.y /= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method multiplyBy(num: Number): Point\r\n\t// Returns the result of multiplication of the current point by the given number.\r\n\tmultiplyBy: function (num) {\r\n\t\treturn this.clone()._multiplyBy(num);\r\n\t},\r\n\r\n\t_multiplyBy: function (num) {\r\n\t\tthis.x *= num;\r\n\t\tthis.y *= num;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method scaleBy(scale: Point): Point\r\n\t// Multiply each coordinate of the current point by each coordinate of\r\n\t// `scale`. In linear algebra terms, multiply the point by the\r\n\t// [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation)\r\n\t// defined by `scale`.\r\n\tscaleBy: function (point) {\r\n\t\treturn new Point(this.x * point.x, this.y * point.y);\r\n\t},\r\n\r\n\t// @method unscaleBy(scale: Point): Point\r\n\t// Inverse of `scaleBy`. Divide each coordinate of the current point by\r\n\t// each coordinate of `scale`.\r\n\tunscaleBy: function (point) {\r\n\t\treturn new Point(this.x / point.x, this.y / point.y);\r\n\t},\r\n\r\n\t// @method round(): Point\r\n\t// Returns a copy of the current point with rounded coordinates.\r\n\tround: function () {\r\n\t\treturn this.clone()._round();\r\n\t},\r\n\r\n\t_round: function () {\r\n\t\tthis.x = Math.round(this.x);\r\n\t\tthis.y = Math.round(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method floor(): Point\r\n\t// Returns a copy of the current point with floored coordinates (rounded down).\r\n\tfloor: function () {\r\n\t\treturn this.clone()._floor();\r\n\t},\r\n\r\n\t_floor: function () {\r\n\t\tthis.x = Math.floor(this.x);\r\n\t\tthis.y = Math.floor(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method ceil(): Point\r\n\t// Returns a copy of the current point with ceiled coordinates (rounded up).\r\n\tceil: function () {\r\n\t\treturn this.clone()._ceil();\r\n\t},\r\n\r\n\t_ceil: function () {\r\n\t\tthis.x = Math.ceil(this.x);\r\n\t\tthis.y = Math.ceil(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method trunc(): Point\r\n\t// Returns a copy of the current point with truncated coordinates (rounded towards zero).\r\n\ttrunc: function () {\r\n\t\treturn this.clone()._trunc();\r\n\t},\r\n\r\n\t_trunc: function () {\r\n\t\tthis.x = trunc(this.x);\r\n\t\tthis.y = trunc(this.y);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method distanceTo(otherPoint: Point): Number\r\n\t// Returns the cartesian distance between the current and the given points.\r\n\tdistanceTo: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\tvar x = point.x - this.x,\r\n\t\t    y = point.y - this.y;\r\n\r\n\t\treturn Math.sqrt(x * x + y * y);\r\n\t},\r\n\r\n\t// @method equals(otherPoint: Point): Boolean\r\n\t// Returns `true` if the given point has the same coordinates.\r\n\tequals: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn point.x === this.x &&\r\n\t\t       point.y === this.y;\r\n\t},\r\n\r\n\t// @method contains(otherPoint: Point): Boolean\r\n\t// Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values).\r\n\tcontains: function (point) {\r\n\t\tpoint = toPoint(point);\r\n\r\n\t\treturn Math.abs(point.x) <= Math.abs(this.x) &&\r\n\t\t       Math.abs(point.y) <= Math.abs(this.y);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point for debugging purposes.\r\n\ttoString: function () {\r\n\t\treturn 'Point(' +\r\n\t\t        formatNum(this.x) + ', ' +\r\n\t\t        formatNum(this.y) + ')';\r\n\t}\r\n};\r\n\r\n// @factory L.point(x: Number, y: Number, round?: Boolean)\r\n// Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Number[])\r\n// Expects an array of the form `[x, y]` instead.\r\n\r\n// @alternative\r\n// @factory L.point(coords: Object)\r\n// Expects a plain object of the form `{x: Number, y: Number}` instead.\r\nexport function toPoint(x, y, round) {\r\n\tif (x instanceof Point) {\r\n\t\treturn x;\r\n\t}\r\n\tif (isArray(x)) {\r\n\t\treturn new Point(x[0], x[1]);\r\n\t}\r\n\tif (x === undefined || x === null) {\r\n\t\treturn x;\r\n\t}\r\n\tif (typeof x === 'object' && 'x' in x && 'y' in x) {\r\n\t\treturn new Point(x.x, x.y);\r\n\t}\r\n\treturn new Point(x, y, round);\r\n}\r\n", "import {Point, toPoint} from './Point';\r\n\r\n/*\r\n * @class Bounds\r\n * @aka L.Bounds\r\n *\r\n * Represents a rectangular area in pixel coordinates.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var p1 = L.point(10, 10),\r\n * p2 = L.point(40, 60),\r\n * bounds = L.bounds(p1, p2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * otherBounds.intersects([[10, 10], [40, 60]]);\r\n * ```\r\n *\r\n * Note that `Bounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function Bounds(a, b) {\r\n\tif (!a) { return; }\r\n\r\n\tvar points = b ? [a, b] : a;\r\n\r\n\tfor (var i = 0, len = points.length; i < len; i++) {\r\n\t\tthis.extend(points[i]);\r\n\t}\r\n}\r\n\r\nBounds.prototype = {\r\n\t// @method extend(point: Point): this\r\n\t// Extends the bounds to contain the given point.\r\n\r\n\t// @alternative\r\n\t// @method extend(otherBounds: Bounds): this\r\n\t// Extend the bounds to contain the given bounds\r\n\textend: function (obj) {\r\n\t\tvar min2, max2;\r\n\t\tif (!obj) { return this; }\r\n\r\n\t\tif (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) {\r\n\t\t\tmin2 = max2 = toPoint(obj);\r\n\t\t} else {\r\n\t\t\tobj = toBounds(obj);\r\n\t\t\tmin2 = obj.min;\r\n\t\t\tmax2 = obj.max;\r\n\r\n\t\t\tif (!min2 || !max2) { return this; }\r\n\t\t}\r\n\r\n\t\t// @property min: Point\r\n\t\t// The top left corner of the rectangle.\r\n\t\t// @property max: Point\r\n\t\t// The bottom right corner of the rectangle.\r\n\t\tif (!this.min && !this.max) {\r\n\t\t\tthis.min = min2.clone();\r\n\t\t\tthis.max = max2.clone();\r\n\t\t} else {\r\n\t\t\tthis.min.x = Math.min(min2.x, this.min.x);\r\n\t\t\tthis.max.x = Math.max(max2.x, this.max.x);\r\n\t\t\tthis.min.y = Math.min(min2.y, this.min.y);\r\n\t\t\tthis.max.y = Math.max(max2.y, this.max.y);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getCenter(round?: Boolean): Point\r\n\t// Returns the center point of the bounds.\r\n\tgetCenter: function (round) {\r\n\t\treturn toPoint(\r\n\t\t        (this.min.x + this.max.x) / 2,\r\n\t\t        (this.min.y + this.max.y) / 2, round);\r\n\t},\r\n\r\n\t// @method getBottomLeft(): Point\r\n\t// Returns the bottom-left point of the bounds.\r\n\tgetBottomLeft: function () {\r\n\t\treturn toPoint(this.min.x, this.max.y);\r\n\t},\r\n\r\n\t// @method getTopRight(): Point\r\n\t// Returns the top-right point of the bounds.\r\n\tgetTopRight: function () { // -> Point\r\n\t\treturn toPoint(this.max.x, this.min.y);\r\n\t},\r\n\r\n\t// @method getTopLeft(): Point\r\n\t// Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)).\r\n\tgetTopLeft: function () {\r\n\t\treturn this.min; // left, top\r\n\t},\r\n\r\n\t// @method getBottomRight(): Point\r\n\t// Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)).\r\n\tgetBottomRight: function () {\r\n\t\treturn this.max; // right, bottom\r\n\t},\r\n\r\n\t// @method getSize(): Point\r\n\t// Returns the size of the given bounds\r\n\tgetSize: function () {\r\n\t\treturn this.max.subtract(this.min);\r\n\t},\r\n\r\n\t// @method contains(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle contains the given one.\r\n\t// @alternative\r\n\t// @method contains(point: Point): Boolean\r\n\t// Returns `true` if the rectangle contains the given point.\r\n\tcontains: function (obj) {\r\n\t\tvar min, max;\r\n\r\n\t\tif (typeof obj[0] === 'number' || obj instanceof Point) {\r\n\t\t\tobj = toPoint(obj);\r\n\t\t} else {\r\n\t\t\tobj = toBounds(obj);\r\n\t\t}\r\n\r\n\t\tif (obj instanceof Bounds) {\r\n\t\t\tmin = obj.min;\r\n\t\t\tmax = obj.max;\r\n\t\t} else {\r\n\t\t\tmin = max = obj;\r\n\t\t}\r\n\r\n\t\treturn (min.x >= this.min.x) &&\r\n\t\t       (max.x <= this.max.x) &&\r\n\t\t       (min.y >= this.min.y) &&\r\n\t\t       (max.y <= this.max.y);\r\n\t},\r\n\r\n\t// @method intersects(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle intersects the given bounds. Two bounds\r\n\t// intersect if they have at least one point in common.\r\n\tintersects: function (bounds) { // (Bounds) -> Boolean\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\tvar min = this.min,\r\n\t\t    max = this.max,\r\n\t\t    min2 = bounds.min,\r\n\t\t    max2 = bounds.max,\r\n\t\t    xIntersects = (max2.x >= min.x) && (min2.x <= max.x),\r\n\t\t    yIntersects = (max2.y >= min.y) && (min2.y <= max.y);\r\n\r\n\t\treturn xIntersects && yIntersects;\r\n\t},\r\n\r\n\t// @method overlaps(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle overlaps the given bounds. Two bounds\r\n\t// overlap if their intersection is an area.\r\n\toverlaps: function (bounds) { // (Bounds) -> Boolean\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\tvar min = this.min,\r\n\t\t    max = this.max,\r\n\t\t    min2 = bounds.min,\r\n\t\t    max2 = bounds.max,\r\n\t\t    xOverlaps = (max2.x > min.x) && (min2.x < max.x),\r\n\t\t    yOverlaps = (max2.y > min.y) && (min2.y < max.y);\r\n\r\n\t\treturn xOverlaps && yOverlaps;\r\n\t},\r\n\r\n\t// @method isValid(): Boolean\r\n\t// Returns `true` if the bounds are properly initialized.\r\n\tisValid: function () {\r\n\t\treturn !!(this.min && this.max);\r\n\t},\r\n\r\n\r\n\t// @method pad(bufferRatio: Number): Bounds\r\n\t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n\t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n\t// Negative values will retract the bounds.\r\n\tpad: function (bufferRatio) {\r\n\t\tvar min = this.min,\r\n\t\tmax = this.max,\r\n\t\theightBuffer = Math.abs(min.x - max.x) * bufferRatio,\r\n\t\twidthBuffer = Math.abs(min.y - max.y) * bufferRatio;\r\n\r\n\r\n\t\treturn toBounds(\r\n\t\t\ttoPoint(min.x - heightBuffer, min.y - widthBuffer),\r\n\t\t\ttoPoint(max.x + heightBuffer, max.y + widthBuffer));\r\n\t},\r\n\r\n\r\n\t// @method equals(otherBounds: Bounds): Boolean\r\n\t// Returns `true` if the rectangle is equivalent to the given bounds.\r\n\tequals: function (bounds) {\r\n\t\tif (!bounds) { return false; }\r\n\r\n\t\tbounds = toBounds(bounds);\r\n\r\n\t\treturn this.min.equals(bounds.getTopLeft()) &&\r\n\t\t\tthis.max.equals(bounds.getBottomRight());\r\n\t},\r\n};\r\n\r\n\r\n// @factory L.bounds(corner1: Point, corner2: Point)\r\n// Creates a Bounds object from two corners coordinate pairs.\r\n// @alternative\r\n// @factory L.bounds(points: Point[])\r\n// Creates a Bounds object from the given array of points.\r\nexport function toBounds(a, b) {\r\n\tif (!a || a instanceof Bounds) {\r\n\t\treturn a;\r\n\t}\r\n\treturn new Bounds(a, b);\r\n}\r\n", "import {LatLng, toLatLng} from './LatLng';\r\n\r\n/*\r\n * @class LatLngBounds\r\n * @aka L.LatLngBounds\r\n *\r\n * Represents a rectangular geographical area on a map.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var corner1 = L.latLng(40.712, -74.227),\r\n * corner2 = L.latLng(40.774, -74.125),\r\n * bounds = L.latLngBounds(corner1, corner2);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this:\r\n *\r\n * ```js\r\n * map.fitBounds([\r\n * \t[40.712, -74.227],\r\n * \t[40.774, -74.125]\r\n * ]);\r\n * ```\r\n *\r\n * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\r\n *\r\n * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\r\n\tif (!corner1) { return; }\r\n\r\n\tvar latlngs = corner2 ? [corner1, corner2] : corner1;\r\n\r\n\tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n\t\tthis.extend(latlngs[i]);\r\n\t}\r\n}\r\n\r\nLatLngBounds.prototype = {\r\n\r\n\t// @method extend(latlng: LatLng): this\r\n\t// Extend the bounds to contain the given point\r\n\r\n\t// @alternative\r\n\t// @method extend(otherBounds: LatLngBounds): this\r\n\t// Extend the bounds to contain the given bounds\r\n\textend: function (obj) {\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2, ne2;\r\n\r\n\t\tif (obj instanceof LatLng) {\r\n\t\t\tsw2 = obj;\r\n\t\t\tne2 = obj;\r\n\r\n\t\t} else if (obj instanceof LatLngBounds) {\r\n\t\t\tsw2 = obj._southWest;\r\n\t\t\tne2 = obj._northEast;\r\n\r\n\t\t\tif (!sw2 || !ne2) { return this; }\r\n\r\n\t\t} else {\r\n\t\t\treturn obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this;\r\n\t\t}\r\n\r\n\t\tif (!sw && !ne) {\r\n\t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\r\n\t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\r\n\t\t} else {\r\n\t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\r\n\t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\r\n\t\t\tne.lat = Math.max(ne2.lat, ne.lat);\r\n\t\t\tne.lng = Math.max(ne2.lng, ne.lng);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method pad(bufferRatio: Number): LatLngBounds\r\n\t// Returns bounds created by extending or retracting the current bounds by a given ratio in each direction.\r\n\t// For example, a ratio of 0.5 extends the bounds by 50% in each direction.\r\n\t// Negative values will retract the bounds.\r\n\tpad: function (bufferRatio) {\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\r\n\t\t    widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\r\n\r\n\t\treturn new LatLngBounds(\r\n\t\t        new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\r\n\t\t        new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\r\n\t},\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the center point of the bounds.\r\n\tgetCenter: function () {\r\n\t\treturn new LatLng(\r\n\t\t        (this._southWest.lat + this._northEast.lat) / 2,\r\n\t\t        (this._southWest.lng + this._northEast.lng) / 2);\r\n\t},\r\n\r\n\t// @method getSouthWest(): LatLng\r\n\t// Returns the south-west point of the bounds.\r\n\tgetSouthWest: function () {\r\n\t\treturn this._southWest;\r\n\t},\r\n\r\n\t// @method getNorthEast(): LatLng\r\n\t// Returns the north-east point of the bounds.\r\n\tgetNorthEast: function () {\r\n\t\treturn this._northEast;\r\n\t},\r\n\r\n\t// @method getNorthWest(): LatLng\r\n\t// Returns the north-west point of the bounds.\r\n\tgetNorthWest: function () {\r\n\t\treturn new LatLng(this.getNorth(), this.getWest());\r\n\t},\r\n\r\n\t// @method getSouthEast(): LatLng\r\n\t// Returns the south-east point of the bounds.\r\n\tgetSouthEast: function () {\r\n\t\treturn new LatLng(this.getSouth(), this.getEast());\r\n\t},\r\n\r\n\t// @method getWest(): Number\r\n\t// Returns the west longitude of the bounds\r\n\tgetWest: function () {\r\n\t\treturn this._southWest.lng;\r\n\t},\r\n\r\n\t// @method getSouth(): Number\r\n\t// Returns the south latitude of the bounds\r\n\tgetSouth: function () {\r\n\t\treturn this._southWest.lat;\r\n\t},\r\n\r\n\t// @method getEast(): Number\r\n\t// Returns the east longitude of the bounds\r\n\tgetEast: function () {\r\n\t\treturn this._northEast.lng;\r\n\t},\r\n\r\n\t// @method getNorth(): Number\r\n\t// Returns the north latitude of the bounds\r\n\tgetNorth: function () {\r\n\t\treturn this._northEast.lat;\r\n\t},\r\n\r\n\t// @method contains(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle contains the given one.\r\n\r\n\t// @alternative\r\n\t// @method contains (latlng: LatLng): Boolean\r\n\t// Returns `true` if the rectangle contains the given point.\r\n\tcontains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean\r\n\t\tif (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) {\r\n\t\t\tobj = toLatLng(obj);\r\n\t\t} else {\r\n\t\t\tobj = toLatLngBounds(obj);\r\n\t\t}\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2, ne2;\r\n\r\n\t\tif (obj instanceof LatLngBounds) {\r\n\t\t\tsw2 = obj.getSouthWest();\r\n\t\t\tne2 = obj.getNorthEast();\r\n\t\t} else {\r\n\t\t\tsw2 = ne2 = obj;\r\n\t\t}\r\n\r\n\t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\r\n\t\t       (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\r\n\t},\r\n\r\n\t// @method intersects(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common.\r\n\tintersects: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2 = bounds.getSouthWest(),\r\n\t\t    ne2 = bounds.getNorthEast(),\r\n\r\n\t\t    latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\r\n\t\t    lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\r\n\r\n\t\treturn latIntersects && lngIntersects;\r\n\t},\r\n\r\n\t// @method overlaps(otherBounds: LatLngBounds): Boolean\r\n\t// Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area.\r\n\toverlaps: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tvar sw = this._southWest,\r\n\t\t    ne = this._northEast,\r\n\t\t    sw2 = bounds.getSouthWest(),\r\n\t\t    ne2 = bounds.getNorthEast(),\r\n\r\n\t\t    latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\r\n\t\t    lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\r\n\r\n\t\treturn latOverlaps && lngOverlaps;\r\n\t},\r\n\r\n\t// @method toBBoxString(): String\r\n\t// Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data.\r\n\ttoBBoxString: function () {\r\n\t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\r\n\t},\r\n\r\n\t// @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean\r\n\t// Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number.\r\n\tequals: function (bounds, maxMargin) {\r\n\t\tif (!bounds) { return false; }\r\n\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\r\n\t\t       this._northEast.equals(bounds.getNorthEast(), maxMargin);\r\n\t},\r\n\r\n\t// @method isValid(): Boolean\r\n\t// Returns `true` if the bounds are properly initialized.\r\n\tisValid: function () {\r\n\t\treturn !!(this._southWest && this._northEast);\r\n\t}\r\n};\r\n\r\n// TODO International date line?\r\n\r\n// @factory L.latLngBounds(corner1: LatLng, corner2: LatLng)\r\n// Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle.\r\n\r\n// @alternative\r\n// @factory L.latLngBounds(latlngs: LatLng[])\r\n// Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds).\r\nexport function toLatLngBounds(a, b) {\r\n\tif (a instanceof LatLngBounds) {\r\n\t\treturn a;\r\n\t}\r\n\treturn new LatLngBounds(a, b);\r\n}\r\n", "import * as Util from '../core/Util';\r\nimport {Earth} from './crs/CRS.Earth';\r\nimport {toLatLngBounds} from './LatLngBounds';\r\n\r\n/* @class LatLng\r\n * @aka L.LatLng\r\n *\r\n * Represents a geographical point with a certain latitude and longitude.\r\n *\r\n * @example\r\n *\r\n * ```\r\n * var latlng = L.latLng(50.5, 30.5);\r\n * ```\r\n *\r\n * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent:\r\n *\r\n * ```\r\n * map.panTo([50, 30]);\r\n * map.panTo({lon: 30, lat: 50});\r\n * map.panTo({lat: 50, lng: 30});\r\n * map.panTo(L.latLng(50, 30));\r\n * ```\r\n *\r\n * Note that `LatLng` does not inherit from Leaflet's `Class` object,\r\n * which means new classes can't inherit from it, and new methods\r\n * can't be added to it with the `include` function.\r\n */\r\n\r\nexport function LatLng(lat, lng, alt) {\r\n\tif (isNaN(lat) || isNaN(lng)) {\r\n\t\tthrow new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')');\r\n\t}\r\n\r\n\t// @property lat: Number\r\n\t// Latitude in degrees\r\n\tthis.lat = +lat;\r\n\r\n\t// @property lng: Number\r\n\t// Longitude in degrees\r\n\tthis.lng = +lng;\r\n\r\n\t// @property alt: Number\r\n\t// Altitude in meters (optional)\r\n\tif (alt !== undefined) {\r\n\t\tthis.alt = +alt;\r\n\t}\r\n}\r\n\r\nLatLng.prototype = {\r\n\t// @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean\r\n\t// Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number.\r\n\tequals: function (obj, maxMargin) {\r\n\t\tif (!obj) { return false; }\r\n\r\n\t\tobj = toLatLng(obj);\r\n\r\n\t\tvar margin = Math.max(\r\n\t\t        Math.abs(this.lat - obj.lat),\r\n\t\t        Math.abs(this.lng - obj.lng));\r\n\r\n\t\treturn margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin);\r\n\t},\r\n\r\n\t// @method toString(): String\r\n\t// Returns a string representation of the point (for debugging purposes).\r\n\ttoString: function (precision) {\r\n\t\treturn 'LatLng(' +\r\n\t\t        Util.formatNum(this.lat, precision) + ', ' +\r\n\t\t        Util.formatNum(this.lng, precision) + ')';\r\n\t},\r\n\r\n\t// @method distanceTo(otherLatLng: LatLng): Number\r\n\t// Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines).\r\n\tdistanceTo: function (other) {\r\n\t\treturn Earth.distance(this, toLatLng(other));\r\n\t},\r\n\r\n\t// @method wrap(): LatLng\r\n\t// Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees.\r\n\twrap: function () {\r\n\t\treturn Earth.wrapLatLng(this);\r\n\t},\r\n\r\n\t// @method toBounds(sizeInMeters: Number): LatLngBounds\r\n\t// Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`.\r\n\ttoBounds: function (sizeInMeters) {\r\n\t\tvar latAccuracy = 180 * sizeInMeters / 40075017,\r\n\t\t    lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat);\r\n\r\n\t\treturn toLatLngBounds(\r\n\t\t        [this.lat - latAccuracy, this.lng - lngAccuracy],\r\n\t\t        [this.lat + latAccuracy, this.lng + lngAccuracy]);\r\n\t},\r\n\r\n\tclone: function () {\r\n\t\treturn new LatLng(this.lat, this.lng, this.alt);\r\n\t}\r\n};\r\n\r\n\r\n\r\n// @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng\r\n// Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude).\r\n\r\n// @alternative\r\n// @factory L.latLng(coords: Array): LatLng\r\n// Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead.\r\n\r\n// @alternative\r\n// @factory L.latLng(coords: Object): LatLng\r\n// Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead.\r\n\r\nexport function toLatLng(a, b, c) {\r\n\tif (a instanceof LatLng) {\r\n\t\treturn a;\r\n\t}\r\n\tif (Util.isArray(a) && typeof a[0] !== 'object') {\r\n\t\tif (a.length === 3) {\r\n\t\t\treturn new LatLng(a[0], a[1], a[2]);\r\n\t\t}\r\n\t\tif (a.length === 2) {\r\n\t\t\treturn new LatLng(a[0], a[1]);\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\tif (a === undefined || a === null) {\r\n\t\treturn a;\r\n\t}\r\n\tif (typeof a === 'object' && 'lat' in a) {\r\n\t\treturn new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt);\r\n\t}\r\n\tif (b === undefined) {\r\n\t\treturn null;\r\n\t}\r\n\treturn new LatLng(a, b, c);\r\n}\r\n", "\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {LatLng} from '../LatLng';\r\nimport {LatLngBounds} from '../LatLngBounds';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.Base\r\n * Object that defines coordinate reference systems for projecting\r\n * geographical points into pixel (screen) coordinates and back (and to\r\n * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See\r\n * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system).\r\n *\r\n * Leaflet defines the most usual CRSs by default. If you want to use a\r\n * CRS not defined by default, take a look at the\r\n * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin.\r\n *\r\n * Note that the CRS instances do not inherit from Leaflet's `Class` object,\r\n * and can't be instantiated. Also, new classes can't inherit from them,\r\n * and methods can't be added to them with the `include` function.\r\n */\r\n\r\nexport var CRS = {\r\n\t// @method latLngToPoint(latlng: LatLng, zoom: Number): Point\r\n\t// Projects geographical coordinates into pixel coordinates for a given zoom.\r\n\tlatLngToPoint: function (latlng, zoom) {\r\n\t\tvar projectedPoint = this.projection.project(latlng),\r\n\t\t    scale = this.scale(zoom);\r\n\r\n\t\treturn this.transformation._transform(projectedPoint, scale);\r\n\t},\r\n\r\n\t// @method pointToLatLng(point: Point, zoom: Number): LatLng\r\n\t// The inverse of `latLngToPoint`. Projects pixel coordinates on a given\r\n\t// zoom into geographical coordinates.\r\n\tpointToLatLng: function (point, zoom) {\r\n\t\tvar scale = this.scale(zoom),\r\n\t\t    untransformedPoint = this.transformation.untransform(point, scale);\r\n\r\n\t\treturn this.projection.unproject(untransformedPoint);\r\n\t},\r\n\r\n\t// @method project(latlng: LatLng): Point\r\n\t// Projects geographical coordinates into coordinates in units accepted for\r\n\t// this CRS (e.g. meters for EPSG:3857, for passing it to WMS services).\r\n\tproject: function (latlng) {\r\n\t\treturn this.projection.project(latlng);\r\n\t},\r\n\r\n\t// @method unproject(point: Point): LatLng\r\n\t// Given a projected coordinate returns the corresponding LatLng.\r\n\t// The inverse of `project`.\r\n\tunproject: function (point) {\r\n\t\treturn this.projection.unproject(point);\r\n\t},\r\n\r\n\t// @method scale(zoom: Number): Number\r\n\t// Returns the scale used when transforming projected coordinates into\r\n\t// pixel coordinates for a particular zoom. For example, it returns\r\n\t// `256 * 2^zoom` for Mercator-based CRS.\r\n\tscale: function (zoom) {\r\n\t\treturn 256 * Math.pow(2, zoom);\r\n\t},\r\n\r\n\t// @method zoom(scale: Number): Number\r\n\t// Inverse of `scale()`, returns the zoom level corresponding to a scale\r\n\t// factor of `scale`.\r\n\tzoom: function (scale) {\r\n\t\treturn Math.log(scale / 256) / Math.LN2;\r\n\t},\r\n\r\n\t// @method getProjectedBounds(zoom: Number): Bounds\r\n\t// Returns the projection's bounds scaled and transformed for the provided `zoom`.\r\n\tgetProjectedBounds: function (zoom) {\r\n\t\tif (this.infinite) { return null; }\r\n\r\n\t\tvar b = this.projection.bounds,\r\n\t\t    s = this.scale(zoom),\r\n\t\t    min = this.transformation.transform(b.min, s),\r\n\t\t    max = this.transformation.transform(b.max, s);\r\n\r\n\t\treturn new Bounds(min, max);\r\n\t},\r\n\r\n\t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n\t// Returns the distance between two geographical coordinates.\r\n\r\n\t// @property code: String\r\n\t// Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`)\r\n\t//\r\n\t// @property wrapLng: Number[]\r\n\t// An array of two numbers defining whether the longitude (horizontal) coordinate\r\n\t// axis wraps around a given range and how. Defaults to `[-180, 180]` in most\r\n\t// geographical CRSs. If `undefined`, the longitude axis does not wrap around.\r\n\t//\r\n\t// @property wrapLat: Number[]\r\n\t// Like `wrapLng`, but for the latitude (vertical) axis.\r\n\r\n\t// wrapLng: [min, max],\r\n\t// wrapLat: [min, max],\r\n\r\n\t// @property infinite: Boolean\r\n\t// If true, the coordinate space will be unbounded (infinite in both axes)\r\n\tinfinite: false,\r\n\r\n\t// @method wrapLatLng(latlng: LatLng): LatLng\r\n\t// Returns a `LatLng` where lat and lng has been wrapped according to the\r\n\t// CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds.\r\n\twrapLatLng: function (latlng) {\r\n\t\tvar lng = this.wrapLng ? Util.wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng,\r\n\t\t    lat = this.wrapLat ? Util.wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat,\r\n\t\t    alt = latlng.alt;\r\n\r\n\t\treturn new LatLng(lat, lng, alt);\r\n\t},\r\n\r\n\t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n\t// Returns a `LatLngBounds` with the same size as the given one, ensuring\r\n\t// that its center is within the CRS's bounds.\r\n\t// Only accepts actual `L.LatLngBounds` instances, not arrays.\r\n\twrapLatLngBounds: function (bounds) {\r\n\t\tvar center = bounds.getCenter(),\r\n\t\t    newCenter = this.wrapLatLng(center),\r\n\t\t    latShift = center.lat - newCenter.lat,\r\n\t\t    lngShift = center.lng - newCenter.lng;\r\n\r\n\t\tif (latShift === 0 && lngShift === 0) {\r\n\t\t\treturn bounds;\r\n\t\t}\r\n\r\n\t\tvar sw = bounds.getSouthWest(),\r\n\t\t    ne = bounds.getNorthEast(),\r\n\t\t    newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift),\r\n\t\t    newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift);\r\n\r\n\t\treturn new LatLngBounds(newSw, newNe);\r\n\t}\r\n};\r\n", "import {CRS} from './CRS';\nimport * as Util from '../../core/Util';\n\n/*\n * @namespace CRS\n * @crs L.CRS.Earth\n *\n * Serves as the base for CRS that are global such that they cover the earth.\n * Can only be used as the base for other CRS and cannot be used directly,\n * since it does not have a `code`, `projection` or `transformation`. `distance()` returns\n * meters.\n */\n\nexport var Earth = Util.extend({}, CRS, {\n\twrapLng: [-180, 180],\n\n\t// Mean Earth Radius, as recommended for use by\n\t// the International Union of Geodesy and Geophysics,\n\t// see https://rosettacode.org/wiki/Haversine_formula\n\tR: 6371000,\n\n\t// distance between two geographical points using spherical law of cosines approximation\n\tdistance: function (latlng1, latlng2) {\n\t\tvar rad = Math.PI / 180,\n\t\t    lat1 = latlng1.lat * rad,\n\t\t    lat2 = latlng2.lat * rad,\n\t\t    sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2),\n\t\t    sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2),\n\t\t    a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon,\n\t\t    c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n\t\treturn this.R * c;\n\t}\n});\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @projection L.Projection.SphericalMercator\r\n *\r\n * Spherical Mercator projection — the most common projection for online maps,\r\n * used by almost all free and commercial tile providers. Assumes that Earth is\r\n * a sphere. Used by the `EPSG:3857` CRS.\r\n */\r\n\r\nvar earthRadius = 6378137;\r\n\r\nexport var SphericalMercator = {\r\n\r\n\tR: earthRadius,\r\n\tMAX_LATITUDE: 85.0511287798,\r\n\r\n\tproject: function (latlng) {\r\n\t\tvar d = Math.PI / 180,\r\n\t\t    max = this.MAX_LATITUDE,\r\n\t\t    lat = Math.max(Math.min(max, latlng.lat), -max),\r\n\t\t    sin = Math.sin(lat * d);\r\n\r\n\t\treturn new Point(\r\n\t\t\tthis.R * latlng.lng * d,\r\n\t\t\tthis.R * Math.log((1 + sin) / (1 - sin)) / 2);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\tvar d = 180 / Math.PI;\r\n\r\n\t\treturn new LatLng(\r\n\t\t\t(2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d,\r\n\t\t\tpoint.x * d / this.R);\r\n\t},\r\n\r\n\tbounds: (function () {\r\n\t\tvar d = earthRadius * Math.PI;\r\n\t\treturn new Bounds([-d, -d], [d, d]);\r\n\t})()\r\n};\r\n", "import {Point} from './Point';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class Transformation\r\n * @aka L.Transformation\r\n *\r\n * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d`\r\n * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing\r\n * the reverse. Used by Leaflet in its projections code.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var transformation = L.transformation(2, 5, -1, 10),\r\n * \tp = L.point(1, 2),\r\n * \tp2 = transformation.transform(p), //  L.point(7, 8)\r\n * \tp3 = transformation.untransform(p2); //  L.point(1, 2)\r\n * ```\r\n */\r\n\r\n\r\n// factory new L.Transformation(a: Number, b: Number, c: Number, d: Number)\r\n// Creates a `Transformation` object with the given coefficients.\r\nexport function Transformation(a, b, c, d) {\r\n\tif (Util.isArray(a)) {\r\n\t\t// use array properties\r\n\t\tthis._a = a[0];\r\n\t\tthis._b = a[1];\r\n\t\tthis._c = a[2];\r\n\t\tthis._d = a[3];\r\n\t\treturn;\r\n\t}\r\n\tthis._a = a;\r\n\tthis._b = b;\r\n\tthis._c = c;\r\n\tthis._d = d;\r\n}\r\n\r\nTransformation.prototype = {\r\n\t// @method transform(point: Point, scale?: Number): Point\r\n\t// Returns a transformed point, optionally multiplied by the given scale.\r\n\t// Only accepts actual `L.Point` instances, not arrays.\r\n\ttransform: function (point, scale) { // (Point, Number) -> Point\r\n\t\treturn this._transform(point.clone(), scale);\r\n\t},\r\n\r\n\t// destructive transform (faster)\r\n\t_transform: function (point, scale) {\r\n\t\tscale = scale || 1;\r\n\t\tpoint.x = scale * (this._a * point.x + this._b);\r\n\t\tpoint.y = scale * (this._c * point.y + this._d);\r\n\t\treturn point;\r\n\t},\r\n\r\n\t// @method untransform(point: Point, scale?: Number): Point\r\n\t// Returns the reverse transformation of the given point, optionally divided\r\n\t// by the given scale. Only accepts actual `L.Point` instances, not arrays.\r\n\tuntransform: function (point, scale) {\r\n\t\tscale = scale || 1;\r\n\t\treturn new Point(\r\n\t\t        (point.x / scale - this._b) / this._a,\r\n\t\t        (point.y / scale - this._d) / this._c);\r\n\t}\r\n};\r\n\r\n// factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n\r\n// @factory L.transformation(a: Number, b: Number, c: Number, d: Number)\r\n// Instantiates a Transformation object with the given coefficients.\r\n\r\n// @alternative\r\n// @factory L.transformation(coefficients: Array): Transformation\r\n// Expects an coefficients array of the form\r\n// `[a: Number, b: Number, c: Number, d: Number]`.\r\n\r\nexport function toTransformation(a, b, c, d) {\r\n\treturn new Transformation(a, b, c, d);\r\n}\r\n", "import {Earth} from './CRS.Earth';\r\nimport {SphericalMercator} from '../projection/Projection.SphericalMercator';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3857\r\n *\r\n * The most common CRS for online maps, used by almost all free and commercial\r\n * tile providers. Uses Spherical Mercator projection. Set in by default in\r\n * Map's `crs` option.\r\n */\r\n\r\nexport var EPSG3857 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:3857',\r\n\tprojection: SphericalMercator,\r\n\r\n\ttransformation: (function () {\r\n\t\tvar scale = 0.5 / (Math.PI * SphericalMercator.R);\r\n\t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n\t}())\r\n});\r\n\r\nexport var EPSG900913 = Util.extend({}, EPSG3857, {\r\n\tcode: 'EPSG:900913'\r\n});\r\n", "import Browser from '../../core/Browser';\n\n// @namespace SVG; @section\n// There are several static functions which can be called without instantiating L.SVG:\n\n// @function create(name: String): SVGElement\n// Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n// corresponding to the class name passed. For example, using 'line' will return\n// an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\nexport function svgCreate(name) {\n\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n}\n\n// @function pointsToPath(rings: Point[], closed: Boolean): String\n// Generates a SVG path string for multiple rings, with each ring turning\n// into \"M..L..L..\" instructions\nexport function pointsToPath(rings, closed) {\n\tvar str = '',\n\ti, j, len, len2, points, p;\n\n\tfor (i = 0, len = rings.length; i < len; i++) {\n\t\tpoints = rings[i];\n\n\t\tfor (j = 0, len2 = points.length; j < len2; j++) {\n\t\t\tp = points[j];\n\t\t\tstr += (j ? 'L' : 'M') + p.x + ' ' + p.y;\n\t\t}\n\n\t\t// closes the ring for polygons; \"x\" is VML syntax\n\t\tstr += closed ? (Browser.svg ? 'z' : 'x') : '';\n\t}\n\n\t// SVG complains about empty path strings\n\treturn str || 'M0 0';\n}\n\n\n\n\n", "import * as Util from './Util';\r\nimport {svgCreate} from '../layer/vector/SVG.Util';\r\n\r\n/*\r\n * @namespace Browser\r\n * @aka L.Browser\r\n *\r\n * A namespace with static properties for browser/feature detection used by Leaflet internally.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * if (L.Browser.ielt9) {\r\n *   alert('Upgrade your browser, dude!');\r\n * }\r\n * ```\r\n */\r\n\r\nvar style = document.documentElement.style;\r\n\r\n// @property ie: Boolean; `true` for all Internet Explorer versions (not Edge).\r\nvar ie = 'ActiveXObject' in window;\r\n\r\n// @property ielt9: Boolean; `true` for Internet Explorer versions less than 9.\r\nvar ielt9 = ie && !document.addEventListener;\r\n\r\n// @property edge: Boolean; `true` for the Edge web browser.\r\nvar edge = 'msLaunchUri' in navigator && !('documentMode' in document);\r\n\r\n// @property webkit: Boolean;\r\n// `true` for webkit-based browsers like Chrome and Safari (including mobile versions).\r\nvar webkit = userAgentContains('webkit');\r\n\r\n// @property android: Boolean\r\n// **Deprecated.** `true` for any browser running on an Android platform.\r\nvar android = userAgentContains('android');\r\n\r\n// @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3.\r\nvar android23 = userAgentContains('android 2') || userAgentContains('android 3');\r\n\r\n/* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */\r\nvar webkitVer = parseInt(/WebKit\\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit\r\n// @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome)\r\nvar androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window);\r\n\r\n// @property opera: Boolean; `true` for the Opera browser\r\nvar opera = !!window.opera;\r\n\r\n// @property chrome: Boolean; `true` for the Chrome browser.\r\nvar chrome = !edge && userAgentContains('chrome');\r\n\r\n// @property gecko: Boolean; `true` for gecko-based browsers like Firefox.\r\nvar gecko = userAgentContains('gecko') && !webkit && !opera && !ie;\r\n\r\n// @property safari: Boolean; `true` for the Safari browser.\r\nvar safari = !chrome && userAgentContains('safari');\r\n\r\nvar phantom = userAgentContains('phantom');\r\n\r\n// @property opera12: Boolean\r\n// `true` for the Opera browser supporting CSS transforms (version 12 or later).\r\nvar opera12 = 'OTransition' in style;\r\n\r\n// @property win: Boolean; `true` when the browser is running in a Windows platform\r\nvar win = navigator.platform.indexOf('Win') === 0;\r\n\r\n// @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms.\r\nvar ie3d = ie && ('transition' in style);\r\n\r\n// @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms.\r\nvar webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23;\r\n\r\n// @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms.\r\nvar gecko3d = 'MozPerspective' in style;\r\n\r\n// @property any3d: Boolean\r\n// `true` for all browsers supporting CSS transforms.\r\nvar any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom;\r\n\r\n// @property mobile: Boolean; `true` for all browsers running in a mobile device.\r\nvar mobile = typeof orientation !== 'undefined' || userAgentContains('mobile');\r\n\r\n// @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device.\r\nvar mobileWebkit = mobile && webkit;\r\n\r\n// @property mobileWebkit3d: Boolean\r\n// `true` for all webkit-based browsers in a mobile device supporting CSS transforms.\r\nvar mobileWebkit3d = mobile && webkit3d;\r\n\r\n// @property msPointer: Boolean\r\n// `true` for browsers implementing the Microsoft touch events model (notably IE10).\r\nvar msPointer = !window.PointerEvent && window.MSPointerEvent;\r\n\r\n// @property pointer: Boolean\r\n// `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx).\r\nvar pointer = !!(window.PointerEvent || msPointer);\r\n\r\n// @property touchNative: Boolean\r\n// `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events).\r\n// **This does not necessarily mean** that the browser is running in a computer with\r\n// a touchscreen, it only means that the browser is capable of understanding\r\n// touch events.\r\nvar touchNative = 'ontouchstart' in window || !!window.TouchEvent;\r\n\r\n// @property touch: Boolean\r\n// `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events.\r\n// Note: pointer events will be preferred (if available), and processed for all `touch*` listeners.\r\nvar touch = !window.L_NO_TOUCH && (touchNative || pointer);\r\n\r\n// @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device.\r\nvar mobileOpera = mobile && opera;\r\n\r\n// @property mobileGecko: Boolean\r\n// `true` for gecko-based browsers running in a mobile device.\r\nvar mobileGecko = mobile && gecko;\r\n\r\n// @property retina: Boolean\r\n// `true` for browsers on a high-resolution \"retina\" screen or on any screen when browser's display zoom is more than 100%.\r\nvar retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1;\r\n\r\n// @property passiveEvents: Boolean\r\n// `true` for browsers that support passive events.\r\nvar passiveEvents = (function () {\r\n\tvar supportsPassiveOption = false;\r\n\ttry {\r\n\t\tvar opts = Object.defineProperty({}, 'passive', {\r\n\t\t\tget: function () { // eslint-disable-line getter-return\r\n\t\t\t\tsupportsPassiveOption = true;\r\n\t\t\t}\r\n\t\t});\r\n\t\twindow.addEventListener('testPassiveEventSupport', Util.falseFn, opts);\r\n\t\twindow.removeEventListener('testPassiveEventSupport', Util.falseFn, opts);\r\n\t} catch (e) {\r\n\t\t// Errors can safely be ignored since this is only a browser support test.\r\n\t}\r\n\treturn supportsPassiveOption;\r\n}());\r\n\r\n// @property canvas: Boolean\r\n// `true` when the browser supports [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).\r\nvar canvas = (function () {\r\n\treturn !!document.createElement('canvas').getContext;\r\n}());\r\n\r\n// @property svg: Boolean\r\n// `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG).\r\nvar svg = !!(document.createElementNS && svgCreate('svg').createSVGRect);\r\n\r\nvar inlineSvg = !!svg && (function () {\r\n\tvar div = document.createElement('div');\r\n\tdiv.innerHTML = '<svg/>';\r\n\treturn (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg';\r\n})();\r\n\r\n// @property vml: Boolean\r\n// `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language).\r\nvar vml = !svg && (function () {\r\n\ttry {\r\n\t\tvar div = document.createElement('div');\r\n\t\tdiv.innerHTML = '<v:shape adj=\"1\"/>';\r\n\r\n\t\tvar shape = div.firstChild;\r\n\t\tshape.style.behavior = 'url(#default#VML)';\r\n\r\n\t\treturn shape && (typeof shape.adj === 'object');\r\n\r\n\t} catch (e) {\r\n\t\treturn false;\r\n\t}\r\n}());\r\n\r\n\r\n// @property mac: Boolean; `true` when the browser is running in a Mac platform\r\nvar mac = navigator.platform.indexOf('Mac') === 0;\r\n\r\n// @property mac: Boolean; `true` when the browser is running in a Linux platform\r\nvar linux = navigator.platform.indexOf('Linux') === 0;\r\n\r\nfunction userAgentContains(str) {\r\n\treturn navigator.userAgent.toLowerCase().indexOf(str) >= 0;\r\n}\r\n\r\n\r\nexport default {\r\n\tie: ie,\r\n\tielt9: ielt9,\r\n\tedge: edge,\r\n\twebkit: webkit,\r\n\tandroid: android,\r\n\tandroid23: android23,\r\n\tandroidStock: androidStock,\r\n\topera: opera,\r\n\tchrome: chrome,\r\n\tgecko: gecko,\r\n\tsafari: safari,\r\n\tphantom: phantom,\r\n\topera12: opera12,\r\n\twin: win,\r\n\tie3d: ie3d,\r\n\twebkit3d: webkit3d,\r\n\tgecko3d: gecko3d,\r\n\tany3d: any3d,\r\n\tmobile: mobile,\r\n\tmobileWebkit: mobileWebkit,\r\n\tmobileWebkit3d: mobileWebkit3d,\r\n\tmsPointer: msPointer,\r\n\tpointer: pointer,\r\n\ttouch: touch,\r\n\ttouchNative: touchNative,\r\n\tmobileOpera: mobileOpera,\r\n\tmobileGecko: mobileGecko,\r\n\tretina: retina,\r\n\tpassiveEvents: passiveEvents,\r\n\tcanvas: canvas,\r\n\tsvg: svg,\r\n\tvml: vml,\r\n\tinlineSvg: inlineSvg,\r\n\tmac: mac,\r\n\tlinux: linux\r\n};\r\n", "import * as DomEvent from './DomEvent';\nimport Browser from '../core/Browser';\nimport {falseFn} from '../core/Util';\n\n/*\n * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices.\n */\n\nvar POINTER_DOWN =   Browser.msPointer ? 'MSPointerDown'   : 'pointerdown';\nvar POINTER_MOVE =   Browser.msPointer ? 'MSPointerMove'   : 'pointermove';\nvar POINTER_UP =     Browser.msPointer ? 'MSPointerUp'     : 'pointerup';\nvar POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel';\nvar pEvent = {\n\ttouchstart  : POINTER_DOWN,\n\ttouchmove   : POINTER_MOVE,\n\ttouchend    : POINTER_UP,\n\ttouchcancel : POINTER_CANCEL\n};\nvar handle = {\n\ttouchstart  : _onPointerStart,\n\ttouchmove   : _handlePointer,\n\ttouchend    : _handlePointer,\n\ttouchcancel : _handlePointer\n};\nvar _pointers = {};\nvar _pointerDocListener = false;\n\n// Provides a touch events wrapper for (ms)pointer events.\n// ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890\n\nexport function addPointerListener(obj, type, handler) {\n\tif (type === 'touchstart') {\n\t\t_addPointerDocListener();\n\t}\n\tif (!handle[type]) {\n\t\tconsole.warn('wrong event specified:', type);\n\t\treturn falseFn;\n\t}\n\thandler = handle[type].bind(this, handler);\n\tobj.addEventListener(pEvent[type], handler, false);\n\treturn handler;\n}\n\nexport function removePointerListener(obj, type, handler) {\n\tif (!pEvent[type]) {\n\t\tconsole.warn('wrong event specified:', type);\n\t\treturn;\n\t}\n\tobj.removeEventListener(pEvent[type], handler, false);\n}\n\nfunction _globalPointerDown(e) {\n\t_pointers[e.pointerId] = e;\n}\n\nfunction _globalPointerMove(e) {\n\tif (_pointers[e.pointerId]) {\n\t\t_pointers[e.pointerId] = e;\n\t}\n}\n\nfunction _globalPointerUp(e) {\n\tdelete _pointers[e.pointerId];\n}\n\nfunction _addPointerDocListener() {\n\t// need to keep track of what pointers and how many are active to provide e.touches emulation\n\tif (!_pointerDocListener) {\n\t\t// we listen document as any drags that end by moving the touch off the screen get fired there\n\t\tdocument.addEventListener(POINTER_DOWN, _globalPointerDown, true);\n\t\tdocument.addEventListener(POINTER_MOVE, _globalPointerMove, true);\n\t\tdocument.addEventListener(POINTER_UP, _globalPointerUp, true);\n\t\tdocument.addEventListener(POINTER_CANCEL, _globalPointerUp, true);\n\n\t\t_pointerDocListener = true;\n\t}\n}\n\nfunction _handlePointer(handler, e) {\n\tif (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; }\n\n\te.touches = [];\n\tfor (var i in _pointers) {\n\t\te.touches.push(_pointers[i]);\n\t}\n\te.changedTouches = [e];\n\n\thandler(e);\n}\n\nfunction _onPointerStart(handler, e) {\n\t// IE10 specific: MsTouch needs preventDefault. See #2000\n\tif (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) {\n\t\tDomEvent.preventDefault(e);\n\t}\n\t_handlePointer(handler, e);\n}\n", "import * as DomEvent from './DomEvent';\r\n\r\n/*\r\n * Extends the event handling code with double tap support for mobile browsers.\r\n *\r\n * Note: currently most browsers fire native dblclick, with only a few exceptions\r\n * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386)\r\n */\r\n\r\nfunction makeDblclick(event) {\r\n\t// in modern browsers `type` cannot be just overridden:\r\n\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only\r\n\tvar newEvent = {},\r\n\t    prop, i;\r\n\tfor (i in event) {\r\n\t\tprop = event[i];\r\n\t\tnewEvent[i] = prop && prop.bind ? prop.bind(event) : prop;\r\n\t}\r\n\tevent = newEvent;\r\n\tnewEvent.type = 'dblclick';\r\n\tnewEvent.detail = 2;\r\n\tnewEvent.isTrusted = false;\r\n\tnewEvent._simulated = true; // for debug purposes\r\n\treturn newEvent;\r\n}\r\n\r\nvar delay = 200;\r\nexport function addDoubleTapListener(obj, handler) {\r\n\t// Most browsers handle double tap natively\r\n\tobj.addEventListener('dblclick', handler);\r\n\r\n\t// On some platforms the browser doesn't fire native dblclicks for touch events.\r\n\t// It seems that in all such cases `detail` property of `click` event is always `1`.\r\n\t// So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed.\r\n\tvar last = 0,\r\n\t    detail;\r\n\tfunction simDblclick(e) {\r\n\t\tif (e.detail !== 1) {\r\n\t\t\tdetail = e.detail; // keep in sync to avoid false dblclick in some cases\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (e.pointerType === 'mouse' ||\r\n\t\t\t(e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) {\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// When clicking on an <input>, the browser generates a click on its\r\n\t\t// <label> (and vice versa) triggering two clicks in quick succession.\r\n\t\t// This ignores clicks on elements which are a label with a 'for'\r\n\t\t// attribute (or children of such a label), but not children of\r\n\t\t// a <input>.\r\n\t\tvar path = DomEvent.getPropagationPath(e);\r\n\t\tif (path.some(function (el) {\r\n\t\t\treturn el instanceof HTMLLabelElement && el.attributes.for;\r\n\t\t}) &&\r\n\t\t\t!path.some(function (el) {\r\n\t\t\t\treturn (\r\n\t\t\t\t\tel instanceof HTMLInputElement ||\r\n\t\t\t\t\tel instanceof HTMLSelectElement\r\n\t\t\t\t);\r\n\t\t\t})\r\n\t\t) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar now = Date.now();\r\n\t\tif (now - last <= delay) {\r\n\t\t\tdetail++;\r\n\t\t\tif (detail === 2) {\r\n\t\t\t\thandler(makeDblclick(e));\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tdetail = 1;\r\n\t\t}\r\n\t\tlast = now;\r\n\t}\r\n\r\n\tobj.addEventListener('click', simDblclick);\r\n\r\n\treturn {\r\n\t\tdblclick: handler,\r\n\t\tsimDblclick: simDblclick\r\n\t};\r\n}\r\n\r\nexport function removeDoubleTapListener(obj, handlers) {\r\n\tobj.removeEventListener('dblclick', handlers.dblclick);\r\n\tobj.removeEventListener('click', handlers.simDblclick);\r\n}\r\n", "import * as DomEvent from './DomEvent';\r\nimport * as Util from '../core/Util';\r\nimport {Point} from '../geometry/Point';\r\nimport Browser from '../core/Browser';\r\n\r\n/*\r\n * @namespace DomUtil\r\n *\r\n * Utility functions to work with the [DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model)\r\n * tree, used by Leaflet internally.\r\n *\r\n * Most functions expecting or returning a `HTMLElement` also work for\r\n * SVG elements. The only difference is that classes refer to CSS classes\r\n * in HTML and SVG classes in SVG.\r\n */\r\n\r\n\r\n// @property TRANSFORM: String\r\n// Vendor-prefixed transform style name (e.g. `'webkitTransform'` for WebKit).\r\nexport var TRANSFORM = testProp(\r\n\t['transform', 'webkitTransform', 'OTransform', 'MozTransform', 'msTransform']);\r\n\r\n// webkitTransition comes first because some browser versions that drop vendor prefix don't do\r\n// the same for the transitionend event, in particular the Android 4.1 stock browser\r\n\r\n// @property TRANSITION: String\r\n// Vendor-prefixed transition style name.\r\nexport var TRANSITION = testProp(\r\n\t['webkitTransition', 'transition', 'OTransition', 'MozTransition', 'msTransition']);\r\n\r\n// @property TRANSITION_END: String\r\n// Vendor-prefixed transitionend event name.\r\nexport var TRANSITION_END =\r\n\tTRANSITION === 'webkitTransition' || TRANSITION === 'OTransition' ? TRANSITION + 'End' : 'transitionend';\r\n\r\n\r\n// @function get(id: String|HTMLElement): HTMLElement\r\n// Returns an element given its DOM id, or returns the element itself\r\n// if it was passed directly.\r\nexport function get(id) {\r\n\treturn typeof id === 'string' ? document.getElementById(id) : id;\r\n}\r\n\r\n// @function getStyle(el: HTMLElement, styleAttrib: String): String\r\n// Returns the value for a certain style attribute on an element,\r\n// including computed values or values set through CSS.\r\nexport function getStyle(el, style) {\r\n\tvar value = el.style[style] || (el.currentStyle && el.currentStyle[style]);\r\n\r\n\tif ((!value || value === 'auto') && document.defaultView) {\r\n\t\tvar css = document.defaultView.getComputedStyle(el, null);\r\n\t\tvalue = css ? css[style] : null;\r\n\t}\r\n\treturn value === 'auto' ? null : value;\r\n}\r\n\r\n// @function create(tagName: String, className?: String, container?: HTMLElement): HTMLElement\r\n// Creates an HTML element with `tagName`, sets its class to `className`, and optionally appends it to `container` element.\r\nexport function create(tagName, className, container) {\r\n\tvar el = document.createElement(tagName);\r\n\tel.className = className || '';\r\n\r\n\tif (container) {\r\n\t\tcontainer.appendChild(el);\r\n\t}\r\n\treturn el;\r\n}\r\n\r\n// @function remove(el: HTMLElement)\r\n// Removes `el` from its parent element\r\nexport function remove(el) {\r\n\tvar parent = el.parentNode;\r\n\tif (parent) {\r\n\t\tparent.removeChild(el);\r\n\t}\r\n}\r\n\r\n// @function empty(el: HTMLElement)\r\n// Removes all of `el`'s children elements from `el`\r\nexport function empty(el) {\r\n\twhile (el.firstChild) {\r\n\t\tel.removeChild(el.firstChild);\r\n\t}\r\n}\r\n\r\n// @function toFront(el: HTMLElement)\r\n// Makes `el` the last child of its parent, so it renders in front of the other children.\r\nexport function toFront(el) {\r\n\tvar parent = el.parentNode;\r\n\tif (parent && parent.lastChild !== el) {\r\n\t\tparent.appendChild(el);\r\n\t}\r\n}\r\n\r\n// @function toBack(el: HTMLElement)\r\n// Makes `el` the first child of its parent, so it renders behind the other children.\r\nexport function toBack(el) {\r\n\tvar parent = el.parentNode;\r\n\tif (parent && parent.firstChild !== el) {\r\n\t\tparent.insertBefore(el, parent.firstChild);\r\n\t}\r\n}\r\n\r\n// @function hasClass(el: HTMLElement, name: String): Boolean\r\n// Returns `true` if the element's class attribute contains `name`.\r\nexport function hasClass(el, name) {\r\n\tif (el.classList !== undefined) {\r\n\t\treturn el.classList.contains(name);\r\n\t}\r\n\tvar className = getClass(el);\r\n\treturn className.length > 0 && new RegExp('(^|\\\\s)' + name + '(\\\\s|$)').test(className);\r\n}\r\n\r\n// @function addClass(el: HTMLElement, name: String)\r\n// Adds `name` to the element's class attribute.\r\nexport function addClass(el, name) {\r\n\tif (el.classList !== undefined) {\r\n\t\tvar classes = Util.splitWords(name);\r\n\t\tfor (var i = 0, len = classes.length; i < len; i++) {\r\n\t\t\tel.classList.add(classes[i]);\r\n\t\t}\r\n\t} else if (!hasClass(el, name)) {\r\n\t\tvar className = getClass(el);\r\n\t\tsetClass(el, (className ? className + ' ' : '') + name);\r\n\t}\r\n}\r\n\r\n// @function removeClass(el: HTMLElement, name: String)\r\n// Removes `name` from the element's class attribute.\r\nexport function removeClass(el, name) {\r\n\tif (el.classList !== undefined) {\r\n\t\tel.classList.remove(name);\r\n\t} else {\r\n\t\tsetClass(el, Util.trim((' ' + getClass(el) + ' ').replace(' ' + name + ' ', ' ')));\r\n\t}\r\n}\r\n\r\n// @function setClass(el: HTMLElement, name: String)\r\n// Sets the element's class.\r\nexport function setClass(el, name) {\r\n\tif (el.className.baseVal === undefined) {\r\n\t\tel.className = name;\r\n\t} else {\r\n\t\t// in case of SVG element\r\n\t\tel.className.baseVal = name;\r\n\t}\r\n}\r\n\r\n// @function getClass(el: HTMLElement): String\r\n// Returns the element's class.\r\nexport function getClass(el) {\r\n\t// Check if the element is an SVGElementInstance and use the correspondingElement instead\r\n\t// (Required for linked SVG elements in IE11.)\r\n\tif (el.correspondingElement) {\r\n\t\tel = el.correspondingElement;\r\n\t}\r\n\treturn el.className.baseVal === undefined ? el.className : el.className.baseVal;\r\n}\r\n\r\n// @function setOpacity(el: HTMLElement, opacity: Number)\r\n// Set the opacity of an element (including old IE support).\r\n// `opacity` must be a number from `0` to `1`.\r\nexport function setOpacity(el, value) {\r\n\tif ('opacity' in el.style) {\r\n\t\tel.style.opacity = value;\r\n\t} else if ('filter' in el.style) {\r\n\t\t_setOpacityIE(el, value);\r\n\t}\r\n}\r\n\r\nfunction _setOpacityIE(el, value) {\r\n\tvar filter = false,\r\n\t    filterName = 'DXImageTransform.Microsoft.Alpha';\r\n\r\n\t// filters collection throws an error if we try to retrieve a filter that doesn't exist\r\n\ttry {\r\n\t\tfilter = el.filters.item(filterName);\r\n\t} catch (e) {\r\n\t\t// don't set opacity to 1 if we haven't already set an opacity,\r\n\t\t// it isn't needed and breaks transparent pngs.\r\n\t\tif (value === 1) { return; }\r\n\t}\r\n\r\n\tvalue = Math.round(value * 100);\r\n\r\n\tif (filter) {\r\n\t\tfilter.Enabled = (value !== 100);\r\n\t\tfilter.Opacity = value;\r\n\t} else {\r\n\t\tel.style.filter += ' progid:' + filterName + '(opacity=' + value + ')';\r\n\t}\r\n}\r\n\r\n// @function testProp(props: String[]): String|false\r\n// Goes through the array of style names and returns the first name\r\n// that is a valid style name for an element. If no such name is found,\r\n// it returns false. Useful for vendor-prefixed styles like `transform`.\r\nexport function testProp(props) {\r\n\tvar style = document.documentElement.style;\r\n\r\n\tfor (var i = 0; i < props.length; i++) {\r\n\t\tif (props[i] in style) {\r\n\t\t\treturn props[i];\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}\r\n\r\n// @function setTransform(el: HTMLElement, offset: Point, scale?: Number)\r\n// Resets the 3D CSS transform of `el` so it is translated by `offset` pixels\r\n// and optionally scaled by `scale`. Does not have an effect if the\r\n// browser doesn't support 3D CSS transforms.\r\nexport function setTransform(el, offset, scale) {\r\n\tvar pos = offset || new Point(0, 0);\r\n\r\n\tel.style[TRANSFORM] =\r\n\t\t(Browser.ie3d ?\r\n\t\t\t'translate(' + pos.x + 'px,' + pos.y + 'px)' :\r\n\t\t\t'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)') +\r\n\t\t(scale ? ' scale(' + scale + ')' : '');\r\n}\r\n\r\n// @function setPosition(el: HTMLElement, position: Point)\r\n// Sets the position of `el` to coordinates specified by `position`,\r\n// using CSS translate or top/left positioning depending on the browser\r\n// (used by Leaflet internally to position its layers).\r\nexport function setPosition(el, point) {\r\n\r\n\t/*eslint-disable */\r\n\tel._leaflet_pos = point;\r\n\t/* eslint-enable */\r\n\r\n\tif (Browser.any3d) {\r\n\t\tsetTransform(el, point);\r\n\t} else {\r\n\t\tel.style.left = point.x + 'px';\r\n\t\tel.style.top = point.y + 'px';\r\n\t}\r\n}\r\n\r\n// @function getPosition(el: HTMLElement): Point\r\n// Returns the coordinates of an element previously positioned with setPosition.\r\nexport function getPosition(el) {\r\n\t// this method is only used for elements previously positioned using setPosition,\r\n\t// so it's safe to cache the position for performance\r\n\r\n\treturn el._leaflet_pos || new Point(0, 0);\r\n}\r\n\r\n// @function disableTextSelection()\r\n// Prevents the user from generating `selectstart` DOM events, usually generated\r\n// when the user drags the mouse through a page with text. Used internally\r\n// by Leaflet to override the behaviour of any click-and-drag interaction on\r\n// the map. Affects drag interactions on the whole document.\r\n\r\n// @function enableTextSelection()\r\n// Cancels the effects of a previous [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection).\r\nexport var disableTextSelection;\r\nexport var enableTextSelection;\r\nvar _userSelect;\r\nif ('onselectstart' in document) {\r\n\tdisableTextSelection = function () {\r\n\t\tDomEvent.on(window, 'selectstart', DomEvent.preventDefault);\r\n\t};\r\n\tenableTextSelection = function () {\r\n\t\tDomEvent.off(window, 'selectstart', DomEvent.preventDefault);\r\n\t};\r\n} else {\r\n\tvar userSelectProperty = testProp(\r\n\t\t['userSelect', 'WebkitUserSelect', 'OUserSelect', 'MozUserSelect', 'msUserSelect']);\r\n\r\n\tdisableTextSelection = function () {\r\n\t\tif (userSelectProperty) {\r\n\t\t\tvar style = document.documentElement.style;\r\n\t\t\t_userSelect = style[userSelectProperty];\r\n\t\t\tstyle[userSelectProperty] = 'none';\r\n\t\t}\r\n\t};\r\n\tenableTextSelection = function () {\r\n\t\tif (userSelectProperty) {\r\n\t\t\tdocument.documentElement.style[userSelectProperty] = _userSelect;\r\n\t\t\t_userSelect = undefined;\r\n\t\t}\r\n\t};\r\n}\r\n\r\n// @function disableImageDrag()\r\n// As [`L.DomUtil.disableTextSelection`](#domutil-disabletextselection), but\r\n// for `dragstart` DOM events, usually generated when the user drags an image.\r\nexport function disableImageDrag() {\r\n\tDomEvent.on(window, 'dragstart', DomEvent.preventDefault);\r\n}\r\n\r\n// @function enableImageDrag()\r\n// Cancels the effects of a previous [`L.DomUtil.disableImageDrag`](#domutil-disabletextselection).\r\nexport function enableImageDrag() {\r\n\tDomEvent.off(window, 'dragstart', DomEvent.preventDefault);\r\n}\r\n\r\nvar _outlineElement, _outlineStyle;\r\n// @function preventOutline(el: HTMLElement)\r\n// Makes the [outline](https://developer.mozilla.org/docs/Web/CSS/outline)\r\n// of the element `el` invisible. Used internally by Leaflet to prevent\r\n// focusable elements from displaying an outline when the user performs a\r\n// drag interaction on them.\r\nexport function preventOutline(element) {\r\n\twhile (element.tabIndex === -1) {\r\n\t\telement = element.parentNode;\r\n\t}\r\n\tif (!element.style) { return; }\r\n\trestoreOutline();\r\n\t_outlineElement = element;\r\n\t_outlineStyle = element.style.outlineStyle;\r\n\telement.style.outlineStyle = 'none';\r\n\tDomEvent.on(window, 'keydown', restoreOutline);\r\n}\r\n\r\n// @function restoreOutline()\r\n// Cancels the effects of a previous [`L.DomUtil.preventOutline`]().\r\nexport function restoreOutline() {\r\n\tif (!_outlineElement) { return; }\r\n\t_outlineElement.style.outlineStyle = _outlineStyle;\r\n\t_outlineElement = undefined;\r\n\t_outlineStyle = undefined;\r\n\tDomEvent.off(window, 'keydown', restoreOutline);\r\n}\r\n\r\n// @function getSizedParentNode(el: HTMLElement): HTMLElement\r\n// Finds the closest parent node which size (width and height) is not null.\r\nexport function getSizedParentNode(element) {\r\n\tdo {\r\n\t\telement = element.parentNode;\r\n\t} while ((!element.offsetWidth || !element.offsetHeight) && element !== document.body);\r\n\treturn element;\r\n}\r\n\r\n// @function getScale(el: HTMLElement): Object\r\n// Computes the CSS scale currently applied on the element.\r\n// Returns an object with `x` and `y` members as horizontal and vertical scales respectively,\r\n// and `boundingClientRect` as the result of [`getBoundingClientRect()`](https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect).\r\nexport function getScale(element) {\r\n\tvar rect = element.getBoundingClientRect(); // Read-only in old browsers.\r\n\r\n\treturn {\r\n\t\tx: rect.width / element.offsetWidth || 1,\r\n\t\ty: rect.height / element.offsetHeight || 1,\r\n\t\tboundingClientRect: rect\r\n\t};\r\n}\r\n", "import {Point} from '../geometry/Point';\r\nimport * as Util from '../core/Util';\r\nimport Browser from '../core/Browser';\r\nimport {addPointerListener, removePointerListener} from './DomEvent.Pointer';\r\nimport {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap';\r\nimport {getScale} from './DomUtil';\r\n\r\n/*\r\n * @namespace DomEvent\r\n * Utility functions to work with the [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Leaflet internally.\r\n */\r\n\r\n// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\r\n\r\n// @function on(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Adds a listener function (`fn`) to a particular DOM event type of the\r\n// element `el`. You can optionally specify the context of the listener\r\n// (object the `this` keyword will point to). You can also pass several\r\n// space-separated types (e.g. `'click dblclick'`).\r\n\r\n// @alternative\r\n// @function on(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\nexport function on(obj, types, fn, context) {\r\n\r\n\tif (types && typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\taddOne(obj, type, types[type], fn);\r\n\t\t}\r\n\t} else {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\taddOne(obj, types[i], fn, context);\r\n\t\t}\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\nvar eventsKey = '_leaflet_events';\r\n\r\n// @function off(el: HTMLElement, types: String, fn: Function, context?: Object): this\r\n// Removes a previously added listener function.\r\n// Note that if you passed a custom context to on, you must pass the same\r\n// context to `off` in order to remove the listener.\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement, eventMap: Object, context?: Object): this\r\n// Removes a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}`\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement, types: String): this\r\n// Removes all previously added listeners of given types.\r\n\r\n// @alternative\r\n// @function off(el: HTMLElement): this\r\n// Removes all previously added listeners from given HTMLElement\r\nexport function off(obj, types, fn, context) {\r\n\r\n\tif (arguments.length === 1) {\r\n\t\tbatchRemove(obj);\r\n\t\tdelete obj[eventsKey];\r\n\r\n\t} else if (types && typeof types === 'object') {\r\n\t\tfor (var type in types) {\r\n\t\t\tremoveOne(obj, type, types[type], fn);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\ttypes = Util.splitWords(types);\r\n\r\n\t\tif (arguments.length === 2) {\r\n\t\t\tbatchRemove(obj, function (type) {\r\n\t\t\t\treturn Util.indexOf(types, type) !== -1;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\tfor (var i = 0, len = types.length; i < len; i++) {\r\n\t\t\t\tremoveOne(obj, types[i], fn, context);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\nfunction batchRemove(obj, filterFn) {\r\n\tfor (var id in obj[eventsKey]) {\r\n\t\tvar type = id.split(/\\d/)[0];\r\n\t\tif (!filterFn || filterFn(type)) {\r\n\t\t\tremoveOne(obj, type, null, null, id);\r\n\t\t}\r\n\t}\r\n}\r\n\r\nvar mouseSubst = {\r\n\tmouseenter: 'mouseover',\r\n\tmouseleave: 'mouseout',\r\n\twheel: !('onwheel' in window) && 'mousewheel'\r\n};\r\n\r\nfunction addOne(obj, type, fn, context) {\r\n\tvar id = type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');\r\n\r\n\tif (obj[eventsKey] && obj[eventsKey][id]) { return this; }\r\n\r\n\tvar handler = function (e) {\r\n\t\treturn fn.call(context || obj, e || window.event);\r\n\t};\r\n\r\n\tvar originalHandler = handler;\r\n\r\n\tif (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\t// Needs DomEvent.Pointer.js\r\n\t\thandler = addPointerListener(obj, type, handler);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick')) {\r\n\t\thandler = addDoubleTapListener(obj, handler);\r\n\r\n\t} else if ('addEventListener' in obj) {\r\n\r\n\t\tif (type === 'touchstart' || type === 'touchmove' || type === 'wheel' ||  type === 'mousewheel') {\r\n\t\t\tobj.addEventListener(mouseSubst[type] || type, handler, Browser.passiveEvents ? {passive: false} : false);\r\n\r\n\t\t} else if (type === 'mouseenter' || type === 'mouseleave') {\r\n\t\t\thandler = function (e) {\r\n\t\t\t\te = e || window.event;\r\n\t\t\t\tif (isExternalTarget(obj, e)) {\r\n\t\t\t\t\toriginalHandler(e);\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t\tobj.addEventListener(mouseSubst[type], handler, false);\r\n\r\n\t\t} else {\r\n\t\t\tobj.addEventListener(type, originalHandler, false);\r\n\t\t}\r\n\r\n\t} else {\r\n\t\tobj.attachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey] = obj[eventsKey] || {};\r\n\tobj[eventsKey][id] = handler;\r\n}\r\n\r\nfunction removeOne(obj, type, fn, context, id) {\r\n\tid = id || type + Util.stamp(fn) + (context ? '_' + Util.stamp(context) : '');\r\n\tvar handler = obj[eventsKey] && obj[eventsKey][id];\r\n\r\n\tif (!handler) { return this; }\r\n\r\n\tif (!Browser.touchNative && Browser.pointer && type.indexOf('touch') === 0) {\r\n\t\tremovePointerListener(obj, type, handler);\r\n\r\n\t} else if (Browser.touch && (type === 'dblclick')) {\r\n\t\tremoveDoubleTapListener(obj, handler);\r\n\r\n\t} else if ('removeEventListener' in obj) {\r\n\r\n\t\tobj.removeEventListener(mouseSubst[type] || type, handler, false);\r\n\r\n\t} else {\r\n\t\tobj.detachEvent('on' + type, handler);\r\n\t}\r\n\r\n\tobj[eventsKey][id] = null;\r\n}\r\n\r\n// @function stopPropagation(ev: DOMEvent): this\r\n// Stop the given event from propagation to parent elements. Used inside the listener functions:\r\n// ```js\r\n// L.DomEvent.on(div, 'click', function (ev) {\r\n// \tL.DomEvent.stopPropagation(ev);\r\n// });\r\n// ```\r\nexport function stopPropagation(e) {\r\n\r\n\tif (e.stopPropagation) {\r\n\t\te.stopPropagation();\r\n\t} else if (e.originalEvent) {  // In case of Leaflet event.\r\n\t\te.originalEvent._stopped = true;\r\n\t} else {\r\n\t\te.cancelBubble = true;\r\n\t}\r\n\r\n\treturn this;\r\n}\r\n\r\n// @function disableScrollPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).\r\nexport function disableScrollPropagation(el) {\r\n\taddOne(el, 'wheel', stopPropagation);\r\n\treturn this;\r\n}\r\n\r\n// @function disableClickPropagation(el: HTMLElement): this\r\n// Adds `stopPropagation` to the element's `'click'`, `'dblclick'`, `'contextmenu'`,\r\n// `'mousedown'` and `'touchstart'` events (plus browser variants).\r\nexport function disableClickPropagation(el) {\r\n\ton(el, 'mousedown touchstart dblclick contextmenu', stopPropagation);\r\n\tel['_leaflet_disable_click'] = true;\r\n\treturn this;\r\n}\r\n\r\n// @function preventDefault(ev: DOMEvent): this\r\n// Prevents the default action of the DOM Event `ev` from happening (such as\r\n// following a link in the href of the a element, or doing a POST request\r\n// with page reload when a `<form>` is submitted).\r\n// Use it inside listener functions.\r\nexport function preventDefault(e) {\r\n\tif (e.preventDefault) {\r\n\t\te.preventDefault();\r\n\t} else {\r\n\t\te.returnValue = false;\r\n\t}\r\n\treturn this;\r\n}\r\n\r\n// @function stop(ev: DOMEvent): this\r\n// Does `stopPropagation` and `preventDefault` at the same time.\r\nexport function stop(e) {\r\n\tpreventDefault(e);\r\n\tstopPropagation(e);\r\n\treturn this;\r\n}\r\n\r\n// @function getPropagationPath(ev: DOMEvent): Array\r\n// Compatibility polyfill for [`Event.composedPath()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/composedPath).\r\n// Returns an array containing the `HTMLElement`s that the given DOM event\r\n// should propagate to (if not stopped).\r\nexport function getPropagationPath(ev) {\r\n\tif (ev.composedPath) {\r\n\t\treturn ev.composedPath();\r\n\t}\r\n\r\n\tvar path = [];\r\n\tvar el = ev.target;\r\n\r\n\twhile (el) {\r\n\t\tpath.push(el);\r\n\t\tel = el.parentNode;\r\n\t}\r\n\treturn path;\r\n}\r\n\r\n\r\n// @function getMousePosition(ev: DOMEvent, container?: HTMLElement): Point\r\n// Gets normalized mouse position from a DOM event relative to the\r\n// `container` (border excluded) or to the whole page if not specified.\r\nexport function getMousePosition(e, container) {\r\n\tif (!container) {\r\n\t\treturn new Point(e.clientX, e.clientY);\r\n\t}\r\n\r\n\tvar scale = getScale(container),\r\n\t    offset = scale.boundingClientRect; // left and top  values are in page scale (like the event clientX/Y)\r\n\r\n\treturn new Point(\r\n\t\t// offset.left/top values are in page scale (like clientX/Y),\r\n\t\t// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\r\n\t\t(e.clientX - offset.left) / scale.x - container.clientLeft,\r\n\t\t(e.clientY - offset.top) / scale.y - container.clientTop\r\n\t);\r\n}\r\n\r\n\r\n//  except , Safari and\r\n// We need double the scroll pixels (see #7403 and #4538) for all Browsers\r\n// except OSX (Mac) -> 3x, Chrome running on Linux 1x\r\n\r\nvar wheelPxFactor =\r\n\t(Browser.linux && Browser.chrome) ? window.devicePixelRatio :\r\n\tBrowser.mac ? window.devicePixelRatio * 3 :\r\n\twindow.devicePixelRatio > 0 ? 2 * window.devicePixelRatio : 1;\r\n// @function getWheelDelta(ev: DOMEvent): Number\r\n// Gets normalized wheel delta from a wheel DOM event, in vertical\r\n// pixels scrolled (negative if scrolling down).\r\n// Events from pointing devices without precise scrolling are mapped to\r\n// a best guess of 60 pixels.\r\nexport function getWheelDelta(e) {\r\n\treturn (Browser.edge) ? e.wheelDeltaY / 2 : // Don't trust window-geometry-based delta\r\n\t       (e.deltaY && e.deltaMode === 0) ? -e.deltaY / wheelPxFactor : // Pixels\r\n\t       (e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\r\n\t       (e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\r\n\t       (e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\r\n\t       e.wheelDelta ? (e.wheelDeltaY || e.wheelDelta) / 2 : // Legacy IE pixels\r\n\t       (e.detail && Math.abs(e.detail) < 32765) ? -e.detail * 20 : // Legacy Moz lines\r\n\t       e.detail ? e.detail / -32765 * 60 : // Legacy Moz pages\r\n\t       0;\r\n}\r\n\r\n// check if element really left/entered the event target (for mouseenter/mouseleave)\r\nexport function isExternalTarget(el, e) {\r\n\r\n\tvar related = e.relatedTarget;\r\n\r\n\tif (!related) { return true; }\r\n\r\n\ttry {\r\n\t\twhile (related && (related !== el)) {\r\n\t\t\trelated = related.parentNode;\r\n\t\t}\r\n\t} catch (err) {\r\n\t\treturn false;\r\n\t}\r\n\treturn (related !== el);\r\n}\r\n\r\n// @function addListener(…): this\r\n// Alias to [`L.DomEvent.on`](#domevent-on)\r\nexport {on as addListener};\r\n\r\n// @function removeListener(…): this\r\n// Alias to [`L.DomEvent.off`](#domevent-off)\r\nexport {off as removeListener};\r\n", "import * as Util from '../core/Util';\nimport {Evented} from '../core/Events';\nimport * as DomUtil from '../dom/DomUtil';\n\n\n/*\n * @class PosAnimation\n * @aka L.PosAnimation\n * @inherits Evented\n * Used internally for panning animations, utilizing CSS3 Transitions for modern browsers and a timer fallback for IE6-9.\n *\n * @example\n * ```js\n * var myPositionMarker = L.marker([48.864716, 2.294694]).addTo(map);\n *\n * myPositionMarker.on(\"click\", function() {\n * \tvar pos = map.latLngToLayerPoint(myPositionMarker.getLatLng());\n * \tpos.y -= 25;\n * \tvar fx = new L.PosAnimation();\n *\n * \tfx.once('end',function() {\n * \t\tpos.y += 25;\n * \t\tfx.run(myPositionMarker._icon, pos, 0.8);\n * \t});\n *\n * \tfx.run(myPositionMarker._icon, pos, 0.3);\n * });\n *\n * ```\n *\n * @constructor L.PosAnimation()\n * Creates a `PosAnimation` object.\n *\n */\n\nexport var PosAnimation = Evented.extend({\n\n\t// @method run(el: HTMLElement, newPos: Point, duration?: Number, easeLinearity?: Number)\n\t// Run an animation of a given element to a new position, optionally setting\n\t// duration in seconds (`0.25` by default) and easing linearity factor (3rd\n\t// argument of the [cubic bezier curve](https://cubic-bezier.com/#0,0,.5,1),\n\t// `0.5` by default).\n\trun: function (el, newPos, duration, easeLinearity) {\n\t\tthis.stop();\n\n\t\tthis._el = el;\n\t\tthis._inProgress = true;\n\t\tthis._duration = duration || 0.25;\n\t\tthis._easeOutPower = 1 / Math.max(easeLinearity || 0.5, 0.2);\n\n\t\tthis._startPos = DomUtil.getPosition(el);\n\t\tthis._offset = newPos.subtract(this._startPos);\n\t\tthis._startTime = +new Date();\n\n\t\t// @event start: Event\n\t\t// Fired when the animation starts\n\t\tthis.fire('start');\n\n\t\tthis._animate();\n\t},\n\n\t// @method stop()\n\t// Stops the animation (if currently running).\n\tstop: function () {\n\t\tif (!this._inProgress) { return; }\n\n\t\tthis._step(true);\n\t\tthis._complete();\n\t},\n\n\t_animate: function () {\n\t\t// animation loop\n\t\tthis._animId = Util.requestAnimFrame(this._animate, this);\n\t\tthis._step();\n\t},\n\n\t_step: function (round) {\n\t\tvar elapsed = (+new Date()) - this._startTime,\n\t\t    duration = this._duration * 1000;\n\n\t\tif (elapsed < duration) {\n\t\t\tthis._runFrame(this._easeOut(elapsed / duration), round);\n\t\t} else {\n\t\t\tthis._runFrame(1);\n\t\t\tthis._complete();\n\t\t}\n\t},\n\n\t_runFrame: function (progress, round) {\n\t\tvar pos = this._startPos.add(this._offset.multiplyBy(progress));\n\t\tif (round) {\n\t\t\tpos._round();\n\t\t}\n\t\tDomUtil.setPosition(this._el, pos);\n\n\t\t// @event step: Event\n\t\t// Fired continuously during the animation.\n\t\tthis.fire('step');\n\t},\n\n\t_complete: function () {\n\t\tUtil.cancelAnimFrame(this._animId);\n\n\t\tthis._inProgress = false;\n\t\t// @event end: Event\n\t\t// Fired when the animation ends.\n\t\tthis.fire('end');\n\t},\n\n\t_easeOut: function (t) {\n\t\treturn 1 - Math.pow(1 - t, this._easeOutPower);\n\t}\n});\n", "import * as Util from '../core/Util';\r\nimport {Evented} from '../core/Events';\r\nimport {EPSG3857} from '../geo/crs/CRS.EPSG3857';\r\nimport {Point, toPoint} from '../geometry/Point';\r\nimport {Bounds, toBounds} from '../geometry/Bounds';\r\nimport {LatLng, toLatLng} from '../geo/LatLng';\r\nimport {LatLngBounds, toLatLngBounds} from '../geo/LatLngBounds';\r\nimport Browser from '../core/Browser';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport {PosAnimation} from '../dom/PosAnimation';\r\n\r\n/*\r\n * @class Map\r\n * @aka L.Map\r\n * @inherits Evented\r\n *\r\n * The central class of the API — it is used to create a map on a page and manipulate it.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * // initialize the map on the \"map\" div with a given center and zoom\r\n * var map = L.map('map', {\r\n * \tcenter: [51.505, -0.09],\r\n * \tzoom: 13\r\n * });\r\n * ```\r\n *\r\n */\r\n\r\nexport var Map = Evented.extend({\r\n\r\n\toptions: {\r\n\t\t// @section Map State Options\r\n\t\t// @option crs: CRS = L.CRS.EPSG3857\r\n\t\t// The [Coordinate Reference System](#crs) to use. Don't change this if you're not\r\n\t\t// sure what it means.\r\n\t\tcrs: EPSG3857,\r\n\r\n\t\t// @option center: LatLng = undefined\r\n\t\t// Initial geographic center of the map\r\n\t\tcenter: undefined,\r\n\r\n\t\t// @option zoom: Number = undefined\r\n\t\t// Initial map zoom level\r\n\t\tzoom: undefined,\r\n\r\n\t\t// @option minZoom: Number = *\r\n\t\t// Minimum zoom level of the map.\r\n\t\t// If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r\n\t\t// the lowest of their `minZoom` options will be used instead.\r\n\t\tminZoom: undefined,\r\n\r\n\t\t// @option maxZoom: Number = *\r\n\t\t// Maximum zoom level of the map.\r\n\t\t// If not specified and at least one `GridLayer` or `TileLayer` is in the map,\r\n\t\t// the highest of their `maxZoom` options will be used instead.\r\n\t\tmaxZoom: undefined,\r\n\r\n\t\t// @option layers: Layer[] = []\r\n\t\t// Array of layers that will be added to the map initially\r\n\t\tlayers: [],\r\n\r\n\t\t// @option maxBounds: LatLngBounds = null\r\n\t\t// When this option is set, the map restricts the view to the given\r\n\t\t// geographical bounds, bouncing the user back if the user tries to pan\r\n\t\t// outside the view. To set the restriction dynamically, use\r\n\t\t// [`setMaxBounds`](#map-setmaxbounds) method.\r\n\t\tmaxBounds: undefined,\r\n\r\n\t\t// @option renderer: Renderer = *\r\n\t\t// The default method for drawing vector layers on the map. `L.SVG`\r\n\t\t// or `L.Canvas` by default depending on browser support.\r\n\t\trenderer: undefined,\r\n\r\n\r\n\t\t// @section Animation Options\r\n\t\t// @option zoomAnimation: Boolean = true\r\n\t\t// Whether the map zoom animation is enabled. By default it's enabled\r\n\t\t// in all browsers that support CSS3 Transitions except Android.\r\n\t\tzoomAnimation: true,\r\n\r\n\t\t// @option zoomAnimationThreshold: Number = 4\r\n\t\t// Won't animate zoom if the zoom difference exceeds this value.\r\n\t\tzoomAnimationThreshold: 4,\r\n\r\n\t\t// @option fadeAnimation: Boolean = true\r\n\t\t// Whether the tile fade animation is enabled. By default it's enabled\r\n\t\t// in all browsers that support CSS3 Transitions except Android.\r\n\t\tfadeAnimation: true,\r\n\r\n\t\t// @option markerZoomAnimation: Boolean = true\r\n\t\t// Whether markers animate their zoom with the zoom animation, if disabled\r\n\t\t// they will disappear for the length of the animation. By default it's\r\n\t\t// enabled in all browsers that support CSS3 Transitions except Android.\r\n\t\tmarkerZoomAnimation: true,\r\n\r\n\t\t// @option transform3DLimit: Number = 2^23\r\n\t\t// Defines the maximum size of a CSS translation transform. The default\r\n\t\t// value should not be changed unless a web browser positions layers in\r\n\t\t// the wrong place after doing a large `panBy`.\r\n\t\ttransform3DLimit: 8388608, // Precision limit of a 32-bit float\r\n\r\n\t\t// @section Interaction Options\r\n\t\t// @option zoomSnap: Number = 1\r\n\t\t// Forces the map's zoom level to always be a multiple of this, particularly\r\n\t\t// right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.\r\n\t\t// By default, the zoom level snaps to the nearest integer; lower values\r\n\t\t// (e.g. `0.5` or `0.1`) allow for greater granularity. A value of `0`\r\n\t\t// means the zoom level will not be snapped after `fitBounds` or a pinch-zoom.\r\n\t\tzoomSnap: 1,\r\n\r\n\t\t// @option zoomDelta: Number = 1\r\n\t\t// Controls how much the map's zoom level will change after a\r\n\t\t// [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+`\r\n\t\t// or `-` on the keyboard, or using the [zoom controls](#control-zoom).\r\n\t\t// Values smaller than `1` (e.g. `0.5`) allow for greater granularity.\r\n\t\tzoomDelta: 1,\r\n\r\n\t\t// @option trackResize: Boolean = true\r\n\t\t// Whether the map automatically handles browser window resize to update itself.\r\n\t\ttrackResize: true\r\n\t},\r\n\r\n\tinitialize: function (id, options) { // (HTMLElement or String, Object)\r\n\t\toptions = Util.setOptions(this, options);\r\n\r\n\t\t// Make sure to assign internal flags at the beginning,\r\n\t\t// to avoid inconsistent state in some edge cases.\r\n\t\tthis._handlers = [];\r\n\t\tthis._layers = {};\r\n\t\tthis._zoomBoundLayers = {};\r\n\t\tthis._sizeChanged = true;\r\n\r\n\t\tthis._initContainer(id);\r\n\t\tthis._initLayout();\r\n\r\n\t\t// hack for https://github.com/Leaflet/Leaflet/issues/1980\r\n\t\tthis._onResize = Util.bind(this._onResize, this);\r\n\r\n\t\tthis._initEvents();\r\n\r\n\t\tif (options.maxBounds) {\r\n\t\t\tthis.setMaxBounds(options.maxBounds);\r\n\t\t}\r\n\r\n\t\tif (options.zoom !== undefined) {\r\n\t\t\tthis._zoom = this._limitZoom(options.zoom);\r\n\t\t}\r\n\r\n\t\tif (options.center && options.zoom !== undefined) {\r\n\t\t\tthis.setView(toLatLng(options.center), options.zoom, {reset: true});\r\n\t\t}\r\n\r\n\t\tthis.callInitHooks();\r\n\r\n\t\t// don't animate on browsers without hardware-accelerated transitions or old Android/Opera\r\n\t\tthis._zoomAnimated = DomUtil.TRANSITION && Browser.any3d && !Browser.mobileOpera &&\r\n\t\t\t\tthis.options.zoomAnimation;\r\n\r\n\t\t// zoom transitions run with the same duration for all layers, so if one of transitionend events\r\n\t\t// happens after starting zoom animation (propagating to the map pane), we know that it ended globally\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tthis._createAnimProxy();\r\n\t\t\tDomEvent.on(this._proxy, DomUtil.TRANSITION_END, this._catchTransitionEnd, this);\r\n\t\t}\r\n\r\n\t\tthis._addLayers(this.options.layers);\r\n\t},\r\n\r\n\r\n\t// @section Methods for modifying map state\r\n\r\n\t// @method setView(center: LatLng, zoom: Number, options?: Zoom/pan options): this\r\n\t// Sets the view of the map (geographical center and zoom) with the given\r\n\t// animation options.\r\n\tsetView: function (center, zoom, options) {\r\n\r\n\t\tzoom = zoom === undefined ? this._zoom : this._limitZoom(zoom);\r\n\t\tcenter = this._limitCenter(toLatLng(center), zoom, this.options.maxBounds);\r\n\t\toptions = options || {};\r\n\r\n\t\tthis._stop();\r\n\r\n\t\tif (this._loaded && !options.reset && options !== true) {\r\n\r\n\t\t\tif (options.animate !== undefined) {\r\n\t\t\t\toptions.zoom = Util.extend({animate: options.animate}, options.zoom);\r\n\t\t\t\toptions.pan = Util.extend({animate: options.animate, duration: options.duration}, options.pan);\r\n\t\t\t}\r\n\r\n\t\t\t// try animating pan or zoom\r\n\t\t\tvar moved = (this._zoom !== zoom) ?\r\n\t\t\t\tthis._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) :\r\n\t\t\t\tthis._tryAnimatedPan(center, options.pan);\r\n\r\n\t\t\tif (moved) {\r\n\t\t\t\t// prevent resize handler call, the view will refresh after animation anyway\r\n\t\t\t\tclearTimeout(this._sizeTimer);\r\n\t\t\t\treturn this;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// animation didn't start, just reset the map view\r\n\t\tthis._resetView(center, zoom, options.pan && options.pan.noMoveStart);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setZoom(zoom: Number, options?: Zoom/pan options): this\r\n\t// Sets the zoom of the map.\r\n\tsetZoom: function (zoom, options) {\r\n\t\tif (!this._loaded) {\r\n\t\t\tthis._zoom = zoom;\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\treturn this.setView(this.getCenter(), zoom, {zoom: options});\r\n\t},\r\n\r\n\t// @method zoomIn(delta?: Number, options?: Zoom options): this\r\n\t// Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r\n\tzoomIn: function (delta, options) {\r\n\t\tdelta = delta || (Browser.any3d ? this.options.zoomDelta : 1);\r\n\t\treturn this.setZoom(this._zoom + delta, options);\r\n\t},\r\n\r\n\t// @method zoomOut(delta?: Number, options?: Zoom options): this\r\n\t// Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\r\n\tzoomOut: function (delta, options) {\r\n\t\tdelta = delta || (Browser.any3d ? this.options.zoomDelta : 1);\r\n\t\treturn this.setZoom(this._zoom - delta, options);\r\n\t},\r\n\r\n\t// @method setZoomAround(latlng: LatLng, zoom: Number, options: Zoom options): this\r\n\t// Zooms the map while keeping a specified geographical point on the map\r\n\t// stationary (e.g. used internally for scroll zoom and double-click zoom).\r\n\t// @alternative\r\n\t// @method setZoomAround(offset: Point, zoom: Number, options: Zoom options): this\r\n\t// Zooms the map while keeping a specified pixel on the map (relative to the top-left corner) stationary.\r\n\tsetZoomAround: function (latlng, zoom, options) {\r\n\t\tvar scale = this.getZoomScale(zoom),\r\n\t\t    viewHalf = this.getSize().divideBy(2),\r\n\t\t    containerPoint = latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng),\r\n\r\n\t\t    centerOffset = containerPoint.subtract(viewHalf).multiplyBy(1 - 1 / scale),\r\n\t\t    newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset));\r\n\r\n\t\treturn this.setView(newCenter, zoom, {zoom: options});\r\n\t},\r\n\r\n\t_getBoundsCenterZoom: function (bounds, options) {\r\n\r\n\t\toptions = options || {};\r\n\t\tbounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);\r\n\r\n\t\tvar paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r\n\t\t    paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r\n\r\n\t\t    zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\r\n\r\n\t\tzoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\r\n\r\n\t\tif (zoom === Infinity) {\r\n\t\t\treturn {\r\n\t\t\t\tcenter: bounds.getCenter(),\r\n\t\t\t\tzoom: zoom\r\n\t\t\t};\r\n\t\t}\r\n\r\n\t\tvar paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),\r\n\r\n\t\t    swPoint = this.project(bounds.getSouthWest(), zoom),\r\n\t\t    nePoint = this.project(bounds.getNorthEast(), zoom),\r\n\t\t    center = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);\r\n\r\n\t\treturn {\r\n\t\t\tcenter: center,\r\n\t\t\tzoom: zoom\r\n\t\t};\r\n\t},\r\n\r\n\t// @method fitBounds(bounds: LatLngBounds, options?: fitBounds options): this\r\n\t// Sets a map view that contains the given geographical bounds with the\r\n\t// maximum zoom level possible.\r\n\tfitBounds: function (bounds, options) {\r\n\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tif (!bounds.isValid()) {\r\n\t\t\tthrow new Error('Bounds are not valid.');\r\n\t\t}\r\n\r\n\t\tvar target = this._getBoundsCenterZoom(bounds, options);\r\n\t\treturn this.setView(target.center, target.zoom, options);\r\n\t},\r\n\r\n\t// @method fitWorld(options?: fitBounds options): this\r\n\t// Sets a map view that mostly contains the whole world with the maximum\r\n\t// zoom level possible.\r\n\tfitWorld: function (options) {\r\n\t\treturn this.fitBounds([[-90, -180], [90, 180]], options);\r\n\t},\r\n\r\n\t// @method panTo(latlng: LatLng, options?: Pan options): this\r\n\t// Pans the map to a given center.\r\n\tpanTo: function (center, options) { // (LatLng)\r\n\t\treturn this.setView(center, this._zoom, {pan: options});\r\n\t},\r\n\r\n\t// @method panBy(offset: Point, options?: Pan options): this\r\n\t// Pans the map by a given number of pixels (animated).\r\n\tpanBy: function (offset, options) {\r\n\t\toffset = toPoint(offset).round();\r\n\t\toptions = options || {};\r\n\r\n\t\tif (!offset.x && !offset.y) {\r\n\t\t\treturn this.fire('moveend');\r\n\t\t}\r\n\t\t// If we pan too far, Chrome gets issues with tiles\r\n\t\t// and makes them disappear or appear in the wrong place (slightly offset) #2602\r\n\t\tif (options.animate !== true && !this.getSize().contains(offset)) {\r\n\t\t\tthis._resetView(this.unproject(this.project(this.getCenter()).add(offset)), this.getZoom());\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tif (!this._panAnim) {\r\n\t\t\tthis._panAnim = new PosAnimation();\r\n\r\n\t\t\tthis._panAnim.on({\r\n\t\t\t\t'step': this._onPanTransitionStep,\r\n\t\t\t\t'end': this._onPanTransitionEnd\r\n\t\t\t}, this);\r\n\t\t}\r\n\r\n\t\t// don't fire movestart if animating inertia\r\n\t\tif (!options.noMoveStart) {\r\n\t\t\tthis.fire('movestart');\r\n\t\t}\r\n\r\n\t\t// animate pan unless animate: false specified\r\n\t\tif (options.animate !== false) {\r\n\t\t\tDomUtil.addClass(this._mapPane, 'leaflet-pan-anim');\r\n\r\n\t\t\tvar newPos = this._getMapPanePos().subtract(offset).round();\r\n\t\t\tthis._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity);\r\n\t\t} else {\r\n\t\t\tthis._rawPanBy(offset);\r\n\t\t\tthis.fire('move').fire('moveend');\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method flyTo(latlng: LatLng, zoom?: Number, options?: Zoom/pan options): this\r\n\t// Sets the view of the map (geographical center and zoom) performing a smooth\r\n\t// pan-zoom animation.\r\n\tflyTo: function (targetCenter, targetZoom, options) {\r\n\r\n\t\toptions = options || {};\r\n\t\tif (options.animate === false || !Browser.any3d) {\r\n\t\t\treturn this.setView(targetCenter, targetZoom, options);\r\n\t\t}\r\n\r\n\t\tthis._stop();\r\n\r\n\t\tvar from = this.project(this.getCenter()),\r\n\t\t    to = this.project(targetCenter),\r\n\t\t    size = this.getSize(),\r\n\t\t    startZoom = this._zoom;\r\n\r\n\t\ttargetCenter = toLatLng(targetCenter);\r\n\t\ttargetZoom = targetZoom === undefined ? startZoom : targetZoom;\r\n\r\n\t\tvar w0 = Math.max(size.x, size.y),\r\n\t\t    w1 = w0 * this.getZoomScale(startZoom, targetZoom),\r\n\t\t    u1 = (to.distanceTo(from)) || 1,\r\n\t\t    rho = 1.42,\r\n\t\t    rho2 = rho * rho;\r\n\r\n\t\tfunction r(i) {\r\n\t\t\tvar s1 = i ? -1 : 1,\r\n\t\t\t    s2 = i ? w1 : w0,\r\n\t\t\t    t1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1,\r\n\t\t\t    b1 = 2 * s2 * rho2 * u1,\r\n\t\t\t    b = t1 / b1,\r\n\t\t\t    sq = Math.sqrt(b * b + 1) - b;\r\n\r\n\t\t\t    // workaround for floating point precision bug when sq = 0, log = -Infinite,\r\n\t\t\t    // thus triggering an infinite loop in flyTo\r\n\t\t\t    var log = sq < 0.000000001 ? -18 : Math.log(sq);\r\n\r\n\t\t\treturn log;\r\n\t\t}\r\n\r\n\t\tfunction sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; }\r\n\t\tfunction cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; }\r\n\t\tfunction tanh(n) { return sinh(n) / cosh(n); }\r\n\r\n\t\tvar r0 = r(0);\r\n\r\n\t\tfunction w(s) { return w0 * (cosh(r0) / cosh(r0 + rho * s)); }\r\n\t\tfunction u(s) { return w0 * (cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2; }\r\n\r\n\t\tfunction easeOut(t) { return 1 - Math.pow(1 - t, 1.5); }\r\n\r\n\t\tvar start = Date.now(),\r\n\t\t    S = (r(1) - r0) / rho,\r\n\t\t    duration = options.duration ? 1000 * options.duration : 1000 * S * 0.8;\r\n\r\n\t\tfunction frame() {\r\n\t\t\tvar t = (Date.now() - start) / duration,\r\n\t\t\t    s = easeOut(t) * S;\r\n\r\n\t\t\tif (t <= 1) {\r\n\t\t\t\tthis._flyToFrame = Util.requestAnimFrame(frame, this);\r\n\r\n\t\t\t\tthis._move(\r\n\t\t\t\t\tthis.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom),\r\n\t\t\t\t\tthis.getScaleZoom(w0 / w(s), startZoom),\r\n\t\t\t\t\t{flyTo: true});\r\n\r\n\t\t\t} else {\r\n\t\t\t\tthis\r\n\t\t\t\t\t._move(targetCenter, targetZoom)\r\n\t\t\t\t\t._moveEnd(true);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._moveStart(true, options.noMoveStart);\r\n\r\n\t\tframe.call(this);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this\r\n\t// Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\r\n\t// but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\r\n\tflyToBounds: function (bounds, options) {\r\n\t\tvar target = this._getBoundsCenterZoom(bounds, options);\r\n\t\treturn this.flyTo(target.center, target.zoom, options);\r\n\t},\r\n\r\n\t// @method setMaxBounds(bounds: LatLngBounds): this\r\n\t// Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).\r\n\tsetMaxBounds: function (bounds) {\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\r\n\t\tif (this.listens('moveend', this._panInsideMaxBounds)) {\r\n\t\t\tthis.off('moveend', this._panInsideMaxBounds);\r\n\t\t}\r\n\r\n\t\tif (!bounds.isValid()) {\r\n\t\t\tthis.options.maxBounds = null;\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tthis.options.maxBounds = bounds;\r\n\r\n\t\tif (this._loaded) {\r\n\t\t\tthis._panInsideMaxBounds();\r\n\t\t}\r\n\r\n\t\treturn this.on('moveend', this._panInsideMaxBounds);\r\n\t},\r\n\r\n\t// @method setMinZoom(zoom: Number): this\r\n\t// Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).\r\n\tsetMinZoom: function (zoom) {\r\n\t\tvar oldZoom = this.options.minZoom;\r\n\t\tthis.options.minZoom = zoom;\r\n\r\n\t\tif (this._loaded && oldZoom !== zoom) {\r\n\t\t\tthis.fire('zoomlevelschange');\r\n\r\n\t\t\tif (this.getZoom() < this.options.minZoom) {\r\n\t\t\t\treturn this.setZoom(zoom);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setMaxZoom(zoom: Number): this\r\n\t// Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).\r\n\tsetMaxZoom: function (zoom) {\r\n\t\tvar oldZoom = this.options.maxZoom;\r\n\t\tthis.options.maxZoom = zoom;\r\n\r\n\t\tif (this._loaded && oldZoom !== zoom) {\r\n\t\t\tthis.fire('zoomlevelschange');\r\n\r\n\t\t\tif (this.getZoom() > this.options.maxZoom) {\r\n\t\t\t\treturn this.setZoom(zoom);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method panInsideBounds(bounds: LatLngBounds, options?: Pan options): this\r\n\t// Pans the map to the closest view that would lie inside the given bounds (if it's not already), controlling the animation using the options specific, if any.\r\n\tpanInsideBounds: function (bounds, options) {\r\n\t\tthis._enforcingBounds = true;\r\n\t\tvar center = this.getCenter(),\r\n\t\t    newCenter = this._limitCenter(center, this._zoom, toLatLngBounds(bounds));\r\n\r\n\t\tif (!center.equals(newCenter)) {\r\n\t\t\tthis.panTo(newCenter, options);\r\n\t\t}\r\n\r\n\t\tthis._enforcingBounds = false;\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method panInside(latlng: LatLng, options?: padding options): this\r\n\t// Pans the map the minimum amount to make the `latlng` visible. Use\r\n\t// padding options to fit the display to more restricted bounds.\r\n\t// If `latlng` is already within the (optionally padded) display bounds,\r\n\t// the map will not be panned.\r\n\tpanInside: function (latlng, options) {\r\n\t\toptions = options || {};\r\n\r\n\t\tvar paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\r\n\t\t    paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\r\n\t\t    pixelCenter = this.project(this.getCenter()),\r\n\t\t    pixelPoint = this.project(latlng),\r\n\t\t    pixelBounds = this.getPixelBounds(),\r\n\t\t    paddedBounds = toBounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),\r\n\t\t    paddedSize = paddedBounds.getSize();\r\n\r\n\t\tif (!paddedBounds.contains(pixelPoint)) {\r\n\t\t\tthis._enforcingBounds = true;\r\n\t\t\tvar centerOffset = pixelPoint.subtract(paddedBounds.getCenter());\r\n\t\t\tvar offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);\r\n\t\t\tpixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;\r\n\t\t\tpixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;\r\n\t\t\tthis.panTo(this.unproject(pixelCenter), options);\r\n\t\t\tthis._enforcingBounds = false;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method invalidateSize(options: Zoom/pan options): this\r\n\t// Checks if the map container size changed and updates the map if so —\r\n\t// call it after you've changed the map size dynamically, also animating\r\n\t// pan by default. If `options.pan` is `false`, panning will not occur.\r\n\t// If `options.debounceMoveend` is `true`, it will delay `moveend` event so\r\n\t// that it doesn't happen often even if the method is called many\r\n\t// times in a row.\r\n\r\n\t// @alternative\r\n\t// @method invalidateSize(animate: Boolean): this\r\n\t// Checks if the map container size changed and updates the map if so —\r\n\t// call it after you've changed the map size dynamically, also animating\r\n\t// pan by default.\r\n\tinvalidateSize: function (options) {\r\n\t\tif (!this._loaded) { return this; }\r\n\r\n\t\toptions = Util.extend({\r\n\t\t\tanimate: false,\r\n\t\t\tpan: true\r\n\t\t}, options === true ? {animate: true} : options);\r\n\r\n\t\tvar oldSize = this.getSize();\r\n\t\tthis._sizeChanged = true;\r\n\t\tthis._lastCenter = null;\r\n\r\n\t\tvar newSize = this.getSize(),\r\n\t\t    oldCenter = oldSize.divideBy(2).round(),\r\n\t\t    newCenter = newSize.divideBy(2).round(),\r\n\t\t    offset = oldCenter.subtract(newCenter);\r\n\r\n\t\tif (!offset.x && !offset.y) { return this; }\r\n\r\n\t\tif (options.animate && options.pan) {\r\n\t\t\tthis.panBy(offset);\r\n\r\n\t\t} else {\r\n\t\t\tif (options.pan) {\r\n\t\t\t\tthis._rawPanBy(offset);\r\n\t\t\t}\r\n\r\n\t\t\tthis.fire('move');\r\n\r\n\t\t\tif (options.debounceMoveend) {\r\n\t\t\t\tclearTimeout(this._sizeTimer);\r\n\t\t\t\tthis._sizeTimer = setTimeout(Util.bind(this.fire, this, 'moveend'), 200);\r\n\t\t\t} else {\r\n\t\t\t\tthis.fire('moveend');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// @section Map state change events\r\n\t\t// @event resize: ResizeEvent\r\n\t\t// Fired when the map is resized.\r\n\t\treturn this.fire('resize', {\r\n\t\t\toldSize: oldSize,\r\n\t\t\tnewSize: newSize\r\n\t\t});\r\n\t},\r\n\r\n\t// @section Methods for modifying map state\r\n\t// @method stop(): this\r\n\t// Stops the currently running `panTo` or `flyTo` animation, if any.\r\n\tstop: function () {\r\n\t\tthis.setZoom(this._limitZoom(this._zoom));\r\n\t\tif (!this.options.zoomSnap) {\r\n\t\t\tthis.fire('viewreset');\r\n\t\t}\r\n\t\treturn this._stop();\r\n\t},\r\n\r\n\t// @section Geolocation methods\r\n\t// @method locate(options?: Locate options): this\r\n\t// Tries to locate the user using the Geolocation API, firing a [`locationfound`](#map-locationfound)\r\n\t// event with location data on success or a [`locationerror`](#map-locationerror) event on failure,\r\n\t// and optionally sets the map view to the user's location with respect to\r\n\t// detection accuracy (or to the world view if geolocation failed).\r\n\t// Note that, if your page doesn't use HTTPS, this method will fail in\r\n\t// modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))\r\n\t// See `Locate options` for more details.\r\n\tlocate: function (options) {\r\n\r\n\t\toptions = this._locateOptions = Util.extend({\r\n\t\t\ttimeout: 10000,\r\n\t\t\twatch: false\r\n\t\t\t// setView: false\r\n\t\t\t// maxZoom: <Number>\r\n\t\t\t// maximumAge: 0\r\n\t\t\t// enableHighAccuracy: false\r\n\t\t}, options);\r\n\r\n\t\tif (!('geolocation' in navigator)) {\r\n\t\t\tthis._handleGeolocationError({\r\n\t\t\t\tcode: 0,\r\n\t\t\t\tmessage: 'Geolocation not supported.'\r\n\t\t\t});\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar onResponse = Util.bind(this._handleGeolocationResponse, this),\r\n\t\t    onError = Util.bind(this._handleGeolocationError, this);\r\n\r\n\t\tif (options.watch) {\r\n\t\t\tthis._locationWatchId =\r\n\t\t\t        navigator.geolocation.watchPosition(onResponse, onError, options);\r\n\t\t} else {\r\n\t\t\tnavigator.geolocation.getCurrentPosition(onResponse, onError, options);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method stopLocate(): this\r\n\t// Stops watching location previously initiated by `map.locate({watch: true})`\r\n\t// and aborts resetting the map view if map.locate was called with\r\n\t// `{setView: true}`.\r\n\tstopLocate: function () {\r\n\t\tif (navigator.geolocation && navigator.geolocation.clearWatch) {\r\n\t\t\tnavigator.geolocation.clearWatch(this._locationWatchId);\r\n\t\t}\r\n\t\tif (this._locateOptions) {\r\n\t\t\tthis._locateOptions.setView = false;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_handleGeolocationError: function (error) {\r\n\t\tif (!this._container._leaflet_id) { return; }\r\n\r\n\t\tvar c = error.code,\r\n\t\t    message = error.message ||\r\n\t\t            (c === 1 ? 'permission denied' :\r\n\t\t            (c === 2 ? 'position unavailable' : 'timeout'));\r\n\r\n\t\tif (this._locateOptions.setView && !this._loaded) {\r\n\t\t\tthis.fitWorld();\r\n\t\t}\r\n\r\n\t\t// @section Location events\r\n\t\t// @event locationerror: ErrorEvent\r\n\t\t// Fired when geolocation (using the [`locate`](#map-locate) method) failed.\r\n\t\tthis.fire('locationerror', {\r\n\t\t\tcode: c,\r\n\t\t\tmessage: 'Geolocation error: ' + message + '.'\r\n\t\t});\r\n\t},\r\n\r\n\t_handleGeolocationResponse: function (pos) {\r\n\t\tif (!this._container._leaflet_id) { return; }\r\n\r\n\t\tvar lat = pos.coords.latitude,\r\n\t\t    lng = pos.coords.longitude,\r\n\t\t    latlng = new LatLng(lat, lng),\r\n\t\t    bounds = latlng.toBounds(pos.coords.accuracy * 2),\r\n\t\t    options = this._locateOptions;\r\n\r\n\t\tif (options.setView) {\r\n\t\t\tvar zoom = this.getBoundsZoom(bounds);\r\n\t\t\tthis.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\r\n\t\t}\r\n\r\n\t\tvar data = {\r\n\t\t\tlatlng: latlng,\r\n\t\t\tbounds: bounds,\r\n\t\t\ttimestamp: pos.timestamp\r\n\t\t};\r\n\r\n\t\tfor (var i in pos.coords) {\r\n\t\t\tif (typeof pos.coords[i] === 'number') {\r\n\t\t\t\tdata[i] = pos.coords[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// @event locationfound: LocationEvent\r\n\t\t// Fired when geolocation (using the [`locate`](#map-locate) method)\r\n\t\t// went successfully.\r\n\t\tthis.fire('locationfound', data);\r\n\t},\r\n\r\n\t// TODO Appropriate docs section?\r\n\t// @section Other Methods\r\n\t// @method addHandler(name: String, HandlerClass: Function): this\r\n\t// Adds a new `Handler` to the map, given its name and constructor function.\r\n\taddHandler: function (name, HandlerClass) {\r\n\t\tif (!HandlerClass) { return this; }\r\n\r\n\t\tvar handler = this[name] = new HandlerClass(this);\r\n\r\n\t\tthis._handlers.push(handler);\r\n\r\n\t\tif (this.options[name]) {\r\n\t\t\thandler.enable();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method remove(): this\r\n\t// Destroys the map and clears all related event listeners.\r\n\tremove: function () {\r\n\r\n\t\tthis._initEvents(true);\r\n\t\tif (this.options.maxBounds) { this.off('moveend', this._panInsideMaxBounds); }\r\n\r\n\t\tif (this._containerId !== this._container._leaflet_id) {\r\n\t\t\tthrow new Error('Map container is being reused by another instance');\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\t// throws error in IE6-8\r\n\t\t\tdelete this._container._leaflet_id;\r\n\t\t\tdelete this._containerId;\r\n\t\t} catch (e) {\r\n\t\t\t/*eslint-disable */\r\n\t\t\tthis._container._leaflet_id = undefined;\r\n\t\t\t/* eslint-enable */\r\n\t\t\tthis._containerId = undefined;\r\n\t\t}\r\n\r\n\t\tif (this._locationWatchId !== undefined) {\r\n\t\t\tthis.stopLocate();\r\n\t\t}\r\n\r\n\t\tthis._stop();\r\n\r\n\t\tDomUtil.remove(this._mapPane);\r\n\r\n\t\tif (this._clearControlPos) {\r\n\t\t\tthis._clearControlPos();\r\n\t\t}\r\n\t\tif (this._resizeRequest) {\r\n\t\t\tUtil.cancelAnimFrame(this._resizeRequest);\r\n\t\t\tthis._resizeRequest = null;\r\n\t\t}\r\n\r\n\t\tthis._clearHandlers();\r\n\r\n\t\tif (this._loaded) {\r\n\t\t\t// @section Map state change events\r\n\t\t\t// @event unload: Event\r\n\t\t\t// Fired when the map is destroyed with [remove](#map-remove) method.\r\n\t\t\tthis.fire('unload');\r\n\t\t}\r\n\r\n\t\tvar i;\r\n\t\tfor (i in this._layers) {\r\n\t\t\tthis._layers[i].remove();\r\n\t\t}\r\n\t\tfor (i in this._panes) {\r\n\t\t\tDomUtil.remove(this._panes[i]);\r\n\t\t}\r\n\r\n\t\tthis._layers = [];\r\n\t\tthis._panes = [];\r\n\t\tdelete this._mapPane;\r\n\t\tdelete this._renderer;\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @section Other Methods\r\n\t// @method createPane(name: String, container?: HTMLElement): HTMLElement\r\n\t// Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,\r\n\t// then returns it. The pane is created as a child of `container`, or\r\n\t// as a child of the main map pane if not set.\r\n\tcreatePane: function (name, container) {\r\n\t\tvar className = 'leaflet-pane' + (name ? ' leaflet-' + name.replace('Pane', '') + '-pane' : ''),\r\n\t\t    pane = DomUtil.create('div', className, container || this._mapPane);\r\n\r\n\t\tif (name) {\r\n\t\t\tthis._panes[name] = pane;\r\n\t\t}\r\n\t\treturn pane;\r\n\t},\r\n\r\n\t// @section Methods for Getting Map State\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the geographical center of the map view\r\n\tgetCenter: function () {\r\n\t\tthis._checkIfLoaded();\r\n\r\n\t\tif (this._lastCenter && !this._moved()) {\r\n\t\t\treturn this._lastCenter.clone();\r\n\t\t}\r\n\t\treturn this.layerPointToLatLng(this._getCenterLayerPoint());\r\n\t},\r\n\r\n\t// @method getZoom(): Number\r\n\t// Returns the current zoom level of the map view\r\n\tgetZoom: function () {\r\n\t\treturn this._zoom;\r\n\t},\r\n\r\n\t// @method getBounds(): LatLngBounds\r\n\t// Returns the geographical bounds visible in the current map view\r\n\tgetBounds: function () {\r\n\t\tvar bounds = this.getPixelBounds(),\r\n\t\t    sw = this.unproject(bounds.getBottomLeft()),\r\n\t\t    ne = this.unproject(bounds.getTopRight());\r\n\r\n\t\treturn new LatLngBounds(sw, ne);\r\n\t},\r\n\r\n\t// @method getMinZoom(): Number\r\n\t// Returns the minimum zoom level of the map (if set in the `minZoom` option of the map or of any layers), or `0` by default.\r\n\tgetMinZoom: function () {\r\n\t\treturn this.options.minZoom === undefined ? this._layersMinZoom || 0 : this.options.minZoom;\r\n\t},\r\n\r\n\t// @method getMaxZoom(): Number\r\n\t// Returns the maximum zoom level of the map (if set in the `maxZoom` option of the map or of any layers).\r\n\tgetMaxZoom: function () {\r\n\t\treturn this.options.maxZoom === undefined ?\r\n\t\t\t(this._layersMaxZoom === undefined ? Infinity : this._layersMaxZoom) :\r\n\t\t\tthis.options.maxZoom;\r\n\t},\r\n\r\n\t// @method getBoundsZoom(bounds: LatLngBounds, inside?: Boolean, padding?: Point): Number\r\n\t// Returns the maximum zoom level on which the given bounds fit to the map\r\n\t// view in its entirety. If `inside` (optional) is set to `true`, the method\r\n\t// instead returns the minimum zoom level on which the map view fits into\r\n\t// the given bounds in its entirety.\r\n\tgetBoundsZoom: function (bounds, inside, padding) { // (LatLngBounds[, Boolean, Point]) -> Number\r\n\t\tbounds = toLatLngBounds(bounds);\r\n\t\tpadding = toPoint(padding || [0, 0]);\r\n\r\n\t\tvar zoom = this.getZoom() || 0,\r\n\t\t    min = this.getMinZoom(),\r\n\t\t    max = this.getMaxZoom(),\r\n\t\t    nw = bounds.getNorthWest(),\r\n\t\t    se = bounds.getSouthEast(),\r\n\t\t    size = this.getSize().subtract(padding),\r\n\t\t    boundsSize = toBounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\r\n\t\t    snap = Browser.any3d ? this.options.zoomSnap : 1,\r\n\t\t    scalex = size.x / boundsSize.x,\r\n\t\t    scaley = size.y / boundsSize.y,\r\n\t\t    scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\r\n\r\n\t\tzoom = this.getScaleZoom(scale, zoom);\r\n\r\n\t\tif (snap) {\r\n\t\t\tzoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\r\n\t\t\tzoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\r\n\t\t}\r\n\r\n\t\treturn Math.max(min, Math.min(max, zoom));\r\n\t},\r\n\r\n\t// @method getSize(): Point\r\n\t// Returns the current size of the map container (in pixels).\r\n\tgetSize: function () {\r\n\t\tif (!this._size || this._sizeChanged) {\r\n\t\t\tthis._size = new Point(\r\n\t\t\t\tthis._container.clientWidth || 0,\r\n\t\t\t\tthis._container.clientHeight || 0);\r\n\r\n\t\t\tthis._sizeChanged = false;\r\n\t\t}\r\n\t\treturn this._size.clone();\r\n\t},\r\n\r\n\t// @method getPixelBounds(): Bounds\r\n\t// Returns the bounds of the current map view in projected pixel\r\n\t// coordinates (sometimes useful in layer and overlay implementations).\r\n\tgetPixelBounds: function (center, zoom) {\r\n\t\tvar topLeftPoint = this._getTopLeftPoint(center, zoom);\r\n\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\r\n\t},\r\n\r\n\t// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to\r\n\t// the map pane? \"left point of the map layer\" can be confusing, specially\r\n\t// since there can be negative offsets.\r\n\t// @method getPixelOrigin(): Point\r\n\t// Returns the projected pixel coordinates of the top left point of\r\n\t// the map layer (useful in custom layer and overlay implementations).\r\n\tgetPixelOrigin: function () {\r\n\t\tthis._checkIfLoaded();\r\n\t\treturn this._pixelOrigin;\r\n\t},\r\n\r\n\t// @method getPixelWorldBounds(zoom?: Number): Bounds\r\n\t// Returns the world's bounds in pixel coordinates for zoom level `zoom`.\r\n\t// If `zoom` is omitted, the map's current zoom level is used.\r\n\tgetPixelWorldBounds: function (zoom) {\r\n\t\treturn this.options.crs.getProjectedBounds(zoom === undefined ? this.getZoom() : zoom);\r\n\t},\r\n\r\n\t// @section Other Methods\r\n\r\n\t// @method getPane(pane: String|HTMLElement): HTMLElement\r\n\t// Returns a [map pane](#map-pane), given its name or its HTML element (its identity).\r\n\tgetPane: function (pane) {\r\n\t\treturn typeof pane === 'string' ? this._panes[pane] : pane;\r\n\t},\r\n\r\n\t// @method getPanes(): Object\r\n\t// Returns a plain object containing the names of all [panes](#map-pane) as keys and\r\n\t// the panes as values.\r\n\tgetPanes: function () {\r\n\t\treturn this._panes;\r\n\t},\r\n\r\n\t// @method getContainer: HTMLElement\r\n\t// Returns the HTML element that contains the map.\r\n\tgetContainer: function () {\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\r\n\t// @section Conversion Methods\r\n\r\n\t// @method getZoomScale(toZoom: Number, fromZoom: Number): Number\r\n\t// Returns the scale factor to be applied to a map transition from zoom level\r\n\t// `fromZoom` to `toZoom`. Used internally to help with zoom animations.\r\n\tgetZoomScale: function (toZoom, fromZoom) {\r\n\t\t// TODO replace with universal implementation after refactoring projections\r\n\t\tvar crs = this.options.crs;\r\n\t\tfromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r\n\t\treturn crs.scale(toZoom) / crs.scale(fromZoom);\r\n\t},\r\n\r\n\t// @method getScaleZoom(scale: Number, fromZoom: Number): Number\r\n\t// Returns the zoom level that the map would end up at, if it is at `fromZoom`\r\n\t// level and everything is scaled by a factor of `scale`. Inverse of\r\n\t// [`getZoomScale`](#map-getZoomScale).\r\n\tgetScaleZoom: function (scale, fromZoom) {\r\n\t\tvar crs = this.options.crs;\r\n\t\tfromZoom = fromZoom === undefined ? this._zoom : fromZoom;\r\n\t\tvar zoom = crs.zoom(scale * crs.scale(fromZoom));\r\n\t\treturn isNaN(zoom) ? Infinity : zoom;\r\n\t},\r\n\r\n\t// @method project(latlng: LatLng, zoom: Number): Point\r\n\t// Projects a geographical coordinate `LatLng` according to the projection\r\n\t// of the map's CRS, then scales it according to `zoom` and the CRS's\r\n\t// `Transformation`. The result is pixel coordinate relative to\r\n\t// the CRS origin.\r\n\tproject: function (latlng, zoom) {\r\n\t\tzoom = zoom === undefined ? this._zoom : zoom;\r\n\t\treturn this.options.crs.latLngToPoint(toLatLng(latlng), zoom);\r\n\t},\r\n\r\n\t// @method unproject(point: Point, zoom: Number): LatLng\r\n\t// Inverse of [`project`](#map-project).\r\n\tunproject: function (point, zoom) {\r\n\t\tzoom = zoom === undefined ? this._zoom : zoom;\r\n\t\treturn this.options.crs.pointToLatLng(toPoint(point), zoom);\r\n\t},\r\n\r\n\t// @method layerPointToLatLng(point: Point): LatLng\r\n\t// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r\n\t// returns the corresponding geographical coordinate (for the current zoom level).\r\n\tlayerPointToLatLng: function (point) {\r\n\t\tvar projectedPoint = toPoint(point).add(this.getPixelOrigin());\r\n\t\treturn this.unproject(projectedPoint);\r\n\t},\r\n\r\n\t// @method latLngToLayerPoint(latlng: LatLng): Point\r\n\t// Given a geographical coordinate, returns the corresponding pixel coordinate\r\n\t// relative to the [origin pixel](#map-getpixelorigin).\r\n\tlatLngToLayerPoint: function (latlng) {\r\n\t\tvar projectedPoint = this.project(toLatLng(latlng))._round();\r\n\t\treturn projectedPoint._subtract(this.getPixelOrigin());\r\n\t},\r\n\r\n\t// @method wrapLatLng(latlng: LatLng): LatLng\r\n\t// Returns a `LatLng` where `lat` and `lng` has been wrapped according to the\r\n\t// map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the\r\n\t// CRS's bounds.\r\n\t// By default this means longitude is wrapped around the dateline so its\r\n\t// value is between -180 and +180 degrees.\r\n\twrapLatLng: function (latlng) {\r\n\t\treturn this.options.crs.wrapLatLng(toLatLng(latlng));\r\n\t},\r\n\r\n\t// @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds\r\n\t// Returns a `LatLngBounds` with the same size as the given one, ensuring that\r\n\t// its center is within the CRS's bounds.\r\n\t// By default this means the center longitude is wrapped around the dateline so its\r\n\t// value is between -180 and +180 degrees, and the majority of the bounds\r\n\t// overlaps the CRS's bounds.\r\n\twrapLatLngBounds: function (latlng) {\r\n\t\treturn this.options.crs.wrapLatLngBounds(toLatLngBounds(latlng));\r\n\t},\r\n\r\n\t// @method distance(latlng1: LatLng, latlng2: LatLng): Number\r\n\t// Returns the distance between two geographical coordinates according to\r\n\t// the map's CRS. By default this measures distance in meters.\r\n\tdistance: function (latlng1, latlng2) {\r\n\t\treturn this.options.crs.distance(toLatLng(latlng1), toLatLng(latlng2));\r\n\t},\r\n\r\n\t// @method containerPointToLayerPoint(point: Point): Point\r\n\t// Given a pixel coordinate relative to the map container, returns the corresponding\r\n\t// pixel coordinate relative to the [origin pixel](#map-getpixelorigin).\r\n\tcontainerPointToLayerPoint: function (point) { // (Point)\r\n\t\treturn toPoint(point).subtract(this._getMapPanePos());\r\n\t},\r\n\r\n\t// @method layerPointToContainerPoint(point: Point): Point\r\n\t// Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\r\n\t// returns the corresponding pixel coordinate relative to the map container.\r\n\tlayerPointToContainerPoint: function (point) { // (Point)\r\n\t\treturn toPoint(point).add(this._getMapPanePos());\r\n\t},\r\n\r\n\t// @method containerPointToLatLng(point: Point): LatLng\r\n\t// Given a pixel coordinate relative to the map container, returns\r\n\t// the corresponding geographical coordinate (for the current zoom level).\r\n\tcontainerPointToLatLng: function (point) {\r\n\t\tvar layerPoint = this.containerPointToLayerPoint(toPoint(point));\r\n\t\treturn this.layerPointToLatLng(layerPoint);\r\n\t},\r\n\r\n\t// @method latLngToContainerPoint(latlng: LatLng): Point\r\n\t// Given a geographical coordinate, returns the corresponding pixel coordinate\r\n\t// relative to the map container.\r\n\tlatLngToContainerPoint: function (latlng) {\r\n\t\treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)));\r\n\t},\r\n\r\n\t// @method mouseEventToContainerPoint(ev: MouseEvent): Point\r\n\t// Given a MouseEvent object, returns the pixel coordinate relative to the\r\n\t// map container where the event took place.\r\n\tmouseEventToContainerPoint: function (e) {\r\n\t\treturn DomEvent.getMousePosition(e, this._container);\r\n\t},\r\n\r\n\t// @method mouseEventToLayerPoint(ev: MouseEvent): Point\r\n\t// Given a MouseEvent object, returns the pixel coordinate relative to\r\n\t// the [origin pixel](#map-getpixelorigin) where the event took place.\r\n\tmouseEventToLayerPoint: function (e) {\r\n\t\treturn this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e));\r\n\t},\r\n\r\n\t// @method mouseEventToLatLng(ev: MouseEvent): LatLng\r\n\t// Given a MouseEvent object, returns geographical coordinate where the\r\n\t// event took place.\r\n\tmouseEventToLatLng: function (e) { // (MouseEvent)\r\n\t\treturn this.layerPointToLatLng(this.mouseEventToLayerPoint(e));\r\n\t},\r\n\r\n\r\n\t// map initialization methods\r\n\r\n\t_initContainer: function (id) {\r\n\t\tvar container = this._container = DomUtil.get(id);\r\n\r\n\t\tif (!container) {\r\n\t\t\tthrow new Error('Map container not found.');\r\n\t\t} else if (container._leaflet_id) {\r\n\t\t\tthrow new Error('Map container is already initialized.');\r\n\t\t}\r\n\r\n\t\tDomEvent.on(container, 'scroll', this._onScroll, this);\r\n\t\tthis._containerId = Util.stamp(container);\r\n\t},\r\n\r\n\t_initLayout: function () {\r\n\t\tvar container = this._container;\r\n\r\n\t\tthis._fadeAnimated = this.options.fadeAnimation && Browser.any3d;\r\n\r\n\t\tDomUtil.addClass(container, 'leaflet-container' +\r\n\t\t\t(Browser.touch ? ' leaflet-touch' : '') +\r\n\t\t\t(Browser.retina ? ' leaflet-retina' : '') +\r\n\t\t\t(Browser.ielt9 ? ' leaflet-oldie' : '') +\r\n\t\t\t(Browser.safari ? ' leaflet-safari' : '') +\r\n\t\t\t(this._fadeAnimated ? ' leaflet-fade-anim' : ''));\r\n\r\n\t\tvar position = DomUtil.getStyle(container, 'position');\r\n\r\n\t\tif (position !== 'absolute' && position !== 'relative' && position !== 'fixed' && position !== 'sticky') {\r\n\t\t\tcontainer.style.position = 'relative';\r\n\t\t}\r\n\r\n\t\tthis._initPanes();\r\n\r\n\t\tif (this._initControlPos) {\r\n\t\t\tthis._initControlPos();\r\n\t\t}\r\n\t},\r\n\r\n\t_initPanes: function () {\r\n\t\tvar panes = this._panes = {};\r\n\t\tthis._paneRenderers = {};\r\n\r\n\t\t// @section\r\n\t\t//\r\n\t\t// Panes are DOM elements used to control the ordering of layers on the map. You\r\n\t\t// can access panes with [`map.getPane`](#map-getpane) or\r\n\t\t// [`map.getPanes`](#map-getpanes) methods. New panes can be created with the\r\n\t\t// [`map.createPane`](#map-createpane) method.\r\n\t\t//\r\n\t\t// Every map has the following default panes that differ only in zIndex.\r\n\t\t//\r\n\t\t// @pane mapPane: HTMLElement = 'auto'\r\n\t\t// Pane that contains all other map panes\r\n\r\n\t\tthis._mapPane = this.createPane('mapPane', this._container);\r\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\r\n\r\n\t\t// @pane tilePane: HTMLElement = 200\r\n\t\t// Pane for `GridLayer`s and `TileLayer`s\r\n\t\tthis.createPane('tilePane');\r\n\t\t// @pane overlayPane: HTMLElement = 400\r\n\t\t// Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s\r\n\t\tthis.createPane('overlayPane');\r\n\t\t// @pane shadowPane: HTMLElement = 500\r\n\t\t// Pane for overlay shadows (e.g. `Marker` shadows)\r\n\t\tthis.createPane('shadowPane');\r\n\t\t// @pane markerPane: HTMLElement = 600\r\n\t\t// Pane for `Icon`s of `Marker`s\r\n\t\tthis.createPane('markerPane');\r\n\t\t// @pane tooltipPane: HTMLElement = 650\r\n\t\t// Pane for `Tooltip`s.\r\n\t\tthis.createPane('tooltipPane');\r\n\t\t// @pane popupPane: HTMLElement = 700\r\n\t\t// Pane for `Popup`s.\r\n\t\tthis.createPane('popupPane');\r\n\r\n\t\tif (!this.options.markerZoomAnimation) {\r\n\t\t\tDomUtil.addClass(panes.markerPane, 'leaflet-zoom-hide');\r\n\t\t\tDomUtil.addClass(panes.shadowPane, 'leaflet-zoom-hide');\r\n\t\t}\r\n\t},\r\n\r\n\r\n\t// private methods that modify map state\r\n\r\n\t// @section Map state change events\r\n\t_resetView: function (center, zoom, noMoveStart) {\r\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\r\n\r\n\t\tvar loading = !this._loaded;\r\n\t\tthis._loaded = true;\r\n\t\tzoom = this._limitZoom(zoom);\r\n\r\n\t\tthis.fire('viewprereset');\r\n\r\n\t\tvar zoomChanged = this._zoom !== zoom;\r\n\t\tthis\r\n\t\t\t._moveStart(zoomChanged, noMoveStart)\r\n\t\t\t._move(center, zoom)\r\n\t\t\t._moveEnd(zoomChanged);\r\n\r\n\t\t// @event viewreset: Event\r\n\t\t// Fired when the map needs to redraw its content (this usually happens\r\n\t\t// on map zoom or load). Very useful for creating custom overlays.\r\n\t\tthis.fire('viewreset');\r\n\r\n\t\t// @event load: Event\r\n\t\t// Fired when the map is initialized (when its center and zoom are set\r\n\t\t// for the first time).\r\n\t\tif (loading) {\r\n\t\t\tthis.fire('load');\r\n\t\t}\r\n\t},\r\n\r\n\t_moveStart: function (zoomChanged, noMoveStart) {\r\n\t\t// @event zoomstart: Event\r\n\t\t// Fired when the map zoom is about to change (e.g. before zoom animation).\r\n\t\t// @event movestart: Event\r\n\t\t// Fired when the view of the map starts changing (e.g. user starts dragging the map).\r\n\t\tif (zoomChanged) {\r\n\t\t\tthis.fire('zoomstart');\r\n\t\t}\r\n\t\tif (!noMoveStart) {\r\n\t\t\tthis.fire('movestart');\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_move: function (center, zoom, data, supressEvent) {\r\n\t\tif (zoom === undefined) {\r\n\t\t\tzoom = this._zoom;\r\n\t\t}\r\n\t\tvar zoomChanged = this._zoom !== zoom;\r\n\r\n\t\tthis._zoom = zoom;\r\n\t\tthis._lastCenter = center;\r\n\t\tthis._pixelOrigin = this._getNewPixelOrigin(center);\r\n\r\n\t\tif (!supressEvent) {\r\n\t\t\t// @event zoom: Event\r\n\t\t\t// Fired repeatedly during any change in zoom level,\r\n\t\t\t// including zoom and fly animations.\r\n\t\t\tif (zoomChanged || (data && data.pinch)) {\t// Always fire 'zoom' if pinching because #3530\r\n\t\t\t\tthis.fire('zoom', data);\r\n\t\t\t}\r\n\r\n\t\t\t// @event move: Event\r\n\t\t\t// Fired repeatedly during any movement of the map,\r\n\t\t\t// including pan and fly animations.\r\n\t\t\tthis.fire('move', data);\r\n\t\t} else if (data && data.pinch) {\t// Always fire 'zoom' if pinching because #3530\r\n\t\t\tthis.fire('zoom', data);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_moveEnd: function (zoomChanged) {\r\n\t\t// @event zoomend: Event\r\n\t\t// Fired when the map zoom changed, after any animations.\r\n\t\tif (zoomChanged) {\r\n\t\t\tthis.fire('zoomend');\r\n\t\t}\r\n\r\n\t\t// @event moveend: Event\r\n\t\t// Fired when the center of the map stops changing\r\n\t\t// (e.g. user stopped dragging the map or after non-centered zoom).\r\n\t\treturn this.fire('moveend');\r\n\t},\r\n\r\n\t_stop: function () {\r\n\t\tUtil.cancelAnimFrame(this._flyToFrame);\r\n\t\tif (this._panAnim) {\r\n\t\t\tthis._panAnim.stop();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_rawPanBy: function (offset) {\r\n\t\tDomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset));\r\n\t},\r\n\r\n\t_getZoomSpan: function () {\r\n\t\treturn this.getMaxZoom() - this.getMinZoom();\r\n\t},\r\n\r\n\t_panInsideMaxBounds: function () {\r\n\t\tif (!this._enforcingBounds) {\r\n\t\t\tthis.panInsideBounds(this.options.maxBounds);\r\n\t\t}\r\n\t},\r\n\r\n\t_checkIfLoaded: function () {\r\n\t\tif (!this._loaded) {\r\n\t\t\tthrow new Error('Set map center and zoom first.');\r\n\t\t}\r\n\t},\r\n\r\n\t// DOM event handling\r\n\r\n\t// @section Interaction events\r\n\t_initEvents: function (remove) {\r\n\t\tthis._targets = {};\r\n\t\tthis._targets[Util.stamp(this._container)] = this;\r\n\r\n\t\tvar onOff = remove ? DomEvent.off : DomEvent.on;\r\n\r\n\t\t// @event click: MouseEvent\r\n\t\t// Fired when the user clicks (or taps) the map.\r\n\t\t// @event dblclick: MouseEvent\r\n\t\t// Fired when the user double-clicks (or double-taps) the map.\r\n\t\t// @event mousedown: MouseEvent\r\n\t\t// Fired when the user pushes the mouse button on the map.\r\n\t\t// @event mouseup: MouseEvent\r\n\t\t// Fired when the user releases the mouse button on the map.\r\n\t\t// @event mouseover: MouseEvent\r\n\t\t// Fired when the mouse enters the map.\r\n\t\t// @event mouseout: MouseEvent\r\n\t\t// Fired when the mouse leaves the map.\r\n\t\t// @event mousemove: MouseEvent\r\n\t\t// Fired while the mouse moves over the map.\r\n\t\t// @event contextmenu: MouseEvent\r\n\t\t// Fired when the user pushes the right mouse button on the map, prevents\r\n\t\t// default browser context menu from showing if there are listeners on\r\n\t\t// this event. Also fired on mobile when the user holds a single touch\r\n\t\t// for a second (also called long press).\r\n\t\t// @event keypress: KeyboardEvent\r\n\t\t// Fired when the user presses a key from the keyboard that produces a character value while the map is focused.\r\n\t\t// @event keydown: KeyboardEvent\r\n\t\t// Fired when the user presses a key from the keyboard while the map is focused. Unlike the `keypress` event,\r\n\t\t// the `keydown` event is fired for keys that produce a character value and for keys\r\n\t\t// that do not produce a character value.\r\n\t\t// @event keyup: KeyboardEvent\r\n\t\t// Fired when the user releases a key from the keyboard while the map is focused.\r\n\t\tonOff(this._container, 'click dblclick mousedown mouseup ' +\r\n\t\t\t'mouseover mouseout mousemove contextmenu keypress keydown keyup', this._handleDOMEvent, this);\r\n\r\n\t\tif (this.options.trackResize) {\r\n\t\t\tonOff(window, 'resize', this._onResize, this);\r\n\t\t}\r\n\r\n\t\tif (Browser.any3d && this.options.transform3DLimit) {\r\n\t\t\t(remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\r\n\t\t}\r\n\t},\r\n\r\n\t_onResize: function () {\r\n\t\tUtil.cancelAnimFrame(this._resizeRequest);\r\n\t\tthis._resizeRequest = Util.requestAnimFrame(\r\n\t\t        function () { this.invalidateSize({debounceMoveend: true}); }, this);\r\n\t},\r\n\r\n\t_onScroll: function () {\r\n\t\tthis._container.scrollTop  = 0;\r\n\t\tthis._container.scrollLeft = 0;\r\n\t},\r\n\r\n\t_onMoveEnd: function () {\r\n\t\tvar pos = this._getMapPanePos();\r\n\t\tif (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) {\r\n\t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have\r\n\t\t\t// a pixel offset on very high values, see: https://jsfiddle.net/dg6r5hhb/\r\n\t\t\tthis._resetView(this.getCenter(), this.getZoom());\r\n\t\t}\r\n\t},\r\n\r\n\t_findEventTargets: function (e, type) {\r\n\t\tvar targets = [],\r\n\t\t    target,\r\n\t\t    isHover = type === 'mouseout' || type === 'mouseover',\r\n\t\t    src = e.target || e.srcElement,\r\n\t\t    dragging = false;\r\n\r\n\t\twhile (src) {\r\n\t\t\ttarget = this._targets[Util.stamp(src)];\r\n\t\t\tif (target && (type === 'click' || type === 'preclick') && this._draggableMoved(target)) {\r\n\t\t\t\t// Prevent firing click after you just dragged an object.\r\n\t\t\t\tdragging = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (target && target.listens(type, true)) {\r\n\t\t\t\tif (isHover && !DomEvent.isExternalTarget(src, e)) { break; }\r\n\t\t\t\ttargets.push(target);\r\n\t\t\t\tif (isHover) { break; }\r\n\t\t\t}\r\n\t\t\tif (src === this._container) { break; }\r\n\t\t\tsrc = src.parentNode;\r\n\t\t}\r\n\t\tif (!targets.length && !dragging && !isHover && this.listens(type, true)) {\r\n\t\t\ttargets = [this];\r\n\t\t}\r\n\t\treturn targets;\r\n\t},\r\n\r\n\t_isClickDisabled: function (el) {\r\n\t\twhile (el && el !== this._container) {\r\n\t\t\tif (el['_leaflet_disable_click']) { return true; }\r\n\t\t\tel = el.parentNode;\r\n\t\t}\r\n\t},\r\n\r\n\t_handleDOMEvent: function (e) {\r\n\t\tvar el = (e.target || e.srcElement);\r\n\t\tif (!this._loaded || el['_leaflet_disable_events'] || e.type === 'click' && this._isClickDisabled(el)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar type = e.type;\r\n\r\n\t\tif (type === 'mousedown') {\r\n\t\t\t// prevents outline when clicking on keyboard-focusable element\r\n\t\t\tDomUtil.preventOutline(el);\r\n\t\t}\r\n\r\n\t\tthis._fireDOMEvent(e, type);\r\n\t},\r\n\r\n\t_mouseEvents: ['click', 'dblclick', 'mouseover', 'mouseout', 'contextmenu'],\r\n\r\n\t_fireDOMEvent: function (e, type, canvasTargets) {\r\n\r\n\t\tif (e.type === 'click') {\r\n\t\t\t// Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\r\n\t\t\t// @event preclick: MouseEvent\r\n\t\t\t// Fired before mouse click on the map (sometimes useful when you\r\n\t\t\t// want something to happen on click before any existing click\r\n\t\t\t// handlers start running).\r\n\t\t\tvar synth = Util.extend({}, e);\r\n\t\t\tsynth.type = 'preclick';\r\n\t\t\tthis._fireDOMEvent(synth, synth.type, canvasTargets);\r\n\t\t}\r\n\r\n\t\t// Find the layer the event is propagating from and its parents.\r\n\t\tvar targets = this._findEventTargets(e, type);\r\n\r\n\t\tif (canvasTargets) {\r\n\t\t\tvar filtered = []; // pick only targets with listeners\r\n\t\t\tfor (var i = 0; i < canvasTargets.length; i++) {\r\n\t\t\t\tif (canvasTargets[i].listens(type, true)) {\r\n\t\t\t\t\tfiltered.push(canvasTargets[i]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttargets = filtered.concat(targets);\r\n\t\t}\r\n\r\n\t\tif (!targets.length) { return; }\r\n\r\n\t\tif (type === 'contextmenu') {\r\n\t\t\tDomEvent.preventDefault(e);\r\n\t\t}\r\n\r\n\t\tvar target = targets[0];\r\n\t\tvar data = {\r\n\t\t\toriginalEvent: e\r\n\t\t};\r\n\r\n\t\tif (e.type !== 'keypress' && e.type !== 'keydown' && e.type !== 'keyup') {\r\n\t\t\tvar isMarker = target.getLatLng && (!target._radius || target._radius <= 10);\r\n\t\t\tdata.containerPoint = isMarker ?\r\n\t\t\t\tthis.latLngToContainerPoint(target.getLatLng()) : this.mouseEventToContainerPoint(e);\r\n\t\t\tdata.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\r\n\t\t\tdata.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);\r\n\t\t}\r\n\r\n\t\tfor (i = 0; i < targets.length; i++) {\r\n\t\t\ttargets[i].fire(type, data, true);\r\n\t\t\tif (data.originalEvent._stopped ||\r\n\t\t\t\t(targets[i].options.bubblingMouseEvents === false && Util.indexOf(this._mouseEvents, type) !== -1)) { return; }\r\n\t\t}\r\n\t},\r\n\r\n\t_draggableMoved: function (obj) {\r\n\t\tobj = obj.dragging && obj.dragging.enabled() ? obj : this;\r\n\t\treturn (obj.dragging && obj.dragging.moved()) || (this.boxZoom && this.boxZoom.moved());\r\n\t},\r\n\r\n\t_clearHandlers: function () {\r\n\t\tfor (var i = 0, len = this._handlers.length; i < len; i++) {\r\n\t\t\tthis._handlers[i].disable();\r\n\t\t}\r\n\t},\r\n\r\n\t// @section Other Methods\r\n\r\n\t// @method whenReady(fn: Function, context?: Object): this\r\n\t// Runs the given function `fn` when the map gets initialized with\r\n\t// a view (center and zoom) and at least one layer, or immediately\r\n\t// if it's already initialized, optionally passing a function context.\r\n\twhenReady: function (callback, context) {\r\n\t\tif (this._loaded) {\r\n\t\t\tcallback.call(context || this, {target: this});\r\n\t\t} else {\r\n\t\t\tthis.on('load', callback, context);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\r\n\t// private methods for getting map state\r\n\r\n\t_getMapPanePos: function () {\r\n\t\treturn DomUtil.getPosition(this._mapPane) || new Point(0, 0);\r\n\t},\r\n\r\n\t_moved: function () {\r\n\t\tvar pos = this._getMapPanePos();\r\n\t\treturn pos && !pos.equals([0, 0]);\r\n\t},\r\n\r\n\t_getTopLeftPoint: function (center, zoom) {\r\n\t\tvar pixelOrigin = center && zoom !== undefined ?\r\n\t\t\tthis._getNewPixelOrigin(center, zoom) :\r\n\t\t\tthis.getPixelOrigin();\r\n\t\treturn pixelOrigin.subtract(this._getMapPanePos());\r\n\t},\r\n\r\n\t_getNewPixelOrigin: function (center, zoom) {\r\n\t\tvar viewHalf = this.getSize()._divideBy(2);\r\n\t\treturn this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round();\r\n\t},\r\n\r\n\t_latLngToNewLayerPoint: function (latlng, zoom, center) {\r\n\t\tvar topLeft = this._getNewPixelOrigin(center, zoom);\r\n\t\treturn this.project(latlng, zoom)._subtract(topLeft);\r\n\t},\r\n\r\n\t_latLngBoundsToNewLayerBounds: function (latLngBounds, zoom, center) {\r\n\t\tvar topLeft = this._getNewPixelOrigin(center, zoom);\r\n\t\treturn toBounds([\r\n\t\t\tthis.project(latLngBounds.getSouthWest(), zoom)._subtract(topLeft),\r\n\t\t\tthis.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft),\r\n\t\t\tthis.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft),\r\n\t\t\tthis.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft)\r\n\t\t]);\r\n\t},\r\n\r\n\t// layer point of the current center\r\n\t_getCenterLayerPoint: function () {\r\n\t\treturn this.containerPointToLayerPoint(this.getSize()._divideBy(2));\r\n\t},\r\n\r\n\t// offset of the specified place to the current center in pixels\r\n\t_getCenterOffset: function (latlng) {\r\n\t\treturn this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint());\r\n\t},\r\n\r\n\t// adjust center for view to get inside bounds\r\n\t_limitCenter: function (center, zoom, bounds) {\r\n\r\n\t\tif (!bounds) { return center; }\r\n\r\n\t\tvar centerPoint = this.project(center, zoom),\r\n\t\t    viewHalf = this.getSize().divideBy(2),\r\n\t\t    viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\r\n\t\t    offset = this._getBoundsOffset(viewBounds, bounds, zoom);\r\n\r\n\t\t// If offset is less than a pixel, ignore.\r\n\t\t// This prevents unstable projections from getting into\r\n\t\t// an infinite loop of tiny offsets.\r\n\t\tif (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {\r\n\t\t\treturn center;\r\n\t\t}\r\n\r\n\t\treturn this.unproject(centerPoint.add(offset), zoom);\r\n\t},\r\n\r\n\t// adjust offset for view to get inside bounds\r\n\t_limitOffset: function (offset, bounds) {\r\n\t\tif (!bounds) { return offset; }\r\n\r\n\t\tvar viewBounds = this.getPixelBounds(),\r\n\t\t    newBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));\r\n\r\n\t\treturn offset.add(this._getBoundsOffset(newBounds, bounds));\r\n\t},\r\n\r\n\t// returns offset needed for pxBounds to get inside maxBounds at a specified zoom\r\n\t_getBoundsOffset: function (pxBounds, maxBounds, zoom) {\r\n\t\tvar projectedMaxBounds = toBounds(\r\n\t\t        this.project(maxBounds.getNorthEast(), zoom),\r\n\t\t        this.project(maxBounds.getSouthWest(), zoom)\r\n\t\t    ),\r\n\t\t    minOffset = projectedMaxBounds.min.subtract(pxBounds.min),\r\n\t\t    maxOffset = projectedMaxBounds.max.subtract(pxBounds.max),\r\n\r\n\t\t    dx = this._rebound(minOffset.x, -maxOffset.x),\r\n\t\t    dy = this._rebound(minOffset.y, -maxOffset.y);\r\n\r\n\t\treturn new Point(dx, dy);\r\n\t},\r\n\r\n\t_rebound: function (left, right) {\r\n\t\treturn left + right > 0 ?\r\n\t\t\tMath.round(left - right) / 2 :\r\n\t\t\tMath.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));\r\n\t},\r\n\r\n\t_limitZoom: function (zoom) {\r\n\t\tvar min = this.getMinZoom(),\r\n\t\t    max = this.getMaxZoom(),\r\n\t\t    snap = Browser.any3d ? this.options.zoomSnap : 1;\r\n\t\tif (snap) {\r\n\t\t\tzoom = Math.round(zoom / snap) * snap;\r\n\t\t}\r\n\t\treturn Math.max(min, Math.min(max, zoom));\r\n\t},\r\n\r\n\t_onPanTransitionStep: function () {\r\n\t\tthis.fire('move');\r\n\t},\r\n\r\n\t_onPanTransitionEnd: function () {\r\n\t\tDomUtil.removeClass(this._mapPane, 'leaflet-pan-anim');\r\n\t\tthis.fire('moveend');\r\n\t},\r\n\r\n\t_tryAnimatedPan: function (center, options) {\r\n\t\t// difference between the new and current centers in pixels\r\n\t\tvar offset = this._getCenterOffset(center)._trunc();\r\n\r\n\t\t// don't animate too far unless animate: true specified in options\r\n\t\tif ((options && options.animate) !== true && !this.getSize().contains(offset)) { return false; }\r\n\r\n\t\tthis.panBy(offset, options);\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t_createAnimProxy: function () {\r\n\r\n\t\tvar proxy = this._proxy = DomUtil.create('div', 'leaflet-proxy leaflet-zoom-animated');\r\n\t\tthis._panes.mapPane.appendChild(proxy);\r\n\r\n\t\tthis.on('zoomanim', function (e) {\r\n\t\t\tvar prop = DomUtil.TRANSFORM,\r\n\t\t\t    transform = this._proxy.style[prop];\r\n\r\n\t\t\tDomUtil.setTransform(this._proxy, this.project(e.center, e.zoom), this.getZoomScale(e.zoom, 1));\r\n\r\n\t\t\t// workaround for case when transform is the same and so transitionend event is not fired\r\n\t\t\tif (transform === this._proxy.style[prop] && this._animatingZoom) {\r\n\t\t\t\tthis._onZoomTransitionEnd();\r\n\t\t\t}\r\n\t\t}, this);\r\n\r\n\t\tthis.on('load moveend', this._animMoveEnd, this);\r\n\r\n\t\tthis._on('unload', this._destroyAnimProxy, this);\r\n\t},\r\n\r\n\t_destroyAnimProxy: function () {\r\n\t\tDomUtil.remove(this._proxy);\r\n\t\tthis.off('load moveend', this._animMoveEnd, this);\r\n\t\tdelete this._proxy;\r\n\t},\r\n\r\n\t_animMoveEnd: function () {\r\n\t\tvar c = this.getCenter(),\r\n\t\t    z = this.getZoom();\r\n\t\tDomUtil.setTransform(this._proxy, this.project(c, z), this.getZoomScale(z, 1));\r\n\t},\r\n\r\n\t_catchTransitionEnd: function (e) {\r\n\t\tif (this._animatingZoom && e.propertyName.indexOf('transform') >= 0) {\r\n\t\t\tthis._onZoomTransitionEnd();\r\n\t\t}\r\n\t},\r\n\r\n\t_nothingToAnimate: function () {\r\n\t\treturn !this._container.getElementsByClassName('leaflet-zoom-animated').length;\r\n\t},\r\n\r\n\t_tryAnimatedZoom: function (center, zoom, options) {\r\n\r\n\t\tif (this._animatingZoom) { return true; }\r\n\r\n\t\toptions = options || {};\r\n\r\n\t\t// don't animate if disabled, not supported or zoom difference is too large\r\n\t\tif (!this._zoomAnimated || options.animate === false || this._nothingToAnimate() ||\r\n\t\t        Math.abs(zoom - this._zoom) > this.options.zoomAnimationThreshold) { return false; }\r\n\r\n\t\t// offset is the pixel coords of the zoom origin relative to the current center\r\n\t\tvar scale = this.getZoomScale(zoom),\r\n\t\t    offset = this._getCenterOffset(center)._divideBy(1 - 1 / scale);\r\n\r\n\t\t// don't animate if the zoom origin isn't within one screen from the current center, unless forced\r\n\t\tif (options.animate !== true && !this.getSize().contains(offset)) { return false; }\r\n\r\n\t\tUtil.requestAnimFrame(function () {\r\n\t\t\tthis\r\n\t\t\t    ._moveStart(true, options.noMoveStart || false)\r\n\t\t\t    ._animateZoom(center, zoom, true);\r\n\t\t}, this);\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t_animateZoom: function (center, zoom, startAnim, noUpdate) {\r\n\t\tif (!this._mapPane) { return; }\r\n\r\n\t\tif (startAnim) {\r\n\t\t\tthis._animatingZoom = true;\r\n\r\n\t\t\t// remember what center/zoom to set after animation\r\n\t\t\tthis._animateToCenter = center;\r\n\t\t\tthis._animateToZoom = zoom;\r\n\r\n\t\t\tDomUtil.addClass(this._mapPane, 'leaflet-zoom-anim');\r\n\t\t}\r\n\r\n\t\t// @section Other Events\r\n\t\t// @event zoomanim: ZoomAnimEvent\r\n\t\t// Fired at least once per zoom animation. For continuous zoom, like pinch zooming, fired once per frame during zoom.\r\n\t\tthis.fire('zoomanim', {\r\n\t\t\tcenter: center,\r\n\t\t\tzoom: zoom,\r\n\t\t\tnoUpdate: noUpdate\r\n\t\t});\r\n\r\n\t\tif (!this._tempFireZoomEvent) {\r\n\t\t\tthis._tempFireZoomEvent = this._zoom !== this._animateToZoom;\r\n\t\t}\r\n\r\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\r\n\r\n\t\t// Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693\r\n\t\tsetTimeout(Util.bind(this._onZoomTransitionEnd, this), 250);\r\n\t},\r\n\r\n\t_onZoomTransitionEnd: function () {\r\n\t\tif (!this._animatingZoom) { return; }\r\n\r\n\t\tif (this._mapPane) {\r\n\t\t\tDomUtil.removeClass(this._mapPane, 'leaflet-zoom-anim');\r\n\t\t}\r\n\r\n\t\tthis._animatingZoom = false;\r\n\r\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\r\n\r\n\t\tif (this._tempFireZoomEvent) {\r\n\t\t\tthis.fire('zoom');\r\n\t\t}\r\n\t\tdelete this._tempFireZoomEvent;\r\n\r\n\t\tthis.fire('move');\r\n\r\n\t\tthis._moveEnd(true);\r\n\t}\r\n});\r\n\r\n// @section\r\n\r\n// @factory L.map(id: String, options?: Map options)\r\n// Instantiates a map object given the DOM ID of a `<div>` element\r\n// and optionally an object literal with `Map options`.\r\n//\r\n// @alternative\r\n// @factory L.map(el: HTMLElement, options?: Map options)\r\n// Instantiates a map object given an instance of a `<div>` HTML element\r\n// and optionally an object literal with `Map options`.\r\nexport function createMap(id, options) {\r\n\treturn new Map(id, options);\r\n}\r\n", "\r\nimport {Class} from '../core/Class';\r\nimport {Map} from '../map/Map';\r\nimport * as Util from '../core/Util';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class Control\r\n * @aka L.Control\r\n * @inherits Class\r\n *\r\n * L.Control is a base class for implementing map controls. Handles positioning.\r\n * All other controls extend from this class.\r\n */\r\n\r\nexport var Control = Class.extend({\r\n\t// @section\r\n\t// @aka Control Options\r\n\toptions: {\r\n\t\t// @option position: String = 'topright'\r\n\t\t// The position of the control (one of the map corners). Possible values are `'topleft'`,\r\n\t\t// `'topright'`, `'bottomleft'` or `'bottomright'`\r\n\t\tposition: 'topright'\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tUtil.setOptions(this, options);\r\n\t},\r\n\r\n\t/* @section\r\n\t * Classes extending L.Control will inherit the following methods:\r\n\t *\r\n\t * @method getPosition: string\r\n\t * Returns the position of the control.\r\n\t */\r\n\tgetPosition: function () {\r\n\t\treturn this.options.position;\r\n\t},\r\n\r\n\t// @method setPosition(position: string): this\r\n\t// Sets the position of the control.\r\n\tsetPosition: function (position) {\r\n\t\tvar map = this._map;\r\n\r\n\t\tif (map) {\r\n\t\t\tmap.removeControl(this);\r\n\t\t}\r\n\r\n\t\tthis.options.position = position;\r\n\r\n\t\tif (map) {\r\n\t\t\tmap.addControl(this);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getContainer: HTMLElement\r\n\t// Returns the HTMLElement that contains the control.\r\n\tgetContainer: function () {\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\t// @method addTo(map: Map): this\r\n\t// Adds the control to the given map.\r\n\taddTo: function (map) {\r\n\t\tthis.remove();\r\n\t\tthis._map = map;\r\n\r\n\t\tvar container = this._container = this.onAdd(map),\r\n\t\t    pos = this.getPosition(),\r\n\t\t    corner = map._controlCorners[pos];\r\n\r\n\t\tDomUtil.addClass(container, 'leaflet-control');\r\n\r\n\t\tif (pos.indexOf('bottom') !== -1) {\r\n\t\t\tcorner.insertBefore(container, corner.firstChild);\r\n\t\t} else {\r\n\t\t\tcorner.appendChild(container);\r\n\t\t}\r\n\r\n\t\tthis._map.on('unload', this.remove, this);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method remove: this\r\n\t// Removes the control from the map it is currently active on.\r\n\tremove: function () {\r\n\t\tif (!this._map) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tDomUtil.remove(this._container);\r\n\r\n\t\tif (this.onRemove) {\r\n\t\t\tthis.onRemove(this._map);\r\n\t\t}\r\n\r\n\t\tthis._map.off('unload', this.remove, this);\r\n\t\tthis._map = null;\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_refocusOnMap: function (e) {\r\n\t\t// if map exists and event is not a keyboard event\r\n\t\tif (this._map && e && e.screenX > 0 && e.screenY > 0) {\r\n\t\t\tthis._map.getContainer().focus();\r\n\t\t}\r\n\t}\r\n});\r\n\r\nexport var control = function (options) {\r\n\treturn new Control(options);\r\n};\r\n\r\n/* @section Extension methods\r\n * @uninheritable\r\n *\r\n * Every control should extend from `L.Control` and (re-)implement the following methods.\r\n *\r\n * @method onAdd(map: Map): HTMLElement\r\n * Should return the container DOM element for the control and add listeners on relevant map events. Called on [`control.addTo(map)`](#control-addTo).\r\n *\r\n * @method onRemove(map: Map)\r\n * Optional method. Should contain all clean up code that removes the listeners previously added in [`onAdd`](#control-onadd). Called on [`control.remove()`](#control-remove).\r\n */\r\n\r\n/* @namespace Map\r\n * @section Methods for Layers and Controls\r\n */\r\nMap.include({\r\n\t// @method addControl(control: Control): this\r\n\t// Adds the given control to the map\r\n\taddControl: function (control) {\r\n\t\tcontrol.addTo(this);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeControl(control: Control): this\r\n\t// Removes the given control from the map\r\n\tremoveControl: function (control) {\r\n\t\tcontrol.remove();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_initControlPos: function () {\r\n\t\tvar corners = this._controlCorners = {},\r\n\t\t    l = 'leaflet-',\r\n\t\t    container = this._controlContainer =\r\n\t\t            DomUtil.create('div', l + 'control-container', this._container);\r\n\r\n\t\tfunction createCorner(vSide, hSide) {\r\n\t\t\tvar className = l + vSide + ' ' + l + hSide;\r\n\r\n\t\t\tcorners[vSide + hSide] = DomUtil.create('div', className, container);\r\n\t\t}\r\n\r\n\t\tcreateCorner('top', 'left');\r\n\t\tcreateCorner('top', 'right');\r\n\t\tcreateCorner('bottom', 'left');\r\n\t\tcreateCorner('bottom', 'right');\r\n\t},\r\n\r\n\t_clearControlPos: function () {\r\n\t\tfor (var i in this._controlCorners) {\r\n\t\t\tDomUtil.remove(this._controlCorners[i]);\r\n\t\t}\r\n\t\tDomUtil.remove(this._controlContainer);\r\n\t\tdelete this._controlCorners;\r\n\t\tdelete this._controlContainer;\r\n\t}\r\n});\r\n", "\r\nimport {Control} from './Control';\r\nimport * as Util from '../core/Util';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class Control.Layers\r\n * @aka L.Control.Layers\r\n * @inherits Control\r\n *\r\n * The layers control gives users the ability to switch between different base layers and switch overlays on/off (check out the [detailed example](https://leafletjs.com/examples/layers-control/)). Extends `Control`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var baseLayers = {\r\n * \t\"Mapbox\": mapbox,\r\n * \t\"OpenStreetMap\": osm\r\n * };\r\n *\r\n * var overlays = {\r\n * \t\"Marker\": marker,\r\n * \t\"Roads\": roadsLayer\r\n * };\r\n *\r\n * L.control.layers(baseLayers, overlays).addTo(map);\r\n * ```\r\n *\r\n * The `baseLayers` and `overlays` parameters are object literals with layer names as keys and `Layer` objects as values:\r\n *\r\n * ```js\r\n * {\r\n *     \"<someName1>\": layer1,\r\n *     \"<someName2>\": layer2\r\n * }\r\n * ```\r\n *\r\n * The layer names can contain HTML, which allows you to add additional styling to the items:\r\n *\r\n * ```js\r\n * {\"<img src='my-layer-icon' /> <span class='my-layer-item'>My Layer</span>\": myLayer}\r\n * ```\r\n */\r\n\r\nexport var Layers = Control.extend({\r\n\t// @section\r\n\t// @aka Control.Layers options\r\n\toptions: {\r\n\t\t// @option collapsed: Boolean = true\r\n\t\t// If `true`, the control will be collapsed into an icon and expanded on mouse hover, touch, or keyboard activation.\r\n\t\tcollapsed: true,\r\n\t\tposition: 'topright',\r\n\r\n\t\t// @option autoZIndex: Boolean = true\r\n\t\t// If `true`, the control will assign zIndexes in increasing order to all of its layers so that the order is preserved when switching them on/off.\r\n\t\tautoZIndex: true,\r\n\r\n\t\t// @option hideSingleBase: Boolean = false\r\n\t\t// If `true`, the base layers in the control will be hidden when there is only one.\r\n\t\thideSingleBase: false,\r\n\r\n\t\t// @option sortLayers: Boolean = false\r\n\t\t// Whether to sort the layers. When `false`, layers will keep the order\r\n\t\t// in which they were added to the control.\r\n\t\tsortLayers: false,\r\n\r\n\t\t// @option sortFunction: Function = *\r\n\t\t// A [compare function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)\r\n\t\t// that will be used for sorting the layers, when `sortLayers` is `true`.\r\n\t\t// The function receives both the `L.Layer` instances and their names, as in\r\n\t\t// `sortFunction(layerA, layerB, nameA, nameB)`.\r\n\t\t// By default, it sorts layers alphabetically by their name.\r\n\t\tsortFunction: function (layerA, layerB, nameA, nameB) {\r\n\t\t\treturn nameA < nameB ? -1 : (nameB < nameA ? 1 : 0);\r\n\t\t}\r\n\t},\r\n\r\n\tinitialize: function (baseLayers, overlays, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._layerControlInputs = [];\r\n\t\tthis._layers = [];\r\n\t\tthis._lastZIndex = 0;\r\n\t\tthis._handlingClick = false;\r\n\t\tthis._preventClick = false;\r\n\r\n\t\tfor (var i in baseLayers) {\r\n\t\t\tthis._addLayer(baseLayers[i], i);\r\n\t\t}\r\n\r\n\t\tfor (i in overlays) {\r\n\t\t\tthis._addLayer(overlays[i], i, true);\r\n\t\t}\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis._initLayout();\r\n\t\tthis._update();\r\n\r\n\t\tthis._map = map;\r\n\t\tmap.on('zoomend', this._checkDisabledLayers, this);\r\n\r\n\t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\t\t\tthis._layers[i].layer.on('add remove', this._onLayerChange, this);\r\n\t\t}\r\n\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\taddTo: function (map) {\r\n\t\tControl.prototype.addTo.call(this, map);\r\n\t\t// Trigger expand after Layers Control has been inserted into DOM so that is now has an actual height.\r\n\t\treturn this._expandIfNotCollapsed();\r\n\t},\r\n\r\n\tonRemove: function () {\r\n\t\tthis._map.off('zoomend', this._checkDisabledLayers, this);\r\n\r\n\t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\t\t\tthis._layers[i].layer.off('add remove', this._onLayerChange, this);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method addBaseLayer(layer: Layer, name: String): this\r\n\t// Adds a base layer (radio button entry) with the given name to the control.\r\n\taddBaseLayer: function (layer, name) {\r\n\t\tthis._addLayer(layer, name);\r\n\t\treturn (this._map) ? this._update() : this;\r\n\t},\r\n\r\n\t// @method addOverlay(layer: Layer, name: String): this\r\n\t// Adds an overlay (checkbox entry) with the given name to the control.\r\n\taddOverlay: function (layer, name) {\r\n\t\tthis._addLayer(layer, name, true);\r\n\t\treturn (this._map) ? this._update() : this;\r\n\t},\r\n\r\n\t// @method removeLayer(layer: Layer): this\r\n\t// Remove the given layer from the control.\r\n\tremoveLayer: function (layer) {\r\n\t\tlayer.off('add remove', this._onLayerChange, this);\r\n\r\n\t\tvar obj = this._getLayer(Util.stamp(layer));\r\n\t\tif (obj) {\r\n\t\t\tthis._layers.splice(this._layers.indexOf(obj), 1);\r\n\t\t}\r\n\t\treturn (this._map) ? this._update() : this;\r\n\t},\r\n\r\n\t// @method expand(): this\r\n\t// Expand the control container if collapsed.\r\n\texpand: function () {\r\n\t\tDomUtil.addClass(this._container, 'leaflet-control-layers-expanded');\r\n\t\tthis._section.style.height = null;\r\n\t\tvar acceptableHeight = this._map.getSize().y - (this._container.offsetTop + 50);\r\n\t\tif (acceptableHeight < this._section.clientHeight) {\r\n\t\t\tDomUtil.addClass(this._section, 'leaflet-control-layers-scrollbar');\r\n\t\t\tthis._section.style.height = acceptableHeight + 'px';\r\n\t\t} else {\r\n\t\t\tDomUtil.removeClass(this._section, 'leaflet-control-layers-scrollbar');\r\n\t\t}\r\n\t\tthis._checkDisabledLayers();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method collapse(): this\r\n\t// Collapse the control container if expanded.\r\n\tcollapse: function () {\r\n\t\tDomUtil.removeClass(this._container, 'leaflet-control-layers-expanded');\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_initLayout: function () {\r\n\t\tvar className = 'leaflet-control-layers',\r\n\t\t    container = this._container = DomUtil.create('div', className),\r\n\t\t    collapsed = this.options.collapsed;\r\n\r\n\t\t// makes this work on IE touch devices by stopping it from firing a mouseout event when the touch is released\r\n\t\tcontainer.setAttribute('aria-haspopup', true);\r\n\r\n\t\tDomEvent.disableClickPropagation(container);\r\n\t\tDomEvent.disableScrollPropagation(container);\r\n\r\n\t\tvar section = this._section = DomUtil.create('section', className + '-list');\r\n\r\n\t\tif (collapsed) {\r\n\t\t\tthis._map.on('click', this.collapse, this);\r\n\r\n\t\t\tDomEvent.on(container, {\r\n\t\t\t\tmouseenter: this._expandSafely,\r\n\t\t\t\tmouseleave: this.collapse\r\n\t\t\t}, this);\r\n\t\t}\r\n\r\n\t\tvar link = this._layersLink = DomUtil.create('a', className + '-toggle', container);\r\n\t\tlink.href = '#';\r\n\t\tlink.title = 'Layers';\r\n\t\tlink.setAttribute('role', 'button');\r\n\r\n\t\tDomEvent.on(link, {\r\n\t\t\tkeydown: function (e) {\r\n\t\t\t\tif (e.keyCode === 13) {\r\n\t\t\t\t\tthis._expandSafely();\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\t// Certain screen readers intercept the key event and instead send a click event\r\n\t\t\tclick: function (e) {\r\n\t\t\t\tDomEvent.preventDefault(e);\r\n\t\t\t\tthis._expandSafely();\r\n\t\t\t}\r\n\t\t}, this);\r\n\r\n\t\tif (!collapsed) {\r\n\t\t\tthis.expand();\r\n\t\t}\r\n\r\n\t\tthis._baseLayersList = DomUtil.create('div', className + '-base', section);\r\n\t\tthis._separator = DomUtil.create('div', className + '-separator', section);\r\n\t\tthis._overlaysList = DomUtil.create('div', className + '-overlays', section);\r\n\r\n\t\tcontainer.appendChild(section);\r\n\t},\r\n\r\n\t_getLayer: function (id) {\r\n\t\tfor (var i = 0; i < this._layers.length; i++) {\r\n\r\n\t\t\tif (this._layers[i] && Util.stamp(this._layers[i].layer) === id) {\r\n\t\t\t\treturn this._layers[i];\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_addLayer: function (layer, name, overlay) {\r\n\t\tif (this._map) {\r\n\t\t\tlayer.on('add remove', this._onLayerChange, this);\r\n\t\t}\r\n\r\n\t\tthis._layers.push({\r\n\t\t\tlayer: layer,\r\n\t\t\tname: name,\r\n\t\t\toverlay: overlay\r\n\t\t});\r\n\r\n\t\tif (this.options.sortLayers) {\r\n\t\t\tthis._layers.sort(Util.bind(function (a, b) {\r\n\t\t\t\treturn this.options.sortFunction(a.layer, b.layer, a.name, b.name);\r\n\t\t\t}, this));\r\n\t\t}\r\n\r\n\t\tif (this.options.autoZIndex && layer.setZIndex) {\r\n\t\t\tthis._lastZIndex++;\r\n\t\t\tlayer.setZIndex(this._lastZIndex);\r\n\t\t}\r\n\r\n\t\tthis._expandIfNotCollapsed();\r\n\t},\r\n\r\n\t_update: function () {\r\n\t\tif (!this._container) { return this; }\r\n\r\n\t\tDomUtil.empty(this._baseLayersList);\r\n\t\tDomUtil.empty(this._overlaysList);\r\n\r\n\t\tthis._layerControlInputs = [];\r\n\t\tvar baseLayersPresent, overlaysPresent, i, obj, baseLayersCount = 0;\r\n\r\n\t\tfor (i = 0; i < this._layers.length; i++) {\r\n\t\t\tobj = this._layers[i];\r\n\t\t\tthis._addItem(obj);\r\n\t\t\toverlaysPresent = overlaysPresent || obj.overlay;\r\n\t\t\tbaseLayersPresent = baseLayersPresent || !obj.overlay;\r\n\t\t\tbaseLayersCount += !obj.overlay ? 1 : 0;\r\n\t\t}\r\n\r\n\t\t// Hide base layers section if there's only one layer.\r\n\t\tif (this.options.hideSingleBase) {\r\n\t\t\tbaseLayersPresent = baseLayersPresent && baseLayersCount > 1;\r\n\t\t\tthis._baseLayersList.style.display = baseLayersPresent ? '' : 'none';\r\n\t\t}\r\n\r\n\t\tthis._separator.style.display = overlaysPresent && baseLayersPresent ? '' : 'none';\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_onLayerChange: function (e) {\r\n\t\tif (!this._handlingClick) {\r\n\t\t\tthis._update();\r\n\t\t}\r\n\r\n\t\tvar obj = this._getLayer(Util.stamp(e.target));\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Layer events\r\n\t\t// @event baselayerchange: LayersControlEvent\r\n\t\t// Fired when the base layer is changed through the [layers control](#control-layers).\r\n\t\t// @event overlayadd: LayersControlEvent\r\n\t\t// Fired when an overlay is selected through the [layers control](#control-layers).\r\n\t\t// @event overlayremove: LayersControlEvent\r\n\t\t// Fired when an overlay is deselected through the [layers control](#control-layers).\r\n\t\t// @namespace Control.Layers\r\n\t\tvar type = obj.overlay ?\r\n\t\t\t(e.type === 'add' ? 'overlayadd' : 'overlayremove') :\r\n\t\t\t(e.type === 'add' ? 'baselayerchange' : null);\r\n\r\n\t\tif (type) {\r\n\t\t\tthis._map.fire(type, obj);\r\n\t\t}\r\n\t},\r\n\r\n\t// IE7 bugs out if you create a radio dynamically, so you have to do it this hacky way (see https://stackoverflow.com/a/119079)\r\n\t_createRadioElement: function (name, checked) {\r\n\r\n\t\tvar radioHtml = '<input type=\"radio\" class=\"leaflet-control-layers-selector\" name=\"' +\r\n\t\t\t\tname + '\"' + (checked ? ' checked=\"checked\"' : '') + '/>';\r\n\r\n\t\tvar radioFragment = document.createElement('div');\r\n\t\tradioFragment.innerHTML = radioHtml;\r\n\r\n\t\treturn radioFragment.firstChild;\r\n\t},\r\n\r\n\t_addItem: function (obj) {\r\n\t\tvar label = document.createElement('label'),\r\n\t\t    checked = this._map.hasLayer(obj.layer),\r\n\t\t    input;\r\n\r\n\t\tif (obj.overlay) {\r\n\t\t\tinput = document.createElement('input');\r\n\t\t\tinput.type = 'checkbox';\r\n\t\t\tinput.className = 'leaflet-control-layers-selector';\r\n\t\t\tinput.defaultChecked = checked;\r\n\t\t} else {\r\n\t\t\tinput = this._createRadioElement('leaflet-base-layers_' + Util.stamp(this), checked);\r\n\t\t}\r\n\r\n\t\tthis._layerControlInputs.push(input);\r\n\t\tinput.layerId = Util.stamp(obj.layer);\r\n\r\n\t\tDomEvent.on(input, 'click', this._onInputClick, this);\r\n\r\n\t\tvar name = document.createElement('span');\r\n\t\tname.innerHTML = ' ' + obj.name;\r\n\r\n\t\t// Helps from preventing layer control flicker when checkboxes are disabled\r\n\t\t// https://github.com/Leaflet/Leaflet/issues/2771\r\n\t\tvar holder = document.createElement('span');\r\n\r\n\t\tlabel.appendChild(holder);\r\n\t\tholder.appendChild(input);\r\n\t\tholder.appendChild(name);\r\n\r\n\t\tvar container = obj.overlay ? this._overlaysList : this._baseLayersList;\r\n\t\tcontainer.appendChild(label);\r\n\r\n\t\tthis._checkDisabledLayers();\r\n\t\treturn label;\r\n\t},\r\n\r\n\t_onInputClick: function () {\r\n\t\t// expanding the control on mobile with a click can cause adding a layer - we don't want this\r\n\t\tif (this._preventClick) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar inputs = this._layerControlInputs,\r\n\t\t    input, layer;\r\n\t\tvar addedLayers = [],\r\n\t\t    removedLayers = [];\r\n\r\n\t\tthis._handlingClick = true;\r\n\r\n\t\tfor (var i = inputs.length - 1; i >= 0; i--) {\r\n\t\t\tinput = inputs[i];\r\n\t\t\tlayer = this._getLayer(input.layerId).layer;\r\n\r\n\t\t\tif (input.checked) {\r\n\t\t\t\taddedLayers.push(layer);\r\n\t\t\t} else if (!input.checked) {\r\n\t\t\t\tremovedLayers.push(layer);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Bugfix issue 2318: Should remove all old layers before readding new ones\r\n\t\tfor (i = 0; i < removedLayers.length; i++) {\r\n\t\t\tif (this._map.hasLayer(removedLayers[i])) {\r\n\t\t\t\tthis._map.removeLayer(removedLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (i = 0; i < addedLayers.length; i++) {\r\n\t\t\tif (!this._map.hasLayer(addedLayers[i])) {\r\n\t\t\t\tthis._map.addLayer(addedLayers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._handlingClick = false;\r\n\r\n\t\tthis._refocusOnMap();\r\n\t},\r\n\r\n\t_checkDisabledLayers: function () {\r\n\t\tvar inputs = this._layerControlInputs,\r\n\t\t    input,\r\n\t\t    layer,\r\n\t\t    zoom = this._map.getZoom();\r\n\r\n\t\tfor (var i = inputs.length - 1; i >= 0; i--) {\r\n\t\t\tinput = inputs[i];\r\n\t\t\tlayer = this._getLayer(input.layerId).layer;\r\n\t\t\tinput.disabled = (layer.options.minZoom !== undefined && zoom < layer.options.minZoom) ||\r\n\t\t\t                 (layer.options.maxZoom !== undefined && zoom > layer.options.maxZoom);\r\n\r\n\t\t}\r\n\t},\r\n\r\n\t_expandIfNotCollapsed: function () {\r\n\t\tif (this._map && !this.options.collapsed) {\r\n\t\t\tthis.expand();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_expandSafely: function () {\r\n\t\tvar section = this._section;\r\n\t\tthis._preventClick = true;\r\n\t\tDomEvent.on(section, 'click', DomEvent.preventDefault);\r\n\t\tthis.expand();\r\n\t\tvar that = this;\r\n\t\tsetTimeout(function () {\r\n\t\t\tDomEvent.off(section, 'click', DomEvent.preventDefault);\r\n\t\t\tthat._preventClick = false;\r\n\t\t});\r\n\t}\r\n\r\n});\r\n\r\n\r\n// @factory L.control.layers(baselayers?: Object, overlays?: Object, options?: Control.Layers options)\r\n// Creates a layers control with the given layers. Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.\r\nexport var layers = function (baseLayers, overlays, options) {\r\n\treturn new Layers(baseLayers, overlays, options);\r\n};\r\n", "\r\nimport {Control} from './Control';\r\nimport {Map} from '../map/Map';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport * as DomEvent from '../dom/DomEvent';\r\n\r\n/*\r\n * @class Control.Zoom\r\n * @aka L.Control.Zoom\r\n * @inherits Control\r\n *\r\n * A basic zoom control with two buttons (zoom in and zoom out). It is put on the map by default unless you set its [`zoomControl` option](#map-zoomcontrol) to `false`. Extends `Control`.\r\n */\r\n\r\nexport var Zoom = Control.extend({\r\n\t// @section\r\n\t// @aka Control.Zoom options\r\n\toptions: {\r\n\t\tposition: 'topleft',\r\n\r\n\t\t// @option zoomInText: String = '<span aria-hidden=\"true\">+</span>'\r\n\t\t// The text set on the 'zoom in' button.\r\n\t\tzoomInText: '<span aria-hidden=\"true\">+</span>',\r\n\r\n\t\t// @option zoomInTitle: String = 'Zoom in'\r\n\t\t// The title set on the 'zoom in' button.\r\n\t\tzoomInTitle: 'Zoom in',\r\n\r\n\t\t// @option zoomOutText: String = '<span aria-hidden=\"true\">&#x2212;</span>'\r\n\t\t// The text set on the 'zoom out' button.\r\n\t\tzoomOutText: '<span aria-hidden=\"true\">&#x2212;</span>',\r\n\r\n\t\t// @option zoomOutTitle: String = 'Zoom out'\r\n\t\t// The title set on the 'zoom out' button.\r\n\t\tzoomOutTitle: 'Zoom out'\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tvar zoomName = 'leaflet-control-zoom',\r\n\t\t    container = DomUtil.create('div', zoomName + ' leaflet-bar'),\r\n\t\t    options = this.options;\r\n\r\n\t\tthis._zoomInButton  = this._createButton(options.zoomInText, options.zoomInTitle,\r\n\t\t        zoomName + '-in',  container, this._zoomIn);\r\n\t\tthis._zoomOutButton = this._createButton(options.zoomOutText, options.zoomOutTitle,\r\n\t\t        zoomName + '-out', container, this._zoomOut);\r\n\r\n\t\tthis._updateDisabled();\r\n\t\tmap.on('zoomend zoomlevelschange', this._updateDisabled, this);\r\n\r\n\t\treturn container;\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tmap.off('zoomend zoomlevelschange', this._updateDisabled, this);\r\n\t},\r\n\r\n\tdisable: function () {\r\n\t\tthis._disabled = true;\r\n\t\tthis._updateDisabled();\r\n\t\treturn this;\r\n\t},\r\n\r\n\tenable: function () {\r\n\t\tthis._disabled = false;\r\n\t\tthis._updateDisabled();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_zoomIn: function (e) {\r\n\t\tif (!this._disabled && this._map._zoom < this._map.getMaxZoom()) {\r\n\t\t\tthis._map.zoomIn(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r\n\t\t}\r\n\t},\r\n\r\n\t_zoomOut: function (e) {\r\n\t\tif (!this._disabled && this._map._zoom > this._map.getMinZoom()) {\r\n\t\t\tthis._map.zoomOut(this._map.options.zoomDelta * (e.shiftKey ? 3 : 1));\r\n\t\t}\r\n\t},\r\n\r\n\t_createButton: function (html, title, className, container, fn) {\r\n\t\tvar link = DomUtil.create('a', className, container);\r\n\t\tlink.innerHTML = html;\r\n\t\tlink.href = '#';\r\n\t\tlink.title = title;\r\n\r\n\t\t/*\r\n\t\t * Will force screen readers like VoiceOver to read this as \"Zoom in - button\"\r\n\t\t */\r\n\t\tlink.setAttribute('role', 'button');\r\n\t\tlink.setAttribute('aria-label', title);\r\n\r\n\t\tDomEvent.disableClickPropagation(link);\r\n\t\tDomEvent.on(link, 'click', DomEvent.stop);\r\n\t\tDomEvent.on(link, 'click', fn, this);\r\n\t\tDomEvent.on(link, 'click', this._refocusOnMap, this);\r\n\r\n\t\treturn link;\r\n\t},\r\n\r\n\t_updateDisabled: function () {\r\n\t\tvar map = this._map,\r\n\t\t    className = 'leaflet-disabled';\r\n\r\n\t\tDomUtil.removeClass(this._zoomInButton, className);\r\n\t\tDomUtil.removeClass(this._zoomOutButton, className);\r\n\t\tthis._zoomInButton.setAttribute('aria-disabled', 'false');\r\n\t\tthis._zoomOutButton.setAttribute('aria-disabled', 'false');\r\n\r\n\t\tif (this._disabled || map._zoom === map.getMinZoom()) {\r\n\t\t\tDomUtil.addClass(this._zoomOutButton, className);\r\n\t\t\tthis._zoomOutButton.setAttribute('aria-disabled', 'true');\r\n\t\t}\r\n\t\tif (this._disabled || map._zoom === map.getMaxZoom()) {\r\n\t\t\tDomUtil.addClass(this._zoomInButton, className);\r\n\t\t\tthis._zoomInButton.setAttribute('aria-disabled', 'true');\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// @namespace Map\r\n// @section Control options\r\n// @option zoomControl: Boolean = true\r\n// Whether a [zoom control](#control-zoom) is added to the map by default.\r\nMap.mergeOptions({\r\n\tzoomControl: true\r\n});\r\n\r\nMap.addInitHook(function () {\r\n\tif (this.options.zoomControl) {\r\n\t\t// @section Controls\r\n\t\t// @property zoomControl: Control.Zoom\r\n\t\t// The default zoom control (only available if the\r\n\t\t// [`zoomControl` option](#map-zoomcontrol) was `true` when creating the map).\r\n\t\tthis.zoomControl = new Zoom();\r\n\t\tthis.addControl(this.zoomControl);\r\n\t}\r\n});\r\n\r\n// @namespace Control.Zoom\r\n// @factory L.control.zoom(options: Control.Zoom options)\r\n// Creates a zoom control\r\nexport var zoom = function (options) {\r\n\treturn new Zoom(options);\r\n};\r\n", "\nimport {Control} from './Control';\nimport * as DomUtil from '../dom/DomUtil';\n\n/*\n * @class Control.Scale\n * @aka L.Control.Scale\n * @inherits Control\n *\n * A simple scale control that shows the scale of the current center of screen in metric (m/km) and imperial (mi/ft) systems. Extends `Control`.\n *\n * @example\n *\n * ```js\n * L.control.scale().addTo(map);\n * ```\n */\n\nexport var Scale = Control.extend({\n\t// @section\n\t// @aka Control.Scale options\n\toptions: {\n\t\tposition: 'bottomleft',\n\n\t\t// @option maxWidth: Number = 100\n\t\t// Maximum width of the control in pixels. The width is set dynamically to show round values (e.g. 100, 200, 500).\n\t\tmaxWidth: 100,\n\n\t\t// @option metric: Boolean = True\n\t\t// Whether to show the metric scale line (m/km).\n\t\tmetric: true,\n\n\t\t// @option imperial: Boolean = True\n\t\t// Whether to show the imperial scale line (mi/ft).\n\t\timperial: true\n\n\t\t// @option updateWhenIdle: Boolean = false\n\t\t// If `true`, the control is updated on [`moveend`](#map-moveend), otherwise it's always up-to-date (updated on [`move`](#map-move)).\n\t},\n\n\tonAdd: function (map) {\n\t\tvar className = 'leaflet-control-scale',\n\t\t    container = DomUtil.create('div', className),\n\t\t    options = this.options;\n\n\t\tthis._addScales(options, className + '-line', container);\n\n\t\tmap.on(options.updateWhenIdle ? 'moveend' : 'move', this._update, this);\n\t\tmap.whenReady(this._update, this);\n\n\t\treturn container;\n\t},\n\n\tonRemove: function (map) {\n\t\tmap.off(this.options.updateWhenIdle ? 'moveend' : 'move', this._update, this);\n\t},\n\n\t_addScales: function (options, className, container) {\n\t\tif (options.metric) {\n\t\t\tthis._mScale = DomUtil.create('div', className, container);\n\t\t}\n\t\tif (options.imperial) {\n\t\t\tthis._iScale = DomUtil.create('div', className, container);\n\t\t}\n\t},\n\n\t_update: function () {\n\t\tvar map = this._map,\n\t\t    y = map.getSize().y / 2;\n\n\t\tvar maxMeters = map.distance(\n\t\t\tmap.containerPointToLatLng([0, y]),\n\t\t\tmap.containerPointToLatLng([this.options.maxWidth, y]));\n\n\t\tthis._updateScales(maxMeters);\n\t},\n\n\t_updateScales: function (maxMeters) {\n\t\tif (this.options.metric && maxMeters) {\n\t\t\tthis._updateMetric(maxMeters);\n\t\t}\n\t\tif (this.options.imperial && maxMeters) {\n\t\t\tthis._updateImperial(maxMeters);\n\t\t}\n\t},\n\n\t_updateMetric: function (maxMeters) {\n\t\tvar meters = this._getRoundNum(maxMeters),\n\t\t    label = meters < 1000 ? meters + ' m' : (meters / 1000) + ' km';\n\n\t\tthis._updateScale(this._mScale, label, meters / maxMeters);\n\t},\n\n\t_updateImperial: function (maxMeters) {\n\t\tvar maxFeet = maxMeters * 3.2808399,\n\t\t    maxMiles, miles, feet;\n\n\t\tif (maxFeet > 5280) {\n\t\t\tmaxMiles = maxFeet / 5280;\n\t\t\tmiles = this._getRoundNum(maxMiles);\n\t\t\tthis._updateScale(this._iScale, miles + ' mi', miles / maxMiles);\n\n\t\t} else {\n\t\t\tfeet = this._getRoundNum(maxFeet);\n\t\t\tthis._updateScale(this._iScale, feet + ' ft', feet / maxFeet);\n\t\t}\n\t},\n\n\t_updateScale: function (scale, text, ratio) {\n\t\tscale.style.width = Math.round(this.options.maxWidth * ratio) + 'px';\n\t\tscale.innerHTML = text;\n\t},\n\n\t_getRoundNum: function (num) {\n\t\tvar pow10 = Math.pow(10, (Math.floor(num) + '').length - 1),\n\t\t    d = num / pow10;\n\n\t\td = d >= 10 ? 10 :\n\t\t    d >= 5 ? 5 :\n\t\t    d >= 3 ? 3 :\n\t\t    d >= 2 ? 2 : 1;\n\n\t\treturn pow10 * d;\n\t}\n});\n\n\n// @factory L.control.scale(options?: Control.Scale options)\n// Creates an scale control with the given options.\nexport var scale = function (options) {\n\treturn new Scale(options);\n};\n", "\r\nimport {Control} from './Control';\r\nimport {Map} from '../map/Map';\r\nimport * as Util from '../core/Util';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport Browser from '../core/Browser';\r\n\r\nvar ukrainianFlag = '<svg aria-hidden=\"true\" xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"8\" viewBox=\"0 0 12 8\" class=\"leaflet-attribution-flag\"><path fill=\"#4C7BE1\" d=\"M0 0h12v4H0z\"/><path fill=\"#FFD500\" d=\"M0 4h12v3H0z\"/><path fill=\"#E0BC00\" d=\"M0 7h12v1H0z\"/></svg>';\r\n\r\n\r\n/*\r\n * @class Control.Attribution\r\n * @aka L.Control.Attribution\r\n * @inherits Control\r\n *\r\n * The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its [`attributionControl` option](#map-attributioncontrol) to `false`, and it fetches attribution texts from layers with the [`getAttribution` method](#layer-getattribution) automatically. Extends Control.\r\n */\r\n\r\nexport var Attribution = Control.extend({\r\n\t// @section\r\n\t// @aka Control.Attribution options\r\n\toptions: {\r\n\t\tposition: 'bottomright',\r\n\r\n\t\t// @option prefix: String|false = 'Leaflet'\r\n\t\t// The HTML text shown before the attributions. Pass `false` to disable.\r\n\t\tprefix: '<a href=\"https://leafletjs.com\" title=\"A JavaScript library for interactive maps\">' + (Browser.inlineSvg ? ukrainianFlag + ' ' : '') + 'Leaflet</a>'\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._attributions = {};\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tmap.attributionControl = this;\r\n\t\tthis._container = DomUtil.create('div', 'leaflet-control-attribution');\r\n\t\tDomEvent.disableClickPropagation(this._container);\r\n\r\n\t\t// TODO ugly, refactor\r\n\t\tfor (var i in map._layers) {\r\n\t\t\tif (map._layers[i].getAttribution) {\r\n\t\t\t\tthis.addAttribution(map._layers[i].getAttribution());\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis._update();\r\n\r\n\t\tmap.on('layeradd', this._addAttribution, this);\r\n\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tmap.off('layeradd', this._addAttribution, this);\r\n\t},\r\n\r\n\t_addAttribution: function (ev) {\r\n\t\tif (ev.layer.getAttribution) {\r\n\t\t\tthis.addAttribution(ev.layer.getAttribution());\r\n\t\t\tev.layer.once('remove', function () {\r\n\t\t\t\tthis.removeAttribution(ev.layer.getAttribution());\r\n\t\t\t}, this);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method setPrefix(prefix: String|false): this\r\n\t// The HTML text shown before the attributions. Pass `false` to disable.\r\n\tsetPrefix: function (prefix) {\r\n\t\tthis.options.prefix = prefix;\r\n\t\tthis._update();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method addAttribution(text: String): this\r\n\t// Adds an attribution text (e.g. `'&copy; OpenStreetMap contributors'`).\r\n\taddAttribution: function (text) {\r\n\t\tif (!text) { return this; }\r\n\r\n\t\tif (!this._attributions[text]) {\r\n\t\t\tthis._attributions[text] = 0;\r\n\t\t}\r\n\t\tthis._attributions[text]++;\r\n\r\n\t\tthis._update();\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeAttribution(text: String): this\r\n\t// Removes an attribution text.\r\n\tremoveAttribution: function (text) {\r\n\t\tif (!text) { return this; }\r\n\r\n\t\tif (this._attributions[text]) {\r\n\t\t\tthis._attributions[text]--;\r\n\t\t\tthis._update();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_update: function () {\r\n\t\tif (!this._map) { return; }\r\n\r\n\t\tvar attribs = [];\r\n\r\n\t\tfor (var i in this._attributions) {\r\n\t\t\tif (this._attributions[i]) {\r\n\t\t\t\tattribs.push(i);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar prefixAndAttribs = [];\r\n\r\n\t\tif (this.options.prefix) {\r\n\t\t\tprefixAndAttribs.push(this.options.prefix);\r\n\t\t}\r\n\t\tif (attribs.length) {\r\n\t\t\tprefixAndAttribs.push(attribs.join(', '));\r\n\t\t}\r\n\r\n\t\tthis._container.innerHTML = prefixAndAttribs.join(' <span aria-hidden=\"true\">|</span> ');\r\n\t}\r\n});\r\n\r\n// @namespace Map\r\n// @section Control options\r\n// @option attributionControl: Boolean = true\r\n// Whether a [attribution control](#control-attribution) is added to the map by default.\r\nMap.mergeOptions({\r\n\tattributionControl: true\r\n});\r\n\r\nMap.addInitHook(function () {\r\n\tif (this.options.attributionControl) {\r\n\t\tnew Attribution().addTo(this);\r\n\t}\r\n});\r\n\r\n// @namespace Control.Attribution\r\n// @factory L.control.attribution(options: Control.Attribution options)\r\n// Creates an attribution control.\r\nexport var attribution = function (options) {\r\n\treturn new Attribution(options);\r\n};\r\n", "import {Control, control} from './Control';\nimport {Layers, layers} from './Control.Layers';\nimport {Zoom, zoom} from './Control.Zoom';\nimport {Scale, scale} from './Control.Scale';\nimport {Attribution, attribution} from './Control.Attribution';\n\nControl.Layers = Layers;\nControl.Zoom = Zoom;\nControl.Scale = Scale;\nControl.Attribution = Attribution;\n\ncontrol.layers = layers;\ncontrol.zoom = zoom;\ncontrol.scale = scale;\ncontrol.attribution = attribution;\n\nexport {Control, control};\n", "import {Class} from './Class';\n\n/*\n\tL.Handler is a base class for handler classes that are used internally to inject\n\tinteraction features like dragging to classes like Map and Marker.\n*/\n\n// @class Handler\n// @aka L.Handler\n// Abstract class for map interaction handlers\n\nexport var Handler = Class.extend({\n\tinitialize: function (map) {\n\t\tthis._map = map;\n\t},\n\n\t// @method enable(): this\n\t// Enables the handler\n\tenable: function () {\n\t\tif (this._enabled) { return this; }\n\n\t\tthis._enabled = true;\n\t\tthis.addHooks();\n\t\treturn this;\n\t},\n\n\t// @method disable(): this\n\t// Disables the handler\n\tdisable: function () {\n\t\tif (!this._enabled) { return this; }\n\n\t\tthis._enabled = false;\n\t\tthis.removeHooks();\n\t\treturn this;\n\t},\n\n\t// @method enabled(): Boolean\n\t// Returns `true` if the handler is enabled\n\tenabled: function () {\n\t\treturn !!this._enabled;\n\t}\n\n\t// @section Extension methods\n\t// Classes inheriting from `Handler` must implement the two following methods:\n\t// @method addHooks()\n\t// Called when the handler is enabled, should add event hooks.\n\t// @method removeHooks()\n\t// Called when the handler is disabled, should remove the event hooks added previously.\n});\n\n// @section There is static function which can be called without instantiating L.Handler:\n// @function addTo(map: Map, name: String): this\n// Adds a new Handler to the given map with the given name.\nHandler.addTo = function (map, name) {\n\tmap.addHandler(name, this);\n\treturn this;\n};\n", "import Browser from './Browser';\nexport {Browser};\n\nexport {Class} from './Class';\n\nimport {Evented} from './Events';\nimport {Events} from './Events';\nexport {Evented};\nexport var Mixin = {Events: Events};\n\nexport {Handler} from './Handler';\n\nimport * as Util from './Util';\nexport {Util};\nexport {extend, bind, stamp, setOptions} from './Util';\n", "import {Evented} from '../core/Events';\r\nimport Browser from '../core/Browser';\r\nimport * as DomEvent from './DomEvent';\r\nimport * as DomUtil from './DomUtil';\r\nimport * as Util from '../core/Util';\r\nimport {Point} from '../geometry/Point';\r\n\r\n/*\r\n * @class Draggable\r\n * @aka L.Draggable\r\n * @inherits Evented\r\n *\r\n * A class for making DOM elements draggable (including touch support).\r\n * Used internally for map and marker dragging. Only works for elements\r\n * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).\r\n *\r\n * @example\r\n * ```js\r\n * var draggable = new L.Draggable(elementToDrag);\r\n * draggable.enable();\r\n * ```\r\n */\r\n\r\nvar START = Browser.touch ? 'touchstart mousedown' : 'mousedown';\r\n\r\nexport var Draggable = Evented.extend({\r\n\r\n\toptions: {\r\n\t\t// @section\r\n\t\t// @aka Draggable options\r\n\t\t// @option clickTolerance: Number = 3\r\n\t\t// The max number of pixels a user can shift the mouse pointer during a click\r\n\t\t// for it to be considered a valid click (as opposed to a mouse drag).\r\n\t\tclickTolerance: 3\r\n\t},\r\n\r\n\t// @constructor L.Draggable(el: HTMLElement, dragHandle?: HTMLElement, preventOutline?: Boolean, options?: Draggable options)\r\n\t// Creates a `Draggable` object for moving `el` when you start dragging the `dragHandle` element (equals `el` itself by default).\r\n\tinitialize: function (element, dragStartTarget, preventOutline, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._element = element;\r\n\t\tthis._dragStartTarget = dragStartTarget || element;\r\n\t\tthis._preventOutline = preventOutline;\r\n\t},\r\n\r\n\t// @method enable()\r\n\t// Enables the dragging ability\r\n\tenable: function () {\r\n\t\tif (this._enabled) { return; }\r\n\r\n\t\tDomEvent.on(this._dragStartTarget, START, this._onDown, this);\r\n\r\n\t\tthis._enabled = true;\r\n\t},\r\n\r\n\t// @method disable()\r\n\t// Disables the dragging ability\r\n\tdisable: function () {\r\n\t\tif (!this._enabled) { return; }\r\n\r\n\t\t// If we're currently dragging this draggable,\r\n\t\t// disabling it counts as first ending the drag.\r\n\t\tif (Draggable._dragging === this) {\r\n\t\t\tthis.finishDrag(true);\r\n\t\t}\r\n\r\n\t\tDomEvent.off(this._dragStartTarget, START, this._onDown, this);\r\n\r\n\t\tthis._enabled = false;\r\n\t\tthis._moved = false;\r\n\t},\r\n\r\n\t_onDown: function (e) {\r\n\t\t// Ignore the event if disabled; this happens in IE11\r\n\t\t// under some circumstances, see #3666.\r\n\t\tif (!this._enabled) { return; }\r\n\r\n\t\tthis._moved = false;\r\n\r\n\t\tif (DomUtil.hasClass(this._element, 'leaflet-zoom-anim')) { return; }\r\n\r\n\t\tif (e.touches && e.touches.length !== 1) {\r\n\t\t\t// Finish dragging to avoid conflict with touchZoom\r\n\t\t\tif (Draggable._dragging === this) {\r\n\t\t\t\tthis.finishDrag();\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (Draggable._dragging || e.shiftKey || ((e.which !== 1) && (e.button !== 1) && !e.touches)) { return; }\r\n\t\tDraggable._dragging = this;  // Prevent dragging multiple objects at once.\r\n\r\n\t\tif (this._preventOutline) {\r\n\t\t\tDomUtil.preventOutline(this._element);\r\n\t\t}\r\n\r\n\t\tDomUtil.disableImageDrag();\r\n\t\tDomUtil.disableTextSelection();\r\n\r\n\t\tif (this._moving) { return; }\r\n\r\n\t\t// @event down: Event\r\n\t\t// Fired when a drag is about to start.\r\n\t\tthis.fire('down');\r\n\r\n\t\tvar first = e.touches ? e.touches[0] : e,\r\n\t\t    sizedParent = DomUtil.getSizedParentNode(this._element);\r\n\r\n\t\tthis._startPoint = new Point(first.clientX, first.clientY);\r\n\t\tthis._startPos = DomUtil.getPosition(this._element);\r\n\r\n\t\t// Cache the scale, so that we can continuously compensate for it during drag (_onMove).\r\n\t\tthis._parentScale = DomUtil.getScale(sizedParent);\r\n\r\n\t\tvar mouseevent = e.type === 'mousedown';\r\n\t\tDomEvent.on(document, mouseevent ? 'mousemove' : 'touchmove', this._onMove, this);\r\n\t\tDomEvent.on(document, mouseevent ? 'mouseup' : 'touchend touchcancel', this._onUp, this);\r\n\t},\r\n\r\n\t_onMove: function (e) {\r\n\t\t// Ignore the event if disabled; this happens in IE11\r\n\t\t// under some circumstances, see #3666.\r\n\t\tif (!this._enabled) { return; }\r\n\r\n\t\tif (e.touches && e.touches.length > 1) {\r\n\t\t\tthis._moved = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar first = (e.touches && e.touches.length === 1 ? e.touches[0] : e),\r\n\t\t    offset = new Point(first.clientX, first.clientY)._subtract(this._startPoint);\r\n\r\n\t\tif (!offset.x && !offset.y) { return; }\r\n\t\tif (Math.abs(offset.x) + Math.abs(offset.y) < this.options.clickTolerance) { return; }\r\n\r\n\t\t// We assume that the parent container's position, border and scale do not change for the duration of the drag.\r\n\t\t// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)\r\n\t\t// and we can use the cached value for the scale.\r\n\t\toffset.x /= this._parentScale.x;\r\n\t\toffset.y /= this._parentScale.y;\r\n\r\n\t\tDomEvent.preventDefault(e);\r\n\r\n\t\tif (!this._moved) {\r\n\t\t\t// @event dragstart: Event\r\n\t\t\t// Fired when a drag starts\r\n\t\t\tthis.fire('dragstart');\r\n\r\n\t\t\tthis._moved = true;\r\n\r\n\t\t\tDomUtil.addClass(document.body, 'leaflet-dragging');\r\n\r\n\t\t\tthis._lastTarget = e.target || e.srcElement;\r\n\t\t\t// IE and Edge do not give the <use> element, so fetch it\r\n\t\t\t// if necessary\r\n\t\t\tif (window.SVGElementInstance && this._lastTarget instanceof window.SVGElementInstance) {\r\n\t\t\t\tthis._lastTarget = this._lastTarget.correspondingUseElement;\r\n\t\t\t}\r\n\t\t\tDomUtil.addClass(this._lastTarget, 'leaflet-drag-target');\r\n\t\t}\r\n\r\n\t\tthis._newPos = this._startPos.add(offset);\r\n\t\tthis._moving = true;\r\n\r\n\t\tthis._lastEvent = e;\r\n\t\tthis._updatePosition();\r\n\t},\r\n\r\n\t_updatePosition: function () {\r\n\t\tvar e = {originalEvent: this._lastEvent};\r\n\r\n\t\t// @event predrag: Event\r\n\t\t// Fired continuously during dragging *before* each corresponding\r\n\t\t// update of the element's position.\r\n\t\tthis.fire('predrag', e);\r\n\t\tDomUtil.setPosition(this._element, this._newPos);\r\n\r\n\t\t// @event drag: Event\r\n\t\t// Fired continuously during dragging.\r\n\t\tthis.fire('drag', e);\r\n\t},\r\n\r\n\t_onUp: function () {\r\n\t\t// Ignore the event if disabled; this happens in IE11\r\n\t\t// under some circumstances, see #3666.\r\n\t\tif (!this._enabled) { return; }\r\n\t\tthis.finishDrag();\r\n\t},\r\n\r\n\tfinishDrag: function (noInertia) {\r\n\t\tDomUtil.removeClass(document.body, 'leaflet-dragging');\r\n\r\n\t\tif (this._lastTarget) {\r\n\t\t\tDomUtil.removeClass(this._lastTarget, 'leaflet-drag-target');\r\n\t\t\tthis._lastTarget = null;\r\n\t\t}\r\n\r\n\t\tDomEvent.off(document, 'mousemove touchmove', this._onMove, this);\r\n\t\tDomEvent.off(document, 'mouseup touchend touchcancel', this._onUp, this);\r\n\r\n\t\tDomUtil.enableImageDrag();\r\n\t\tDomUtil.enableTextSelection();\r\n\r\n\t\tvar fireDragend = this._moved && this._moving;\r\n\r\n\t\tthis._moving = false;\r\n\t\tDraggable._dragging = false;\r\n\r\n\t\tif (fireDragend) {\r\n\t\t\t// @event dragend: DragEndEvent\r\n\t\t\t// Fired when the drag ends.\r\n\t\t\tthis.fire('dragend', {\r\n\t\t\t\tnoInertia: noInertia,\r\n\t\t\t\tdistance: this._newPos.distanceTo(this._startPos)\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n});\r\n", "import * as LineUtil from './LineUtil';\r\nimport {toLatLng} from '../geo/LatLng';\r\nimport {toPoint} from './Point';\r\nimport {toLatLngBounds} from '../geo/LatLngBounds';\r\n/*\r\n * @namespace PolyUtil\r\n * Various utility functions for polygon geometries.\r\n */\r\n\r\n/* @function clipPolygon(points: Point[], bounds: Bounds, round?: Boolean): Point[]\r\n * Clips the polygon geometry defined by the given `points` by the given bounds (using the [Sutherland-Hodgman algorithm](https://en.wikipedia.org/wiki/Sutherland%E2%80%93Hodgman_algorithm)).\r\n * Used by Leaflet to only show polygon points that are on the screen or near, increasing\r\n * performance. Note that polygon points needs different algorithm for clipping\r\n * than polyline, so there's a separate method for it.\r\n */\r\nexport function clipPolygon(points, bounds, round) {\r\n\tvar clippedPoints,\r\n\t    edges = [1, 4, 2, 8],\r\n\t    i, j, k,\r\n\t    a, b,\r\n\t    len, edge, p;\r\n\r\n\tfor (i = 0, len = points.length; i < len; i++) {\r\n\t\tpoints[i]._code = LineUtil._getBitCode(points[i], bounds);\r\n\t}\r\n\r\n\t// for each edge (left, bottom, right, top)\r\n\tfor (k = 0; k < 4; k++) {\r\n\t\tedge = edges[k];\r\n\t\tclippedPoints = [];\r\n\r\n\t\tfor (i = 0, len = points.length, j = len - 1; i < len; j = i++) {\r\n\t\t\ta = points[i];\r\n\t\t\tb = points[j];\r\n\r\n\t\t\t// if a is inside the clip window\r\n\t\t\tif (!(a._code & edge)) {\r\n\t\t\t\t// if b is outside the clip window (a->b goes out of screen)\r\n\t\t\t\tif (b._code & edge) {\r\n\t\t\t\t\tp = LineUtil._getEdgeIntersection(b, a, edge, bounds, round);\r\n\t\t\t\t\tp._code = LineUtil._getBitCode(p, bounds);\r\n\t\t\t\t\tclippedPoints.push(p);\r\n\t\t\t\t}\r\n\t\t\t\tclippedPoints.push(a);\r\n\r\n\t\t\t// else if b is inside the clip window (a->b enters the screen)\r\n\t\t\t} else if (!(b._code & edge)) {\r\n\t\t\t\tp = LineUtil._getEdgeIntersection(b, a, edge, bounds, round);\r\n\t\t\t\tp._code = LineUtil._getBitCode(p, bounds);\r\n\t\t\t\tclippedPoints.push(p);\r\n\t\t\t}\r\n\t\t}\r\n\t\tpoints = clippedPoints;\r\n\t}\r\n\r\n\treturn points;\r\n}\r\n\r\n/* @function polygonCenter(latlngs: LatLng[], crs: CRS): LatLng\r\n * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polygon.\r\n */\r\nexport function polygonCenter(latlngs, crs) {\r\n\tvar i, j, p1, p2, f, area, x, y, center;\r\n\r\n\tif (!latlngs || latlngs.length === 0) {\r\n\t\tthrow new Error('latlngs not passed');\r\n\t}\r\n\r\n\tif (!LineUtil.isFlat(latlngs)) {\r\n\t\tconsole.warn('latlngs are not flat! Only the first ring will be used');\r\n\t\tlatlngs = latlngs[0];\r\n\t}\r\n\r\n\tvar centroidLatLng = toLatLng([0, 0]);\r\n\r\n\tvar bounds = toLatLngBounds(latlngs);\r\n\tvar areaBounds = bounds.getNorthWest().distanceTo(bounds.getSouthWest()) * bounds.getNorthEast().distanceTo(bounds.getNorthWest());\r\n\t// tests showed that below 1700 rounding errors are happening\r\n\tif (areaBounds < 1700) {\r\n\t\t// getting a inexact center, to move the latlngs near to [0, 0] to prevent rounding errors\r\n\t\tcentroidLatLng = centroid(latlngs);\r\n\t}\r\n\r\n\tvar len = latlngs.length;\r\n\tvar points = [];\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tvar latlng = toLatLng(latlngs[i]);\r\n\t\tpoints.push(crs.project(toLatLng([latlng.lat - centroidLatLng.lat, latlng.lng - centroidLatLng.lng])));\r\n\t}\r\n\r\n\tarea = x = y = 0;\r\n\r\n\t// polygon centroid algorithm;\r\n\tfor (i = 0, j = len - 1; i < len; j = i++) {\r\n\t\tp1 = points[i];\r\n\t\tp2 = points[j];\r\n\r\n\t\tf = p1.y * p2.x - p2.y * p1.x;\r\n\t\tx += (p1.x + p2.x) * f;\r\n\t\ty += (p1.y + p2.y) * f;\r\n\t\tarea += f * 3;\r\n\t}\r\n\r\n\tif (area === 0) {\r\n\t\t// Polygon is so small that all points are on same pixel.\r\n\t\tcenter = points[0];\r\n\t} else {\r\n\t\tcenter = [x / area, y / area];\r\n\t}\r\n\r\n\tvar latlngCenter = crs.unproject(toPoint(center));\r\n\treturn toLatLng([latlngCenter.lat + centroidLatLng.lat, latlngCenter.lng + centroidLatLng.lng]);\r\n}\r\n\r\n/* @function centroid(latlngs: LatLng[]): LatLng\r\n * Returns the 'center of mass' of the passed LatLngs.\r\n */\r\nexport function centroid(coords) {\r\n\tvar latSum = 0;\r\n\tvar lngSum = 0;\r\n\tvar len = 0;\r\n\tfor (var i = 0; i < coords.length; i++) {\r\n\t\tvar latlng = toLatLng(coords[i]);\r\n\t\tlatSum += latlng.lat;\r\n\t\tlngSum += latlng.lng;\r\n\t\tlen++;\r\n\t}\r\n\treturn toLatLng([latSum / len, lngSum / len]);\r\n}\r\n", "import {Point, toPoint} from './Point';\r\nimport * as Util from '../core/Util';\r\nimport {toLatLng} from '../geo/LatLng';\r\nimport {centroid} from './PolyUtil';\r\nimport {toLatLngBounds} from '../geo/LatLngBounds';\r\n\r\n\r\n/*\r\n * @namespace LineUtil\r\n *\r\n * Various utility functions for polyline points processing, used by Leaflet internally to make polylines lightning-fast.\r\n */\r\n\r\n// Simplify polyline with vertex reduction and Douglas-Peucker simplification.\r\n// Improves rendering performance dramatically by lessening the number of points to draw.\r\n\r\n// @function simplify(points: Point[], tolerance: Number): Point[]\r\n// Dramatically reduces the number of points in a polyline while retaining\r\n// its shape and returns a new array of simplified points, using the\r\n// [Ramer-Douglas-Peucker algorithm](https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm).\r\n// Used for a huge performance boost when processing/displaying Leaflet polylines for\r\n// each zoom level and also reducing visual noise. tolerance affects the amount of\r\n// simplification (lesser value means higher quality but slower and with more points).\r\n// Also released as a separated micro-library [Simplify.js](https://mourner.github.io/simplify-js/).\r\nexport function simplify(points, tolerance) {\r\n\tif (!tolerance || !points.length) {\r\n\t\treturn points.slice();\r\n\t}\r\n\r\n\tvar sqTolerance = tolerance * tolerance;\r\n\r\n\t    // stage 1: vertex reduction\r\n\t    points = _reducePoints(points, sqTolerance);\r\n\r\n\t    // stage 2: Douglas-Peucker simplification\r\n\t    points = _simplifyDP(points, sqTolerance);\r\n\r\n\treturn points;\r\n}\r\n\r\n// @function pointToSegmentDistance(p: Point, p1: Point, p2: Point): Number\r\n// Returns the distance between point `p` and segment `p1` to `p2`.\r\nexport function pointToSegmentDistance(p, p1, p2) {\r\n\treturn Math.sqrt(_sqClosestPointOnSegment(p, p1, p2, true));\r\n}\r\n\r\n// @function closestPointOnSegment(p: Point, p1: Point, p2: Point): Number\r\n// Returns the closest point from a point `p` on a segment `p1` to `p2`.\r\nexport function closestPointOnSegment(p, p1, p2) {\r\n\treturn _sqClosestPointOnSegment(p, p1, p2);\r\n}\r\n\r\n// Ramer-Douglas-Peucker simplification, see https://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm\r\nfunction _simplifyDP(points, sqTolerance) {\r\n\r\n\tvar len = points.length,\r\n\t    ArrayConstructor = typeof Uint8Array !== undefined + '' ? Uint8Array : Array,\r\n\t    markers = new ArrayConstructor(len);\r\n\r\n\t    markers[0] = markers[len - 1] = 1;\r\n\r\n\t_simplifyDPStep(points, markers, sqTolerance, 0, len - 1);\r\n\r\n\tvar i,\r\n\t    newPoints = [];\r\n\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tif (markers[i]) {\r\n\t\t\tnewPoints.push(points[i]);\r\n\t\t}\r\n\t}\r\n\r\n\treturn newPoints;\r\n}\r\n\r\nfunction _simplifyDPStep(points, markers, sqTolerance, first, last) {\r\n\r\n\tvar maxSqDist = 0,\r\n\tindex, i, sqDist;\r\n\r\n\tfor (i = first + 1; i <= last - 1; i++) {\r\n\t\tsqDist = _sqClosestPointOnSegment(points[i], points[first], points[last], true);\r\n\r\n\t\tif (sqDist > maxSqDist) {\r\n\t\t\tindex = i;\r\n\t\t\tmaxSqDist = sqDist;\r\n\t\t}\r\n\t}\r\n\r\n\tif (maxSqDist > sqTolerance) {\r\n\t\tmarkers[index] = 1;\r\n\r\n\t\t_simplifyDPStep(points, markers, sqTolerance, first, index);\r\n\t\t_simplifyDPStep(points, markers, sqTolerance, index, last);\r\n\t}\r\n}\r\n\r\n// reduce points that are too close to each other to a single point\r\nfunction _reducePoints(points, sqTolerance) {\r\n\tvar reducedPoints = [points[0]];\r\n\r\n\tfor (var i = 1, prev = 0, len = points.length; i < len; i++) {\r\n\t\tif (_sqDist(points[i], points[prev]) > sqTolerance) {\r\n\t\t\treducedPoints.push(points[i]);\r\n\t\t\tprev = i;\r\n\t\t}\r\n\t}\r\n\tif (prev < len - 1) {\r\n\t\treducedPoints.push(points[len - 1]);\r\n\t}\r\n\treturn reducedPoints;\r\n}\r\n\r\nvar _lastCode;\r\n\r\n// @function clipSegment(a: Point, b: Point, bounds: Bounds, useLastCode?: Boolean, round?: Boolean): Point[]|Boolean\r\n// Clips the segment a to b by rectangular bounds with the\r\n// [Cohen-Sutherland algorithm](https://en.wikipedia.org/wiki/Cohen%E2%80%93Sutherland_algorithm)\r\n// (modifying the segment points directly!). Used by Leaflet to only show polyline\r\n// points that are on the screen or near, increasing performance.\r\nexport function clipSegment(a, b, bounds, useLastCode, round) {\r\n\tvar codeA = useLastCode ? _lastCode : _getBitCode(a, bounds),\r\n\t    codeB = _getBitCode(b, bounds),\r\n\r\n\t    codeOut, p, newCode;\r\n\r\n\t    // save 2nd code to avoid calculating it on the next segment\r\n\t    _lastCode = codeB;\r\n\r\n\twhile (true) {\r\n\t\t// if a,b is inside the clip window (trivial accept)\r\n\t\tif (!(codeA | codeB)) {\r\n\t\t\treturn [a, b];\r\n\t\t}\r\n\r\n\t\t// if a,b is outside the clip window (trivial reject)\r\n\t\tif (codeA & codeB) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// other cases\r\n\t\tcodeOut = codeA || codeB;\r\n\t\tp = _getEdgeIntersection(a, b, codeOut, bounds, round);\r\n\t\tnewCode = _getBitCode(p, bounds);\r\n\r\n\t\tif (codeOut === codeA) {\r\n\t\t\ta = p;\r\n\t\t\tcodeA = newCode;\r\n\t\t} else {\r\n\t\t\tb = p;\r\n\t\t\tcodeB = newCode;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport function _getEdgeIntersection(a, b, code, bounds, round) {\r\n\tvar dx = b.x - a.x,\r\n\t    dy = b.y - a.y,\r\n\t    min = bounds.min,\r\n\t    max = bounds.max,\r\n\t    x, y;\r\n\r\n\tif (code & 8) { // top\r\n\t\tx = a.x + dx * (max.y - a.y) / dy;\r\n\t\ty = max.y;\r\n\r\n\t} else if (code & 4) { // bottom\r\n\t\tx = a.x + dx * (min.y - a.y) / dy;\r\n\t\ty = min.y;\r\n\r\n\t} else if (code & 2) { // right\r\n\t\tx = max.x;\r\n\t\ty = a.y + dy * (max.x - a.x) / dx;\r\n\r\n\t} else if (code & 1) { // left\r\n\t\tx = min.x;\r\n\t\ty = a.y + dy * (min.x - a.x) / dx;\r\n\t}\r\n\r\n\treturn new Point(x, y, round);\r\n}\r\n\r\nexport function _getBitCode(p, bounds) {\r\n\tvar code = 0;\r\n\r\n\tif (p.x < bounds.min.x) { // left\r\n\t\tcode |= 1;\r\n\t} else if (p.x > bounds.max.x) { // right\r\n\t\tcode |= 2;\r\n\t}\r\n\r\n\tif (p.y < bounds.min.y) { // bottom\r\n\t\tcode |= 4;\r\n\t} else if (p.y > bounds.max.y) { // top\r\n\t\tcode |= 8;\r\n\t}\r\n\r\n\treturn code;\r\n}\r\n\r\n// square distance (to avoid unnecessary Math.sqrt calls)\r\nfunction _sqDist(p1, p2) {\r\n\tvar dx = p2.x - p1.x,\r\n\t    dy = p2.y - p1.y;\r\n\treturn dx * dx + dy * dy;\r\n}\r\n\r\n// return closest point on segment or distance to that point\r\nexport function _sqClosestPointOnSegment(p, p1, p2, sqDist) {\r\n\tvar x = p1.x,\r\n\t    y = p1.y,\r\n\t    dx = p2.x - x,\r\n\t    dy = p2.y - y,\r\n\t    dot = dx * dx + dy * dy,\r\n\t    t;\r\n\r\n\tif (dot > 0) {\r\n\t\tt = ((p.x - x) * dx + (p.y - y) * dy) / dot;\r\n\r\n\t\tif (t > 1) {\r\n\t\t\tx = p2.x;\r\n\t\t\ty = p2.y;\r\n\t\t} else if (t > 0) {\r\n\t\t\tx += dx * t;\r\n\t\t\ty += dy * t;\r\n\t\t}\r\n\t}\r\n\r\n\tdx = p.x - x;\r\n\tdy = p.y - y;\r\n\r\n\treturn sqDist ? dx * dx + dy * dy : new Point(x, y);\r\n}\r\n\r\n\r\n// @function isFlat(latlngs: LatLng[]): Boolean\r\n// Returns true if `latlngs` is a flat array, false is nested.\r\nexport function isFlat(latlngs) {\r\n\treturn !Util.isArray(latlngs[0]) || (typeof latlngs[0][0] !== 'object' && typeof latlngs[0][0] !== 'undefined');\r\n}\r\n\r\nexport function _flat(latlngs) {\r\n\tconsole.warn('Deprecated use of _flat, please use L.LineUtil.isFlat instead.');\r\n\treturn isFlat(latlngs);\r\n}\r\n\r\n/* @function polylineCenter(latlngs: LatLng[], crs: CRS): LatLng\r\n * Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the passed LatLngs (first ring) from a polyline.\r\n */\r\nexport function polylineCenter(latlngs, crs) {\r\n\tvar i, halfDist, segDist, dist, p1, p2, ratio, center;\r\n\r\n\tif (!latlngs || latlngs.length === 0) {\r\n\t\tthrow new Error('latlngs not passed');\r\n\t}\r\n\r\n\tif (!isFlat(latlngs)) {\r\n\t\tconsole.warn('latlngs are not flat! Only the first ring will be used');\r\n\t\tlatlngs = latlngs[0];\r\n\t}\r\n\r\n\tvar centroidLatLng = toLatLng([0, 0]);\r\n\r\n\tvar bounds = toLatLngBounds(latlngs);\r\n\tvar areaBounds = bounds.getNorthWest().distanceTo(bounds.getSouthWest()) * bounds.getNorthEast().distanceTo(bounds.getNorthWest());\r\n\t// tests showed that below 1700 rounding errors are happening\r\n\tif (areaBounds < 1700) {\r\n\t\t// getting a inexact center, to move the latlngs near to [0, 0] to prevent rounding errors\r\n\t\tcentroidLatLng = centroid(latlngs);\r\n\t}\r\n\r\n\tvar len = latlngs.length;\r\n\tvar points = [];\r\n\tfor (i = 0; i < len; i++) {\r\n\t\tvar latlng = toLatLng(latlngs[i]);\r\n\t\tpoints.push(crs.project(toLatLng([latlng.lat - centroidLatLng.lat, latlng.lng - centroidLatLng.lng])));\r\n\t}\r\n\r\n\tfor (i = 0, halfDist = 0; i < len - 1; i++) {\r\n\t\thalfDist += points[i].distanceTo(points[i + 1]) / 2;\r\n\t}\r\n\r\n\t// The line is so small in the current view that all points are on the same pixel.\r\n\tif (halfDist === 0) {\r\n\t\tcenter = points[0];\r\n\t} else {\r\n\t\tfor (i = 0, dist = 0; i < len - 1; i++) {\r\n\t\t\tp1 = points[i];\r\n\t\t\tp2 = points[i + 1];\r\n\t\t\tsegDist = p1.distanceTo(p2);\r\n\t\t\tdist += segDist;\r\n\r\n\t\t\tif (dist > halfDist) {\r\n\t\t\t\tratio = (dist - halfDist) / segDist;\r\n\t\t\t\tcenter = [\r\n\t\t\t\t\tp2.x - ratio * (p2.x - p1.x),\r\n\t\t\t\t\tp2.y - ratio * (p2.y - p1.y)\r\n\t\t\t\t];\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tvar latlngCenter = crs.unproject(toPoint(center));\r\n\treturn toLatLng([latlngCenter.lat + centroidLatLng.lat, latlngCenter.lng + centroidLatLng.lng]);\r\n}\r\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @section\r\n * Leaflet comes with a set of already defined Projections out of the box:\r\n *\r\n * @projection L.Projection.LonLat\r\n *\r\n * Equirectangular, or Plate Carree projection — the most simple projection,\r\n * mostly used by GIS enthusiasts. Directly maps `x` as longitude, and `y` as\r\n * latitude. Also suitable for flat worlds, e.g. game maps. Used by the\r\n * `EPSG:4326` and `Simple` CRS.\r\n */\r\n\r\nexport var LonLat = {\r\n\tproject: function (latlng) {\r\n\t\treturn new Point(latlng.lng, latlng.lat);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\treturn new LatLng(point.y, point.x);\r\n\t},\r\n\r\n\tbounds: new Bounds([-180, -90], [180, 90])\r\n};\r\n", "import {LatLng} from '../LatLng';\r\nimport {Bounds} from '../../geometry/Bounds';\r\nimport {Point} from '../../geometry/Point';\r\n\r\n/*\r\n * @namespace Projection\r\n * @projection L.Projection.Mercator\r\n *\r\n * Elliptical Mercator projection — more complex than Spherical Mercator. Assumes that Earth is an ellipsoid. Used by the EPSG:3395 CRS.\r\n */\r\n\r\nexport var Mercator = {\r\n\tR: 6378137,\r\n\tR_MINOR: 6356752.314245179,\r\n\r\n\tbounds: new Bounds([-20037508.34279, -15496570.73972], [20037508.34279, 18764656.23138]),\r\n\r\n\tproject: function (latlng) {\r\n\t\tvar d = Math.PI / 180,\r\n\t\t    r = this.R,\r\n\t\t    y = latlng.lat * d,\r\n\t\t    tmp = this.R_MINOR / r,\r\n\t\t    e = Math.sqrt(1 - tmp * tmp),\r\n\t\t    con = e * Math.sin(y);\r\n\r\n\t\tvar ts = Math.tan(Math.PI / 4 - y / 2) / Math.pow((1 - con) / (1 + con), e / 2);\r\n\t\ty = -r * Math.log(Math.max(ts, 1E-10));\r\n\r\n\t\treturn new Point(latlng.lng * d * r, y);\r\n\t},\r\n\r\n\tunproject: function (point) {\r\n\t\tvar d = 180 / Math.PI,\r\n\t\t    r = this.R,\r\n\t\t    tmp = this.R_MINOR / r,\r\n\t\t    e = Math.sqrt(1 - tmp * tmp),\r\n\t\t    ts = Math.exp(-point.y / r),\r\n\t\t    phi = Math.PI / 2 - 2 * Math.atan(ts);\r\n\r\n\t\tfor (var i = 0, dphi = 0.1, con; i < 15 && Math.abs(dphi) > 1e-7; i++) {\r\n\t\t\tcon = e * Math.sin(phi);\r\n\t\t\tcon = Math.pow((1 - con) / (1 + con), e / 2);\r\n\t\t\tdphi = Math.PI / 2 - 2 * Math.atan(ts * con) - phi;\r\n\t\t\tphi += dphi;\r\n\t\t}\r\n\r\n\t\treturn new LatLng(phi * d, point.x * d / r);\r\n\t}\r\n};\r\n", "/*\n * @class Projection\n\n * An object with methods for projecting geographical coordinates of the world onto\n * a flat surface (and back). See [Map projection](https://en.wikipedia.org/wiki/Map_projection).\n\n * @property bounds: Bounds\n * The bounds (specified in CRS units) where the projection is valid\n\n * @method project(latlng: LatLng): Point\n * Projects geographical coordinates into a 2D point.\n * Only accepts actual `L.LatLng` instances, not arrays.\n\n * @method unproject(point: Point): LatLng\n * The inverse of `project`. Projects a 2D point into a geographical location.\n * Only accepts actual `L.Point` instances, not arrays.\n\n * Note that the projection instances do not inherit from Leaflet's `Class` object,\n * and can't be instantiated. Also, new classes can't inherit from them,\n * and methods can't be added to them with the `include` function.\n\n */\n\nexport {LonLat} from './Projection.LonLat';\nexport {Mercator} from './Projection.Mercator';\nexport {SphericalMercator} from './Projection.SphericalMercator';\n", "import {Earth} from './CRS.Earth';\r\nimport {Mercator} from '../projection/Projection.Mercator';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG3395\r\n *\r\n * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.\r\n */\r\nexport var EPSG3395 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:3395',\r\n\tprojection: Mercator,\r\n\r\n\ttransformation: (function () {\r\n\t\tvar scale = 0.5 / (Math.PI * Mercator.R);\r\n\t\treturn toTransformation(scale, 0.5, -scale, 0.5);\r\n\t}())\r\n});\r\n", "import {Earth} from './CRS.Earth';\r\nimport {LonLat} from '../projection/Projection.LonLat';\r\nimport {toTransformation} from '../../geometry/Transformation';\r\nimport * as Util from '../../core/Util';\r\n\r\n/*\r\n * @namespace CRS\r\n * @crs L.CRS.EPSG4326\r\n *\r\n * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.\r\n *\r\n * Leaflet 1.0.x complies with the [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic),\r\n * which is a breaking change from 0.7.x behaviour.  If you are using a `TileLayer`\r\n * with this CRS, ensure that there are two 256x256 pixel tiles covering the\r\n * whole earth at zoom level zero, and that the tile coordinate origin is (-180,+90),\r\n * or (-180,-90) for `TileLayer`s with [the `tms` option](#tilelayer-tms) set.\r\n */\r\n\r\nexport var EPSG4326 = Util.extend({}, Earth, {\r\n\tcode: 'EPSG:4326',\r\n\tprojection: LonLat,\r\n\ttransformation: toTransformation(1 / 180, 1, -1 / 180, 0.5)\r\n});\r\n", "import {CRS} from './CRS';\nimport {LonLat} from '../projection/Projection.LonLat';\nimport {toTransformation} from '../../geometry/Transformation';\nimport * as Util from '../../core/Util';\n\n/*\n * @namespace CRS\n * @crs L.CRS.Simple\n *\n * A simple CRS that maps longitude and latitude into `x` and `y` directly.\n * May be used for maps of flat surfaces (e.g. game maps). Note that the `y`\n * axis should still be inverted (going from bottom to top). `distance()` returns\n * simple euclidean distance.\n */\n\nexport var Simple = Util.extend({}, CRS, {\n\tprojection: LonLat,\n\ttransformation: toTransformation(1, 0, -1, 0),\n\n\tscale: function (zoom) {\n\t\treturn Math.pow(2, zoom);\n\t},\n\n\tzoom: function (scale) {\n\t\treturn Math.log(scale) / Math.LN2;\n\t},\n\n\tdistance: function (latlng1, latlng2) {\n\t\tvar dx = latlng2.lng - latlng1.lng,\n\t\t    dy = latlng2.lat - latlng1.lat;\n\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t},\n\n\tinfinite: true\n});\n", "import {CRS} from './CRS';\nimport {Earth} from './CRS.Earth';\nimport {EPSG3395} from './CRS.EPSG3395';\nimport {EPSG3857, EPSG900913} from './CRS.EPSG3857';\nimport {EPSG4326} from './CRS.EPSG4326';\nimport {Simple} from './CRS.Simple';\n\nCRS.Earth = Earth;\nCRS.EPSG3395 = EPSG3395;\nCRS.EPSG3857 = EPSG3857;\nCRS.EPSG900913 = EPSG900913;\nCRS.EPSG4326 = EPSG4326;\nCRS.Simple = Simple;\n\nexport {CRS};\n", "import {Evented} from '../core/Events';\nimport {Map} from '../map/Map';\nimport * as Util from '../core/Util';\n\n/*\n * @class Layer\n * @inherits Evented\n * @aka L.Layer\n * @aka ILayer\n *\n * A set of methods from the Layer base class that all Leaflet layers use.\n * Inherits all methods, options and events from `L.Evented`.\n *\n * @example\n *\n * ```js\n * var layer = L.marker(latlng).addTo(map);\n * layer.addTo(map);\n * layer.remove();\n * ```\n *\n * @event add: Event\n * Fired after the layer is added to a map\n *\n * @event remove: Event\n * Fired after the layer is removed from a map\n */\n\n\nexport var Layer = Evented.extend({\n\n\t// Classes extending `L.Layer` will inherit the following options:\n\toptions: {\n\t\t// @option pane: String = 'overlayPane'\n\t\t// By default the layer will be added to the map's [overlay pane](#map-overlaypane). Overriding this option will cause the layer to be placed on another pane by default.\n\t\tpane: 'overlayPane',\n\n\t\t// @option attribution: String = null\n\t\t// String to be shown in the attribution control, e.g. \"© OpenStreetMap contributors\". It describes the layer data and is often a legal obligation towards copyright holders and tile providers.\n\t\tattribution: null,\n\n\t\tbubblingMouseEvents: true\n\t},\n\n\t/* @section\n\t * Classes extending `L.Layer` will inherit the following methods:\n\t *\n\t * @method addTo(map: Map|LayerGroup): this\n\t * Adds the layer to the given map or layer group.\n\t */\n\taddTo: function (map) {\n\t\tmap.addLayer(this);\n\t\treturn this;\n\t},\n\n\t// @method remove: this\n\t// Removes the layer from the map it is currently active on.\n\tremove: function () {\n\t\treturn this.removeFrom(this._map || this._mapToAdd);\n\t},\n\n\t// @method removeFrom(map: Map): this\n\t// Removes the layer from the given map\n\t//\n\t// @alternative\n\t// @method removeFrom(group: LayerGroup): this\n\t// Removes the layer from the given `LayerGroup`\n\tremoveFrom: function (obj) {\n\t\tif (obj) {\n\t\t\tobj.removeLayer(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method getPane(name? : String): HTMLElement\n\t// Returns the `HTMLElement` representing the named pane on the map. If `name` is omitted, returns the pane for this layer.\n\tgetPane: function (name) {\n\t\treturn this._map.getPane(name ? (this.options[name] || name) : this.options.pane);\n\t},\n\n\taddInteractiveTarget: function (targetEl) {\n\t\tthis._map._targets[Util.stamp(targetEl)] = this;\n\t\treturn this;\n\t},\n\n\tremoveInteractiveTarget: function (targetEl) {\n\t\tdelete this._map._targets[Util.stamp(targetEl)];\n\t\treturn this;\n\t},\n\n\t// @method getAttribution: String\n\t// Used by the `attribution control`, returns the [attribution option](#gridlayer-attribution).\n\tgetAttribution: function () {\n\t\treturn this.options.attribution;\n\t},\n\n\t_layerAdd: function (e) {\n\t\tvar map = e.target;\n\n\t\t// check in case layer gets added and then removed before the map is ready\n\t\tif (!map.hasLayer(this)) { return; }\n\n\t\tthis._map = map;\n\t\tthis._zoomAnimated = map._zoomAnimated;\n\n\t\tif (this.getEvents) {\n\t\t\tvar events = this.getEvents();\n\t\t\tmap.on(events, this);\n\t\t\tthis.once('remove', function () {\n\t\t\t\tmap.off(events, this);\n\t\t\t}, this);\n\t\t}\n\n\t\tthis.onAdd(map);\n\n\t\tthis.fire('add');\n\t\tmap.fire('layeradd', {layer: this});\n\t}\n});\n\n/* @section Extension methods\n * @uninheritable\n *\n * Every layer should extend from `L.Layer` and (re-)implement the following methods.\n *\n * @method onAdd(map: Map): this\n * Should contain code that creates DOM elements for the layer, adds them to `map panes` where they should belong and puts listeners on relevant map events. Called on [`map.addLayer(layer)`](#map-addlayer).\n *\n * @method onRemove(map: Map): this\n * Should contain all clean up code that removes the layer's elements from the DOM and removes listeners previously added in [`onAdd`](#layer-onadd). Called on [`map.removeLayer(layer)`](#map-removelayer).\n *\n * @method getEvents(): Object\n * This optional method should return an object like `{ viewreset: this._reset }` for [`addEventListener`](#evented-addeventlistener). The event handlers in this object will be automatically added and removed from the map with your layer.\n *\n * @method getAttribution(): String\n * This optional method should return a string containing HTML to be shown on the `Attribution control` whenever the layer is visible.\n *\n * @method beforeAdd(map: Map): this\n * Optional method. Called on [`map.addLayer(layer)`](#map-addlayer), before the layer is added to the map, before events are initialized, without waiting until the map is in a usable state. Use for early initialization only.\n */\n\n\n/* @namespace Map\n * @section Layer events\n *\n * @event layeradd: LayerEvent\n * Fired when a new layer is added to the map.\n *\n * @event layerremove: LayerEvent\n * Fired when some layer is removed from the map\n *\n * @section Methods for Layers and Controls\n */\nMap.include({\n\t// @method addLayer(layer: Layer): this\n\t// Adds the given layer to the map\n\taddLayer: function (layer) {\n\t\tif (!layer._layerAdd) {\n\t\t\tthrow new Error('The provided object is not a Layer.');\n\t\t}\n\n\t\tvar id = Util.stamp(layer);\n\t\tif (this._layers[id]) { return this; }\n\t\tthis._layers[id] = layer;\n\n\t\tlayer._mapToAdd = this;\n\n\t\tif (layer.beforeAdd) {\n\t\t\tlayer.beforeAdd(this);\n\t\t}\n\n\t\tthis.whenReady(layer._layerAdd, layer);\n\n\t\treturn this;\n\t},\n\n\t// @method removeLayer(layer: Layer): this\n\t// Removes the given layer from the map.\n\tremoveLayer: function (layer) {\n\t\tvar id = Util.stamp(layer);\n\n\t\tif (!this._layers[id]) { return this; }\n\n\t\tif (this._loaded) {\n\t\t\tlayer.onRemove(this);\n\t\t}\n\n\t\tdelete this._layers[id];\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('layerremove', {layer: layer});\n\t\t\tlayer.fire('remove');\n\t\t}\n\n\t\tlayer._map = layer._mapToAdd = null;\n\n\t\treturn this;\n\t},\n\n\t// @method hasLayer(layer: Layer): Boolean\n\t// Returns `true` if the given layer is currently added to the map\n\thasLayer: function (layer) {\n\t\treturn Util.stamp(layer) in this._layers;\n\t},\n\n\t/* @method eachLayer(fn: Function, context?: Object): this\n\t * Iterates over the layers of the map, optionally specifying context of the iterator function.\n\t * ```\n\t * map.eachLayer(function(layer){\n\t *     layer.bindPopup('Hello');\n\t * });\n\t * ```\n\t */\n\teachLayer: function (method, context) {\n\t\tfor (var i in this._layers) {\n\t\t\tmethod.call(context, this._layers[i]);\n\t\t}\n\t\treturn this;\n\t},\n\n\t_addLayers: function (layers) {\n\t\tlayers = layers ? (Util.isArray(layers) ? layers : [layers]) : [];\n\n\t\tfor (var i = 0, len = layers.length; i < len; i++) {\n\t\t\tthis.addLayer(layers[i]);\n\t\t}\n\t},\n\n\t_addZoomLimit: function (layer) {\n\t\tif (!isNaN(layer.options.maxZoom) || !isNaN(layer.options.minZoom)) {\n\t\t\tthis._zoomBoundLayers[Util.stamp(layer)] = layer;\n\t\t\tthis._updateZoomLevels();\n\t\t}\n\t},\n\n\t_removeZoomLimit: function (layer) {\n\t\tvar id = Util.stamp(layer);\n\n\t\tif (this._zoomBoundLayers[id]) {\n\t\t\tdelete this._zoomBoundLayers[id];\n\t\t\tthis._updateZoomLevels();\n\t\t}\n\t},\n\n\t_updateZoomLevels: function () {\n\t\tvar minZoom = Infinity,\n\t\t    maxZoom = -Infinity,\n\t\t    oldZoomSpan = this._getZoomSpan();\n\n\t\tfor (var i in this._zoomBoundLayers) {\n\t\t\tvar options = this._zoomBoundLayers[i].options;\n\n\t\t\tminZoom = options.minZoom === undefined ? minZoom : Math.min(minZoom, options.minZoom);\n\t\t\tmaxZoom = options.maxZoom === undefined ? maxZoom : Math.max(maxZoom, options.maxZoom);\n\t\t}\n\n\t\tthis._layersMaxZoom = maxZoom === -Infinity ? undefined : maxZoom;\n\t\tthis._layersMinZoom = minZoom === Infinity ? undefined : minZoom;\n\n\t\t// @section Map state change events\n\t\t// @event zoomlevelschange: Event\n\t\t// Fired when the number of zoomlevels on the map is changed due\n\t\t// to adding or removing a layer.\n\t\tif (oldZoomSpan !== this._getZoomSpan()) {\n\t\t\tthis.fire('zoomlevelschange');\n\t\t}\n\n\t\tif (this.options.maxZoom === undefined && this._layersMaxZoom && this.getZoom() > this._layersMaxZoom) {\n\t\t\tthis.setZoom(this._layersMaxZoom);\n\t\t}\n\t\tif (this.options.minZoom === undefined && this._layersMinZoom && this.getZoom() < this._layersMinZoom) {\n\t\t\tthis.setZoom(this._layersMinZoom);\n\t\t}\n\t}\n});\n", "\r\nimport {Layer} from './Layer';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class LayerGroup\r\n * @aka L.LayerGroup\r\n * @inherits Interactive layer\r\n *\r\n * Used to group several layers and handle them as one. If you add it to the map,\r\n * any layers added or removed from the group will be added/removed on the map as\r\n * well. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.layerGroup([marker1, marker2])\r\n * \t.addLayer(polyline)\r\n * \t.addTo(map);\r\n * ```\r\n */\r\n\r\nexport var LayerGroup = Layer.extend({\r\n\r\n\tinitialize: function (layers, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._layers = {};\r\n\r\n\t\tvar i, len;\r\n\r\n\t\tif (layers) {\r\n\t\t\tfor (i = 0, len = layers.length; i < len; i++) {\r\n\t\t\t\tthis.addLayer(layers[i]);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// @method addLayer(layer: Layer): this\r\n\t// Adds the given layer to the group.\r\n\taddLayer: function (layer) {\r\n\t\tvar id = this.getLayerId(layer);\r\n\r\n\t\tthis._layers[id] = layer;\r\n\r\n\t\tif (this._map) {\r\n\t\t\tthis._map.addLayer(layer);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method removeLayer(layer: Layer): this\r\n\t// Removes the given layer from the group.\r\n\t// @alternative\r\n\t// @method removeLayer(id: Number): this\r\n\t// Removes the layer with the given internal ID from the group.\r\n\tremoveLayer: function (layer) {\r\n\t\tvar id = layer in this._layers ? layer : this.getLayerId(layer);\r\n\r\n\t\tif (this._map && this._layers[id]) {\r\n\t\t\tthis._map.removeLayer(this._layers[id]);\r\n\t\t}\r\n\r\n\t\tdelete this._layers[id];\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method hasLayer(layer: Layer): Boolean\r\n\t// Returns `true` if the given layer is currently added to the group.\r\n\t// @alternative\r\n\t// @method hasLayer(id: Number): Boolean\r\n\t// Returns `true` if the given internal ID is currently added to the group.\r\n\thasLayer: function (layer) {\r\n\t\tvar layerId = typeof layer === 'number' ? layer : this.getLayerId(layer);\r\n\t\treturn layerId in this._layers;\r\n\t},\r\n\r\n\t// @method clearLayers(): this\r\n\t// Removes all the layers from the group.\r\n\tclearLayers: function () {\r\n\t\treturn this.eachLayer(this.removeLayer, this);\r\n\t},\r\n\r\n\t// @method invoke(methodName: String, …): this\r\n\t// Calls `methodName` on every layer contained in this group, passing any\r\n\t// additional parameters. Has no effect if the layers contained do not\r\n\t// implement `methodName`.\r\n\tinvoke: function (methodName) {\r\n\t\tvar args = Array.prototype.slice.call(arguments, 1),\r\n\t\t    i, layer;\r\n\r\n\t\tfor (i in this._layers) {\r\n\t\t\tlayer = this._layers[i];\r\n\r\n\t\t\tif (layer[methodName]) {\r\n\t\t\t\tlayer[methodName].apply(layer, args);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis.eachLayer(map.addLayer, map);\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tthis.eachLayer(map.removeLayer, map);\r\n\t},\r\n\r\n\t// @method eachLayer(fn: Function, context?: Object): this\r\n\t// Iterates over the layers of the group, optionally specifying context of the iterator function.\r\n\t// ```js\r\n\t// group.eachLayer(function (layer) {\r\n\t// \tlayer.bindPopup('Hello');\r\n\t// });\r\n\t// ```\r\n\teachLayer: function (method, context) {\r\n\t\tfor (var i in this._layers) {\r\n\t\t\tmethod.call(context, this._layers[i]);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getLayer(id: Number): Layer\r\n\t// Returns the layer with the given internal ID.\r\n\tgetLayer: function (id) {\r\n\t\treturn this._layers[id];\r\n\t},\r\n\r\n\t// @method getLayers(): Layer[]\r\n\t// Returns an array of all the layers added to the group.\r\n\tgetLayers: function () {\r\n\t\tvar layers = [];\r\n\t\tthis.eachLayer(layers.push, layers);\r\n\t\treturn layers;\r\n\t},\r\n\r\n\t// @method setZIndex(zIndex: Number): this\r\n\t// Calls `setZIndex` on every layer contained in this group, passing the z-index.\r\n\tsetZIndex: function (zIndex) {\r\n\t\treturn this.invoke('setZIndex', zIndex);\r\n\t},\r\n\r\n\t// @method getLayerId(layer: Layer): Number\r\n\t// Returns the internal ID for a layer\r\n\tgetLayerId: function (layer) {\r\n\t\treturn Util.stamp(layer);\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.layerGroup(layers?: Layer[], options?: Object)\r\n// Create a layer group, optionally given an initial set of layers and an `options` object.\r\nexport var layerGroup = function (layers, options) {\r\n\treturn new LayerGroup(layers, options);\r\n};\r\n", "import {LayerGroup} from './LayerGroup';\r\nimport {LatLngBounds} from '../geo/LatLngBounds';\r\n\r\n/*\r\n * @class FeatureGroup\r\n * @aka L.FeatureGroup\r\n * @inherits LayerGroup\r\n *\r\n * Extended `LayerGroup` that makes it easier to do the same thing to all its member layers:\r\n *  * [`bindPopup`](#layer-bindpopup) binds a popup to all of the layers at once (likewise with [`bindTooltip`](#layer-bindtooltip))\r\n *  * Events are propagated to the `FeatureGroup`, so if the group has an event\r\n * handler, it will handle events from any of the layers. This includes mouse events\r\n * and custom events.\r\n *  * Has `layeradd` and `layerremove` events\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.featureGroup([marker1, marker2, polyline])\r\n * \t.bindPopup('Hello world!')\r\n * \t.on('click', function() { alert('Clicked on a member of the group!'); })\r\n * \t.addTo(map);\r\n * ```\r\n */\r\n\r\nexport var FeatureGroup = LayerGroup.extend({\r\n\r\n\taddLayer: function (layer) {\r\n\t\tif (this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tlayer.addEventParent(this);\r\n\r\n\t\tLayerGroup.prototype.addLayer.call(this, layer);\r\n\r\n\t\t// @event layeradd: LayerEvent\r\n\t\t// Fired when a layer is added to this `FeatureGroup`\r\n\t\treturn this.fire('layeradd', {layer: layer});\r\n\t},\r\n\r\n\tremoveLayer: function (layer) {\r\n\t\tif (!this.hasLayer(layer)) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tif (layer in this._layers) {\r\n\t\t\tlayer = this._layers[layer];\r\n\t\t}\r\n\r\n\t\tlayer.removeEventParent(this);\r\n\r\n\t\tLayerGroup.prototype.removeLayer.call(this, layer);\r\n\r\n\t\t// @event layerremove: LayerEvent\r\n\t\t// Fired when a layer is removed from this `FeatureGroup`\r\n\t\treturn this.fire('layerremove', {layer: layer});\r\n\t},\r\n\r\n\t// @method setStyle(style: Path options): this\r\n\t// Sets the given path options to each layer of the group that has a `setStyle` method.\r\n\tsetStyle: function (style) {\r\n\t\treturn this.invoke('setStyle', style);\r\n\t},\r\n\r\n\t// @method bringToFront(): this\r\n\t// Brings the layer group to the top of all other layers\r\n\tbringToFront: function () {\r\n\t\treturn this.invoke('bringToFront');\r\n\t},\r\n\r\n\t// @method bringToBack(): this\r\n\t// Brings the layer group to the back of all other layers\r\n\tbringToBack: function () {\r\n\t\treturn this.invoke('bringToBack');\r\n\t},\r\n\r\n\t// @method getBounds(): LatLngBounds\r\n\t// Returns the LatLngBounds of the Feature Group (created from bounds and coordinates of its children).\r\n\tgetBounds: function () {\r\n\t\tvar bounds = new LatLngBounds();\r\n\r\n\t\tfor (var id in this._layers) {\r\n\t\t\tvar layer = this._layers[id];\r\n\t\t\tbounds.extend(layer.getBounds ? layer.getBounds() : layer.getLatLng());\r\n\t\t}\r\n\t\treturn bounds;\r\n\t}\r\n});\r\n\r\n// @factory L.featureGroup(layers?: Layer[], options?: Object)\r\n// Create a feature group, optionally given an initial set of layers and an `options` object.\r\nexport var featureGroup = function (layers, options) {\r\n\treturn new FeatureGroup(layers, options);\r\n};\r\n", "import {Class} from '../../core/Class';\r\nimport {setOptions} from '../../core/Util';\r\nimport {toPoint as point} from '../../geometry/Point';\r\nimport Browser from '../../core/Browser';\r\n\r\n/*\r\n * @class Icon\r\n * @aka L.Icon\r\n *\r\n * Represents an icon to provide when creating a marker.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var myIcon = L.icon({\r\n *     iconUrl: 'my-icon.png',\r\n *     iconRetinaUrl: 'my-icon@2x.png',\r\n *     iconSize: [38, 95],\r\n *     iconAnchor: [22, 94],\r\n *     popupAnchor: [-3, -76],\r\n *     shadowUrl: 'my-icon-shadow.png',\r\n *     shadowRetinaUrl: 'my-icon-shadow@2x.png',\r\n *     shadowSize: [68, 95],\r\n *     shadowAnchor: [22, 94]\r\n * });\r\n *\r\n * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\r\n * ```\r\n *\r\n * `L.Icon.Default` extends `L.Icon` and is the blue icon Leaflet uses for markers by default.\r\n *\r\n */\r\n\r\nexport var Icon = Class.extend({\r\n\r\n\t/* @section\r\n\t * @aka Icon options\r\n\t *\r\n\t * @option iconUrl: String = null\r\n\t * **(required)** The URL to the icon image (absolute or relative to your script path).\r\n\t *\r\n\t * @option iconRetinaUrl: String = null\r\n\t * The URL to a retina sized version of the icon image (absolute or relative to your\r\n\t * script path). Used for Retina screen devices.\r\n\t *\r\n\t * @option iconSize: Point = null\r\n\t * Size of the icon image in pixels.\r\n\t *\r\n\t * @option iconAnchor: Point = null\r\n\t * The coordinates of the \"tip\" of the icon (relative to its top left corner). The icon\r\n\t * will be aligned so that this point is at the marker's geographical location. Centered\r\n\t * by default if size is specified, also can be set in CSS with negative margins.\r\n\t *\r\n\t * @option popupAnchor: Point = [0, 0]\r\n\t * The coordinates of the point from which popups will \"open\", relative to the icon anchor.\r\n\t *\r\n\t * @option tooltipAnchor: Point = [0, 0]\r\n\t * The coordinates of the point from which tooltips will \"open\", relative to the icon anchor.\r\n\t *\r\n\t * @option shadowUrl: String = null\r\n\t * The URL to the icon shadow image. If not specified, no shadow image will be created.\r\n\t *\r\n\t * @option shadowRetinaUrl: String = null\r\n\t *\r\n\t * @option shadowSize: Point = null\r\n\t * Size of the shadow image in pixels.\r\n\t *\r\n\t * @option shadowAnchor: Point = null\r\n\t * The coordinates of the \"tip\" of the shadow (relative to its top left corner) (the same\r\n\t * as iconAnchor if not specified).\r\n\t *\r\n\t * @option className: String = ''\r\n\t * A custom class name to assign to both icon and shadow images. Empty by default.\r\n\t */\r\n\r\n\toptions: {\r\n\t\tpopupAnchor: [0, 0],\r\n\t\ttooltipAnchor: [0, 0],\r\n\r\n\t\t// @option crossOrigin: Boolean|String = false\r\n\t\t// Whether the crossOrigin attribute will be added to the tiles.\r\n\t\t// If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.\r\n\t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n\t\tcrossOrigin: false\r\n\t},\r\n\r\n\tinitialize: function (options) {\r\n\t\tsetOptions(this, options);\r\n\t},\r\n\r\n\t// @method createIcon(oldIcon?: HTMLElement): HTMLElement\r\n\t// Called internally when the icon has to be shown, returns a `<img>` HTML element\r\n\t// styled according to the options.\r\n\tcreateIcon: function (oldIcon) {\r\n\t\treturn this._createIcon('icon', oldIcon);\r\n\t},\r\n\r\n\t// @method createShadow(oldIcon?: HTMLElement): HTMLElement\r\n\t// As `createIcon`, but for the shadow beneath it.\r\n\tcreateShadow: function (oldIcon) {\r\n\t\treturn this._createIcon('shadow', oldIcon);\r\n\t},\r\n\r\n\t_createIcon: function (name, oldIcon) {\r\n\t\tvar src = this._getIconUrl(name);\r\n\r\n\t\tif (!src) {\r\n\t\t\tif (name === 'icon') {\r\n\t\t\t\tthrow new Error('iconUrl not set in Icon options (see the docs).');\r\n\t\t\t}\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tvar img = this._createImg(src, oldIcon && oldIcon.tagName === 'IMG' ? oldIcon : null);\r\n\t\tthis._setIconStyles(img, name);\r\n\r\n\t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n\t\t\timg.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n\t\t}\r\n\r\n\t\treturn img;\r\n\t},\r\n\r\n\t_setIconStyles: function (img, name) {\r\n\t\tvar options = this.options;\r\n\t\tvar sizeOption = options[name + 'Size'];\r\n\r\n\t\tif (typeof sizeOption === 'number') {\r\n\t\t\tsizeOption = [sizeOption, sizeOption];\r\n\t\t}\r\n\r\n\t\tvar size = point(sizeOption),\r\n\t\t    anchor = point(name === 'shadow' && options.shadowAnchor || options.iconAnchor ||\r\n\t\t            size && size.divideBy(2, true));\r\n\r\n\t\timg.className = 'leaflet-marker-' + name + ' ' + (options.className || '');\r\n\r\n\t\tif (anchor) {\r\n\t\t\timg.style.marginLeft = (-anchor.x) + 'px';\r\n\t\t\timg.style.marginTop  = (-anchor.y) + 'px';\r\n\t\t}\r\n\r\n\t\tif (size) {\r\n\t\t\timg.style.width  = size.x + 'px';\r\n\t\t\timg.style.height = size.y + 'px';\r\n\t\t}\r\n\t},\r\n\r\n\t_createImg: function (src, el) {\r\n\t\tel = el || document.createElement('img');\r\n\t\tel.src = src;\r\n\t\treturn el;\r\n\t},\r\n\r\n\t_getIconUrl: function (name) {\r\n\t\treturn Browser.retina && this.options[name + 'RetinaUrl'] || this.options[name + 'Url'];\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.icon(options: Icon options)\r\n// Creates an icon instance with the given options.\r\nexport function icon(options) {\r\n\treturn new Icon(options);\r\n}\r\n", "import {Icon} from './Icon';\nimport * as DomUtil from '../../dom/DomUtil';\n\n/*\n * @miniclass Icon.Default (Icon)\n * @aka L.Icon.Default\n * @section\n *\n * A trivial subclass of `Icon`, represents the icon to use in `Marker`s when\n * no icon is specified. Points to the blue marker image distributed with Leaflet\n * releases.\n *\n * In order to customize the default icon, just change the properties of `L.Icon.Default.prototype.options`\n * (which is a set of `Icon options`).\n *\n * If you want to _completely_ replace the default icon, override the\n * `L.Marker.prototype.options.icon` with your own icon instead.\n */\n\nexport var IconDefault = Icon.extend({\n\n\toptions: {\n\t\ticonUrl:       'marker-icon.png',\n\t\ticonRetinaUrl: 'marker-icon-2x.png',\n\t\tshadowUrl:     'marker-shadow.png',\n\t\ticonSize:    [25, 41],\n\t\ticonAnchor:  [12, 41],\n\t\tpopupAnchor: [1, -34],\n\t\ttooltipAnchor: [16, -28],\n\t\tshadowSize:  [41, 41]\n\t},\n\n\t_getIconUrl: function (name) {\n\t\tif (typeof IconDefault.imagePath !== 'string') {\t// Deprecated, backwards-compatibility only\n\t\t\tIconDefault.imagePath = this._detectIconPath();\n\t\t}\n\n\t\t// @option imagePath: String\n\t\t// `Icon.Default` will try to auto-detect the location of the\n\t\t// blue icon images. If you are placing these images in a non-standard\n\t\t// way, set this option to point to the right path.\n\t\treturn (this.options.imagePath || IconDefault.imagePath) + Icon.prototype._getIconUrl.call(this, name);\n\t},\n\n\t_stripUrl: function (path) {\t// separate function to use in tests\n\t\tvar strip = function (str, re, idx) {\n\t\t\tvar match = re.exec(str);\n\t\t\treturn match && match[idx];\n\t\t};\n\t\tpath = strip(path, /^url\\((['\"])?(.+)\\1\\)$/, 2);\n\t\treturn path && strip(path, /^(.*)marker-icon\\.png$/, 1);\n\t},\n\n\t_detectIconPath: function () {\n\t\tvar el = DomUtil.create('div',  'leaflet-default-icon-path', document.body);\n\t\tvar path = DomUtil.getStyle(el, 'background-image') ||\n\t\t           DomUtil.getStyle(el, 'backgroundImage');\t// IE8\n\n\t\tdocument.body.removeChild(el);\n\t\tpath = this._stripUrl(path);\n\t\tif (path) { return path; }\n\t\tvar link = document.querySelector('link[href$=\"leaflet.css\"]');\n\t\tif (!link) { return ''; }\n\t\treturn link.href.substring(0, link.href.length - 'leaflet.css'.length - 1);\n\t}\n});\n", "import {Handler} from '../../core/Handler';\nimport * as DomUtil from '../../dom/DomUtil';\nimport {Draggable} from '../../dom/Draggable';\nimport {toBounds} from '../../geometry/Bounds';\nimport {toPoint} from '../../geometry/Point';\nimport {requestAnimFrame, cancelAnimFrame} from '../../core/Util';\n\n/*\n * L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable.\n */\n\n\n/* @namespace Marker\n * @section Interaction handlers\n *\n * Interaction handlers are properties of a marker instance that allow you to control interaction behavior in runtime, enabling or disabling certain features such as dragging (see `Handler` methods). Example:\n *\n * ```js\n * marker.dragging.disable();\n * ```\n *\n * @property dragging: Handler\n * Marker dragging handler (by both mouse and touch). Only valid when the marker is on the map (Otherwise set [`marker.options.draggable`](#marker-draggable)).\n */\n\nexport var MarkerDrag = Handler.extend({\n\tinitialize: function (marker) {\n\t\tthis._marker = marker;\n\t},\n\n\taddHooks: function () {\n\t\tvar icon = this._marker._icon;\n\n\t\tif (!this._draggable) {\n\t\t\tthis._draggable = new Draggable(icon, icon, true);\n\t\t}\n\n\t\tthis._draggable.on({\n\t\t\tdragstart: this._onDragStart,\n\t\t\tpredrag: this._onPreDrag,\n\t\t\tdrag: this._onDrag,\n\t\t\tdragend: this._onDragEnd\n\t\t}, this).enable();\n\n\t\tDomUtil.addClass(icon, 'leaflet-marker-draggable');\n\t},\n\n\tremoveHooks: function () {\n\t\tthis._draggable.off({\n\t\t\tdragstart: this._onDragStart,\n\t\t\tpredrag: this._onPreDrag,\n\t\t\tdrag: this._onDrag,\n\t\t\tdragend: this._onDragEnd\n\t\t}, this).disable();\n\n\t\tif (this._marker._icon) {\n\t\t\tDomUtil.removeClass(this._marker._icon, 'leaflet-marker-draggable');\n\t\t}\n\t},\n\n\tmoved: function () {\n\t\treturn this._draggable && this._draggable._moved;\n\t},\n\n\t_adjustPan: function (e) {\n\t\tvar marker = this._marker,\n\t\t    map = marker._map,\n\t\t    speed = this._marker.options.autoPanSpeed,\n\t\t    padding = this._marker.options.autoPanPadding,\n\t\t    iconPos = DomUtil.getPosition(marker._icon),\n\t\t    bounds = map.getPixelBounds(),\n\t\t    origin = map.getPixelOrigin();\n\n\t\tvar panBounds = toBounds(\n\t\t\tbounds.min._subtract(origin).add(padding),\n\t\t\tbounds.max._subtract(origin).subtract(padding)\n\t\t);\n\n\t\tif (!panBounds.contains(iconPos)) {\n\t\t\t// Compute incremental movement\n\t\t\tvar movement = toPoint(\n\t\t\t\t(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -\n\t\t\t\t(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),\n\n\t\t\t\t(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -\n\t\t\t\t(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)\n\t\t\t).multiplyBy(speed);\n\n\t\t\tmap.panBy(movement, {animate: false});\n\n\t\t\tthis._draggable._newPos._add(movement);\n\t\t\tthis._draggable._startPos._add(movement);\n\n\t\t\tDomUtil.setPosition(marker._icon, this._draggable._newPos);\n\t\t\tthis._onDrag(e);\n\n\t\t\tthis._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t},\n\n\t_onDragStart: function () {\n\t\t// @section Dragging events\n\t\t// @event dragstart: Event\n\t\t// Fired when the user starts dragging the marker.\n\n\t\t// @event movestart: Event\n\t\t// Fired when the marker starts moving (because of dragging).\n\n\t\tthis._oldLatLng = this._marker.getLatLng();\n\n\t\t// When using ES6 imports it could not be set when `Popup` was not imported as well\n\t\tthis._marker.closePopup && this._marker.closePopup();\n\n\t\tthis._marker\n\t\t\t.fire('movestart')\n\t\t\t.fire('dragstart');\n\t},\n\n\t_onPreDrag: function (e) {\n\t\tif (this._marker.options.autoPan) {\n\t\t\tcancelAnimFrame(this._panRequest);\n\t\t\tthis._panRequest = requestAnimFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t},\n\n\t_onDrag: function (e) {\n\t\tvar marker = this._marker,\n\t\t    shadow = marker._shadow,\n\t\t    iconPos = DomUtil.getPosition(marker._icon),\n\t\t    latlng = marker._map.layerPointToLatLng(iconPos);\n\n\t\t// update shadow position\n\t\tif (shadow) {\n\t\t\tDomUtil.setPosition(shadow, iconPos);\n\t\t}\n\n\t\tmarker._latlng = latlng;\n\t\te.latlng = latlng;\n\t\te.oldLatLng = this._oldLatLng;\n\n\t\t// @event drag: Event\n\t\t// Fired repeatedly while the user drags the marker.\n\t\tmarker\n\t\t    .fire('move', e)\n\t\t    .fire('drag', e);\n\t},\n\n\t_onDragEnd: function (e) {\n\t\t// @event dragend: DragEndEvent\n\t\t// Fired when the user stops dragging the marker.\n\n\t\t cancelAnimFrame(this._panRequest);\n\n\t\t// @event moveend: Event\n\t\t// Fired when the marker stops moving (because of dragging).\n\t\tdelete this._oldLatLng;\n\t\tthis._marker\n\t\t    .fire('moveend')\n\t\t    .fire('dragend', e);\n\t}\n});\n", "import {Layer} from '../Layer';\r\nimport {IconDefault} from './Icon.Default';\r\nimport * as Util from '../../core/Util';\r\nimport {toLatLng as latLng} from '../../geo/LatLng';\r\nimport {toPoint as point} from '../../geometry/Point';\r\nimport * as DomUtil from '../../dom/DomUtil';\r\nimport * as DomEvent from '../../dom/DomEvent';\r\nimport {MarkerDrag} from './Marker.Drag';\r\n\r\n/*\r\n * @class Marker\r\n * @inherits Interactive layer\r\n * @aka L.Marker\r\n * L.Marker is used to display clickable/draggable icons on the map. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.marker([50.5, 30.5]).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var Marker = Layer.extend({\r\n\r\n\t// @section\r\n\t// @aka Marker options\r\n\toptions: {\r\n\t\t// @option icon: Icon = *\r\n\t\t// Icon instance to use for rendering the marker.\r\n\t\t// See [Icon documentation](#L.Icon) for details on how to customize the marker icon.\r\n\t\t// If not specified, a common instance of `L.Icon.Default` is used.\r\n\t\ticon: new IconDefault(),\r\n\r\n\t\t// Option inherited from \"Interactive layer\" abstract class\r\n\t\tinteractive: true,\r\n\r\n\t\t// @option keyboard: Boolean = true\r\n\t\t// Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.\r\n\t\tkeyboard: true,\r\n\r\n\t\t// @option title: String = ''\r\n\t\t// Text for the browser tooltip that appear on marker hover (no tooltip by default).\r\n\t\t// [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).\r\n\t\ttitle: '',\r\n\r\n\t\t// @option alt: String = 'Marker'\r\n\t\t// Text for the `alt` attribute of the icon image.\r\n\t\t// [Useful for accessibility](https://leafletjs.com/examples/accessibility/#markers-must-be-labelled).\r\n\t\talt: 'Marker',\r\n\r\n\t\t// @option zIndexOffset: Number = 0\r\n\t\t// By default, marker images zIndex is set automatically based on its latitude. Use this option if you want to put the marker on top of all others (or below), specifying a high value like `1000` (or high negative value, respectively).\r\n\t\tzIndexOffset: 0,\r\n\r\n\t\t// @option opacity: Number = 1.0\r\n\t\t// The opacity of the marker.\r\n\t\topacity: 1,\r\n\r\n\t\t// @option riseOnHover: Boolean = false\r\n\t\t// If `true`, the marker will get on top of others when you hover the mouse over it.\r\n\t\triseOnHover: false,\r\n\r\n\t\t// @option riseOffset: Number = 250\r\n\t\t// The z-index offset used for the `riseOnHover` feature.\r\n\t\triseOffset: 250,\r\n\r\n\t\t// @option pane: String = 'markerPane'\r\n\t\t// `Map pane` where the markers icon will be added.\r\n\t\tpane: 'markerPane',\r\n\r\n\t\t// @option shadowPane: String = 'shadowPane'\r\n\t\t// `Map pane` where the markers shadow will be added.\r\n\t\tshadowPane: 'shadowPane',\r\n\r\n\t\t// @option bubblingMouseEvents: Boolean = false\r\n\t\t// When `true`, a mouse event on this marker will trigger the same event on the map\r\n\t\t// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\r\n\t\tbubblingMouseEvents: false,\r\n\r\n\t\t// @option autoPanOnFocus: Boolean = true\r\n\t\t// When `true`, the map will pan whenever the marker is focused (via\r\n\t\t// e.g. pressing `tab` on the keyboard) to ensure the marker is\r\n\t\t// visible within the map's bounds\r\n\t\tautoPanOnFocus: true,\r\n\r\n\t\t// @section Draggable marker options\r\n\t\t// @option draggable: Boolean = false\r\n\t\t// Whether the marker is draggable with mouse/touch or not.\r\n\t\tdraggable: false,\r\n\r\n\t\t// @option autoPan: Boolean = false\r\n\t\t// Whether to pan the map when dragging this marker near its edge or not.\r\n\t\tautoPan: false,\r\n\r\n\t\t// @option autoPanPadding: Point = Point(50, 50)\r\n\t\t// Distance (in pixels to the left/right and to the top/bottom) of the\r\n\t\t// map edge to start panning the map.\r\n\t\tautoPanPadding: [50, 50],\r\n\r\n\t\t// @option autoPanSpeed: Number = 10\r\n\t\t// Number of pixels the map should pan by.\r\n\t\tautoPanSpeed: 10\r\n\t},\r\n\r\n\t/* @section\r\n\t *\r\n\t * In addition to [shared layer methods](#Layer) like `addTo()` and `remove()` and [popup methods](#Popup) like bindPopup() you can also use the following methods:\r\n\t */\r\n\r\n\tinitialize: function (latlng, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\t\tthis._latlng = latLng(latlng);\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis._zoomAnimated = this._zoomAnimated && map.options.markerZoomAnimation;\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tmap.on('zoomanim', this._animateZoom, this);\r\n\t\t}\r\n\r\n\t\tthis._initIcon();\r\n\t\tthis.update();\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tif (this.dragging && this.dragging.enabled()) {\r\n\t\t\tthis.options.draggable = true;\r\n\t\t\tthis.dragging.removeHooks();\r\n\t\t}\r\n\t\tdelete this.dragging;\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tmap.off('zoomanim', this._animateZoom, this);\r\n\t\t}\r\n\r\n\t\tthis._removeIcon();\r\n\t\tthis._removeShadow();\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\treturn {\r\n\t\t\tzoom: this.update,\r\n\t\t\tviewreset: this.update\r\n\t\t};\r\n\t},\r\n\r\n\t// @method getLatLng: LatLng\r\n\t// Returns the current geographical position of the marker.\r\n\tgetLatLng: function () {\r\n\t\treturn this._latlng;\r\n\t},\r\n\r\n\t// @method setLatLng(latlng: LatLng): this\r\n\t// Changes the marker position to the given point.\r\n\tsetLatLng: function (latlng) {\r\n\t\tvar oldLatLng = this._latlng;\r\n\t\tthis._latlng = latLng(latlng);\r\n\t\tthis.update();\r\n\r\n\t\t// @event move: Event\r\n\t\t// Fired when the marker is moved via [`setLatLng`](#marker-setlatlng) or by [dragging](#marker-dragging). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.\r\n\t\treturn this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\r\n\t},\r\n\r\n\t// @method setZIndexOffset(offset: Number): this\r\n\t// Changes the [zIndex offset](#marker-zindexoffset) of the marker.\r\n\tsetZIndexOffset: function (offset) {\r\n\t\tthis.options.zIndexOffset = offset;\r\n\t\treturn this.update();\r\n\t},\r\n\r\n\t// @method getIcon: Icon\r\n\t// Returns the current icon used by the marker\r\n\tgetIcon: function () {\r\n\t\treturn this.options.icon;\r\n\t},\r\n\r\n\t// @method setIcon(icon: Icon): this\r\n\t// Changes the marker icon.\r\n\tsetIcon: function (icon) {\r\n\r\n\t\tthis.options.icon = icon;\r\n\r\n\t\tif (this._map) {\r\n\t\t\tthis._initIcon();\r\n\t\t\tthis.update();\r\n\t\t}\r\n\r\n\t\tif (this._popup) {\r\n\t\t\tthis.bindPopup(this._popup, this._popup.options);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\tgetElement: function () {\r\n\t\treturn this._icon;\r\n\t},\r\n\r\n\tupdate: function () {\r\n\r\n\t\tif (this._icon && this._map) {\r\n\t\t\tvar pos = this._map.latLngToLayerPoint(this._latlng).round();\r\n\t\t\tthis._setPos(pos);\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_initIcon: function () {\r\n\t\tvar options = this.options,\r\n\t\t    classToAdd = 'leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\r\n\r\n\t\tvar icon = options.icon.createIcon(this._icon),\r\n\t\t    addIcon = false;\r\n\r\n\t\t// if we're not reusing the icon, remove the old one and init new one\r\n\t\tif (icon !== this._icon) {\r\n\t\t\tif (this._icon) {\r\n\t\t\t\tthis._removeIcon();\r\n\t\t\t}\r\n\t\t\taddIcon = true;\r\n\r\n\t\t\tif (options.title) {\r\n\t\t\t\ticon.title = options.title;\r\n\t\t\t}\r\n\r\n\t\t\tif (icon.tagName === 'IMG') {\r\n\t\t\t\ticon.alt = options.alt || '';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tDomUtil.addClass(icon, classToAdd);\r\n\r\n\t\tif (options.keyboard) {\r\n\t\t\ticon.tabIndex = '0';\r\n\t\t\ticon.setAttribute('role', 'button');\r\n\t\t}\r\n\r\n\t\tthis._icon = icon;\r\n\r\n\t\tif (options.riseOnHover) {\r\n\t\t\tthis.on({\r\n\t\t\t\tmouseover: this._bringToFront,\r\n\t\t\t\tmouseout: this._resetZIndex\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.options.autoPanOnFocus) {\r\n\t\t\tDomEvent.on(icon, 'focus', this._panOnFocus, this);\r\n\t\t}\r\n\r\n\t\tvar newShadow = options.icon.createShadow(this._shadow),\r\n\t\t    addShadow = false;\r\n\r\n\t\tif (newShadow !== this._shadow) {\r\n\t\t\tthis._removeShadow();\r\n\t\t\taddShadow = true;\r\n\t\t}\r\n\r\n\t\tif (newShadow) {\r\n\t\t\tDomUtil.addClass(newShadow, classToAdd);\r\n\t\t\tnewShadow.alt = '';\r\n\t\t}\r\n\t\tthis._shadow = newShadow;\r\n\r\n\r\n\t\tif (options.opacity < 1) {\r\n\t\t\tthis._updateOpacity();\r\n\t\t}\r\n\r\n\r\n\t\tif (addIcon) {\r\n\t\t\tthis.getPane().appendChild(this._icon);\r\n\t\t}\r\n\t\tthis._initInteraction();\r\n\t\tif (newShadow && addShadow) {\r\n\t\t\tthis.getPane(options.shadowPane).appendChild(this._shadow);\r\n\t\t}\r\n\t},\r\n\r\n\t_removeIcon: function () {\r\n\t\tif (this.options.riseOnHover) {\r\n\t\t\tthis.off({\r\n\t\t\t\tmouseover: this._bringToFront,\r\n\t\t\t\tmouseout: this._resetZIndex\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tif (this.options.autoPanOnFocus) {\r\n\t\t\tDomEvent.off(this._icon, 'focus', this._panOnFocus, this);\r\n\t\t}\r\n\r\n\t\tDomUtil.remove(this._icon);\r\n\t\tthis.removeInteractiveTarget(this._icon);\r\n\r\n\t\tthis._icon = null;\r\n\t},\r\n\r\n\t_removeShadow: function () {\r\n\t\tif (this._shadow) {\r\n\t\t\tDomUtil.remove(this._shadow);\r\n\t\t}\r\n\t\tthis._shadow = null;\r\n\t},\r\n\r\n\t_setPos: function (pos) {\r\n\r\n\t\tif (this._icon) {\r\n\t\t\tDomUtil.setPosition(this._icon, pos);\r\n\t\t}\r\n\r\n\t\tif (this._shadow) {\r\n\t\t\tDomUtil.setPosition(this._shadow, pos);\r\n\t\t}\r\n\r\n\t\tthis._zIndex = pos.y + this.options.zIndexOffset;\r\n\r\n\t\tthis._resetZIndex();\r\n\t},\r\n\r\n\t_updateZIndex: function (offset) {\r\n\t\tif (this._icon) {\r\n\t\t\tthis._icon.style.zIndex = this._zIndex + offset;\r\n\t\t}\r\n\t},\r\n\r\n\t_animateZoom: function (opt) {\r\n\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, opt.zoom, opt.center).round();\r\n\r\n\t\tthis._setPos(pos);\r\n\t},\r\n\r\n\t_initInteraction: function () {\r\n\r\n\t\tif (!this.options.interactive) { return; }\r\n\r\n\t\tDomUtil.addClass(this._icon, 'leaflet-interactive');\r\n\r\n\t\tthis.addInteractiveTarget(this._icon);\r\n\r\n\t\tif (MarkerDrag) {\r\n\t\t\tvar draggable = this.options.draggable;\r\n\t\t\tif (this.dragging) {\r\n\t\t\t\tdraggable = this.dragging.enabled();\r\n\t\t\t\tthis.dragging.disable();\r\n\t\t\t}\r\n\r\n\t\t\tthis.dragging = new MarkerDrag(this);\r\n\r\n\t\t\tif (draggable) {\r\n\t\t\t\tthis.dragging.enable();\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t// @method setOpacity(opacity: Number): this\r\n\t// Changes the opacity of the marker.\r\n\tsetOpacity: function (opacity) {\r\n\t\tthis.options.opacity = opacity;\r\n\t\tif (this._map) {\r\n\t\t\tthis._updateOpacity();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t_updateOpacity: function () {\r\n\t\tvar opacity = this.options.opacity;\r\n\r\n\t\tif (this._icon) {\r\n\t\t\tDomUtil.setOpacity(this._icon, opacity);\r\n\t\t}\r\n\r\n\t\tif (this._shadow) {\r\n\t\t\tDomUtil.setOpacity(this._shadow, opacity);\r\n\t\t}\r\n\t},\r\n\r\n\t_bringToFront: function () {\r\n\t\tthis._updateZIndex(this.options.riseOffset);\r\n\t},\r\n\r\n\t_resetZIndex: function () {\r\n\t\tthis._updateZIndex(0);\r\n\t},\r\n\r\n\t_panOnFocus: function () {\r\n\t\tvar map = this._map;\r\n\t\tif (!map) { return; }\r\n\r\n\t\tvar iconOpts = this.options.icon.options;\r\n\t\tvar size = iconOpts.iconSize ? point(iconOpts.iconSize) : point(0, 0);\r\n\t\tvar anchor = iconOpts.iconAnchor ? point(iconOpts.iconAnchor) : point(0, 0);\r\n\r\n\t\tmap.panInside(this._latlng, {\r\n\t\t\tpaddingTopLeft: anchor,\r\n\t\t\tpaddingBottomRight: size.subtract(anchor)\r\n\t\t});\r\n\t},\r\n\r\n\t_getPopupAnchor: function () {\r\n\t\treturn this.options.icon.options.popupAnchor;\r\n\t},\r\n\r\n\t_getTooltipAnchor: function () {\r\n\t\treturn this.options.icon.options.tooltipAnchor;\r\n\t}\r\n});\r\n\r\n\r\n// factory L.marker(latlng: LatLng, options? : Marker options)\r\n\r\n// @factory L.marker(latlng: LatLng, options? : Marker options)\r\n// Instantiates a Marker object given a geographical point and optionally an options object.\r\nexport function marker(latlng, options) {\r\n\treturn new Marker(latlng, options);\r\n}\r\n", "import {Layer} from '../Layer';\nimport * as Util from '../../core/Util';\n\n/*\n * @class Path\n * @aka L.Path\n * @inherits Interactive layer\n *\n * An abstract class that contains options and constants shared between vector\n * overlays (Polygon, Polyline, Circle). Do not use it directly. Extends `Layer`.\n */\n\nexport var Path = Layer.extend({\n\n\t// @section\n\t// @aka Path options\n\toptions: {\n\t\t// @option stroke: Boolean = true\n\t\t// Whether to draw stroke along the path. Set it to `false` to disable borders on polygons or circles.\n\t\tstroke: true,\n\n\t\t// @option color: String = '#3388ff'\n\t\t// Stroke color\n\t\tcolor: '#3388ff',\n\n\t\t// @option weight: Number = 3\n\t\t// Stroke width in pixels\n\t\tweight: 3,\n\n\t\t// @option opacity: Number = 1.0\n\t\t// Stroke opacity\n\t\topacity: 1,\n\n\t\t// @option lineCap: String= 'round'\n\t\t// A string that defines [shape to be used at the end](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linecap) of the stroke.\n\t\tlineCap: 'round',\n\n\t\t// @option lineJoin: String = 'round'\n\t\t// A string that defines [shape to be used at the corners](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-linejoin) of the stroke.\n\t\tlineJoin: 'round',\n\n\t\t// @option dashArray: String = null\n\t\t// A string that defines the stroke [dash pattern](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dasharray). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).\n\t\tdashArray: null,\n\n\t\t// @option dashOffset: String = null\n\t\t// A string that defines the [distance into the dash pattern to start the dash](https://developer.mozilla.org/docs/Web/SVG/Attribute/stroke-dashoffset). Doesn't work on `Canvas`-powered layers in [some old browsers](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/setLineDash#Browser_compatibility).\n\t\tdashOffset: null,\n\n\t\t// @option fill: Boolean = depends\n\t\t// Whether to fill the path with color. Set it to `false` to disable filling on polygons or circles.\n\t\tfill: false,\n\n\t\t// @option fillColor: String = *\n\t\t// Fill color. Defaults to the value of the [`color`](#path-color) option\n\t\tfillColor: null,\n\n\t\t// @option fillOpacity: Number = 0.2\n\t\t// Fill opacity.\n\t\tfillOpacity: 0.2,\n\n\t\t// @option fillRule: String = 'evenodd'\n\t\t// A string that defines [how the inside of a shape](https://developer.mozilla.org/docs/Web/SVG/Attribute/fill-rule) is determined.\n\t\tfillRule: 'evenodd',\n\n\t\t// className: '',\n\n\t\t// Option inherited from \"Interactive layer\" abstract class\n\t\tinteractive: true,\n\n\t\t// @option bubblingMouseEvents: Boolean = true\n\t\t// When `true`, a mouse event on this path will trigger the same event on the map\n\t\t// (unless [`L.DomEvent.stopPropagation`](#domevent-stoppropagation) is used).\n\t\tbubblingMouseEvents: true\n\t},\n\n\tbeforeAdd: function (map) {\n\t\t// Renderer is set here because we need to call renderer.getEvents\n\t\t// before this.getEvents.\n\t\tthis._renderer = map.getRenderer(this);\n\t},\n\n\tonAdd: function () {\n\t\tthis._renderer._initPath(this);\n\t\tthis._reset();\n\t\tthis._renderer._addPath(this);\n\t},\n\n\tonRemove: function () {\n\t\tthis._renderer._removePath(this);\n\t},\n\n\t// @method redraw(): this\n\t// Redraws the layer. Sometimes useful after you changed the coordinates that the path uses.\n\tredraw: function () {\n\t\tif (this._map) {\n\t\t\tthis._renderer._updatePath(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method setStyle(style: Path options): this\n\t// Changes the appearance of a Path based on the options in the `Path options` object.\n\tsetStyle: function (style) {\n\t\tUtil.setOptions(this, style);\n\t\tif (this._renderer) {\n\t\t\tthis._renderer._updateStyle(this);\n\t\t\tif (this.options.stroke && style && Object.prototype.hasOwnProperty.call(style, 'weight')) {\n\t\t\t\tthis._updateBounds();\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method bringToFront(): this\n\t// Brings the layer to the top of all path layers.\n\tbringToFront: function () {\n\t\tif (this._renderer) {\n\t\t\tthis._renderer._bringToFront(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method bringToBack(): this\n\t// Brings the layer to the bottom of all path layers.\n\tbringToBack: function () {\n\t\tif (this._renderer) {\n\t\t\tthis._renderer._bringToBack(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\tgetElement: function () {\n\t\treturn this._path;\n\t},\n\n\t_reset: function () {\n\t\t// defined in child classes\n\t\tthis._project();\n\t\tthis._update();\n\t},\n\n\t_clickTolerance: function () {\n\t\t// used when doing hit detection for Canvas layers\n\t\treturn (this.options.stroke ? this.options.weight / 2 : 0) +\n\t\t  (this._renderer.options.tolerance || 0);\n\t}\n});\n", "import {Path} from './Path';\nimport * as Util from '../../core/Util';\nimport {toLatLng} from '../../geo/LatLng';\nimport {Bounds} from '../../geometry/Bounds';\n\n\n/*\n * @class CircleMarker\n * @aka L.CircleMarker\n * @inherits Path\n *\n * A circle of a fixed size with radius specified in pixels. Extends `Path`.\n */\n\nexport var CircleMarker = Path.extend({\n\n\t// @section\n\t// @aka CircleMarker options\n\toptions: {\n\t\tfill: true,\n\n\t\t// @option radius: Number = 10\n\t\t// Radius of the circle marker, in pixels\n\t\tradius: 10\n\t},\n\n\tinitialize: function (latlng, options) {\n\t\tUtil.setOptions(this, options);\n\t\tthis._latlng = toLatLng(latlng);\n\t\tthis._radius = this.options.radius;\n\t},\n\n\t// @method setLatLng(latLng: LatLng): this\n\t// Sets the position of a circle marker to a new location.\n\tsetLatLng: function (latlng) {\n\t\tvar oldLatLng = this._latlng;\n\t\tthis._latlng = toLatLng(latlng);\n\t\tthis.redraw();\n\n\t\t// @event move: Event\n\t\t// Fired when the marker is moved via [`setLatLng`](#circlemarker-setlatlng). Old and new coordinates are included in event arguments as `oldLatLng`, `latlng`.\n\t\treturn this.fire('move', {oldLatLng: oldLatLng, latlng: this._latlng});\n\t},\n\n\t// @method getLatLng(): LatLng\n\t// Returns the current geographical position of the circle marker\n\tgetLatLng: function () {\n\t\treturn this._latlng;\n\t},\n\n\t// @method setRadius(radius: Number): this\n\t// Sets the radius of a circle marker. Units are in pixels.\n\tsetRadius: function (radius) {\n\t\tthis.options.radius = this._radius = radius;\n\t\treturn this.redraw();\n\t},\n\n\t// @method getRadius(): Number\n\t// Returns the current radius of the circle\n\tgetRadius: function () {\n\t\treturn this._radius;\n\t},\n\n\tsetStyle : function (options) {\n\t\tvar radius = options && options.radius || this._radius;\n\t\tPath.prototype.setStyle.call(this, options);\n\t\tthis.setRadius(radius);\n\t\treturn this;\n\t},\n\n\t_project: function () {\n\t\tthis._point = this._map.latLngToLayerPoint(this._latlng);\n\t\tthis._updateBounds();\n\t},\n\n\t_updateBounds: function () {\n\t\tvar r = this._radius,\n\t\t    r2 = this._radiusY || r,\n\t\t    w = this._clickTolerance(),\n\t\t    p = [r + w, r2 + w];\n\t\tthis._pxBounds = new Bounds(this._point.subtract(p), this._point.add(p));\n\t},\n\n\t_update: function () {\n\t\tif (this._map) {\n\t\t\tthis._updatePath();\n\t\t}\n\t},\n\n\t_updatePath: function () {\n\t\tthis._renderer._updateCircle(this);\n\t},\n\n\t_empty: function () {\n\t\treturn this._radius && !this._renderer._bounds.intersects(this._pxBounds);\n\t},\n\n\t// Needed by the `Canvas` renderer for interactivity\n\t_containsPoint: function (p) {\n\t\treturn p.distanceTo(this._point) <= this._radius + this._clickTolerance();\n\t}\n});\n\n\n// @factory L.circleMarker(latlng: LatLng, options?: CircleMarker options)\n// Instantiates a circle marker object given a geographical point, and an optional options object.\nexport function circleMarker(latlng, options) {\n\treturn new CircleMarker(latlng, options);\n}\n", "import {CircleMarker} from './CircleMarker';\nimport {Path} from './Path';\nimport * as Util from '../../core/Util';\nimport {toLatLng} from '../../geo/LatLng';\nimport {LatLngBounds} from '../../geo/LatLngBounds';\nimport {Earth} from '../../geo/crs/CRS.Earth';\n\n\n/*\n * @class Circle\n * @aka L.Circle\n * @inherits CircleMarker\n *\n * A class for drawing circle overlays on a map. Extends `CircleMarker`.\n *\n * It's an approximation and starts to diverge from a real circle closer to poles (due to projection distortion).\n *\n * @example\n *\n * ```js\n * L.circle([50.5, 30.5], {radius: 200}).addTo(map);\n * ```\n */\n\nexport var Circle = CircleMarker.extend({\n\n\tinitialize: function (latlng, options, legacyOptions) {\n\t\tif (typeof options === 'number') {\n\t\t\t// Backwards compatibility with 0.7.x factory (latlng, radius, options?)\n\t\t\toptions = Util.extend({}, legacyOptions, {radius: options});\n\t\t}\n\t\tUtil.setOptions(this, options);\n\t\tthis._latlng = toLatLng(latlng);\n\n\t\tif (isNaN(this.options.radius)) { throw new Error('Circle radius cannot be NaN'); }\n\n\t\t// @section\n\t\t// @aka Circle options\n\t\t// @option radius: Number; Radius of the circle, in meters.\n\t\tthis._mRadius = this.options.radius;\n\t},\n\n\t// @method setRadius(radius: Number): this\n\t// Sets the radius of a circle. Units are in meters.\n\tsetRadius: function (radius) {\n\t\tthis._mRadius = radius;\n\t\treturn this.redraw();\n\t},\n\n\t// @method getRadius(): Number\n\t// Returns the current radius of a circle. Units are in meters.\n\tgetRadius: function () {\n\t\treturn this._mRadius;\n\t},\n\n\t// @method getBounds(): LatLngBounds\n\t// Returns the `LatLngBounds` of the path.\n\tgetBounds: function () {\n\t\tvar half = [this._radius, this._radiusY || this._radius];\n\n\t\treturn new LatLngBounds(\n\t\t\tthis._map.layerPointToLatLng(this._point.subtract(half)),\n\t\t\tthis._map.layerPointToLatLng(this._point.add(half)));\n\t},\n\n\tsetStyle: Path.prototype.setStyle,\n\n\t_project: function () {\n\n\t\tvar lng = this._latlng.lng,\n\t\t    lat = this._latlng.lat,\n\t\t    map = this._map,\n\t\t    crs = map.options.crs;\n\n\t\tif (crs.distance === Earth.distance) {\n\t\t\tvar d = Math.PI / 180,\n\t\t\t    latR = (this._mRadius / Earth.R) / d,\n\t\t\t    top = map.project([lat + latR, lng]),\n\t\t\t    bottom = map.project([lat - latR, lng]),\n\t\t\t    p = top.add(bottom).divideBy(2),\n\t\t\t    lat2 = map.unproject(p).lat,\n\t\t\t    lngR = Math.acos((Math.cos(latR * d) - Math.sin(lat * d) * Math.sin(lat2 * d)) /\n\t\t\t            (Math.cos(lat * d) * Math.cos(lat2 * d))) / d;\n\n\t\t\tif (isNaN(lngR) || lngR === 0) {\n\t\t\t\tlngR = latR / Math.cos(Math.PI / 180 * lat); // Fallback for edge case, #2425\n\t\t\t}\n\n\t\t\tthis._point = p.subtract(map.getPixelOrigin());\n\t\t\tthis._radius = isNaN(lngR) ? 0 : p.x - map.project([lat2, lng - lngR]).x;\n\t\t\tthis._radiusY = p.y - top.y;\n\n\t\t} else {\n\t\t\tvar latlng2 = crs.unproject(crs.project(this._latlng).subtract([this._mRadius, 0]));\n\n\t\t\tthis._point = map.latLngToLayerPoint(this._latlng);\n\t\t\tthis._radius = this._point.x - map.latLngToLayerPoint(latlng2).x;\n\t\t}\n\n\t\tthis._updateBounds();\n\t}\n});\n\n// @factory L.circle(latlng: LatLng, options?: Circle options)\n// Instantiates a circle object given a geographical point, and an options object\n// which contains the circle radius.\n// @alternative\n// @factory L.circle(latlng: LatLng, radius: Number, options?: Circle options)\n// Obsolete way of instantiating a circle, for compatibility with 0.7.x code.\n// Do not use in new applications or plugins.\nexport function circle(latlng, options, legacyOptions) {\n\treturn new Circle(latlng, options, legacyOptions);\n}\n", "import {Path} from './Path';\nimport * as Util from '../../core/Util';\nimport * as LineUtil from '../../geometry/LineUtil';\nimport {LatLng, toLatLng} from '../../geo/LatLng';\nimport {LatLngBounds} from '../../geo/LatLngBounds';\nimport {Bounds} from '../../geometry/Bounds';\nimport {Point} from '../../geometry/Point';\n\n/*\n * @class Polyline\n * @aka L.Polyline\n * @inherits Path\n *\n * A class for drawing polyline overlays on a map. Extends `Path`.\n *\n * @example\n *\n * ```js\n * // create a red polyline from an array of LatLng points\n * var latlngs = [\n * \t[45.51, -122.68],\n * \t[37.77, -122.43],\n * \t[34.04, -118.2]\n * ];\n *\n * var polyline = L.polyline(latlngs, {color: 'red'}).addTo(map);\n *\n * // zoom the map to the polyline\n * map.fitBounds(polyline.getBounds());\n * ```\n *\n * You can also pass a multi-dimensional array to represent a `MultiPolyline` shape:\n *\n * ```js\n * // create a red polyline from an array of arrays of LatLng points\n * var latlngs = [\n * \t[[45.51, -122.68],\n * \t [37.77, -122.43],\n * \t [34.04, -118.2]],\n * \t[[40.78, -73.91],\n * \t [41.83, -87.62],\n * \t [32.76, -96.72]]\n * ];\n * ```\n */\n\n\nexport var Polyline = Path.extend({\n\n\t// @section\n\t// @aka Polyline options\n\toptions: {\n\t\t// @option smoothFactor: Number = 1.0\n\t\t// How much to simplify the polyline on each zoom level. More means\n\t\t// better performance and smoother look, and less means more accurate representation.\n\t\tsmoothFactor: 1.0,\n\n\t\t// @option noClip: Boolean = false\n\t\t// Disable polyline clipping.\n\t\tnoClip: false\n\t},\n\n\tinitialize: function (latlngs, options) {\n\t\tUtil.setOptions(this, options);\n\t\tthis._setLatLngs(latlngs);\n\t},\n\n\t// @method getLatLngs(): LatLng[]\n\t// Returns an array of the points in the path, or nested arrays of points in case of multi-polyline.\n\tgetLatLngs: function () {\n\t\treturn this._latlngs;\n\t},\n\n\t// @method setLatLngs(latlngs: LatLng[]): this\n\t// Replaces all the points in the polyline with the given array of geographical points.\n\tsetLatLngs: function (latlngs) {\n\t\tthis._setLatLngs(latlngs);\n\t\treturn this.redraw();\n\t},\n\n\t// @method isEmpty(): Boolean\n\t// Returns `true` if the Polyline has no LatLngs.\n\tisEmpty: function () {\n\t\treturn !this._latlngs.length;\n\t},\n\n\t// @method closestLayerPoint(p: Point): Point\n\t// Returns the point closest to `p` on the Polyline.\n\tclosestLayerPoint: function (p) {\n\t\tvar minDistance = Infinity,\n\t\t    minPoint = null,\n\t\t    closest = LineUtil._sqClosestPointOnSegment,\n\t\t    p1, p2;\n\n\t\tfor (var j = 0, jLen = this._parts.length; j < jLen; j++) {\n\t\t\tvar points = this._parts[j];\n\n\t\t\tfor (var i = 1, len = points.length; i < len; i++) {\n\t\t\t\tp1 = points[i - 1];\n\t\t\t\tp2 = points[i];\n\n\t\t\t\tvar sqDist = closest(p, p1, p2, true);\n\n\t\t\t\tif (sqDist < minDistance) {\n\t\t\t\t\tminDistance = sqDist;\n\t\t\t\t\tminPoint = closest(p, p1, p2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (minPoint) {\n\t\t\tminPoint.distance = Math.sqrt(minDistance);\n\t\t}\n\t\treturn minPoint;\n\t},\n\n\t// @method getCenter(): LatLng\n\t// Returns the center ([centroid](https://en.wikipedia.org/wiki/Centroid)) of the polyline.\n\tgetCenter: function () {\n\t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n\t\tif (!this._map) {\n\t\t\tthrow new Error('Must add layer to map before using getCenter()');\n\t\t}\n\t\treturn LineUtil.polylineCenter(this._defaultShape(), this._map.options.crs);\n\t},\n\n\t// @method getBounds(): LatLngBounds\n\t// Returns the `LatLngBounds` of the path.\n\tgetBounds: function () {\n\t\treturn this._bounds;\n\t},\n\n\t// @method addLatLng(latlng: LatLng, latlngs?: LatLng[]): this\n\t// Adds a given point to the polyline. By default, adds to the first ring of\n\t// the polyline in case of a multi-polyline, but can be overridden by passing\n\t// a specific ring as a LatLng array (that you can earlier access with [`getLatLngs`](#polyline-getlatlngs)).\n\taddLatLng: function (latlng, latlngs) {\n\t\tlatlngs = latlngs || this._defaultShape();\n\t\tlatlng = toLatLng(latlng);\n\t\tlatlngs.push(latlng);\n\t\tthis._bounds.extend(latlng);\n\t\treturn this.redraw();\n\t},\n\n\t_setLatLngs: function (latlngs) {\n\t\tthis._bounds = new LatLngBounds();\n\t\tthis._latlngs = this._convertLatLngs(latlngs);\n\t},\n\n\t_defaultShape: function () {\n\t\treturn LineUtil.isFlat(this._latlngs) ? this._latlngs : this._latlngs[0];\n\t},\n\n\t// recursively convert latlngs input into actual LatLng instances; calculate bounds along the way\n\t_convertLatLngs: function (latlngs) {\n\t\tvar result = [],\n\t\t    flat = LineUtil.isFlat(latlngs);\n\n\t\tfor (var i = 0, len = latlngs.length; i < len; i++) {\n\t\t\tif (flat) {\n\t\t\t\tresult[i] = toLatLng(latlngs[i]);\n\t\t\t\tthis._bounds.extend(result[i]);\n\t\t\t} else {\n\t\t\t\tresult[i] = this._convertLatLngs(latlngs[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t},\n\n\t_project: function () {\n\t\tvar pxBounds = new Bounds();\n\t\tthis._rings = [];\n\t\tthis._projectLatlngs(this._latlngs, this._rings, pxBounds);\n\n\t\tif (this._bounds.isValid() && pxBounds.isValid()) {\n\t\t\tthis._rawPxBounds = pxBounds;\n\t\t\tthis._updateBounds();\n\t\t}\n\t},\n\n\t_updateBounds: function () {\n\t\tvar w = this._clickTolerance(),\n\t\t    p = new Point(w, w);\n\n\t\tif (!this._rawPxBounds) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._pxBounds = new Bounds([\n\t\t\tthis._rawPxBounds.min.subtract(p),\n\t\t\tthis._rawPxBounds.max.add(p)\n\t\t]);\n\t},\n\n\t// recursively turns latlngs into a set of rings with projected coordinates\n\t_projectLatlngs: function (latlngs, result, projectedBounds) {\n\t\tvar flat = latlngs[0] instanceof LatLng,\n\t\t    len = latlngs.length,\n\t\t    i, ring;\n\n\t\tif (flat) {\n\t\t\tring = [];\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tring[i] = this._map.latLngToLayerPoint(latlngs[i]);\n\t\t\t\tprojectedBounds.extend(ring[i]);\n\t\t\t}\n\t\t\tresult.push(ring);\n\t\t} else {\n\t\t\tfor (i = 0; i < len; i++) {\n\t\t\t\tthis._projectLatlngs(latlngs[i], result, projectedBounds);\n\t\t\t}\n\t\t}\n\t},\n\n\t// clip polyline by renderer bounds so that we have less to render for performance\n\t_clipPoints: function () {\n\t\tvar bounds = this._renderer._bounds;\n\n\t\tthis._parts = [];\n\t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.options.noClip) {\n\t\t\tthis._parts = this._rings;\n\t\t\treturn;\n\t\t}\n\n\t\tvar parts = this._parts,\n\t\t    i, j, k, len, len2, segment, points;\n\n\t\tfor (i = 0, k = 0, len = this._rings.length; i < len; i++) {\n\t\t\tpoints = this._rings[i];\n\n\t\t\tfor (j = 0, len2 = points.length; j < len2 - 1; j++) {\n\t\t\t\tsegment = LineUtil.clipSegment(points[j], points[j + 1], bounds, j, true);\n\n\t\t\t\tif (!segment) { continue; }\n\n\t\t\t\tparts[k] = parts[k] || [];\n\t\t\t\tparts[k].push(segment[0]);\n\n\t\t\t\t// if segment goes out of screen, or it's the last one, it's the end of the line part\n\t\t\t\tif ((segment[1] !== points[j + 1]) || (j === len2 - 2)) {\n\t\t\t\t\tparts[k].push(segment[1]);\n\t\t\t\t\tk++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// simplify each clipped part of the polyline for performance\n\t_simplifyPoints: function () {\n\t\tvar parts = this._parts,\n\t\t    tolerance = this.options.smoothFactor;\n\n\t\tfor (var i = 0, len = parts.length; i < len; i++) {\n\t\t\tparts[i] = LineUtil.simplify(parts[i], tolerance);\n\t\t}\n\t},\n\n\t_update: function () {\n\t\tif (!this._map) { return; }\n\n\t\tthis._clipPoints();\n\t\tthis._simplifyPoints();\n\t\tthis._updatePath();\n\t},\n\n\t_updatePath: function () {\n\t\tthis._renderer._updatePoly(this);\n\t},\n\n\t// Needed by the `Canvas` renderer for interactivity\n\t_containsPoint: function (p, closed) {\n\t\tvar i, j, k, len, len2, part,\n\t\t    w = this._clickTolerance();\n\n\t\tif (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }\n\n\t\t// hit detection for polylines\n\t\tfor (i = 0, len = this._parts.length; i < len; i++) {\n\t\t\tpart = this._parts[i];\n\n\t\t\tfor (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {\n\t\t\t\tif (!closed && (j === 0)) { continue; }\n\n\t\t\t\tif (LineUtil.pointToSegmentDistance(p, part[k], part[j]) <= w) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n});\n\n// @factory L.polyline(latlngs: LatLng[], options?: Polyline options)\n// Instantiates a polyline object given an array of geographical points and\n// optionally an options object. You can create a `Polyline` object with\n// multiple separate lines (`MultiPolyline`) by passing an array of arrays\n// of geographic points.\nexport function polyline(latlngs, options) {\n\treturn new Polyline(latlngs, options);\n}\n\n// Retrocompat. Allow plugins to support Leaflet versions before and after 1.1.\nPolyline._flat = LineUtil._flat;\n", "import {Polyline} from './Polyline';\nimport {LatLng} from '../../geo/LatLng';\nimport * as LineUtil from '../../geometry/LineUtil';\nimport {Point} from '../../geometry/Point';\nimport {Bounds} from '../../geometry/Bounds';\nimport * as PolyUtil from '../../geometry/PolyUtil';\n\n/*\n * @class Polygon\n * @aka L.Polygon\n * @inherits Polyline\n *\n * A class for drawing polygon overlays on a map. Extends `Polyline`.\n *\n * Note that points you pass when creating a polygon shouldn't have an additional last point equal to the first one — it's better to filter out such points.\n *\n *\n * @example\n *\n * ```js\n * // create a red polygon from an array of LatLng points\n * var latlngs = [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]];\n *\n * var polygon = L.polygon(latlngs, {color: 'red'}).addTo(map);\n *\n * // zoom the map to the polygon\n * map.fitBounds(polygon.getBounds());\n * ```\n *\n * You can also pass an array of arrays of latlngs, with the first array representing the outer shape and the other arrays representing holes in the outer shape:\n *\n * ```js\n * var latlngs = [\n *   [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n *   [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n * ];\n * ```\n *\n * Additionally, you can pass a multi-dimensional array to represent a MultiPolygon shape.\n *\n * ```js\n * var latlngs = [\n *   [ // first polygon\n *     [[37, -109.05],[41, -109.03],[41, -102.05],[37, -102.04]], // outer ring\n *     [[37.29, -108.58],[40.71, -108.58],[40.71, -102.50],[37.29, -102.50]] // hole\n *   ],\n *   [ // second polygon\n *     [[41, -111.03],[45, -111.04],[45, -104.05],[41, -104.05]]\n *   ]\n * ];\n * ```\n */\n\nexport var Polygon = Polyline.extend({\n\n\toptions: {\n\t\tfill: true\n\t},\n\n\tisEmpty: function () {\n\t\treturn !this._latlngs.length || !this._latlngs[0].length;\n\t},\n\n\t// @method getCenter(): LatLng\n\t// Returns the center ([centroid](http://en.wikipedia.org/wiki/Centroid)) of the Polygon.\n\tgetCenter: function () {\n\t\t// throws error when not yet added to map as this center calculation requires projected coordinates\n\t\tif (!this._map) {\n\t\t\tthrow new Error('Must add layer to map before using getCenter()');\n\t\t}\n\t\treturn PolyUtil.polygonCenter(this._defaultShape(), this._map.options.crs);\n\t},\n\n\t_convertLatLngs: function (latlngs) {\n\t\tvar result = Polyline.prototype._convertLatLngs.call(this, latlngs),\n\t\t    len = result.length;\n\n\t\t// remove last point if it equals first one\n\t\tif (len >= 2 && result[0] instanceof LatLng && result[0].equals(result[len - 1])) {\n\t\t\tresult.pop();\n\t\t}\n\t\treturn result;\n\t},\n\n\t_setLatLngs: function (latlngs) {\n\t\tPolyline.prototype._setLatLngs.call(this, latlngs);\n\t\tif (LineUtil.isFlat(this._latlngs)) {\n\t\t\tthis._latlngs = [this._latlngs];\n\t\t}\n\t},\n\n\t_defaultShape: function () {\n\t\treturn LineUtil.isFlat(this._latlngs[0]) ? this._latlngs[0] : this._latlngs[0][0];\n\t},\n\n\t_clipPoints: function () {\n\t\t// polygons need a different clipping algorithm so we redefine that\n\n\t\tvar bounds = this._renderer._bounds,\n\t\t    w = this.options.weight,\n\t\t    p = new Point(w, w);\n\n\t\t// increase clip padding by stroke width to avoid stroke on clip edges\n\t\tbounds = new Bounds(bounds.min.subtract(p), bounds.max.add(p));\n\n\t\tthis._parts = [];\n\t\tif (!this._pxBounds || !this._pxBounds.intersects(bounds)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.options.noClip) {\n\t\t\tthis._parts = this._rings;\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var i = 0, len = this._rings.length, clipped; i < len; i++) {\n\t\t\tclipped = PolyUtil.clipPolygon(this._rings[i], bounds, true);\n\t\t\tif (clipped.length) {\n\t\t\t\tthis._parts.push(clipped);\n\t\t\t}\n\t\t}\n\t},\n\n\t_updatePath: function () {\n\t\tthis._renderer._updatePoly(this, true);\n\t},\n\n\t// Needed by the `Canvas` renderer for interactivity\n\t_containsPoint: function (p) {\n\t\tvar inside = false,\n\t\t    part, p1, p2, i, j, k, len, len2;\n\n\t\tif (!this._pxBounds || !this._pxBounds.contains(p)) { return false; }\n\n\t\t// ray casting algorithm for detecting if point is in polygon\n\t\tfor (i = 0, len = this._parts.length; i < len; i++) {\n\t\t\tpart = this._parts[i];\n\n\t\t\tfor (j = 0, len2 = part.length, k = len2 - 1; j < len2; k = j++) {\n\t\t\t\tp1 = part[j];\n\t\t\t\tp2 = part[k];\n\n\t\t\t\tif (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n\t\t\t\t\tinside = !inside;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// also check if it's on polygon stroke\n\t\treturn inside || Polyline.prototype._containsPoint.call(this, p, true);\n\t}\n\n});\n\n\n// @factory L.polygon(latlngs: LatLng[], options?: Polyline options)\nexport function polygon(latlngs, options) {\n\treturn new Polygon(latlngs, options);\n}\n", "import {LayerGroup} from './LayerGroup';\r\nimport {FeatureGroup} from './FeatureGroup';\r\nimport * as Util from '../core/Util';\r\nimport {Marker} from './marker/Marker';\r\nimport {Circle} from './vector/Circle';\r\nimport {CircleMarker} from './vector/CircleMarker';\r\nimport {Polyline} from './vector/Polyline';\r\nimport {Polygon} from './vector/Polygon';\r\nimport {LatLng} from '../geo/LatLng';\r\nimport * as LineUtil from '../geometry/LineUtil';\r\nimport {toLatLng} from '../geo/LatLng';\r\n\r\n\r\n/*\r\n * @class GeoJSON\r\n * @aka L.GeoJSON\r\n * @inherits FeatureGroup\r\n *\r\n * Represents a GeoJSON object or an array of GeoJSON objects. Allows you to parse\r\n * GeoJSON data and display it on the map. Extends `FeatureGroup`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.geoJSON(data, {\r\n * \tstyle: function (feature) {\r\n * \t\treturn {color: feature.properties.color};\r\n * \t}\r\n * }).bindPopup(function (layer) {\r\n * \treturn layer.feature.properties.description;\r\n * }).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var GeoJSON = FeatureGroup.extend({\r\n\r\n\t/* @section\r\n\t * @aka GeoJSON options\r\n\t *\r\n\t * @option pointToLayer: Function = *\r\n\t * A `Function` defining how GeoJSON points spawn Leaflet layers. It is internally\r\n\t * called when data is added, passing the GeoJSON point feature and its `LatLng`.\r\n\t * The default is to spawn a default `Marker`:\r\n\t * ```js\r\n\t * function(geoJsonPoint, latlng) {\r\n\t * \treturn L.marker(latlng);\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @option style: Function = *\r\n\t * A `Function` defining the `Path options` for styling GeoJSON lines and polygons,\r\n\t * called internally when data is added.\r\n\t * The default value is to not override any defaults:\r\n\t * ```js\r\n\t * function (geoJsonFeature) {\r\n\t * \treturn {}\r\n\t * }\r\n\t * ```\r\n\t *\r\n\t * @option onEachFeature: Function = *\r\n\t * A `Function` that will be called once for each created `Feature`, after it has\r\n\t * been created and styled. Useful for attaching events and popups to features.\r\n\t * The default is to do nothing with the newly created layers:\r\n\t * ```js\r\n\t * function (feature, layer) {}\r\n\t * ```\r\n\t *\r\n\t * @option filter: Function = *\r\n\t * A `Function` that will be used to decide whether to include a feature or not.\r\n\t * The default is to include all features:\r\n\t * ```js\r\n\t * function (geoJsonFeature) {\r\n\t * \treturn true;\r\n\t * }\r\n\t * ```\r\n\t * Note: dynamically changing the `filter` option will have effect only on newly\r\n\t * added data. It will _not_ re-evaluate already included features.\r\n\t *\r\n\t * @option coordsToLatLng: Function = *\r\n\t * A `Function` that will be used for converting GeoJSON coordinates to `LatLng`s.\r\n\t * The default is the `coordsToLatLng` static method.\r\n\t *\r\n\t * @option markersInheritOptions: Boolean = false\r\n\t * Whether default Markers for \"Point\" type Features inherit from group options.\r\n\t */\r\n\r\n\tinitialize: function (geojson, options) {\r\n\t\tUtil.setOptions(this, options);\r\n\r\n\t\tthis._layers = {};\r\n\r\n\t\tif (geojson) {\r\n\t\t\tthis.addData(geojson);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method addData( <GeoJSON> data ): this\r\n\t// Adds a GeoJSON object to the layer.\r\n\taddData: function (geojson) {\r\n\t\tvar features = Util.isArray(geojson) ? geojson : geojson.features,\r\n\t\t    i, len, feature;\r\n\r\n\t\tif (features) {\r\n\t\t\tfor (i = 0, len = features.length; i < len; i++) {\r\n\t\t\t\t// only add this if geometry or geometries are set and not null\r\n\t\t\t\tfeature = features[i];\r\n\t\t\t\tif (feature.geometries || feature.geometry || feature.features || feature.coordinates) {\r\n\t\t\t\t\tthis.addData(feature);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn this;\r\n\t\t}\r\n\r\n\t\tvar options = this.options;\r\n\r\n\t\tif (options.filter && !options.filter(geojson)) { return this; }\r\n\r\n\t\tvar layer = geometryToLayer(geojson, options);\r\n\t\tif (!layer) {\r\n\t\t\treturn this;\r\n\t\t}\r\n\t\tlayer.feature = asFeature(geojson);\r\n\r\n\t\tlayer.defaultOptions = layer.options;\r\n\t\tthis.resetStyle(layer);\r\n\r\n\t\tif (options.onEachFeature) {\r\n\t\t\toptions.onEachFeature(geojson, layer);\r\n\t\t}\r\n\r\n\t\treturn this.addLayer(layer);\r\n\t},\r\n\r\n\t// @method resetStyle( <Path> layer? ): this\r\n\t// Resets the given vector layer's style to the original GeoJSON style, useful for resetting style after hover events.\r\n\t// If `layer` is omitted, the style of all features in the current layer is reset.\r\n\tresetStyle: function (layer) {\r\n\t\tif (layer === undefined) {\r\n\t\t\treturn this.eachLayer(this.resetStyle, this);\r\n\t\t}\r\n\t\t// reset any custom styles\r\n\t\tlayer.options = Util.extend({}, layer.defaultOptions);\r\n\t\tthis._setLayerStyle(layer, this.options.style);\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setStyle( <Function> style ): this\r\n\t// Changes styles of GeoJSON vector layers with the given style function.\r\n\tsetStyle: function (style) {\r\n\t\treturn this.eachLayer(function (layer) {\r\n\t\t\tthis._setLayerStyle(layer, style);\r\n\t\t}, this);\r\n\t},\r\n\r\n\t_setLayerStyle: function (layer, style) {\r\n\t\tif (layer.setStyle) {\r\n\t\t\tif (typeof style === 'function') {\r\n\t\t\t\tstyle = style(layer.feature);\r\n\t\t\t}\r\n\t\t\tlayer.setStyle(style);\r\n\t\t}\r\n\t}\r\n});\r\n\r\n// @section\r\n// There are several static functions which can be called without instantiating L.GeoJSON:\r\n\r\n// @function geometryToLayer(featureData: Object, options?: GeoJSON options): Layer\r\n// Creates a `Layer` from a given GeoJSON feature. Can use a custom\r\n// [`pointToLayer`](#geojson-pointtolayer) and/or [`coordsToLatLng`](#geojson-coordstolatlng)\r\n// functions if provided as options.\r\nexport function geometryToLayer(geojson, options) {\r\n\r\n\tvar geometry = geojson.type === 'Feature' ? geojson.geometry : geojson,\r\n\t    coords = geometry ? geometry.coordinates : null,\r\n\t    layers = [],\r\n\t    pointToLayer = options && options.pointToLayer,\r\n\t    _coordsToLatLng = options && options.coordsToLatLng || coordsToLatLng,\r\n\t    latlng, latlngs, i, len;\r\n\r\n\tif (!coords && !geometry) {\r\n\t\treturn null;\r\n\t}\r\n\r\n\tswitch (geometry.type) {\r\n\tcase 'Point':\r\n\t\tlatlng = _coordsToLatLng(coords);\r\n\t\treturn _pointToLayer(pointToLayer, geojson, latlng, options);\r\n\r\n\tcase 'MultiPoint':\r\n\t\tfor (i = 0, len = coords.length; i < len; i++) {\r\n\t\t\tlatlng = _coordsToLatLng(coords[i]);\r\n\t\t\tlayers.push(_pointToLayer(pointToLayer, geojson, latlng, options));\r\n\t\t}\r\n\t\treturn new FeatureGroup(layers);\r\n\r\n\tcase 'LineString':\r\n\tcase 'MultiLineString':\r\n\t\tlatlngs = coordsToLatLngs(coords, geometry.type === 'LineString' ? 0 : 1, _coordsToLatLng);\r\n\t\treturn new Polyline(latlngs, options);\r\n\r\n\tcase 'Polygon':\r\n\tcase 'MultiPolygon':\r\n\t\tlatlngs = coordsToLatLngs(coords, geometry.type === 'Polygon' ? 1 : 2, _coordsToLatLng);\r\n\t\treturn new Polygon(latlngs, options);\r\n\r\n\tcase 'GeometryCollection':\r\n\t\tfor (i = 0, len = geometry.geometries.length; i < len; i++) {\r\n\t\t\tvar geoLayer = geometryToLayer({\r\n\t\t\t\tgeometry: geometry.geometries[i],\r\n\t\t\t\ttype: 'Feature',\r\n\t\t\t\tproperties: geojson.properties\r\n\t\t\t}, options);\r\n\r\n\t\t\tif (geoLayer) {\r\n\t\t\t\tlayers.push(geoLayer);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new FeatureGroup(layers);\r\n\r\n\tcase 'FeatureCollection':\r\n\t\tfor (i = 0, len = geometry.features.length; i < len; i++) {\r\n\t\t\tvar featureLayer = geometryToLayer(geometry.features[i], options);\r\n\r\n\t\t\tif (featureLayer) {\r\n\t\t\t\tlayers.push(featureLayer);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new FeatureGroup(layers);\r\n\r\n\tdefault:\r\n\t\tthrow new Error('Invalid GeoJSON object.');\r\n\t}\r\n}\r\n\r\nfunction _pointToLayer(pointToLayerFn, geojson, latlng, options) {\r\n\treturn pointToLayerFn ?\r\n\t\tpointToLayerFn(geojson, latlng) :\r\n\t\tnew Marker(latlng, options && options.markersInheritOptions && options);\r\n}\r\n\r\n// @function coordsToLatLng(coords: Array): LatLng\r\n// Creates a `LatLng` object from an array of 2 numbers (longitude, latitude)\r\n// or 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.\r\nexport function coordsToLatLng(coords) {\r\n\treturn new LatLng(coords[1], coords[0], coords[2]);\r\n}\r\n\r\n// @function coordsToLatLngs(coords: Array, levelsDeep?: Number, coordsToLatLng?: Function): Array\r\n// Creates a multidimensional array of `LatLng`s from a GeoJSON coordinates array.\r\n// `levelsDeep` specifies the nesting level (0 is for an array of points, 1 for an array of arrays of points, etc., 0 by default).\r\n// Can use a custom [`coordsToLatLng`](#geojson-coordstolatlng) function.\r\nexport function coordsToLatLngs(coords, levelsDeep, _coordsToLatLng) {\r\n\tvar latlngs = [];\r\n\r\n\tfor (var i = 0, len = coords.length, latlng; i < len; i++) {\r\n\t\tlatlng = levelsDeep ?\r\n\t\t\tcoordsToLatLngs(coords[i], levelsDeep - 1, _coordsToLatLng) :\r\n\t\t\t(_coordsToLatLng || coordsToLatLng)(coords[i]);\r\n\r\n\t\tlatlngs.push(latlng);\r\n\t}\r\n\r\n\treturn latlngs;\r\n}\r\n\r\n// @function latLngToCoords(latlng: LatLng, precision?: Number|false): Array\r\n// Reverse of [`coordsToLatLng`](#geojson-coordstolatlng)\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.\r\nexport function latLngToCoords(latlng, precision) {\r\n\tlatlng = toLatLng(latlng);\r\n\treturn latlng.alt !== undefined ?\r\n\t\t[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision), Util.formatNum(latlng.alt, precision)] :\r\n\t\t[Util.formatNum(latlng.lng, precision), Util.formatNum(latlng.lat, precision)];\r\n}\r\n\r\n// @function latLngsToCoords(latlngs: Array, levelsDeep?: Number, closed?: Boolean, precision?: Number|false): Array\r\n// Reverse of [`coordsToLatLngs`](#geojson-coordstolatlngs)\r\n// `closed` determines whether the first point should be appended to the end of the array to close the feature, only used when `levelsDeep` is 0. False by default.\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function.\r\nexport function latLngsToCoords(latlngs, levelsDeep, closed, precision) {\r\n\tvar coords = [];\r\n\r\n\tfor (var i = 0, len = latlngs.length; i < len; i++) {\r\n\t\t// Check for flat arrays required to ensure unbalanced arrays are correctly converted in recursion\r\n\t\tcoords.push(levelsDeep ?\r\n\t\t\tlatLngsToCoords(latlngs[i], LineUtil.isFlat(latlngs[i]) ? 0 : levelsDeep - 1, closed, precision) :\r\n\t\t\tlatLngToCoords(latlngs[i], precision));\r\n\t}\r\n\r\n\tif (!levelsDeep && closed && coords.length > 0) {\r\n\t\tcoords.push(coords[0].slice());\r\n\t}\r\n\r\n\treturn coords;\r\n}\r\n\r\nexport function getFeature(layer, newGeometry) {\r\n\treturn layer.feature ?\r\n\t\tUtil.extend({}, layer.feature, {geometry: newGeometry}) :\r\n\t\tasFeature(newGeometry);\r\n}\r\n\r\n// @function asFeature(geojson: Object): Object\r\n// Normalize GeoJSON geometries/features into GeoJSON features.\r\nexport function asFeature(geojson) {\r\n\tif (geojson.type === 'Feature' || geojson.type === 'FeatureCollection') {\r\n\t\treturn geojson;\r\n\t}\r\n\r\n\treturn {\r\n\t\ttype: 'Feature',\r\n\t\tproperties: {},\r\n\t\tgeometry: geojson\r\n\t};\r\n}\r\n\r\nvar PointToGeoJSON = {\r\n\ttoGeoJSON: function (precision) {\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: 'Point',\r\n\t\t\tcoordinates: latLngToCoords(this.getLatLng(), precision)\r\n\t\t});\r\n\t}\r\n};\r\n\r\n// @namespace Marker\r\n// @section Other methods\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the marker (as a GeoJSON `Point` Feature).\r\nMarker.include(PointToGeoJSON);\r\n\r\n// @namespace CircleMarker\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the circle marker (as a GeoJSON `Point` Feature).\r\nCircle.include(PointToGeoJSON);\r\nCircleMarker.include(PointToGeoJSON);\r\n\r\n\r\n// @namespace Polyline\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polyline (as a GeoJSON `LineString` or `MultiLineString` Feature).\r\nPolyline.include({\r\n\ttoGeoJSON: function (precision) {\r\n\t\tvar multi = !LineUtil.isFlat(this._latlngs);\r\n\r\n\t\tvar coords = latLngsToCoords(this._latlngs, multi ? 1 : 0, false, precision);\r\n\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: (multi ? 'Multi' : '') + 'LineString',\r\n\t\t\tcoordinates: coords\r\n\t\t});\r\n\t}\r\n});\r\n\r\n// @namespace Polygon\r\n// @method toGeoJSON(precision?: Number|false): Object\r\n// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the polygon (as a GeoJSON `Polygon` or `MultiPolygon` Feature).\r\nPolygon.include({\r\n\ttoGeoJSON: function (precision) {\r\n\t\tvar holes = !LineUtil.isFlat(this._latlngs),\r\n\t\t    multi = holes && !LineUtil.isFlat(this._latlngs[0]);\r\n\r\n\t\tvar coords = latLngsToCoords(this._latlngs, multi ? 2 : holes ? 1 : 0, true, precision);\r\n\r\n\t\tif (!holes) {\r\n\t\t\tcoords = [coords];\r\n\t\t}\r\n\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: (multi ? 'Multi' : '') + 'Polygon',\r\n\t\t\tcoordinates: coords\r\n\t\t});\r\n\t}\r\n});\r\n\r\n\r\n// @namespace LayerGroup\r\nLayerGroup.include({\r\n\ttoMultiPoint: function (precision) {\r\n\t\tvar coords = [];\r\n\r\n\t\tthis.eachLayer(function (layer) {\r\n\t\t\tcoords.push(layer.toGeoJSON(precision).geometry.coordinates);\r\n\t\t});\r\n\r\n\t\treturn getFeature(this, {\r\n\t\t\ttype: 'MultiPoint',\r\n\t\t\tcoordinates: coords\r\n\t\t});\r\n\t},\r\n\r\n\t// @method toGeoJSON(precision?: Number|false): Object\r\n\t// Coordinates values are rounded with [`formatNum`](#util-formatnum) function with given `precision`.\r\n\t// Returns a [`GeoJSON`](https://en.wikipedia.org/wiki/GeoJSON) representation of the layer group (as a GeoJSON `FeatureCollection`, `GeometryCollection`, or `MultiPoint`).\r\n\ttoGeoJSON: function (precision) {\r\n\r\n\t\tvar type = this.feature && this.feature.geometry && this.feature.geometry.type;\r\n\r\n\t\tif (type === 'MultiPoint') {\r\n\t\t\treturn this.toMultiPoint(precision);\r\n\t\t}\r\n\r\n\t\tvar isGeometryCollection = type === 'GeometryCollection',\r\n\t\t    jsons = [];\r\n\r\n\t\tthis.eachLayer(function (layer) {\r\n\t\t\tif (layer.toGeoJSON) {\r\n\t\t\t\tvar json = layer.toGeoJSON(precision);\r\n\t\t\t\tif (isGeometryCollection) {\r\n\t\t\t\t\tjsons.push(json.geometry);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar feature = asFeature(json);\r\n\t\t\t\t\t// Squash nested feature collections\r\n\t\t\t\t\tif (feature.type === 'FeatureCollection') {\r\n\t\t\t\t\t\tjsons.push.apply(jsons, feature.features);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tjsons.push(feature);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (isGeometryCollection) {\r\n\t\t\treturn getFeature(this, {\r\n\t\t\t\tgeometries: jsons,\r\n\t\t\t\ttype: 'GeometryCollection'\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn {\r\n\t\t\ttype: 'FeatureCollection',\r\n\t\t\tfeatures: jsons\r\n\t\t};\r\n\t}\r\n});\r\n\r\n// @namespace GeoJSON\r\n// @factory L.geoJSON(geojson?: Object, options?: GeoJSON options)\r\n// Creates a GeoJSON layer. Optionally accepts an object in\r\n// [GeoJSON format](https://tools.ietf.org/html/rfc7946) to display on the map\r\n// (you can alternatively add it later with `addData` method) and an `options` object.\r\nexport function geoJSON(geojson, options) {\r\n\treturn new GeoJSON(geojson, options);\r\n}\r\n\r\n// Backward compatibility.\r\nexport var geoJson = geoJSON;\r\n", "import {Layer} from './Layer';\r\nimport * as Util from '../core/Util';\r\nimport {toLatLngBounds} from '../geo/LatLngBounds';\r\nimport {Bounds} from '../geometry/Bounds';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class ImageOverlay\r\n * @aka L.ImageOverlay\r\n * @inherits Interactive layer\r\n *\r\n * Used to load and display a single image over specific bounds of the map. Extends `Layer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var imageUrl = 'https://maps.lib.utexas.edu/maps/historical/newark_nj_1922.jpg',\r\n * \timageBounds = [[40.712216, -74.22655], [40.773941, -74.12544]];\r\n * L.imageOverlay(imageUrl, imageBounds).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var ImageOverlay = Layer.extend({\r\n\r\n\t// @section\r\n\t// @aka ImageOverlay options\r\n\toptions: {\r\n\t\t// @option opacity: Number = 1.0\r\n\t\t// The opacity of the image overlay.\r\n\t\topacity: 1,\r\n\r\n\t\t// @option alt: String = ''\r\n\t\t// Text for the `alt` attribute of the image (useful for accessibility).\r\n\t\talt: '',\r\n\r\n\t\t// @option interactive: Boolean = false\r\n\t\t// If `true`, the image overlay will emit [mouse events](#interactive-layer) when clicked or hovered.\r\n\t\tinteractive: false,\r\n\r\n\t\t// @option crossOrigin: Boolean|String = false\r\n\t\t// Whether the crossOrigin attribute will be added to the image.\r\n\t\t// If a String is provided, the image will have its crossOrigin attribute set to the String provided. This is needed if you want to access image pixel data.\r\n\t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n\t\tcrossOrigin: false,\r\n\r\n\t\t// @option errorOverlayUrl: String = ''\r\n\t\t// URL to the overlay image to show in place of the overlay that failed to load.\r\n\t\terrorOverlayUrl: '',\r\n\r\n\t\t// @option zIndex: Number = 1\r\n\t\t// The explicit [zIndex](https://developer.mozilla.org/docs/Web/CSS/CSS_Positioning/Understanding_z_index) of the overlay layer.\r\n\t\tzIndex: 1,\r\n\r\n\t\t// @option className: String = ''\r\n\t\t// A custom class name to assign to the image. Empty by default.\r\n\t\tclassName: ''\r\n\t},\r\n\r\n\tinitialize: function (url, bounds, options) { // (String, LatLngBounds, Object)\r\n\t\tthis._url = url;\r\n\t\tthis._bounds = toLatLngBounds(bounds);\r\n\r\n\t\tUtil.setOptions(this, options);\r\n\t},\r\n\r\n\tonAdd: function () {\r\n\t\tif (!this._image) {\r\n\t\t\tthis._initImage();\r\n\r\n\t\t\tif (this.options.opacity < 1) {\r\n\t\t\t\tthis._updateOpacity();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (this.options.interactive) {\r\n\t\t\tDomUtil.addClass(this._image, 'leaflet-interactive');\r\n\t\t\tthis.addInteractiveTarget(this._image);\r\n\t\t}\r\n\r\n\t\tthis.getPane().appendChild(this._image);\r\n\t\tthis._reset();\r\n\t},\r\n\r\n\tonRemove: function () {\r\n\t\tDomUtil.remove(this._image);\r\n\t\tif (this.options.interactive) {\r\n\t\t\tthis.removeInteractiveTarget(this._image);\r\n\t\t}\r\n\t},\r\n\r\n\t// @method setOpacity(opacity: Number): this\r\n\t// Sets the opacity of the overlay.\r\n\tsetOpacity: function (opacity) {\r\n\t\tthis.options.opacity = opacity;\r\n\r\n\t\tif (this._image) {\r\n\t\t\tthis._updateOpacity();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tsetStyle: function (styleOpts) {\r\n\t\tif (styleOpts.opacity) {\r\n\t\t\tthis.setOpacity(styleOpts.opacity);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method bringToFront(): this\r\n\t// Brings the layer to the top of all overlays.\r\n\tbringToFront: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toFront(this._image);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method bringToBack(): this\r\n\t// Brings the layer to the bottom of all overlays.\r\n\tbringToBack: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toBack(this._image);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setUrl(url: String): this\r\n\t// Changes the URL of the image.\r\n\tsetUrl: function (url) {\r\n\t\tthis._url = url;\r\n\r\n\t\tif (this._image) {\r\n\t\t\tthis._image.src = url;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method setBounds(bounds: LatLngBounds): this\r\n\t// Update the bounds that this ImageOverlay covers\r\n\tsetBounds: function (bounds) {\r\n\t\tthis._bounds = toLatLngBounds(bounds);\r\n\r\n\t\tif (this._map) {\r\n\t\t\tthis._reset();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\tvar events = {\r\n\t\t\tzoom: this._reset,\r\n\t\t\tviewreset: this._reset\r\n\t\t};\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tevents.zoomanim = this._animateZoom;\r\n\t\t}\r\n\r\n\t\treturn events;\r\n\t},\r\n\r\n\t// @method setZIndex(value: Number): this\r\n\t// Changes the [zIndex](#imageoverlay-zindex) of the image overlay.\r\n\tsetZIndex: function (value) {\r\n\t\tthis.options.zIndex = value;\r\n\t\tthis._updateZIndex();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getBounds(): LatLngBounds\r\n\t// Get the bounds that this ImageOverlay covers\r\n\tgetBounds: function () {\r\n\t\treturn this._bounds;\r\n\t},\r\n\r\n\t// @method getElement(): HTMLElement\r\n\t// Returns the instance of [`HTMLImageElement`](https://developer.mozilla.org/docs/Web/API/HTMLImageElement)\r\n\t// used by this overlay.\r\n\tgetElement: function () {\r\n\t\treturn this._image;\r\n\t},\r\n\r\n\t_initImage: function () {\r\n\t\tvar wasElementSupplied = this._url.tagName === 'IMG';\r\n\t\tvar img = this._image = wasElementSupplied ? this._url : DomUtil.create('img');\r\n\r\n\t\tDomUtil.addClass(img, 'leaflet-image-layer');\r\n\t\tif (this._zoomAnimated) { DomUtil.addClass(img, 'leaflet-zoom-animated'); }\r\n\t\tif (this.options.className) { DomUtil.addClass(img, this.options.className); }\r\n\r\n\t\timg.onselectstart = Util.falseFn;\r\n\t\timg.onmousemove = Util.falseFn;\r\n\r\n\t\t// @event load: Event\r\n\t\t// Fired when the ImageOverlay layer has loaded its image\r\n\t\timg.onload = Util.bind(this.fire, this, 'load');\r\n\t\timg.onerror = Util.bind(this._overlayOnError, this, 'error');\r\n\r\n\t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n\t\t\timg.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n\t\t}\r\n\r\n\t\tif (this.options.zIndex) {\r\n\t\t\tthis._updateZIndex();\r\n\t\t}\r\n\r\n\t\tif (wasElementSupplied) {\r\n\t\t\tthis._url = img.src;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\timg.src = this._url;\r\n\t\timg.alt = this.options.alt;\r\n\t},\r\n\r\n\t_animateZoom: function (e) {\r\n\t\tvar scale = this._map.getZoomScale(e.zoom),\r\n\t\t    offset = this._map._latLngBoundsToNewLayerBounds(this._bounds, e.zoom, e.center).min;\r\n\r\n\t\tDomUtil.setTransform(this._image, offset, scale);\r\n\t},\r\n\r\n\t_reset: function () {\r\n\t\tvar image = this._image,\r\n\t\t    bounds = new Bounds(\r\n\t\t        this._map.latLngToLayerPoint(this._bounds.getNorthWest()),\r\n\t\t        this._map.latLngToLayerPoint(this._bounds.getSouthEast())),\r\n\t\t    size = bounds.getSize();\r\n\r\n\t\tDomUtil.setPosition(image, bounds.min);\r\n\r\n\t\timage.style.width  = size.x + 'px';\r\n\t\timage.style.height = size.y + 'px';\r\n\t},\r\n\r\n\t_updateOpacity: function () {\r\n\t\tDomUtil.setOpacity(this._image, this.options.opacity);\r\n\t},\r\n\r\n\t_updateZIndex: function () {\r\n\t\tif (this._image && this.options.zIndex !== undefined && this.options.zIndex !== null) {\r\n\t\t\tthis._image.style.zIndex = this.options.zIndex;\r\n\t\t}\r\n\t},\r\n\r\n\t_overlayOnError: function () {\r\n\t\t// @event error: Event\r\n\t\t// Fired when the ImageOverlay layer fails to load its image\r\n\t\tthis.fire('error');\r\n\r\n\t\tvar errorUrl = this.options.errorOverlayUrl;\r\n\t\tif (errorUrl && this._url !== errorUrl) {\r\n\t\t\tthis._url = errorUrl;\r\n\t\t\tthis._image.src = errorUrl;\r\n\t\t}\r\n\t},\r\n\r\n\t// @method getCenter(): LatLng\r\n\t// Returns the center of the ImageOverlay.\r\n\tgetCenter: function () {\r\n\t\treturn this._bounds.getCenter();\r\n\t}\r\n});\r\n\r\n// @factory L.imageOverlay(imageUrl: String, bounds: LatLngBounds, options?: ImageOverlay options)\r\n// Instantiates an image overlay object given the URL of the image and the\r\n// geographical bounds it is tied to.\r\nexport var imageOverlay = function (url, bounds, options) {\r\n\treturn new ImageOverlay(url, bounds, options);\r\n};\r\n", "import {ImageOverlay} from './ImageOverlay';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport * as Util from '../core/Util';\r\n\r\n/*\r\n * @class VideoOverlay\r\n * @aka L.VideoOverlay\r\n * @inherits ImageOverlay\r\n *\r\n * Used to load and display a video player over specific bounds of the map. Extends `ImageOverlay`.\r\n *\r\n * A video overlay uses the [`<video>`](https://developer.mozilla.org/docs/Web/HTML/Element/video)\r\n * HTML5 element.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var videoUrl = 'https://www.mapbox.com/bites/00188/patricia_nasa.webm',\r\n * \tvideoBounds = [[ 32, -130], [ 13, -100]];\r\n * L.videoOverlay(videoUrl, videoBounds ).addTo(map);\r\n * ```\r\n */\r\n\r\nexport var VideoOverlay = ImageOverlay.extend({\r\n\r\n\t// @section\r\n\t// @aka VideoOverlay options\r\n\toptions: {\r\n\t\t// @option autoplay: Boolean = true\r\n\t\t// Whether the video starts playing automatically when loaded.\r\n\t\t// On some browsers autoplay will only work with `muted: true`\r\n\t\tautoplay: true,\r\n\r\n\t\t// @option loop: Boolean = true\r\n\t\t// Whether the video will loop back to the beginning when played.\r\n\t\tloop: true,\r\n\r\n\t\t// @option keepAspectRatio: Boolean = true\r\n\t\t// Whether the video will save aspect ratio after the projection.\r\n\t\t// Relevant for supported browsers. See [browser compatibility](https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit)\r\n\t\tkeepAspectRatio: true,\r\n\r\n\t\t// @option muted: Boolean = false\r\n\t\t// Whether the video starts on mute when loaded.\r\n\t\tmuted: false,\r\n\r\n\t\t// @option playsInline: Boolean = true\r\n\t\t// Mobile browsers will play the video right where it is instead of open it up in fullscreen mode.\r\n\t\tplaysInline: true\r\n\t},\r\n\r\n\t_initImage: function () {\r\n\t\tvar wasElementSupplied = this._url.tagName === 'VIDEO';\r\n\t\tvar vid = this._image = wasElementSupplied ? this._url : DomUtil.create('video');\r\n\r\n\t\tDomUtil.addClass(vid, 'leaflet-image-layer');\r\n\t\tif (this._zoomAnimated) { DomUtil.addClass(vid, 'leaflet-zoom-animated'); }\r\n\t\tif (this.options.className) { DomUtil.addClass(vid, this.options.className); }\r\n\r\n\t\tvid.onselectstart = Util.falseFn;\r\n\t\tvid.onmousemove = Util.falseFn;\r\n\r\n\t\t// @event load: Event\r\n\t\t// Fired when the video has finished loading the first frame\r\n\t\tvid.onloadeddata = Util.bind(this.fire, this, 'load');\r\n\r\n\t\tif (wasElementSupplied) {\r\n\t\t\tvar sourceElements = vid.getElementsByTagName('source');\r\n\t\t\tvar sources = [];\r\n\t\t\tfor (var j = 0; j < sourceElements.length; j++) {\r\n\t\t\t\tsources.push(sourceElements[j].src);\r\n\t\t\t}\r\n\r\n\t\t\tthis._url = (sourceElements.length > 0) ? sources : [vid.src];\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (!Util.isArray(this._url)) { this._url = [this._url]; }\r\n\r\n\t\tif (!this.options.keepAspectRatio && Object.prototype.hasOwnProperty.call(vid.style, 'objectFit')) {\r\n\t\t\tvid.style['objectFit'] = 'fill';\r\n\t\t}\r\n\t\tvid.autoplay = !!this.options.autoplay;\r\n\t\tvid.loop = !!this.options.loop;\r\n\t\tvid.muted = !!this.options.muted;\r\n\t\tvid.playsInline = !!this.options.playsInline;\r\n\t\tfor (var i = 0; i < this._url.length; i++) {\r\n\t\t\tvar source = DomUtil.create('source');\r\n\t\t\tsource.src = this._url[i];\r\n\t\t\tvid.appendChild(source);\r\n\t\t}\r\n\t}\r\n\r\n\t// @method getElement(): HTMLVideoElement\r\n\t// Returns the instance of [`HTMLVideoElement`](https://developer.mozilla.org/docs/Web/API/HTMLVideoElement)\r\n\t// used by this overlay.\r\n});\r\n\r\n\r\n// @factory L.videoOverlay(video: String|Array|HTMLVideoElement, bounds: LatLngBounds, options?: VideoOverlay options)\r\n// Instantiates an image overlay object given the URL of the video (or array of URLs, or even a video element) and the\r\n// geographical bounds it is tied to.\r\n\r\nexport function videoOverlay(video, bounds, options) {\r\n\treturn new VideoOverlay(video, bounds, options);\r\n}\r\n", "import {ImageOverlay} from './ImageOverlay';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as Util from '../core/Util';\n\n/*\n * @class SVGOverlay\n * @aka L.SVGOverlay\n * @inherits ImageOverlay\n *\n * Used to load, display and provide DOM access to an SVG file over specific bounds of the map. Extends `ImageOverlay`.\n *\n * An SVG overlay uses the [`<svg>`](https://developer.mozilla.org/docs/Web/SVG/Element/svg) element.\n *\n * @example\n *\n * ```js\n * var svgElement = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n * svgElement.setAttribute('xmlns', \"http://www.w3.org/2000/svg\");\n * svgElement.setAttribute('viewBox', \"0 0 200 200\");\n * svgElement.innerHTML = '<rect width=\"200\" height=\"200\"/><rect x=\"75\" y=\"23\" width=\"50\" height=\"50\" style=\"fill:red\"/><rect x=\"75\" y=\"123\" width=\"50\" height=\"50\" style=\"fill:#0013ff\"/>';\n * var svgElementBounds = [ [ 32, -130 ], [ 13, -100 ] ];\n * L.svgOverlay(svgElement, svgElementBounds).addTo(map);\n * ```\n */\n\nexport var SVGOverlay = ImageOverlay.extend({\n\t_initImage: function () {\n\t\tvar el = this._image = this._url;\n\n\t\tDomUtil.addClass(el, 'leaflet-image-layer');\n\t\tif (this._zoomAnimated) { DomUtil.addClass(el, 'leaflet-zoom-animated'); }\n\t\tif (this.options.className) { DomUtil.addClass(el, this.options.className); }\n\n\t\tel.onselectstart = Util.falseFn;\n\t\tel.onmousemove = Util.falseFn;\n\t}\n\n\t// @method getElement(): SVGElement\n\t// Returns the instance of [`SVGElement`](https://developer.mozilla.org/docs/Web/API/SVGElement)\n\t// used by this overlay.\n});\n\n\n// @factory L.svgOverlay(svg: String|SVGElement, bounds: LatLngBounds, options?: SVGOverlay options)\n// Instantiates an image overlay object given an SVG element and the geographical bounds it is tied to.\n// A viewBox attribute is required on the SVG element to zoom in and out properly.\n\nexport function svgOverlay(el, bounds, options) {\n\treturn new SVGOverlay(el, bounds, options);\n}\n", "import {Map} from '../map/Map';\r\nimport {Layer} from './Layer';\r\nimport {FeatureGroup} from './FeatureGroup';\r\nimport * as Util from '../core/Util';\r\nimport {toLatLng, LatLng} from '../geo/LatLng';\r\nimport {toPoint} from '../geometry/Point';\r\nimport * as DomUtil from '../dom/DomUtil';\r\n\r\n/*\r\n * @class DivOverlay\r\n * @inherits Interactive layer\r\n * @aka L.DivOverlay\r\n * Base model for L.Popup and L.Tooltip. Inherit from it for custom overlays like plugins.\r\n */\r\n\r\n// @namespace DivOverlay\r\nexport var DivOverlay = Layer.extend({\r\n\r\n\t// @section\r\n\t// @aka DivOverlay options\r\n\toptions: {\r\n\t\t// @option interactive: Boolean = false\r\n\t\t// If true, the popup/tooltip will listen to the mouse events.\r\n\t\tinteractive: false,\r\n\r\n\t\t// @option offset: Point = Point(0, 0)\r\n\t\t// The offset of the overlay position.\r\n\t\toffset: [0, 0],\r\n\r\n\t\t// @option className: String = ''\r\n\t\t// A custom CSS class name to assign to the overlay.\r\n\t\tclassName: '',\r\n\r\n\t\t// @option pane: String = undefined\r\n\t\t// `Map pane` where the overlay will be added.\r\n\t\tpane: undefined,\r\n\r\n\t\t// @option content: String|HTMLElement|Function = ''\r\n\t\t// Sets the HTML content of the overlay while initializing. If a function is passed the source layer will be\r\n\t\t// passed to the function. The function should return a `String` or `HTMLElement` to be used in the overlay.\r\n\t\tcontent: ''\r\n\t},\r\n\r\n\tinitialize: function (options, source) {\r\n\t\tif (options && (options instanceof LatLng || Util.isArray(options))) {\r\n\t\t\tthis._latlng = toLatLng(options);\r\n\t\t\tUtil.setOptions(this, source);\r\n\t\t} else {\r\n\t\t\tUtil.setOptions(this, options);\r\n\t\t\tthis._source = source;\r\n\t\t}\r\n\t\tif (this.options.content) {\r\n\t\t\tthis._content = this.options.content;\r\n\t\t}\r\n\t},\r\n\r\n\t// @method openOn(map: Map): this\r\n\t// Adds the overlay to the map.\r\n\t// Alternative to `map.openPopup(popup)`/`.openTooltip(tooltip)`.\r\n\topenOn: function (map) {\r\n\t\tmap = arguments.length ? map : this._source._map; // experimental, not the part of public api\r\n\t\tif (!map.hasLayer(this)) {\r\n\t\t\tmap.addLayer(this);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method close(): this\r\n\t// Closes the overlay.\r\n\t// Alternative to `map.closePopup(popup)`/`.closeTooltip(tooltip)`\r\n\t// and `layer.closePopup()`/`.closeTooltip()`.\r\n\tclose: function () {\r\n\t\tif (this._map) {\r\n\t\t\tthis._map.removeLayer(this);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method toggle(layer?: Layer): this\r\n\t// Opens or closes the overlay bound to layer depending on its current state.\r\n\t// Argument may be omitted only for overlay bound to layer.\r\n\t// Alternative to `layer.togglePopup()`/`.toggleTooltip()`.\r\n\ttoggle: function (layer) {\r\n\t\tif (this._map) {\r\n\t\t\tthis.close();\r\n\t\t} else {\r\n\t\t\tif (arguments.length) {\r\n\t\t\t\tthis._source = layer;\r\n\t\t\t} else {\r\n\t\t\t\tlayer = this._source;\r\n\t\t\t}\r\n\t\t\tthis._prepareOpen();\r\n\r\n\t\t\t// open the overlay on the map\r\n\t\t\tthis.openOn(layer._map);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tthis._zoomAnimated = map._zoomAnimated;\r\n\r\n\t\tif (!this._container) {\r\n\t\t\tthis._initLayout();\r\n\t\t}\r\n\r\n\t\tif (map._fadeAnimated) {\r\n\t\t\tDomUtil.setOpacity(this._container, 0);\r\n\t\t}\r\n\r\n\t\tclearTimeout(this._removeTimeout);\r\n\t\tthis.getPane().appendChild(this._container);\r\n\t\tthis.update();\r\n\r\n\t\tif (map._fadeAnimated) {\r\n\t\t\tDomUtil.setOpacity(this._container, 1);\r\n\t\t}\r\n\r\n\t\tthis.bringToFront();\r\n\r\n\t\tif (this.options.interactive) {\r\n\t\t\tDomUtil.addClass(this._container, 'leaflet-interactive');\r\n\t\t\tthis.addInteractiveTarget(this._container);\r\n\t\t}\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tif (map._fadeAnimated) {\r\n\t\t\tDomUtil.setOpacity(this._container, 0);\r\n\t\t\tthis._removeTimeout = setTimeout(Util.bind(DomUtil.remove, undefined, this._container), 200);\r\n\t\t} else {\r\n\t\t\tDomUtil.remove(this._container);\r\n\t\t}\r\n\r\n\t\tif (this.options.interactive) {\r\n\t\t\tDomUtil.removeClass(this._container, 'leaflet-interactive');\r\n\t\t\tthis.removeInteractiveTarget(this._container);\r\n\t\t}\r\n\t},\r\n\r\n\t// @namespace DivOverlay\r\n\t// @method getLatLng: LatLng\r\n\t// Returns the geographical point of the overlay.\r\n\tgetLatLng: function () {\r\n\t\treturn this._latlng;\r\n\t},\r\n\r\n\t// @method setLatLng(latlng: LatLng): this\r\n\t// Sets the geographical point where the overlay will open.\r\n\tsetLatLng: function (latlng) {\r\n\t\tthis._latlng = toLatLng(latlng);\r\n\t\tif (this._map) {\r\n\t\t\tthis._updatePosition();\r\n\t\t\tthis._adjustPan();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getContent: String|HTMLElement\r\n\t// Returns the content of the overlay.\r\n\tgetContent: function () {\r\n\t\treturn this._content;\r\n\t},\r\n\r\n\t// @method setContent(htmlContent: String|HTMLElement|Function): this\r\n\t// Sets the HTML content of the overlay. If a function is passed the source layer will be passed to the function.\r\n\t// The function should return a `String` or `HTMLElement` to be used in the overlay.\r\n\tsetContent: function (content) {\r\n\t\tthis._content = content;\r\n\t\tthis.update();\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getElement: String|HTMLElement\r\n\t// Returns the HTML container of the overlay.\r\n\tgetElement: function () {\r\n\t\treturn this._container;\r\n\t},\r\n\r\n\t// @method update: null\r\n\t// Updates the overlay content, layout and position. Useful for updating the overlay after something inside changed, e.g. image loaded.\r\n\tupdate: function () {\r\n\t\tif (!this._map) { return; }\r\n\r\n\t\tthis._container.style.visibility = 'hidden';\r\n\r\n\t\tthis._updateContent();\r\n\t\tthis._updateLayout();\r\n\t\tthis._updatePosition();\r\n\r\n\t\tthis._container.style.visibility = '';\r\n\r\n\t\tthis._adjustPan();\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\tvar events = {\r\n\t\t\tzoom: this._updatePosition,\r\n\t\t\tviewreset: this._updatePosition\r\n\t\t};\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tevents.zoomanim = this._animateZoom;\r\n\t\t}\r\n\t\treturn events;\r\n\t},\r\n\r\n\t// @method isOpen: Boolean\r\n\t// Returns `true` when the overlay is visible on the map.\r\n\tisOpen: function () {\r\n\t\treturn !!this._map && this._map.hasLayer(this);\r\n\t},\r\n\r\n\t// @method bringToFront: this\r\n\t// Brings this overlay in front of other overlays (in the same map pane).\r\n\tbringToFront: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toFront(this._container);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method bringToBack: this\r\n\t// Brings this overlay to the back of other overlays (in the same map pane).\r\n\tbringToBack: function () {\r\n\t\tif (this._map) {\r\n\t\t\tDomUtil.toBack(this._container);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// prepare bound overlay to open: update latlng pos / content source (for FeatureGroup)\r\n\t_prepareOpen: function (latlng) {\r\n\t\tvar source = this._source;\r\n\t\tif (!source._map) { return false; }\r\n\r\n\t\tif (source instanceof FeatureGroup) {\r\n\t\t\tsource = null;\r\n\t\t\tvar layers = this._source._layers;\r\n\t\t\tfor (var id in layers) {\r\n\t\t\t\tif (layers[id]._map) {\r\n\t\t\t\t\tsource = layers[id];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (!source) { return false; } // Unable to get source layer.\r\n\r\n\t\t\t// set overlay source to this layer\r\n\t\t\tthis._source = source;\r\n\t\t}\r\n\r\n\t\tif (!latlng) {\r\n\t\t\tif (source.getCenter) {\r\n\t\t\t\tlatlng = source.getCenter();\r\n\t\t\t} else if (source.getLatLng) {\r\n\t\t\t\tlatlng = source.getLatLng();\r\n\t\t\t} else if (source.getBounds) {\r\n\t\t\t\tlatlng = source.getBounds().getCenter();\r\n\t\t\t} else {\r\n\t\t\t\tthrow new Error('Unable to get source layer LatLng.');\r\n\t\t\t}\r\n\t\t}\r\n\t\tthis.setLatLng(latlng);\r\n\r\n\t\tif (this._map) {\r\n\t\t\t// update the overlay (content, layout, etc...)\r\n\t\t\tthis.update();\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t},\r\n\r\n\t_updateContent: function () {\r\n\t\tif (!this._content) { return; }\r\n\r\n\t\tvar node = this._contentNode;\r\n\t\tvar content = (typeof this._content === 'function') ? this._content(this._source || this) : this._content;\r\n\r\n\t\tif (typeof content === 'string') {\r\n\t\t\tnode.innerHTML = content;\r\n\t\t} else {\r\n\t\t\twhile (node.hasChildNodes()) {\r\n\t\t\t\tnode.removeChild(node.firstChild);\r\n\t\t\t}\r\n\t\t\tnode.appendChild(content);\r\n\t\t}\r\n\r\n\t\t// @namespace DivOverlay\r\n\t\t// @section DivOverlay events\r\n\t\t// @event contentupdate: Event\r\n\t\t// Fired when the content of the overlay is updated\r\n\t\tthis.fire('contentupdate');\r\n\t},\r\n\r\n\t_updatePosition: function () {\r\n\t\tif (!this._map) { return; }\r\n\r\n\t\tvar pos = this._map.latLngToLayerPoint(this._latlng),\r\n\t\t    offset = toPoint(this.options.offset),\r\n\t\t    anchor = this._getAnchor();\r\n\r\n\t\tif (this._zoomAnimated) {\r\n\t\t\tDomUtil.setPosition(this._container, pos.add(anchor));\r\n\t\t} else {\r\n\t\t\toffset = offset.add(pos).add(anchor);\r\n\t\t}\r\n\r\n\t\tvar bottom = this._containerBottom = -offset.y,\r\n\t\t    left = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\r\n\r\n\t\t// bottom position the overlay in case the height of the overlay changes (images loading etc)\r\n\t\tthis._container.style.bottom = bottom + 'px';\r\n\t\tthis._container.style.left = left + 'px';\r\n\t},\r\n\r\n\t_getAnchor: function () {\r\n\t\treturn [0, 0];\r\n\t}\r\n\r\n});\r\n\r\nMap.include({\r\n\t_initOverlay: function (OverlayClass, content, latlng, options) {\r\n\t\tvar overlay = content;\r\n\t\tif (!(overlay instanceof OverlayClass)) {\r\n\t\t\toverlay = new OverlayClass(options).setContent(content);\r\n\t\t}\r\n\t\tif (latlng) {\r\n\t\t\toverlay.setLatLng(latlng);\r\n\t\t}\r\n\t\treturn overlay;\r\n\t}\r\n});\r\n\r\n\r\nLayer.include({\r\n\t_initOverlay: function (OverlayClass, old, content, options) {\r\n\t\tvar overlay = content;\r\n\t\tif (overlay instanceof OverlayClass) {\r\n\t\t\tUtil.setOptions(overlay, options);\r\n\t\t\toverlay._source = this;\r\n\t\t} else {\r\n\t\t\toverlay = (old && !options) ? old : new OverlayClass(options, this);\r\n\t\t\toverlay.setContent(content);\r\n\t\t}\r\n\t\treturn overlay;\r\n\t}\r\n});\r\n", "import {DivOverlay} from './DivOverlay';\r\nimport * as DomEvent from '../dom/DomEvent';\r\nimport * as DomUtil from '../dom/DomUtil';\r\nimport {Point, toPoint} from '../geometry/Point';\r\nimport {Map} from '../map/Map';\r\nimport {Layer} from './Layer';\r\nimport {Path} from './vector/Path';\r\nimport {FeatureGroup} from './FeatureGroup';\r\n\r\n/*\r\n * @class Popup\r\n * @inherits DivOverlay\r\n * @aka L.Popup\r\n * Used to open popups in certain places of the map. Use [Map.openPopup](#map-openpopup) to\r\n * open popups while making sure that only one popup is open at one time\r\n * (recommended for usability), or use [Map.addLayer](#map-addlayer) to open as many as you want.\r\n *\r\n * @example\r\n *\r\n * If you want to just bind a popup to marker click and then open it, it's really easy:\r\n *\r\n * ```js\r\n * marker.bindPopup(popupContent).openPopup();\r\n * ```\r\n * Path overlays like polylines also have a `bindPopup` method.\r\n *\r\n * A popup can be also standalone:\r\n *\r\n * ```js\r\n * var popup = L.popup()\r\n * \t.setLatLng(latlng)\r\n * \t.setContent('<p>Hello world!<br />This is a nice popup.</p>')\r\n * \t.openOn(map);\r\n * ```\r\n * or\r\n * ```js\r\n * var popup = L.popup(latlng, {content: '<p>Hello world!<br />This is a nice popup.</p>')\r\n * \t.openOn(map);\r\n * ```\r\n */\r\n\r\n\r\n// @namespace Popup\r\nexport var Popup = DivOverlay.extend({\r\n\r\n\t// @section\r\n\t// @aka Popup options\r\n\toptions: {\r\n\t\t// @option pane: String = 'popupPane'\r\n\t\t// `Map pane` where the popup will be added.\r\n\t\tpane: 'popupPane',\r\n\r\n\t\t// @option offset: Point = Point(0, 7)\r\n\t\t// The offset of the popup position.\r\n\t\toffset: [0, 7],\r\n\r\n\t\t// @option maxWidth: Number = 300\r\n\t\t// Max width of the popup, in pixels.\r\n\t\tmaxWidth: 300,\r\n\r\n\t\t// @option minWidth: Number = 50\r\n\t\t// Min width of the popup, in pixels.\r\n\t\tminWidth: 50,\r\n\r\n\t\t// @option maxHeight: Number = null\r\n\t\t// If set, creates a scrollable container of the given height\r\n\t\t// inside a popup if its content exceeds it.\r\n\t\t// The scrollable container can be styled using the\r\n\t\t// `leaflet-popup-scrolled` CSS class selector.\r\n\t\tmaxHeight: null,\r\n\r\n\t\t// @option autoPan: Boolean = true\r\n\t\t// Set it to `false` if you don't want the map to do panning animation\r\n\t\t// to fit the opened popup.\r\n\t\tautoPan: true,\r\n\r\n\t\t// @option autoPanPaddingTopLeft: Point = null\r\n\t\t// The margin between the popup and the top left corner of the map\r\n\t\t// view after autopanning was performed.\r\n\t\tautoPanPaddingTopLeft: null,\r\n\r\n\t\t// @option autoPanPaddingBottomRight: Point = null\r\n\t\t// The margin between the popup and the bottom right corner of the map\r\n\t\t// view after autopanning was performed.\r\n\t\tautoPanPaddingBottomRight: null,\r\n\r\n\t\t// @option autoPanPadding: Point = Point(5, 5)\r\n\t\t// Equivalent of setting both top left and bottom right autopan padding to the same value.\r\n\t\tautoPanPadding: [5, 5],\r\n\r\n\t\t// @option keepInView: Boolean = false\r\n\t\t// Set it to `true` if you want to prevent users from panning the popup\r\n\t\t// off of the screen while it is open.\r\n\t\tkeepInView: false,\r\n\r\n\t\t// @option closeButton: Boolean = true\r\n\t\t// Controls the presence of a close button in the popup.\r\n\t\tcloseButton: true,\r\n\r\n\t\t// @option autoClose: Boolean = true\r\n\t\t// Set it to `false` if you want to override the default behavior of\r\n\t\t// the popup closing when another popup is opened.\r\n\t\tautoClose: true,\r\n\r\n\t\t// @option closeOnEscapeKey: Boolean = true\r\n\t\t// Set it to `false` if you want to override the default behavior of\r\n\t\t// the ESC key for closing of the popup.\r\n\t\tcloseOnEscapeKey: true,\r\n\r\n\t\t// @option closeOnClick: Boolean = *\r\n\t\t// Set it if you want to override the default behavior of the popup closing when user clicks\r\n\t\t// on the map. Defaults to the map's [`closePopupOnClick`](#map-closepopuponclick) option.\r\n\r\n\t\t// @option className: String = ''\r\n\t\t// A custom CSS class name to assign to the popup.\r\n\t\tclassName: ''\r\n\t},\r\n\r\n\t// @namespace Popup\r\n\t// @method openOn(map: Map): this\r\n\t// Alternative to `map.openPopup(popup)`.\r\n\t// Adds the popup to the map and closes the previous one.\r\n\topenOn: function (map) {\r\n\t\tmap = arguments.length ? map : this._source._map; // experimental, not the part of public api\r\n\r\n\t\tif (!map.hasLayer(this) && map._popup && map._popup.options.autoClose) {\r\n\t\t\tmap.removeLayer(map._popup);\r\n\t\t}\r\n\t\tmap._popup = this;\r\n\r\n\t\treturn DivOverlay.prototype.openOn.call(this, map);\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\t\tDivOverlay.prototype.onAdd.call(this, map);\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Popup events\r\n\t\t// @event popupopen: PopupEvent\r\n\t\t// Fired when a popup is opened in the map\r\n\t\tmap.fire('popupopen', {popup: this});\r\n\r\n\t\tif (this._source) {\r\n\t\t\t// @namespace Layer\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event popupopen: PopupEvent\r\n\t\t\t// Fired when a popup bound to this layer is opened\r\n\t\t\tthis._source.fire('popupopen', {popup: this}, true);\r\n\t\t\t// For non-path layers, we toggle the popup when clicking\r\n\t\t\t// again the layer, so prevent the map to reopen it.\r\n\t\t\tif (!(this._source instanceof Path)) {\r\n\t\t\t\tthis._source.on('preclick', DomEvent.stopPropagation);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tonRemove: function (map) {\r\n\t\tDivOverlay.prototype.onRemove.call(this, map);\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Popup events\r\n\t\t// @event popupclose: PopupEvent\r\n\t\t// Fired when a popup in the map is closed\r\n\t\tmap.fire('popupclose', {popup: this});\r\n\r\n\t\tif (this._source) {\r\n\t\t\t// @namespace Layer\r\n\t\t\t// @section Popup events\r\n\t\t\t// @event popupclose: PopupEvent\r\n\t\t\t// Fired when a popup bound to this layer is closed\r\n\t\t\tthis._source.fire('popupclose', {popup: this}, true);\r\n\t\t\tif (!(this._source instanceof Path)) {\r\n\t\t\t\tthis._source.off('preclick', DomEvent.stopPropagation);\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\tgetEvents: function () {\r\n\t\tvar events = DivOverlay.prototype.getEvents.call(this);\r\n\r\n\t\tif (this.options.closeOnClick !== undefined ? this.options.closeOnClick : this._map.options.closePopupOnClick) {\r\n\t\t\tevents.preclick = this.close;\r\n\t\t}\r\n\r\n\t\tif (this.options.keepInView) {\r\n\t\t\tevents.moveend = this._adjustPan;\r\n\t\t}\r\n\r\n\t\treturn events;\r\n\t},\r\n\r\n\t_initLayout: function () {\r\n\t\tvar prefix = 'leaflet-popup',\r\n\t\t    container = this._container = DomUtil.create('div',\r\n\t\t\tprefix + ' ' + (this.options.className || '') +\r\n\t\t\t' leaflet-zoom-animated');\r\n\r\n\t\tvar wrapper = this._wrapper = DomUtil.create('div', prefix + '-content-wrapper', container);\r\n\t\tthis._contentNode = DomUtil.create('div', prefix + '-content', wrapper);\r\n\r\n\t\tDomEvent.disableClickPropagation(container);\r\n\t\tDomEvent.disableScrollPropagation(this._contentNode);\r\n\t\tDomEvent.on(container, 'contextmenu', DomEvent.stopPropagation);\r\n\r\n\t\tthis._tipContainer = DomUtil.create('div', prefix + '-tip-container', container);\r\n\t\tthis._tip = DomUtil.create('div', prefix + '-tip', this._tipContainer);\r\n\r\n\t\tif (this.options.closeButton) {\r\n\t\t\tvar closeButton = this._closeButton = DomUtil.create('a', prefix + '-close-button', container);\r\n\t\t\tcloseButton.setAttribute('role', 'button'); // overrides the implicit role=link of <a> elements #7399\r\n\t\t\tcloseButton.setAttribute('aria-label', 'Close popup');\r\n\t\t\tcloseButton.href = '#close';\r\n\t\t\tcloseButton.innerHTML = '<span aria-hidden=\"true\">&#215;</span>';\r\n\r\n\t\t\tDomEvent.on(closeButton, 'click', function (ev) {\r\n\t\t\t\tDomEvent.preventDefault(ev);\r\n\t\t\t\tthis.close();\r\n\t\t\t}, this);\r\n\t\t}\r\n\t},\r\n\r\n\t_updateLayout: function () {\r\n\t\tvar container = this._contentNode,\r\n\t\t    style = container.style;\r\n\r\n\t\tstyle.width = '';\r\n\t\tstyle.whiteSpace = 'nowrap';\r\n\r\n\t\tvar width = container.offsetWidth;\r\n\t\twidth = Math.min(width, this.options.maxWidth);\r\n\t\twidth = Math.max(width, this.options.minWidth);\r\n\r\n\t\tstyle.width = (width + 1) + 'px';\r\n\t\tstyle.whiteSpace = '';\r\n\r\n\t\tstyle.height = '';\r\n\r\n\t\tvar height = container.offsetHeight,\r\n\t\t    maxHeight = this.options.maxHeight,\r\n\t\t    scrolledClass = 'leaflet-popup-scrolled';\r\n\r\n\t\tif (maxHeight && height > maxHeight) {\r\n\t\t\tstyle.height = maxHeight + 'px';\r\n\t\t\tDomUtil.addClass(container, scrolledClass);\r\n\t\t} else {\r\n\t\t\tDomUtil.removeClass(container, scrolledClass);\r\n\t\t}\r\n\r\n\t\tthis._containerWidth = this._container.offsetWidth;\r\n\t},\r\n\r\n\t_animateZoom: function (e) {\r\n\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\r\n\t\t    anchor = this._getAnchor();\r\n\t\tDomUtil.setPosition(this._container, pos.add(anchor));\r\n\t},\r\n\r\n\t_adjustPan: function () {\r\n\t\tif (!this.options.autoPan) { return; }\r\n\t\tif (this._map._panAnim) { this._map._panAnim.stop(); }\r\n\r\n\t\t// We can endlessly recurse if keepInView is set and the view resets.\r\n\t\t// Let's guard against that by exiting early if we're responding to our own autopan.\r\n\t\tif (this._autopanning) {\r\n\t\t\tthis._autopanning = false;\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tvar map = this._map,\r\n\t\t    marginBottom = parseInt(DomUtil.getStyle(this._container, 'marginBottom'), 10) || 0,\r\n\t\t    containerHeight = this._container.offsetHeight + marginBottom,\r\n\t\t    containerWidth = this._containerWidth,\r\n\t\t    layerPos = new Point(this._containerLeft, -containerHeight - this._containerBottom);\r\n\r\n\t\tlayerPos._add(DomUtil.getPosition(this._container));\r\n\r\n\t\tvar containerPos = map.layerPointToContainerPoint(layerPos),\r\n\t\t    padding = toPoint(this.options.autoPanPadding),\r\n\t\t    paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding),\r\n\t\t    paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding),\r\n\t\t    size = map.getSize(),\r\n\t\t    dx = 0,\r\n\t\t    dy = 0;\r\n\r\n\t\tif (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\r\n\t\t\tdx = containerPos.x + containerWidth - size.x + paddingBR.x;\r\n\t\t}\r\n\t\tif (containerPos.x - dx - paddingTL.x < 0) { // left\r\n\t\t\tdx = containerPos.x - paddingTL.x;\r\n\t\t}\r\n\t\tif (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\r\n\t\t\tdy = containerPos.y + containerHeight - size.y + paddingBR.y;\r\n\t\t}\r\n\t\tif (containerPos.y - dy - paddingTL.y < 0) { // top\r\n\t\t\tdy = containerPos.y - paddingTL.y;\r\n\t\t}\r\n\r\n\t\t// @namespace Map\r\n\t\t// @section Popup events\r\n\t\t// @event autopanstart: Event\r\n\t\t// Fired when the map starts autopanning when opening a popup.\r\n\t\tif (dx || dy) {\r\n\t\t\t// Track that we're autopanning, as this function will be re-ran on moveend\r\n\t\t\tif (this.options.keepInView) {\r\n\t\t\t\tthis._autopanning = true;\r\n\t\t\t}\r\n\r\n\t\t\tmap\r\n\t\t\t    .fire('autopanstart')\r\n\t\t\t    .panBy([dx, dy]);\r\n\t\t}\r\n\t},\r\n\r\n\t_getAnchor: function () {\r\n\t\t// Where should we anchor the popup on the source layer?\r\n\t\treturn toPoint(this._source && this._source._getPopupAnchor ? this._source._getPopupAnchor() : [0, 0]);\r\n\t}\r\n\r\n});\r\n\r\n// @namespace Popup\r\n// @factory L.popup(options?: Popup options, source?: Layer)\r\n// Instantiates a `Popup` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the popup with a reference to the Layer to which it refers.\r\n// @alternative\r\n// @factory L.popup(latlng: LatLng, options?: Popup options)\r\n// Instantiates a `Popup` object given `latlng` where the popup will open and an optional `options` object that describes its appearance and location.\r\nexport var popup = function (options, source) {\r\n\treturn new Popup(options, source);\r\n};\r\n\r\n\r\n/* @namespace Map\r\n * @section Interaction Options\r\n * @option closePopupOnClick: Boolean = true\r\n * Set it to `false` if you don't want popups to close when user clicks the map.\r\n */\r\nMap.mergeOptions({\r\n\tclosePopupOnClick: true\r\n});\r\n\r\n\r\n// @namespace Map\r\n// @section Methods for Layers and Controls\r\nMap.include({\r\n\t// @method openPopup(popup: Popup): this\r\n\t// Opens the specified popup while closing the previously opened (to make sure only one is opened at one time for usability).\r\n\t// @alternative\r\n\t// @method openPopup(content: String|HTMLElement, latlng: LatLng, options?: Popup options): this\r\n\t// Creates a popup with the specified content and options and opens it in the given point on a map.\r\n\topenPopup: function (popup, latlng, options) {\r\n\t\tthis._initOverlay(Popup, popup, latlng, options)\r\n\t\t  .openOn(this);\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method closePopup(popup?: Popup): this\r\n\t// Closes the popup previously opened with [openPopup](#map-openpopup) (or the given one).\r\n\tclosePopup: function (popup) {\r\n\t\tpopup = arguments.length ? popup : this._popup;\r\n\t\tif (popup) {\r\n\t\t\tpopup.close();\r\n\t\t}\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n/*\r\n * @namespace Layer\r\n * @section Popup methods example\r\n *\r\n * All layers share a set of methods convenient for binding popups to it.\r\n *\r\n * ```js\r\n * var layer = L.Polygon(latlngs).bindPopup('Hi There!').addTo(map);\r\n * layer.openPopup();\r\n * layer.closePopup();\r\n * ```\r\n *\r\n * Popups will also be automatically opened when the layer is clicked on and closed when the layer is removed from the map or another popup is opened.\r\n */\r\n\r\n// @section Popup methods\r\nLayer.include({\r\n\r\n\t// @method bindPopup(content: String|HTMLElement|Function|Popup, options?: Popup options): this\r\n\t// Binds a popup to the layer with the passed `content` and sets up the\r\n\t// necessary event listeners. If a `Function` is passed it will receive\r\n\t// the layer as the first argument and should return a `String` or `HTMLElement`.\r\n\tbindPopup: function (content, options) {\r\n\t\tthis._popup = this._initOverlay(Popup, this._popup, content, options);\r\n\t\tif (!this._popupHandlersAdded) {\r\n\t\t\tthis.on({\r\n\t\t\t\tclick: this._openPopup,\r\n\t\t\t\tkeypress: this._onKeyPress,\r\n\t\t\t\tremove: this.closePopup,\r\n\t\t\t\tmove: this._movePopup\r\n\t\t\t});\r\n\t\t\tthis._popupHandlersAdded = true;\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method unbindPopup(): this\r\n\t// Removes the popup previously bound with `bindPopup`.\r\n\tunbindPopup: function () {\r\n\t\tif (this._popup) {\r\n\t\t\tthis.off({\r\n\t\t\t\tclick: this._openPopup,\r\n\t\t\t\tkeypress: this._onKeyPress,\r\n\t\t\t\tremove: this.closePopup,\r\n\t\t\t\tmove: this._movePopup\r\n\t\t\t});\r\n\t\t\tthis._popupHandlersAdded = false;\r\n\t\t\tthis._popup = null;\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method openPopup(latlng?: LatLng): this\r\n\t// Opens the bound popup at the specified `latlng` or at the default popup anchor if no `latlng` is passed.\r\n\topenPopup: function (latlng) {\r\n\t\tif (this._popup) {\r\n\t\t\tif (!(this instanceof FeatureGroup)) {\r\n\t\t\t\tthis._popup._source = this;\r\n\t\t\t}\r\n\t\t\tif (this._popup._prepareOpen(latlng || this._latlng)) {\r\n\t\t\t\t// open the popup on the map\r\n\t\t\t\tthis._popup.openOn(this._map);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method closePopup(): this\r\n\t// Closes the popup bound to this layer if it is open.\r\n\tclosePopup: function () {\r\n\t\tif (this._popup) {\r\n\t\t\tthis._popup.close();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method togglePopup(): this\r\n\t// Opens or closes the popup bound to this layer depending on its current state.\r\n\ttogglePopup: function () {\r\n\t\tif (this._popup) {\r\n\t\t\tthis._popup.toggle(this);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method isPopupOpen(): boolean\r\n\t// Returns `true` if the popup bound to this layer is currently open.\r\n\tisPopupOpen: function () {\r\n\t\treturn (this._popup ? this._popup.isOpen() : false);\r\n\t},\r\n\r\n\t// @method setPopupContent(content: String|HTMLElement|Popup): this\r\n\t// Sets the content of the popup bound to this layer.\r\n\tsetPopupContent: function (content) {\r\n\t\tif (this._popup) {\r\n\t\t\tthis._popup.setContent(content);\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method getPopup(): Popup\r\n\t// Returns the popup bound to this layer.\r\n\tgetPopup: function () {\r\n\t\treturn this._popup;\r\n\t},\r\n\r\n\t_openPopup: function (e) {\r\n\t\tif (!this._popup || !this._map) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t// prevent map click\r\n\t\tDomEvent.stop(e);\r\n\r\n\t\tvar target = e.layer || e.target;\r\n\t\tif (this._popup._source === target && !(target instanceof Path)) {\r\n\t\t\t// treat it like a marker and figure out\r\n\t\t\t// if we should toggle it open/closed\r\n\t\t\tif (this._map.hasLayer(this._popup)) {\r\n\t\t\t\tthis.closePopup();\r\n\t\t\t} else {\r\n\t\t\t\tthis.openPopup(e.latlng);\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tthis._popup._source = target;\r\n\t\tthis.openPopup(e.latlng);\r\n\t},\r\n\r\n\t_movePopup: function (e) {\r\n\t\tthis._popup.setLatLng(e.latlng);\r\n\t},\r\n\r\n\t_onKeyPress: function (e) {\r\n\t\tif (e.originalEvent.keyCode === 13) {\r\n\t\t\tthis._openPopup(e);\r\n\t\t}\r\n\t}\r\n});\r\n", "import {DivOverlay} from './DivOverlay';\nimport {toPoint} from '../geometry/Point';\nimport {Map} from '../map/Map';\nimport {Layer} from './Layer';\nimport * as DomUtil from '../dom/DomUtil';\nimport * as DomEvent from '../dom/DomEvent';\nimport * as Util from '../core/Util';\nimport {FeatureGroup} from './FeatureGroup';\n\n/*\n * @class Tooltip\n * @inherits DivOverlay\n * @aka L.Tooltip\n * Used to display small texts on top of map layers.\n *\n * @example\n * If you want to just bind a tooltip to marker:\n *\n * ```js\n * marker.bindTooltip(\"my tooltip text\").openTooltip();\n * ```\n * Path overlays like polylines also have a `bindTooltip` method.\n *\n * A tooltip can be also standalone:\n *\n * ```js\n * var tooltip = L.tooltip()\n * \t.setLatLng(latlng)\n * \t.setContent('Hello world!<br />This is a nice tooltip.')\n * \t.addTo(map);\n * ```\n * or\n * ```js\n * var tooltip = L.tooltip(latlng, {content: 'Hello world!<br />This is a nice tooltip.'})\n * \t.addTo(map);\n * ```\n *\n *\n * Note about tooltip offset. Leaflet takes two options in consideration\n * for computing tooltip offsetting:\n * - the `offset` Tooltip option: it defaults to [0, 0], and it's specific to one tooltip.\n *   Add a positive x offset to move the tooltip to the right, and a positive y offset to\n *   move it to the bottom. Negatives will move to the left and top.\n * - the `tooltipAnchor` Icon option: this will only be considered for Marker. You\n *   should adapt this value if you use a custom icon.\n */\n\n\n// @namespace Tooltip\nexport var Tooltip = DivOverlay.extend({\n\n\t// @section\n\t// @aka Tooltip options\n\toptions: {\n\t\t// @option pane: String = 'tooltipPane'\n\t\t// `Map pane` where the tooltip will be added.\n\t\tpane: 'tooltipPane',\n\n\t\t// @option offset: Point = Point(0, 0)\n\t\t// Optional offset of the tooltip position.\n\t\toffset: [0, 0],\n\n\t\t// @option direction: String = 'auto'\n\t\t// Direction where to open the tooltip. Possible values are: `right`, `left`,\n\t\t// `top`, `bottom`, `center`, `auto`.\n\t\t// `auto` will dynamically switch between `right` and `left` according to the tooltip\n\t\t// position on the map.\n\t\tdirection: 'auto',\n\n\t\t// @option permanent: Boolean = false\n\t\t// Whether to open the tooltip permanently or only on mouseover.\n\t\tpermanent: false,\n\n\t\t// @option sticky: Boolean = false\n\t\t// If true, the tooltip will follow the mouse instead of being fixed at the feature center.\n\t\tsticky: false,\n\n\t\t// @option opacity: Number = 0.9\n\t\t// Tooltip container opacity.\n\t\topacity: 0.9\n\t},\n\n\tonAdd: function (map) {\n\t\tDivOverlay.prototype.onAdd.call(this, map);\n\t\tthis.setOpacity(this.options.opacity);\n\n\t\t// @namespace Map\n\t\t// @section Tooltip events\n\t\t// @event tooltipopen: TooltipEvent\n\t\t// Fired when a tooltip is opened in the map.\n\t\tmap.fire('tooltipopen', {tooltip: this});\n\n\t\tif (this._source) {\n\t\t\tthis.addEventParent(this._source);\n\n\t\t\t// @namespace Layer\n\t\t\t// @section Tooltip events\n\t\t\t// @event tooltipopen: TooltipEvent\n\t\t\t// Fired when a tooltip bound to this layer is opened.\n\t\t\tthis._source.fire('tooltipopen', {tooltip: this}, true);\n\t\t}\n\t},\n\n\tonRemove: function (map) {\n\t\tDivOverlay.prototype.onRemove.call(this, map);\n\n\t\t// @namespace Map\n\t\t// @section Tooltip events\n\t\t// @event tooltipclose: TooltipEvent\n\t\t// Fired when a tooltip in the map is closed.\n\t\tmap.fire('tooltipclose', {tooltip: this});\n\n\t\tif (this._source) {\n\t\t\tthis.removeEventParent(this._source);\n\n\t\t\t// @namespace Layer\n\t\t\t// @section Tooltip events\n\t\t\t// @event tooltipclose: TooltipEvent\n\t\t\t// Fired when a tooltip bound to this layer is closed.\n\t\t\tthis._source.fire('tooltipclose', {tooltip: this}, true);\n\t\t}\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = DivOverlay.prototype.getEvents.call(this);\n\n\t\tif (!this.options.permanent) {\n\t\t\tevents.preclick = this.close;\n\t\t}\n\n\t\treturn events;\n\t},\n\n\t_initLayout: function () {\n\t\tvar prefix = 'leaflet-tooltip',\n\t\t    className = prefix + ' ' + (this.options.className || '') + ' leaflet-zoom-' + (this._zoomAnimated ? 'animated' : 'hide');\n\n\t\tthis._contentNode = this._container = DomUtil.create('div', className);\n\n\t\tthis._container.setAttribute('role', 'tooltip');\n\t\tthis._container.setAttribute('id', 'leaflet-tooltip-' + Util.stamp(this));\n\t},\n\n\t_updateLayout: function () {},\n\n\t_adjustPan: function () {},\n\n\t_setPosition: function (pos) {\n\t\tvar subX, subY,\n\t\t    map = this._map,\n\t\t    container = this._container,\n\t\t    centerPoint = map.latLngToContainerPoint(map.getCenter()),\n\t\t    tooltipPoint = map.layerPointToContainerPoint(pos),\n\t\t    direction = this.options.direction,\n\t\t    tooltipWidth = container.offsetWidth,\n\t\t    tooltipHeight = container.offsetHeight,\n\t\t    offset = toPoint(this.options.offset),\n\t\t    anchor = this._getAnchor();\n\n\t\tif (direction === 'top') {\n\t\t\tsubX = tooltipWidth / 2;\n\t\t\tsubY = tooltipHeight;\n\t\t} else if (direction === 'bottom') {\n\t\t\tsubX = tooltipWidth / 2;\n\t\t\tsubY = 0;\n\t\t} else if (direction === 'center') {\n\t\t\tsubX = tooltipWidth / 2;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else if (direction === 'right') {\n\t\t\tsubX = 0;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else if (direction === 'left') {\n\t\t\tsubX = tooltipWidth;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else if (tooltipPoint.x < centerPoint.x) {\n\t\t\tdirection = 'right';\n\t\t\tsubX = 0;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t} else {\n\t\t\tdirection = 'left';\n\t\t\tsubX = tooltipWidth + (offset.x + anchor.x) * 2;\n\t\t\tsubY = tooltipHeight / 2;\n\t\t}\n\n\t\tpos = pos.subtract(toPoint(subX, subY, true)).add(offset).add(anchor);\n\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-right');\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-left');\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-top');\n\t\tDomUtil.removeClass(container, 'leaflet-tooltip-bottom');\n\t\tDomUtil.addClass(container, 'leaflet-tooltip-' + direction);\n\t\tDomUtil.setPosition(container, pos);\n\t},\n\n\t_updatePosition: function () {\n\t\tvar pos = this._map.latLngToLayerPoint(this._latlng);\n\t\tthis._setPosition(pos);\n\t},\n\n\tsetOpacity: function (opacity) {\n\t\tthis.options.opacity = opacity;\n\n\t\tif (this._container) {\n\t\t\tDomUtil.setOpacity(this._container, opacity);\n\t\t}\n\t},\n\n\t_animateZoom: function (e) {\n\t\tvar pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);\n\t\tthis._setPosition(pos);\n\t},\n\n\t_getAnchor: function () {\n\t\t// Where should we anchor the tooltip on the source layer?\n\t\treturn toPoint(this._source && this._source._getTooltipAnchor && !this.options.sticky ? this._source._getTooltipAnchor() : [0, 0]);\n\t}\n\n});\n\n// @namespace Tooltip\n// @factory L.tooltip(options?: Tooltip options, source?: Layer)\n// Instantiates a `Tooltip` object given an optional `options` object that describes its appearance and location and an optional `source` object that is used to tag the tooltip with a reference to the Layer to which it refers.\n// @alternative\n// @factory L.tooltip(latlng: LatLng, options?: Tooltip options)\n// Instantiates a `Tooltip` object given `latlng` where the tooltip will open and an optional `options` object that describes its appearance and location.\nexport var tooltip = function (options, source) {\n\treturn new Tooltip(options, source);\n};\n\n// @namespace Map\n// @section Methods for Layers and Controls\nMap.include({\n\n\t// @method openTooltip(tooltip: Tooltip): this\n\t// Opens the specified tooltip.\n\t// @alternative\n\t// @method openTooltip(content: String|HTMLElement, latlng: LatLng, options?: Tooltip options): this\n\t// Creates a tooltip with the specified content and options and open it.\n\topenTooltip: function (tooltip, latlng, options) {\n\t\tthis._initOverlay(Tooltip, tooltip, latlng, options)\n\t\t  .openOn(this);\n\n\t\treturn this;\n\t},\n\n\t// @method closeTooltip(tooltip: Tooltip): this\n\t// Closes the tooltip given as parameter.\n\tcloseTooltip: function (tooltip) {\n\t\ttooltip.close();\n\t\treturn this;\n\t}\n\n});\n\n/*\n * @namespace Layer\n * @section Tooltip methods example\n *\n * All layers share a set of methods convenient for binding tooltips to it.\n *\n * ```js\n * var layer = L.Polygon(latlngs).bindTooltip('Hi There!').addTo(map);\n * layer.openTooltip();\n * layer.closeTooltip();\n * ```\n */\n\n// @section Tooltip methods\nLayer.include({\n\n\t// @method bindTooltip(content: String|HTMLElement|Function|Tooltip, options?: Tooltip options): this\n\t// Binds a tooltip to the layer with the passed `content` and sets up the\n\t// necessary event listeners. If a `Function` is passed it will receive\n\t// the layer as the first argument and should return a `String` or `HTMLElement`.\n\tbindTooltip: function (content, options) {\n\n\t\tif (this._tooltip && this.isTooltipOpen()) {\n\t\t\tthis.unbindTooltip();\n\t\t}\n\n\t\tthis._tooltip = this._initOverlay(Tooltip, this._tooltip, content, options);\n\t\tthis._initTooltipInteractions();\n\n\t\tif (this._tooltip.options.permanent && this._map && this._map.hasLayer(this)) {\n\t\t\tthis.openTooltip();\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t// @method unbindTooltip(): this\n\t// Removes the tooltip previously bound with `bindTooltip`.\n\tunbindTooltip: function () {\n\t\tif (this._tooltip) {\n\t\t\tthis._initTooltipInteractions(true);\n\t\t\tthis.closeTooltip();\n\t\t\tthis._tooltip = null;\n\t\t}\n\t\treturn this;\n\t},\n\n\t_initTooltipInteractions: function (remove) {\n\t\tif (!remove && this._tooltipHandlersAdded) { return; }\n\t\tvar onOff = remove ? 'off' : 'on',\n\t\t    events = {\n\t\t\tremove: this.closeTooltip,\n\t\t\tmove: this._moveTooltip\n\t\t    };\n\t\tif (!this._tooltip.options.permanent) {\n\t\t\tevents.mouseover = this._openTooltip;\n\t\t\tevents.mouseout = this.closeTooltip;\n\t\t\tevents.click = this._openTooltip;\n\t\t\tif (this._map) {\n\t\t\t\tthis._addFocusListeners();\n\t\t\t} else {\n\t\t\t\tevents.add = this._addFocusListeners;\n\t\t\t}\n\t\t} else {\n\t\t\tevents.add = this._openTooltip;\n\t\t}\n\t\tif (this._tooltip.options.sticky) {\n\t\t\tevents.mousemove = this._moveTooltip;\n\t\t}\n\t\tthis[onOff](events);\n\t\tthis._tooltipHandlersAdded = !remove;\n\t},\n\n\t// @method openTooltip(latlng?: LatLng): this\n\t// Opens the bound tooltip at the specified `latlng` or at the default tooltip anchor if no `latlng` is passed.\n\topenTooltip: function (latlng) {\n\t\tif (this._tooltip) {\n\t\t\tif (!(this instanceof FeatureGroup)) {\n\t\t\t\tthis._tooltip._source = this;\n\t\t\t}\n\t\t\tif (this._tooltip._prepareOpen(latlng)) {\n\t\t\t\t// open the tooltip on the map\n\t\t\t\tthis._tooltip.openOn(this._map);\n\n\t\t\t\tif (this.getElement) {\n\t\t\t\t\tthis._setAriaDescribedByOnLayer(this);\n\t\t\t\t} else if (this.eachLayer) {\n\t\t\t\t\tthis.eachLayer(this._setAriaDescribedByOnLayer, this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method closeTooltip(): this\n\t// Closes the tooltip bound to this layer if it is open.\n\tcloseTooltip: function () {\n\t\tif (this._tooltip) {\n\t\t\treturn this._tooltip.close();\n\t\t}\n\t},\n\n\t// @method toggleTooltip(): this\n\t// Opens or closes the tooltip bound to this layer depending on its current state.\n\ttoggleTooltip: function () {\n\t\tif (this._tooltip) {\n\t\t\tthis._tooltip.toggle(this);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method isTooltipOpen(): boolean\n\t// Returns `true` if the tooltip bound to this layer is currently open.\n\tisTooltipOpen: function () {\n\t\treturn this._tooltip.isOpen();\n\t},\n\n\t// @method setTooltipContent(content: String|HTMLElement|Tooltip): this\n\t// Sets the content of the tooltip bound to this layer.\n\tsetTooltipContent: function (content) {\n\t\tif (this._tooltip) {\n\t\t\tthis._tooltip.setContent(content);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method getTooltip(): Tooltip\n\t// Returns the tooltip bound to this layer.\n\tgetTooltip: function () {\n\t\treturn this._tooltip;\n\t},\n\n\t_addFocusListeners: function () {\n\t\tif (this.getElement) {\n\t\t\tthis._addFocusListenersOnLayer(this);\n\t\t} else if (this.eachLayer) {\n\t\t\tthis.eachLayer(this._addFocusListenersOnLayer, this);\n\t\t}\n\t},\n\n\t_addFocusListenersOnLayer: function (layer) {\n\t\tvar el = typeof layer.getElement === 'function' && layer.getElement();\n\t\tif (el) {\n\t\t\tDomEvent.on(el, 'focus', function () {\n\t\t\t\tthis._tooltip._source = layer;\n\t\t\t\tthis.openTooltip();\n\t\t\t}, this);\n\t\t\tDomEvent.on(el, 'blur', this.closeTooltip, this);\n\t\t}\n\t},\n\n\t_setAriaDescribedByOnLayer: function (layer) {\n\t\tvar el = typeof layer.getElement === 'function' && layer.getElement();\n\t\tif (el) {\n\t\t\tel.setAttribute('aria-describedby', this._tooltip._container.id);\n\t\t}\n\t},\n\n\n\t_openTooltip: function (e) {\n\t\tif (!this._tooltip || !this._map) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If the map is moving, we will show the tooltip after it's done.\n\t\tif (this._map.dragging && this._map.dragging.moving() && !this._openOnceFlag) {\n\t\t\tthis._openOnceFlag = true;\n\t\t\tvar that = this;\n\t\t\tthis._map.once('moveend', function () {\n\t\t\t\tthat._openOnceFlag = false;\n\t\t\t\tthat._openTooltip(e);\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\n\t\tthis._tooltip._source = e.layer || e.target;\n\n\t\tthis.openTooltip(this._tooltip.options.sticky ? e.latlng : undefined);\n\t},\n\n\t_moveTooltip: function (e) {\n\t\tvar latlng = e.latlng, containerPoint, layerPoint;\n\t\tif (this._tooltip.options.sticky && e.originalEvent) {\n\t\t\tcontainerPoint = this._map.mouseEventToContainerPoint(e.originalEvent);\n\t\t\tlayerPoint = this._map.containerPointToLayerPoint(containerPoint);\n\t\t\tlatlng = this._map.layerPointToLatLng(layerPoint);\n\t\t}\n\t\tthis._tooltip.setLatLng(latlng);\n\t}\n});\n", "import {Icon} from './Icon';\nimport {toPoint as point} from '../../geometry/Point';\nimport {empty} from '../../dom/DomUtil';\n\n/*\n * @class DivIcon\n * @aka L.DivIcon\n * @inherits Icon\n *\n * Represents a lightweight icon for markers that uses a simple `<div>`\n * element instead of an image. Inherits from `Icon` but ignores the `iconUrl` and shadow options.\n *\n * @example\n * ```js\n * var myIcon = L.divIcon({className: 'my-div-icon'});\n * // you can set .my-div-icon styles in CSS\n *\n * L.marker([50.505, 30.57], {icon: myIcon}).addTo(map);\n * ```\n *\n * By default, it has a 'leaflet-div-icon' CSS class and is styled as a little white square with a shadow.\n */\n\nexport var DivIcon = Icon.extend({\n\toptions: {\n\t\t// @section\n\t\t// @aka DivIcon options\n\t\ticonSize: [12, 12], // also can be set through CSS\n\n\t\t// iconAnchor: (Point),\n\t\t// popupAnchor: (Point),\n\n\t\t// @option html: String|HTMLElement = ''\n\t\t// Custom HTML code to put inside the div element, empty by default. Alternatively,\n\t\t// an instance of `HTMLElement`.\n\t\thtml: false,\n\n\t\t// @option bgPos: Point = [0, 0]\n\t\t// Optional relative position of the background, in pixels\n\t\tbgPos: null,\n\n\t\tclassName: 'leaflet-div-icon'\n\t},\n\n\tcreateIcon: function (oldIcon) {\n\t\tvar div = (oldIcon && oldIcon.tagName === 'DIV') ? oldIcon : document.createElement('div'),\n\t\t    options = this.options;\n\n\t\tif (options.html instanceof Element) {\n\t\t\tempty(div);\n\t\t\tdiv.appendChild(options.html);\n\t\t} else {\n\t\t\tdiv.innerHTML = options.html !== false ? options.html : '';\n\t\t}\n\n\t\tif (options.bgPos) {\n\t\t\tvar bgPos = point(options.bgPos);\n\t\t\tdiv.style.backgroundPosition = (-bgPos.x) + 'px ' + (-bgPos.y) + 'px';\n\t\t}\n\t\tthis._setIconStyles(div, 'icon');\n\n\t\treturn div;\n\t},\n\n\tcreateShadow: function () {\n\t\treturn null;\n\t}\n});\n\n// @factory L.divIcon(options: DivIcon options)\n// Creates a `DivIcon` instance with the given options.\nexport function divIcon(options) {\n\treturn new DivIcon(options);\n}\n", "import {Icon} from './Icon';\nexport {icon} from './Icon';\nimport {IconDefault} from './Icon.Default';\nIcon.Default = IconDefault;\nexport {Icon};\n\nexport {DivIcon, divIcon} from './DivIcon';\nexport {Marker, marker} from './Marker';\n", "import {Layer} from '../Layer';\nimport Browser from '../../core/Browser';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport {Point} from '../../geometry/Point';\nimport {Bounds} from '../../geometry/Bounds';\nimport {LatLngBounds, toLatLngBounds as latLngBounds} from '../../geo/LatLngBounds';\n\n/*\n * @class GridLayer\n * @inherits Layer\n * @aka L.GridLayer\n *\n * Generic class for handling a tiled grid of HTML elements. This is the base class for all tile layers and replaces `TileLayer.Canvas`.\n * GridLayer can be extended to create a tiled grid of HTML elements like `<canvas>`, `<img>` or `<div>`. GridLayer will handle creating and animating these DOM elements for you.\n *\n *\n * @section Synchronous usage\n * @example\n *\n * To create a custom layer, extend GridLayer and implement the `createTile()` method, which will be passed a `Point` object with the `x`, `y`, and `z` (zoom level) coordinates to draw your tile.\n *\n * ```js\n * var CanvasLayer = L.GridLayer.extend({\n *     createTile: function(coords){\n *         // create a <canvas> element for drawing\n *         var tile = L.DomUtil.create('canvas', 'leaflet-tile');\n *\n *         // setup tile width and height according to the options\n *         var size = this.getTileSize();\n *         tile.width = size.x;\n *         tile.height = size.y;\n *\n *         // get a canvas context and draw something on it using coords.x, coords.y and coords.z\n *         var ctx = tile.getContext('2d');\n *\n *         // return the tile so it can be rendered on screen\n *         return tile;\n *     }\n * });\n * ```\n *\n * @section Asynchronous usage\n * @example\n *\n * Tile creation can also be asynchronous, this is useful when using a third-party drawing library. Once the tile is finished drawing it can be passed to the `done()` callback.\n *\n * ```js\n * var CanvasLayer = L.GridLayer.extend({\n *     createTile: function(coords, done){\n *         var error;\n *\n *         // create a <canvas> element for drawing\n *         var tile = L.DomUtil.create('canvas', 'leaflet-tile');\n *\n *         // setup tile width and height according to the options\n *         var size = this.getTileSize();\n *         tile.width = size.x;\n *         tile.height = size.y;\n *\n *         // draw something asynchronously and pass the tile to the done() callback\n *         setTimeout(function() {\n *             done(error, tile);\n *         }, 1000);\n *\n *         return tile;\n *     }\n * });\n * ```\n *\n * @section\n */\n\n\nexport var GridLayer = Layer.extend({\n\n\t// @section\n\t// @aka GridLayer options\n\toptions: {\n\t\t// @option tileSize: Number|Point = 256\n\t\t// Width and height of tiles in the grid. Use a number if width and height are equal, or `L.point(width, height)` otherwise.\n\t\ttileSize: 256,\n\n\t\t// @option opacity: Number = 1.0\n\t\t// Opacity of the tiles. Can be used in the `createTile()` function.\n\t\topacity: 1,\n\n\t\t// @option updateWhenIdle: Boolean = (depends)\n\t\t// Load new tiles only when panning ends.\n\t\t// `true` by default on mobile browsers, in order to avoid too many requests and keep smooth navigation.\n\t\t// `false` otherwise in order to display new tiles _during_ panning, since it is easy to pan outside the\n\t\t// [`keepBuffer`](#gridlayer-keepbuffer) option in desktop browsers.\n\t\tupdateWhenIdle: Browser.mobile,\n\n\t\t// @option updateWhenZooming: Boolean = true\n\t\t// By default, a smooth zoom animation (during a [touch zoom](#map-touchzoom) or a [`flyTo()`](#map-flyto)) will update grid layers every integer zoom level. Setting this option to `false` will update the grid layer only when the smooth animation ends.\n\t\tupdateWhenZooming: true,\n\n\t\t// @option updateInterval: Number = 200\n\t\t// Tiles will not update more than once every `updateInterval` milliseconds when panning.\n\t\tupdateInterval: 200,\n\n\t\t// @option zIndex: Number = 1\n\t\t// The explicit zIndex of the tile layer.\n\t\tzIndex: 1,\n\n\t\t// @option bounds: LatLngBounds = undefined\n\t\t// If set, tiles will only be loaded inside the set `LatLngBounds`.\n\t\tbounds: null,\n\n\t\t// @option minZoom: Number = 0\n\t\t// The minimum zoom level down to which this layer will be displayed (inclusive).\n\t\tminZoom: 0,\n\n\t\t// @option maxZoom: Number = undefined\n\t\t// The maximum zoom level up to which this layer will be displayed (inclusive).\n\t\tmaxZoom: undefined,\n\n\t\t// @option maxNativeZoom: Number = undefined\n\t\t// Maximum zoom number the tile source has available. If it is specified,\n\t\t// the tiles on all zoom levels higher than `maxNativeZoom` will be loaded\n\t\t// from `maxNativeZoom` level and auto-scaled.\n\t\tmaxNativeZoom: undefined,\n\n\t\t// @option minNativeZoom: Number = undefined\n\t\t// Minimum zoom number the tile source has available. If it is specified,\n\t\t// the tiles on all zoom levels lower than `minNativeZoom` will be loaded\n\t\t// from `minNativeZoom` level and auto-scaled.\n\t\tminNativeZoom: undefined,\n\n\t\t// @option noWrap: Boolean = false\n\t\t// Whether the layer is wrapped around the antimeridian. If `true`, the\n\t\t// GridLayer will only be displayed once at low zoom levels. Has no\n\t\t// effect when the [map CRS](#map-crs) doesn't wrap around. Can be used\n\t\t// in combination with [`bounds`](#gridlayer-bounds) to prevent requesting\n\t\t// tiles outside the CRS limits.\n\t\tnoWrap: false,\n\n\t\t// @option pane: String = 'tilePane'\n\t\t// `Map pane` where the grid layer will be added.\n\t\tpane: 'tilePane',\n\n\t\t// @option className: String = ''\n\t\t// A custom class name to assign to the tile layer. Empty by default.\n\t\tclassName: '',\n\n\t\t// @option keepBuffer: Number = 2\n\t\t// When panning the map, keep this many rows and columns of tiles before unloading them.\n\t\tkeepBuffer: 2\n\t},\n\n\tinitialize: function (options) {\n\t\tUtil.setOptions(this, options);\n\t},\n\n\tonAdd: function () {\n\t\tthis._initContainer();\n\n\t\tthis._levels = {};\n\t\tthis._tiles = {};\n\n\t\tthis._resetView(); // implicit _update() call\n\t},\n\n\tbeforeAdd: function (map) {\n\t\tmap._addZoomLimit(this);\n\t},\n\n\tonRemove: function (map) {\n\t\tthis._removeAllTiles();\n\t\tDomUtil.remove(this._container);\n\t\tmap._removeZoomLimit(this);\n\t\tthis._container = null;\n\t\tthis._tileZoom = undefined;\n\t},\n\n\t// @method bringToFront: this\n\t// Brings the tile layer to the top of all tile layers.\n\tbringToFront: function () {\n\t\tif (this._map) {\n\t\t\tDomUtil.toFront(this._container);\n\t\t\tthis._setAutoZIndex(Math.max);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method bringToBack: this\n\t// Brings the tile layer to the bottom of all tile layers.\n\tbringToBack: function () {\n\t\tif (this._map) {\n\t\t\tDomUtil.toBack(this._container);\n\t\t\tthis._setAutoZIndex(Math.min);\n\t\t}\n\t\treturn this;\n\t},\n\n\t// @method getContainer: HTMLElement\n\t// Returns the HTML element that contains the tiles for this layer.\n\tgetContainer: function () {\n\t\treturn this._container;\n\t},\n\n\t// @method setOpacity(opacity: Number): this\n\t// Changes the [opacity](#gridlayer-opacity) of the grid layer.\n\tsetOpacity: function (opacity) {\n\t\tthis.options.opacity = opacity;\n\t\tthis._updateOpacity();\n\t\treturn this;\n\t},\n\n\t// @method setZIndex(zIndex: Number): this\n\t// Changes the [zIndex](#gridlayer-zindex) of the grid layer.\n\tsetZIndex: function (zIndex) {\n\t\tthis.options.zIndex = zIndex;\n\t\tthis._updateZIndex();\n\n\t\treturn this;\n\t},\n\n\t// @method isLoading: Boolean\n\t// Returns `true` if any tile in the grid layer has not finished loading.\n\tisLoading: function () {\n\t\treturn this._loading;\n\t},\n\n\t// @method redraw: this\n\t// Causes the layer to clear all the tiles and request them again.\n\tredraw: function () {\n\t\tif (this._map) {\n\t\t\tthis._removeAllTiles();\n\t\t\tvar tileZoom = this._clampZoom(this._map.getZoom());\n\t\t\tif (tileZoom !== this._tileZoom) {\n\t\t\t\tthis._tileZoom = tileZoom;\n\t\t\t\tthis._updateLevels();\n\t\t\t}\n\t\t\tthis._update();\n\t\t}\n\t\treturn this;\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = {\n\t\t\tviewprereset: this._invalidateAll,\n\t\t\tviewreset: this._resetView,\n\t\t\tzoom: this._resetView,\n\t\t\tmoveend: this._onMoveEnd\n\t\t};\n\n\t\tif (!this.options.updateWhenIdle) {\n\t\t\t// update tiles on move, but not more often than once per given interval\n\t\t\tif (!this._onMove) {\n\t\t\t\tthis._onMove = Util.throttle(this._onMoveEnd, this.options.updateInterval, this);\n\t\t\t}\n\n\t\t\tevents.move = this._onMove;\n\t\t}\n\n\t\tif (this._zoomAnimated) {\n\t\t\tevents.zoomanim = this._animateZoom;\n\t\t}\n\n\t\treturn events;\n\t},\n\n\t// @section Extension methods\n\t// Layers extending `GridLayer` shall reimplement the following method.\n\t// @method createTile(coords: Object, done?: Function): HTMLElement\n\t// Called only internally, must be overridden by classes extending `GridLayer`.\n\t// Returns the `HTMLElement` corresponding to the given `coords`. If the `done` callback\n\t// is specified, it must be called when the tile has finished loading and drawing.\n\tcreateTile: function () {\n\t\treturn document.createElement('div');\n\t},\n\n\t// @section\n\t// @method getTileSize: Point\n\t// Normalizes the [tileSize option](#gridlayer-tilesize) into a point. Used by the `createTile()` method.\n\tgetTileSize: function () {\n\t\tvar s = this.options.tileSize;\n\t\treturn s instanceof Point ? s : new Point(s, s);\n\t},\n\n\t_updateZIndex: function () {\n\t\tif (this._container && this.options.zIndex !== undefined && this.options.zIndex !== null) {\n\t\t\tthis._container.style.zIndex = this.options.zIndex;\n\t\t}\n\t},\n\n\t_setAutoZIndex: function (compare) {\n\t\t// go through all other layers of the same pane, set zIndex to max + 1 (front) or min - 1 (back)\n\n\t\tvar layers = this.getPane().children,\n\t\t    edgeZIndex = -compare(-Infinity, Infinity); // -Infinity for max, Infinity for min\n\n\t\tfor (var i = 0, len = layers.length, zIndex; i < len; i++) {\n\n\t\t\tzIndex = layers[i].style.zIndex;\n\n\t\t\tif (layers[i] !== this._container && zIndex) {\n\t\t\t\tedgeZIndex = compare(edgeZIndex, +zIndex);\n\t\t\t}\n\t\t}\n\n\t\tif (isFinite(edgeZIndex)) {\n\t\t\tthis.options.zIndex = edgeZIndex + compare(-1, 1);\n\t\t\tthis._updateZIndex();\n\t\t}\n\t},\n\n\t_updateOpacity: function () {\n\t\tif (!this._map) { return; }\n\n\t\t// IE doesn't inherit filter opacity properly, so we're forced to set it on tiles\n\t\tif (Browser.ielt9) { return; }\n\n\t\tDomUtil.setOpacity(this._container, this.options.opacity);\n\n\t\tvar now = +new Date(),\n\t\t    nextFrame = false,\n\t\t    willPrune = false;\n\n\t\tfor (var key in this._tiles) {\n\t\t\tvar tile = this._tiles[key];\n\t\t\tif (!tile.current || !tile.loaded) { continue; }\n\n\t\t\tvar fade = Math.min(1, (now - tile.loaded) / 200);\n\n\t\t\tDomUtil.setOpacity(tile.el, fade);\n\t\t\tif (fade < 1) {\n\t\t\t\tnextFrame = true;\n\t\t\t} else {\n\t\t\t\tif (tile.active) {\n\t\t\t\t\twillPrune = true;\n\t\t\t\t} else {\n\t\t\t\t\tthis._onOpaqueTile(tile);\n\t\t\t\t}\n\t\t\t\ttile.active = true;\n\t\t\t}\n\t\t}\n\n\t\tif (willPrune && !this._noPrune) { this._pruneTiles(); }\n\n\t\tif (nextFrame) {\n\t\t\tUtil.cancelAnimFrame(this._fadeFrame);\n\t\t\tthis._fadeFrame = Util.requestAnimFrame(this._updateOpacity, this);\n\t\t}\n\t},\n\n\t_onOpaqueTile: Util.falseFn,\n\n\t_initContainer: function () {\n\t\tif (this._container) { return; }\n\n\t\tthis._container = DomUtil.create('div', 'leaflet-layer ' + (this.options.className || ''));\n\t\tthis._updateZIndex();\n\n\t\tif (this.options.opacity < 1) {\n\t\t\tthis._updateOpacity();\n\t\t}\n\n\t\tthis.getPane().appendChild(this._container);\n\t},\n\n\t_updateLevels: function () {\n\n\t\tvar zoom = this._tileZoom,\n\t\t    maxZoom = this.options.maxZoom;\n\n\t\tif (zoom === undefined) { return undefined; }\n\n\t\tfor (var z in this._levels) {\n\t\t\tz = Number(z);\n\t\t\tif (this._levels[z].el.children.length || z === zoom) {\n\t\t\t\tthis._levels[z].el.style.zIndex = maxZoom - Math.abs(zoom - z);\n\t\t\t\tthis._onUpdateLevel(z);\n\t\t\t} else {\n\t\t\t\tDomUtil.remove(this._levels[z].el);\n\t\t\t\tthis._removeTilesAtZoom(z);\n\t\t\t\tthis._onRemoveLevel(z);\n\t\t\t\tdelete this._levels[z];\n\t\t\t}\n\t\t}\n\n\t\tvar level = this._levels[zoom],\n\t\t    map = this._map;\n\n\t\tif (!level) {\n\t\t\tlevel = this._levels[zoom] = {};\n\n\t\t\tlevel.el = DomUtil.create('div', 'leaflet-tile-container leaflet-zoom-animated', this._container);\n\t\t\tlevel.el.style.zIndex = maxZoom;\n\n\t\t\tlevel.origin = map.project(map.unproject(map.getPixelOrigin()), zoom).round();\n\t\t\tlevel.zoom = zoom;\n\n\t\t\tthis._setZoomTransform(level, map.getCenter(), map.getZoom());\n\n\t\t\t// force the browser to consider the newly added element for transition\n\t\t\tUtil.falseFn(level.el.offsetWidth);\n\n\t\t\tthis._onCreateLevel(level);\n\t\t}\n\n\t\tthis._level = level;\n\n\t\treturn level;\n\t},\n\n\t_onUpdateLevel: Util.falseFn,\n\n\t_onRemoveLevel: Util.falseFn,\n\n\t_onCreateLevel: Util.falseFn,\n\n\t_pruneTiles: function () {\n\t\tif (!this._map) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar key, tile;\n\n\t\tvar zoom = this._map.getZoom();\n\t\tif (zoom > this.options.maxZoom ||\n\t\t\tzoom < this.options.minZoom) {\n\t\t\tthis._removeAllTiles();\n\t\t\treturn;\n\t\t}\n\n\t\tfor (key in this._tiles) {\n\t\t\ttile = this._tiles[key];\n\t\t\ttile.retain = tile.current;\n\t\t}\n\n\t\tfor (key in this._tiles) {\n\t\t\ttile = this._tiles[key];\n\t\t\tif (tile.current && !tile.active) {\n\t\t\t\tvar coords = tile.coords;\n\t\t\t\tif (!this._retainParent(coords.x, coords.y, coords.z, coords.z - 5)) {\n\t\t\t\t\tthis._retainChildren(coords.x, coords.y, coords.z, coords.z + 2);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (key in this._tiles) {\n\t\t\tif (!this._tiles[key].retain) {\n\t\t\t\tthis._removeTile(key);\n\t\t\t}\n\t\t}\n\t},\n\n\t_removeTilesAtZoom: function (zoom) {\n\t\tfor (var key in this._tiles) {\n\t\t\tif (this._tiles[key].coords.z !== zoom) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tthis._removeTile(key);\n\t\t}\n\t},\n\n\t_removeAllTiles: function () {\n\t\tfor (var key in this._tiles) {\n\t\t\tthis._removeTile(key);\n\t\t}\n\t},\n\n\t_invalidateAll: function () {\n\t\tfor (var z in this._levels) {\n\t\t\tDomUtil.remove(this._levels[z].el);\n\t\t\tthis._onRemoveLevel(Number(z));\n\t\t\tdelete this._levels[z];\n\t\t}\n\t\tthis._removeAllTiles();\n\n\t\tthis._tileZoom = undefined;\n\t},\n\n\t_retainParent: function (x, y, z, minZoom) {\n\t\tvar x2 = Math.floor(x / 2),\n\t\t    y2 = Math.floor(y / 2),\n\t\t    z2 = z - 1,\n\t\t    coords2 = new Point(+x2, +y2);\n\t\tcoords2.z = +z2;\n\n\t\tvar key = this._tileCoordsToKey(coords2),\n\t\t    tile = this._tiles[key];\n\n\t\tif (tile && tile.active) {\n\t\t\ttile.retain = true;\n\t\t\treturn true;\n\n\t\t} else if (tile && tile.loaded) {\n\t\t\ttile.retain = true;\n\t\t}\n\n\t\tif (z2 > minZoom) {\n\t\t\treturn this._retainParent(x2, y2, z2, minZoom);\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t_retainChildren: function (x, y, z, maxZoom) {\n\n\t\tfor (var i = 2 * x; i < 2 * x + 2; i++) {\n\t\t\tfor (var j = 2 * y; j < 2 * y + 2; j++) {\n\n\t\t\t\tvar coords = new Point(i, j);\n\t\t\t\tcoords.z = z + 1;\n\n\t\t\t\tvar key = this._tileCoordsToKey(coords),\n\t\t\t\t    tile = this._tiles[key];\n\n\t\t\t\tif (tile && tile.active) {\n\t\t\t\t\ttile.retain = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\t} else if (tile && tile.loaded) {\n\t\t\t\t\ttile.retain = true;\n\t\t\t\t}\n\n\t\t\t\tif (z + 1 < maxZoom) {\n\t\t\t\t\tthis._retainChildren(i, j, z + 1, maxZoom);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t_resetView: function (e) {\n\t\tvar animating = e && (e.pinch || e.flyTo);\n\t\tthis._setView(this._map.getCenter(), this._map.getZoom(), animating, animating);\n\t},\n\n\t_animateZoom: function (e) {\n\t\tthis._setView(e.center, e.zoom, true, e.noUpdate);\n\t},\n\n\t_clampZoom: function (zoom) {\n\t\tvar options = this.options;\n\n\t\tif (undefined !== options.minNativeZoom && zoom < options.minNativeZoom) {\n\t\t\treturn options.minNativeZoom;\n\t\t}\n\n\t\tif (undefined !== options.maxNativeZoom && options.maxNativeZoom < zoom) {\n\t\t\treturn options.maxNativeZoom;\n\t\t}\n\n\t\treturn zoom;\n\t},\n\n\t_setView: function (center, zoom, noPrune, noUpdate) {\n\t\tvar tileZoom = Math.round(zoom);\n\t\tif ((this.options.maxZoom !== undefined && tileZoom > this.options.maxZoom) ||\n\t\t    (this.options.minZoom !== undefined && tileZoom < this.options.minZoom)) {\n\t\t\ttileZoom = undefined;\n\t\t} else {\n\t\t\ttileZoom = this._clampZoom(tileZoom);\n\t\t}\n\n\t\tvar tileZoomChanged = this.options.updateWhenZooming && (tileZoom !== this._tileZoom);\n\n\t\tif (!noUpdate || tileZoomChanged) {\n\n\t\t\tthis._tileZoom = tileZoom;\n\n\t\t\tif (this._abortLoading) {\n\t\t\t\tthis._abortLoading();\n\t\t\t}\n\n\t\t\tthis._updateLevels();\n\t\t\tthis._resetGrid();\n\n\t\t\tif (tileZoom !== undefined) {\n\t\t\t\tthis._update(center);\n\t\t\t}\n\n\t\t\tif (!noPrune) {\n\t\t\t\tthis._pruneTiles();\n\t\t\t}\n\n\t\t\t// Flag to prevent _updateOpacity from pruning tiles during\n\t\t\t// a zoom anim or a pinch gesture\n\t\t\tthis._noPrune = !!noPrune;\n\t\t}\n\n\t\tthis._setZoomTransforms(center, zoom);\n\t},\n\n\t_setZoomTransforms: function (center, zoom) {\n\t\tfor (var i in this._levels) {\n\t\t\tthis._setZoomTransform(this._levels[i], center, zoom);\n\t\t}\n\t},\n\n\t_setZoomTransform: function (level, center, zoom) {\n\t\tvar scale = this._map.getZoomScale(zoom, level.zoom),\n\t\t    translate = level.origin.multiplyBy(scale)\n\t\t        .subtract(this._map._getNewPixelOrigin(center, zoom)).round();\n\n\t\tif (Browser.any3d) {\n\t\t\tDomUtil.setTransform(level.el, translate, scale);\n\t\t} else {\n\t\t\tDomUtil.setPosition(level.el, translate);\n\t\t}\n\t},\n\n\t_resetGrid: function () {\n\t\tvar map = this._map,\n\t\t    crs = map.options.crs,\n\t\t    tileSize = this._tileSize = this.getTileSize(),\n\t\t    tileZoom = this._tileZoom;\n\n\t\tvar bounds = this._map.getPixelWorldBounds(this._tileZoom);\n\t\tif (bounds) {\n\t\t\tthis._globalTileRange = this._pxBoundsToTileRange(bounds);\n\t\t}\n\n\t\tthis._wrapX = crs.wrapLng && !this.options.noWrap && [\n\t\t\tMath.floor(map.project([0, crs.wrapLng[0]], tileZoom).x / tileSize.x),\n\t\t\tMath.ceil(map.project([0, crs.wrapLng[1]], tileZoom).x / tileSize.y)\n\t\t];\n\t\tthis._wrapY = crs.wrapLat && !this.options.noWrap && [\n\t\t\tMath.floor(map.project([crs.wrapLat[0], 0], tileZoom).y / tileSize.x),\n\t\t\tMath.ceil(map.project([crs.wrapLat[1], 0], tileZoom).y / tileSize.y)\n\t\t];\n\t},\n\n\t_onMoveEnd: function () {\n\t\tif (!this._map || this._map._animatingZoom) { return; }\n\n\t\tthis._update();\n\t},\n\n\t_getTiledPixelBounds: function (center) {\n\t\tvar map = this._map,\n\t\t    mapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),\n\t\t    scale = map.getZoomScale(mapZoom, this._tileZoom),\n\t\t    pixelCenter = map.project(center, this._tileZoom).floor(),\n\t\t    halfSize = map.getSize().divideBy(scale * 2);\n\n\t\treturn new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n\t},\n\n\t// Private method to load tiles in the grid's active zoom level according to map bounds\n\t_update: function (center) {\n\t\tvar map = this._map;\n\t\tif (!map) { return; }\n\t\tvar zoom = this._clampZoom(map.getZoom());\n\n\t\tif (center === undefined) { center = map.getCenter(); }\n\t\tif (this._tileZoom === undefined) { return; }\t// if out of minzoom/maxzoom\n\n\t\tvar pixelBounds = this._getTiledPixelBounds(center),\n\t\t    tileRange = this._pxBoundsToTileRange(pixelBounds),\n\t\t    tileCenter = tileRange.getCenter(),\n\t\t    queue = [],\n\t\t    margin = this.options.keepBuffer,\n\t\t    noPruneRange = new Bounds(tileRange.getBottomLeft().subtract([margin, -margin]),\n\t\t                              tileRange.getTopRight().add([margin, -margin]));\n\n\t\t// Sanity check: panic if the tile range contains Infinity somewhere.\n\t\tif (!(isFinite(tileRange.min.x) &&\n\t\t      isFinite(tileRange.min.y) &&\n\t\t      isFinite(tileRange.max.x) &&\n\t\t      isFinite(tileRange.max.y))) { throw new Error('Attempted to load an infinite number of tiles'); }\n\n\t\tfor (var key in this._tiles) {\n\t\t\tvar c = this._tiles[key].coords;\n\t\t\tif (c.z !== this._tileZoom || !noPruneRange.contains(new Point(c.x, c.y))) {\n\t\t\t\tthis._tiles[key].current = false;\n\t\t\t}\n\t\t}\n\n\t\t// _update just loads more tiles. If the tile zoom level differs too much\n\t\t// from the map's, let _setView reset levels and prune old tiles.\n\t\tif (Math.abs(zoom - this._tileZoom) > 1) { this._setView(center, zoom); return; }\n\n\t\t// create a queue of coordinates to load tiles from\n\t\tfor (var j = tileRange.min.y; j <= tileRange.max.y; j++) {\n\t\t\tfor (var i = tileRange.min.x; i <= tileRange.max.x; i++) {\n\t\t\t\tvar coords = new Point(i, j);\n\t\t\t\tcoords.z = this._tileZoom;\n\n\t\t\t\tif (!this._isValidTile(coords)) { continue; }\n\n\t\t\t\tvar tile = this._tiles[this._tileCoordsToKey(coords)];\n\t\t\t\tif (tile) {\n\t\t\t\t\ttile.current = true;\n\t\t\t\t} else {\n\t\t\t\t\tqueue.push(coords);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// sort tile queue to load tiles in order of their distance to center\n\t\tqueue.sort(function (a, b) {\n\t\t\treturn a.distanceTo(tileCenter) - b.distanceTo(tileCenter);\n\t\t});\n\n\t\tif (queue.length !== 0) {\n\t\t\t// if it's the first batch of tiles to load\n\t\t\tif (!this._loading) {\n\t\t\t\tthis._loading = true;\n\t\t\t\t// @event loading: Event\n\t\t\t\t// Fired when the grid layer starts loading tiles.\n\t\t\t\tthis.fire('loading');\n\t\t\t}\n\n\t\t\t// create DOM fragment to append tiles in one batch\n\t\t\tvar fragment = document.createDocumentFragment();\n\n\t\t\tfor (i = 0; i < queue.length; i++) {\n\t\t\t\tthis._addTile(queue[i], fragment);\n\t\t\t}\n\n\t\t\tthis._level.el.appendChild(fragment);\n\t\t}\n\t},\n\n\t_isValidTile: function (coords) {\n\t\tvar crs = this._map.options.crs;\n\n\t\tif (!crs.infinite) {\n\t\t\t// don't load tile if it's out of bounds and not wrapped\n\t\t\tvar bounds = this._globalTileRange;\n\t\t\tif ((!crs.wrapLng && (coords.x < bounds.min.x || coords.x > bounds.max.x)) ||\n\t\t\t    (!crs.wrapLat && (coords.y < bounds.min.y || coords.y > bounds.max.y))) { return false; }\n\t\t}\n\n\t\tif (!this.options.bounds) { return true; }\n\n\t\t// don't load tile if it doesn't intersect the bounds in options\n\t\tvar tileBounds = this._tileCoordsToBounds(coords);\n\t\treturn latLngBounds(this.options.bounds).overlaps(tileBounds);\n\t},\n\n\t_keyToBounds: function (key) {\n\t\treturn this._tileCoordsToBounds(this._keyToTileCoords(key));\n\t},\n\n\t_tileCoordsToNwSe: function (coords) {\n\t\tvar map = this._map,\n\t\t    tileSize = this.getTileSize(),\n\t\t    nwPoint = coords.scaleBy(tileSize),\n\t\t    sePoint = nwPoint.add(tileSize),\n\t\t    nw = map.unproject(nwPoint, coords.z),\n\t\t    se = map.unproject(sePoint, coords.z);\n\t\treturn [nw, se];\n\t},\n\n\t// converts tile coordinates to its geographical bounds\n\t_tileCoordsToBounds: function (coords) {\n\t\tvar bp = this._tileCoordsToNwSe(coords),\n\t\t    bounds = new LatLngBounds(bp[0], bp[1]);\n\n\t\tif (!this.options.noWrap) {\n\t\t\tbounds = this._map.wrapLatLngBounds(bounds);\n\t\t}\n\t\treturn bounds;\n\t},\n\t// converts tile coordinates to key for the tile cache\n\t_tileCoordsToKey: function (coords) {\n\t\treturn coords.x + ':' + coords.y + ':' + coords.z;\n\t},\n\n\t// converts tile cache key to coordinates\n\t_keyToTileCoords: function (key) {\n\t\tvar k = key.split(':'),\n\t\t    coords = new Point(+k[0], +k[1]);\n\t\tcoords.z = +k[2];\n\t\treturn coords;\n\t},\n\n\t_removeTile: function (key) {\n\t\tvar tile = this._tiles[key];\n\t\tif (!tile) { return; }\n\n\t\tDomUtil.remove(tile.el);\n\n\t\tdelete this._tiles[key];\n\n\t\t// @event tileunload: TileEvent\n\t\t// Fired when a tile is removed (e.g. when a tile goes off the screen).\n\t\tthis.fire('tileunload', {\n\t\t\ttile: tile.el,\n\t\t\tcoords: this._keyToTileCoords(key)\n\t\t});\n\t},\n\n\t_initTile: function (tile) {\n\t\tDomUtil.addClass(tile, 'leaflet-tile');\n\n\t\tvar tileSize = this.getTileSize();\n\t\ttile.style.width = tileSize.x + 'px';\n\t\ttile.style.height = tileSize.y + 'px';\n\n\t\ttile.onselectstart = Util.falseFn;\n\t\ttile.onmousemove = Util.falseFn;\n\n\t\t// update opacity on tiles in IE7-8 because of filter inheritance problems\n\t\tif (Browser.ielt9 && this.options.opacity < 1) {\n\t\t\tDomUtil.setOpacity(tile, this.options.opacity);\n\t\t}\n\t},\n\n\t_addTile: function (coords, container) {\n\t\tvar tilePos = this._getTilePos(coords),\n\t\t    key = this._tileCoordsToKey(coords);\n\n\t\tvar tile = this.createTile(this._wrapCoords(coords), Util.bind(this._tileReady, this, coords));\n\n\t\tthis._initTile(tile);\n\n\t\t// if createTile is defined with a second argument (\"done\" callback),\n\t\t// we know that tile is async and will be ready later; otherwise\n\t\tif (this.createTile.length < 2) {\n\t\t\t// mark tile as ready, but delay one frame for opacity animation to happen\n\t\t\tUtil.requestAnimFrame(Util.bind(this._tileReady, this, coords, null, tile));\n\t\t}\n\n\t\tDomUtil.setPosition(tile, tilePos);\n\n\t\t// save tile in cache\n\t\tthis._tiles[key] = {\n\t\t\tel: tile,\n\t\t\tcoords: coords,\n\t\t\tcurrent: true\n\t\t};\n\n\t\tcontainer.appendChild(tile);\n\t\t// @event tileloadstart: TileEvent\n\t\t// Fired when a tile is requested and starts loading.\n\t\tthis.fire('tileloadstart', {\n\t\t\ttile: tile,\n\t\t\tcoords: coords\n\t\t});\n\t},\n\n\t_tileReady: function (coords, err, tile) {\n\t\tif (err) {\n\t\t\t// @event tileerror: TileErrorEvent\n\t\t\t// Fired when there is an error loading a tile.\n\t\t\tthis.fire('tileerror', {\n\t\t\t\terror: err,\n\t\t\t\ttile: tile,\n\t\t\t\tcoords: coords\n\t\t\t});\n\t\t}\n\n\t\tvar key = this._tileCoordsToKey(coords);\n\n\t\ttile = this._tiles[key];\n\t\tif (!tile) { return; }\n\n\t\ttile.loaded = +new Date();\n\t\tif (this._map._fadeAnimated) {\n\t\t\tDomUtil.setOpacity(tile.el, 0);\n\t\t\tUtil.cancelAnimFrame(this._fadeFrame);\n\t\t\tthis._fadeFrame = Util.requestAnimFrame(this._updateOpacity, this);\n\t\t} else {\n\t\t\ttile.active = true;\n\t\t\tthis._pruneTiles();\n\t\t}\n\n\t\tif (!err) {\n\t\t\tDomUtil.addClass(tile.el, 'leaflet-tile-loaded');\n\n\t\t\t// @event tileload: TileEvent\n\t\t\t// Fired when a tile loads.\n\t\t\tthis.fire('tileload', {\n\t\t\t\ttile: tile.el,\n\t\t\t\tcoords: coords\n\t\t\t});\n\t\t}\n\n\t\tif (this._noTilesToLoad()) {\n\t\t\tthis._loading = false;\n\t\t\t// @event load: Event\n\t\t\t// Fired when the grid layer loaded all visible tiles.\n\t\t\tthis.fire('load');\n\n\t\t\tif (Browser.ielt9 || !this._map._fadeAnimated) {\n\t\t\t\tUtil.requestAnimFrame(this._pruneTiles, this);\n\t\t\t} else {\n\t\t\t\t// Wait a bit more than 0.2 secs (the duration of the tile fade-in)\n\t\t\t\t// to trigger a pruning.\n\t\t\t\tsetTimeout(Util.bind(this._pruneTiles, this), 250);\n\t\t\t}\n\t\t}\n\t},\n\n\t_getTilePos: function (coords) {\n\t\treturn coords.scaleBy(this.getTileSize()).subtract(this._level.origin);\n\t},\n\n\t_wrapCoords: function (coords) {\n\t\tvar newCoords = new Point(\n\t\t\tthis._wrapX ? Util.wrapNum(coords.x, this._wrapX) : coords.x,\n\t\t\tthis._wrapY ? Util.wrapNum(coords.y, this._wrapY) : coords.y);\n\t\tnewCoords.z = coords.z;\n\t\treturn newCoords;\n\t},\n\n\t_pxBoundsToTileRange: function (bounds) {\n\t\tvar tileSize = this.getTileSize();\n\t\treturn new Bounds(\n\t\t\tbounds.min.unscaleBy(tileSize).floor(),\n\t\t\tbounds.max.unscaleBy(tileSize).ceil().subtract([1, 1]));\n\t},\n\n\t_noTilesToLoad: function () {\n\t\tfor (var key in this._tiles) {\n\t\t\tif (!this._tiles[key].loaded) { return false; }\n\t\t}\n\t\treturn true;\n\t}\n});\n\n// @factory L.gridLayer(options?: GridLayer options)\n// Creates a new instance of GridLayer with the supplied options.\nexport function gridLayer(options) {\n\treturn new GridLayer(options);\n}\n", "import {GridLayer} from './GridLayer';\r\nimport Browser from '../../core/Browser';\r\nimport * as Util from '../../core/Util';\r\nimport * as DomEvent from '../../dom/DomEvent';\r\nimport * as DomUtil from '../../dom/DomUtil';\r\n\r\n\r\n/*\r\n * @class TileLayer\r\n * @inherits GridLayer\r\n * @aka L.TileLayer\r\n * Used to load and display tile layers on the map. Note that most tile servers require attribution, which you can set under `Layer`. Extends `GridLayer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png?{foo}', {foo: 'bar', attribution: '&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'}).addTo(map);\n * ```\r\n *\r\n * @section URL template\r\n * @example\r\n *\r\n * A string of the following form:\r\n *\r\n * ```\r\n * 'https://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png'\r\n * ```\r\n *\r\n * `{s}` means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; `a`, `b` or `c` by default, can be omitted), `{z}` — zoom level, `{x}` and `{y}` — tile coordinates. `{r}` can be used to add \"&commat;2x\" to the URL to load retina tiles.\r\n *\r\n * You can use custom keys in the template, which will be [evaluated](#util-template) from TileLayer options, like this:\r\n *\r\n * ```\r\n * L.tileLayer('https://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png', {foo: 'bar'});\r\n * ```\r\n */\r\n\r\n\r\nexport var TileLayer = GridLayer.extend({\r\n\r\n\t// @section\r\n\t// @aka TileLayer options\r\n\toptions: {\r\n\t\t// @option minZoom: Number = 0\r\n\t\t// The minimum zoom level down to which this layer will be displayed (inclusive).\r\n\t\tminZoom: 0,\r\n\r\n\t\t// @option maxZoom: Number = 18\r\n\t\t// The maximum zoom level up to which this layer will be displayed (inclusive).\r\n\t\tmaxZoom: 18,\r\n\r\n\t\t// @option subdomains: String|String[] = 'abc'\r\n\t\t// Subdomains of the tile service. Can be passed in the form of one string (where each letter is a subdomain name) or an array of strings.\r\n\t\tsubdomains: 'abc',\r\n\r\n\t\t// @option errorTileUrl: String = ''\r\n\t\t// URL to the tile image to show in place of the tile that failed to load.\r\n\t\terrorTileUrl: '',\r\n\r\n\t\t// @option zoomOffset: Number = 0\r\n\t\t// The zoom number used in tile URLs will be offset with this value.\r\n\t\tzoomOffset: 0,\r\n\r\n\t\t// @option tms: Boolean = false\r\n\t\t// If `true`, inverses Y axis numbering for tiles (turn this on for [TMS](https://en.wikipedia.org/wiki/Tile_Map_Service) services).\r\n\t\ttms: false,\r\n\r\n\t\t// @option zoomReverse: Boolean = false\r\n\t\t// If set to true, the zoom number used in tile URLs will be reversed (`maxZoom - zoom` instead of `zoom`)\r\n\t\tzoomReverse: false,\r\n\r\n\t\t// @option detectRetina: Boolean = false\r\n\t\t// If `true` and user is on a retina display, it will request four tiles of half the specified size and a bigger zoom level in place of one to utilize the high resolution.\r\n\t\tdetectRetina: false,\r\n\r\n\t\t// @option crossOrigin: Boolean|String = false\r\n\t\t// Whether the crossOrigin attribute will be added to the tiles.\r\n\t\t// If a String is provided, all tiles will have their crossOrigin attribute set to the String provided. This is needed if you want to access tile pixel data.\r\n\t\t// Refer to [CORS Settings](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) for valid String values.\r\n\t\tcrossOrigin: false,\r\n\r\n\t\t// @option referrerPolicy: Boolean|String = false\r\n\t\t// Whether the referrerPolicy attribute will be added to the tiles.\r\n\t\t// If a String is provided, all tiles will have their referrerPolicy attribute set to the String provided.\r\n\t\t// This may be needed if your map's rendering context has a strict default but your tile provider expects a valid referrer\r\n\t\t// (e.g. to validate an API token).\r\n\t\t// Refer to [HTMLImageElement.referrerPolicy](https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/referrerPolicy) for valid String values.\r\n\t\treferrerPolicy: false\r\n\t},\r\n\r\n\tinitialize: function (url, options) {\r\n\r\n\t\tthis._url = url;\r\n\r\n\t\toptions = Util.setOptions(this, options);\r\n\r\n\t\t// detecting retina displays, adjusting tileSize and zoom levels\r\n\t\tif (options.detectRetina && Browser.retina && options.maxZoom > 0) {\r\n\r\n\t\t\toptions.tileSize = Math.floor(options.tileSize / 2);\r\n\r\n\t\t\tif (!options.zoomReverse) {\r\n\t\t\t\toptions.zoomOffset++;\r\n\t\t\t\toptions.maxZoom = Math.max(options.minZoom, options.maxZoom - 1);\r\n\t\t\t} else {\r\n\t\t\t\toptions.zoomOffset--;\r\n\t\t\t\toptions.minZoom = Math.min(options.maxZoom, options.minZoom + 1);\r\n\t\t\t}\r\n\r\n\t\t\toptions.minZoom = Math.max(0, options.minZoom);\r\n\t\t} else if (!options.zoomReverse) {\r\n\t\t\t// make sure maxZoom is gte minZoom\r\n\t\t\toptions.maxZoom = Math.max(options.minZoom, options.maxZoom);\r\n\t\t} else {\r\n\t\t\t// make sure minZoom is lte maxZoom\r\n\t\t\toptions.minZoom = Math.min(options.maxZoom, options.minZoom);\r\n\t\t}\r\n\r\n\t\tif (typeof options.subdomains === 'string') {\r\n\t\t\toptions.subdomains = options.subdomains.split('');\r\n\t\t}\r\n\r\n\t\tthis.on('tileunload', this._onTileRemove);\r\n\t},\r\n\r\n\t// @method setUrl(url: String, noRedraw?: Boolean): this\r\n\t// Updates the layer's URL template and redraws it (unless `noRedraw` is set to `true`).\r\n\t// If the URL does not change, the layer will not be redrawn unless\r\n\t// the noRedraw parameter is set to false.\r\n\tsetUrl: function (url, noRedraw) {\r\n\t\tif (this._url === url && noRedraw === undefined) {\r\n\t\t\tnoRedraw = true;\r\n\t\t}\r\n\r\n\t\tthis._url = url;\r\n\r\n\t\tif (!noRedraw) {\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\t\treturn this;\r\n\t},\r\n\r\n\t// @method createTile(coords: Object, done?: Function): HTMLElement\r\n\t// Called only internally, overrides GridLayer's [`createTile()`](#gridlayer-createtile)\r\n\t// to return an `<img>` HTML element with the appropriate image URL given `coords`. The `done`\r\n\t// callback is called when the tile has been loaded.\r\n\tcreateTile: function (coords, done) {\r\n\t\tvar tile = document.createElement('img');\r\n\r\n\t\tDomEvent.on(tile, 'load', Util.bind(this._tileOnLoad, this, done, tile));\r\n\t\tDomEvent.on(tile, 'error', Util.bind(this._tileOnError, this, done, tile));\r\n\r\n\t\tif (this.options.crossOrigin || this.options.crossOrigin === '') {\r\n\t\t\ttile.crossOrigin = this.options.crossOrigin === true ? '' : this.options.crossOrigin;\r\n\t\t}\r\n\r\n\t\t// for this new option we follow the documented behavior\r\n\t\t// more closely by only setting the property when string\r\n\t\tif (typeof this.options.referrerPolicy === 'string') {\r\n\t\t\ttile.referrerPolicy = this.options.referrerPolicy;\r\n\t\t}\r\n\r\n\t\t// The alt attribute is set to the empty string,\r\n\t\t// allowing screen readers to ignore the decorative image tiles.\r\n\t\t// https://www.w3.org/WAI/tutorials/images/decorative/\r\n\t\t// https://www.w3.org/TR/html-aria/#el-img-empty-alt\r\n\t\ttile.alt = '';\r\n\r\n\t\ttile.src = this.getTileUrl(coords);\r\n\r\n\t\treturn tile;\r\n\t},\r\n\r\n\t// @section Extension methods\r\n\t// @uninheritable\r\n\t// Layers extending `TileLayer` might reimplement the following method.\r\n\t// @method getTileUrl(coords: Object): String\r\n\t// Called only internally, returns the URL for a tile given its coordinates.\r\n\t// Classes extending `TileLayer` can override this function to provide custom tile URL naming schemes.\r\n\tgetTileUrl: function (coords) {\r\n\t\tvar data = {\r\n\t\t\tr: Browser.retina ? '@2x' : '',\r\n\t\t\ts: this._getSubdomain(coords),\r\n\t\t\tx: coords.x,\r\n\t\t\ty: coords.y,\r\n\t\t\tz: this._getZoomForUrl()\r\n\t\t};\r\n\t\tif (this._map && !this._map.options.crs.infinite) {\r\n\t\t\tvar invertedY = this._globalTileRange.max.y - coords.y;\r\n\t\t\tif (this.options.tms) {\r\n\t\t\t\tdata['y'] = invertedY;\r\n\t\t\t}\r\n\t\t\tdata['-y'] = invertedY;\r\n\t\t}\r\n\r\n\t\treturn Util.template(this._url, Util.extend(data, this.options));\r\n\t},\r\n\r\n\t_tileOnLoad: function (done, tile) {\r\n\t\t// For https://github.com/Leaflet/Leaflet/issues/3332\r\n\t\tif (Browser.ielt9) {\r\n\t\t\tsetTimeout(Util.bind(done, this, null, tile), 0);\r\n\t\t} else {\r\n\t\t\tdone(null, tile);\r\n\t\t}\r\n\t},\r\n\r\n\t_tileOnError: function (done, tile, e) {\r\n\t\tvar errorUrl = this.options.errorTileUrl;\r\n\t\tif (errorUrl && tile.getAttribute('src') !== errorUrl) {\r\n\t\t\ttile.src = errorUrl;\r\n\t\t}\r\n\t\tdone(e, tile);\r\n\t},\r\n\r\n\t_onTileRemove: function (e) {\r\n\t\te.tile.onload = null;\r\n\t},\r\n\r\n\t_getZoomForUrl: function () {\r\n\t\tvar zoom = this._tileZoom,\r\n\t\tmaxZoom = this.options.maxZoom,\r\n\t\tzoomReverse = this.options.zoomReverse,\r\n\t\tzoomOffset = this.options.zoomOffset;\r\n\r\n\t\tif (zoomReverse) {\r\n\t\t\tzoom = maxZoom - zoom;\r\n\t\t}\r\n\r\n\t\treturn zoom + zoomOffset;\r\n\t},\r\n\r\n\t_getSubdomain: function (tilePoint) {\r\n\t\tvar index = Math.abs(tilePoint.x + tilePoint.y) % this.options.subdomains.length;\r\n\t\treturn this.options.subdomains[index];\r\n\t},\r\n\r\n\t// stops loading all tiles in the background layer\r\n\t_abortLoading: function () {\r\n\t\tvar i, tile;\r\n\t\tfor (i in this._tiles) {\r\n\t\t\tif (this._tiles[i].coords.z !== this._tileZoom) {\r\n\t\t\t\ttile = this._tiles[i].el;\r\n\r\n\t\t\t\ttile.onload = Util.falseFn;\r\n\t\t\t\ttile.onerror = Util.falseFn;\r\n\r\n\t\t\t\tif (!tile.complete) {\r\n\t\t\t\t\ttile.src = Util.emptyImageUrl;\r\n\t\t\t\t\tvar coords = this._tiles[i].coords;\r\n\t\t\t\t\tDomUtil.remove(tile);\r\n\t\t\t\t\tdelete this._tiles[i];\r\n\t\t\t\t\t// @event tileabort: TileEvent\r\n\t\t\t\t\t// Fired when a tile was loading but is now not wanted.\r\n\t\t\t\t\tthis.fire('tileabort', {\r\n\t\t\t\t\t\ttile: tile,\r\n\t\t\t\t\t\tcoords: coords\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t},\r\n\r\n\t_removeTile: function (key) {\r\n\t\tvar tile = this._tiles[key];\r\n\t\tif (!tile) { return; }\r\n\r\n\t\t// Cancels any pending http requests associated with the tile\r\n\t\ttile.el.setAttribute('src', Util.emptyImageUrl);\r\n\r\n\t\treturn GridLayer.prototype._removeTile.call(this, key);\r\n\t},\r\n\r\n\t_tileReady: function (coords, err, tile) {\r\n\t\tif (!this._map || (tile && tile.getAttribute('src') === Util.emptyImageUrl)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\treturn GridLayer.prototype._tileReady.call(this, coords, err, tile);\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.tilelayer(urlTemplate: String, options?: TileLayer options)\r\n// Instantiates a tile layer object given a `URL template` and optionally an options object.\r\n\r\nexport function tileLayer(url, options) {\r\n\treturn new TileLayer(url, options);\r\n}\r\n", "import {TileLayer} from './TileLayer';\r\nimport {extend, setOptions, getParamString} from '../../core/Util';\r\nimport Browser from '../../core/Browser';\r\nimport {EPSG4326} from '../../geo/crs/CRS.EPSG4326';\r\nimport {toBounds} from '../../geometry/Bounds';\r\n\r\n/*\r\n * @class TileLayer.WMS\r\n * @inherits TileLayer\r\n * @aka L.TileLayer.WMS\r\n * Used to display [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services as tile layers on the map. Extends `TileLayer`.\r\n *\r\n * @example\r\n *\r\n * ```js\r\n * var nexrad = L.tileLayer.wms(\"http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi\", {\r\n * \tlayers: 'nexrad-n0r-900913',\r\n * \tformat: 'image/png',\r\n * \ttransparent: true,\r\n * \tattribution: \"Weather data © 2012 IEM Nexrad\"\r\n * });\r\n * ```\r\n */\r\n\r\nexport var TileLayerWMS = TileLayer.extend({\r\n\r\n\t// @section\r\n\t// @aka TileLayer.WMS options\r\n\t// If any custom options not documented here are used, they will be sent to the\r\n\t// WMS server as extra parameters in each request URL. This can be useful for\r\n\t// [non-standard vendor WMS parameters](https://docs.geoserver.org/stable/en/user/services/wms/vendor.html).\r\n\tdefaultWmsParams: {\r\n\t\tservice: 'WMS',\r\n\t\trequest: 'GetMap',\r\n\r\n\t\t// @option layers: String = ''\r\n\t\t// **(required)** Comma-separated list of WMS layers to show.\r\n\t\tlayers: '',\r\n\r\n\t\t// @option styles: String = ''\r\n\t\t// Comma-separated list of WMS styles.\r\n\t\tstyles: '',\r\n\r\n\t\t// @option format: String = 'image/jpeg'\r\n\t\t// WMS image format (use `'image/png'` for layers with transparency).\r\n\t\tformat: 'image/jpeg',\r\n\r\n\t\t// @option transparent: Boolean = false\r\n\t\t// If `true`, the WMS service will return images with transparency.\r\n\t\ttransparent: false,\r\n\r\n\t\t// @option version: String = '1.1.1'\r\n\t\t// Version of the WMS service to use\r\n\t\tversion: '1.1.1'\r\n\t},\r\n\r\n\toptions: {\r\n\t\t// @option crs: CRS = null\r\n\t\t// Coordinate Reference System to use for the WMS requests, defaults to\r\n\t\t// map CRS. Don't change this if you're not sure what it means.\r\n\t\tcrs: null,\r\n\r\n\t\t// @option uppercase: Boolean = false\r\n\t\t// If `true`, WMS request parameter keys will be uppercase.\r\n\t\tuppercase: false\r\n\t},\r\n\r\n\tinitialize: function (url, options) {\r\n\r\n\t\tthis._url = url;\r\n\r\n\t\tvar wmsParams = extend({}, this.defaultWmsParams);\r\n\r\n\t\t// all keys that are not TileLayer options go to WMS params\r\n\t\tfor (var i in options) {\r\n\t\t\tif (!(i in this.options)) {\r\n\t\t\t\twmsParams[i] = options[i];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\toptions = setOptions(this, options);\r\n\r\n\t\tvar realRetina = options.detectRetina && Browser.retina ? 2 : 1;\r\n\t\tvar tileSize = this.getTileSize();\r\n\t\twmsParams.width = tileSize.x * realRetina;\r\n\t\twmsParams.height = tileSize.y * realRetina;\r\n\r\n\t\tthis.wmsParams = wmsParams;\r\n\t},\r\n\r\n\tonAdd: function (map) {\r\n\r\n\t\tthis._crs = this.options.crs || map.options.crs;\r\n\t\tthis._wmsVersion = parseFloat(this.wmsParams.version);\r\n\r\n\t\tvar projectionKey = this._wmsVersion >= 1.3 ? 'crs' : 'srs';\r\n\t\tthis.wmsParams[projectionKey] = this._crs.code;\r\n\r\n\t\tTileLayer.prototype.onAdd.call(this, map);\r\n\t},\r\n\r\n\tgetTileUrl: function (coords) {\r\n\r\n\t\tvar tileBounds = this._tileCoordsToNwSe(coords),\r\n\t\t    crs = this._crs,\r\n\t\t    bounds = toBounds(crs.project(tileBounds[0]), crs.project(tileBounds[1])),\r\n\t\t    min = bounds.min,\r\n\t\t    max = bounds.max,\r\n\t\t    bbox = (this._wmsVersion >= 1.3 && this._crs === EPSG4326 ?\r\n\t\t    [min.y, min.x, max.y, max.x] :\r\n\t\t    [min.x, min.y, max.x, max.y]).join(','),\r\n\t\t    url = TileLayer.prototype.getTileUrl.call(this, coords);\r\n\t\treturn url +\r\n\t\t\tgetParamString(this.wmsParams, url, this.options.uppercase) +\r\n\t\t\t(this.options.uppercase ? '&BBOX=' : '&bbox=') + bbox;\r\n\t},\r\n\r\n\t// @method setParams(params: Object, noRedraw?: Boolean): this\r\n\t// Merges an object with the new parameters and re-requests tiles on the current screen (unless `noRedraw` was set to true).\r\n\tsetParams: function (params, noRedraw) {\r\n\r\n\t\textend(this.wmsParams, params);\r\n\r\n\t\tif (!noRedraw) {\r\n\t\t\tthis.redraw();\r\n\t\t}\r\n\r\n\t\treturn this;\r\n\t}\r\n});\r\n\r\n\r\n// @factory L.tileLayer.wms(baseUrl: String, options: TileLayer.WMS options)\r\n// Instantiates a WMS tile layer object given a base URL of the WMS service and a WMS parameters/options object.\r\nexport function tileLayerWMS(url, options) {\r\n\treturn new TileLayerWMS(url, options);\r\n}\r\n", "export {GridLayer, gridLayer} from './GridLayer';\nimport {TileLayer, tileLayer} from './TileLayer';\nimport {TileLayerWMS, tileLayerWMS} from './TileLayer.WMS';\nTileLayer.WMS = TileLayerWMS;\ntileLayer.wms = tileLayerWMS;\nexport {TileLayer, tileLayer};\n", "import {Layer} from '../Layer';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as Util from '../../core/Util';\nimport Browser from '../../core/Browser';\nimport {Bounds} from '../../geometry/Bounds';\n\n\n\n/*\n * @class Renderer\n * @inherits Layer\n * @aka L.Renderer\n *\n * Base class for vector renderer implementations (`SVG`, `Canvas`). Handles the\n * DOM container of the renderer, its bounds, and its zoom animation.\n *\n * A `Renderer` works as an implicit layer group for all `Path`s - the renderer\n * itself can be added or removed to the map. All paths use a renderer, which can\n * be implicit (the map will decide the type of renderer and use it automatically)\n * or explicit (using the [`renderer`](#path-renderer) option of the path).\n *\n * Do not use this class directly, use `SVG` and `Canvas` instead.\n *\n * @event update: Event\n * Fired when the renderer updates its bounds, center and zoom, for example when\n * its map has moved\n */\n\nexport var Renderer = Layer.extend({\n\n\t// @section\n\t// @aka Renderer options\n\toptions: {\n\t\t// @option padding: Number = 0.1\n\t\t// How much to extend the clip area around the map view (relative to its size)\n\t\t// e.g. 0.1 would be 10% of map view in each direction\n\t\tpadding: 0.1\n\t},\n\n\tinitialize: function (options) {\n\t\tUtil.setOptions(this, options);\n\t\tUtil.stamp(this);\n\t\tthis._layers = this._layers || {};\n\t},\n\n\tonAdd: function () {\n\t\tif (!this._container) {\n\t\t\tthis._initContainer(); // defined by renderer implementations\n\n\t\t\t// always keep transform-origin as 0 0\n\t\t\tDomUtil.addClass(this._container, 'leaflet-zoom-animated');\n\t\t}\n\n\t\tthis.getPane().appendChild(this._container);\n\t\tthis._update();\n\t\tthis.on('update', this._updatePaths, this);\n\t},\n\n\tonRemove: function () {\n\t\tthis.off('update', this._updatePaths, this);\n\t\tthis._destroyContainer();\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = {\n\t\t\tviewreset: this._reset,\n\t\t\tzoom: this._onZoom,\n\t\t\tmoveend: this._update,\n\t\t\tzoomend: this._onZoomEnd\n\t\t};\n\t\tif (this._zoomAnimated) {\n\t\t\tevents.zoomanim = this._onAnimZoom;\n\t\t}\n\t\treturn events;\n\t},\n\n\t_onAnimZoom: function (ev) {\n\t\tthis._updateTransform(ev.center, ev.zoom);\n\t},\n\n\t_onZoom: function () {\n\t\tthis._updateTransform(this._map.getCenter(), this._map.getZoom());\n\t},\n\n\t_updateTransform: function (center, zoom) {\n\t\tvar scale = this._map.getZoomScale(zoom, this._zoom),\n\t\t    viewHalf = this._map.getSize().multiplyBy(0.5 + this.options.padding),\n\t\t    currentCenterPoint = this._map.project(this._center, zoom),\n\n\t\t    topLeftOffset = viewHalf.multiplyBy(-scale).add(currentCenterPoint)\n\t\t\t\t  .subtract(this._map._getNewPixelOrigin(center, zoom));\n\n\t\tif (Browser.any3d) {\n\t\t\tDomUtil.setTransform(this._container, topLeftOffset, scale);\n\t\t} else {\n\t\t\tDomUtil.setPosition(this._container, topLeftOffset);\n\t\t}\n\t},\n\n\t_reset: function () {\n\t\tthis._update();\n\t\tthis._updateTransform(this._center, this._zoom);\n\n\t\tfor (var id in this._layers) {\n\t\t\tthis._layers[id]._reset();\n\t\t}\n\t},\n\n\t_onZoomEnd: function () {\n\t\tfor (var id in this._layers) {\n\t\t\tthis._layers[id]._project();\n\t\t}\n\t},\n\n\t_updatePaths: function () {\n\t\tfor (var id in this._layers) {\n\t\t\tthis._layers[id]._update();\n\t\t}\n\t},\n\n\t_update: function () {\n\t\t// Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n\t\t// Subclasses are responsible of firing the 'update' event.\n\t\tvar p = this.options.padding,\n\t\t    size = this._map.getSize(),\n\t\t    min = this._map.containerPointToLayerPoint(size.multiplyBy(-p)).round();\n\n\t\tthis._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());\n\n\t\tthis._center = this._map.getCenter();\n\t\tthis._zoom = this._map.getZoom();\n\t}\n});\n", "import {Renderer} from './Renderer';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as DomEvent from '../../dom/DomEvent';\nimport Browser from '../../core/Browser';\nimport * as Util from '../../core/Util';\nimport {Bounds} from '../../geometry/Bounds';\n\n/*\n * @class Canvas\n * @inherits Renderer\n * @aka L.Canvas\n *\n * Allows vector layers to be displayed with [`<canvas>`](https://developer.mozilla.org/docs/Web/API/Canvas_API).\n * Inherits `Renderer`.\n *\n * Due to [technical limitations](https://caniuse.com/canvas), Canvas is not\n * available in all web browsers, notably IE8, and overlapping geometries might\n * not display properly in some edge cases.\n *\n * @example\n *\n * Use Canvas by default for all paths in the map:\n *\n * ```js\n * var map = L.map('map', {\n * \trenderer: L.canvas()\n * });\n * ```\n *\n * Use a Canvas renderer with extra padding for specific vector geometries:\n *\n * ```js\n * var map = L.map('map');\n * var myRenderer = L.canvas({ padding: 0.5 });\n * var line = L.polyline( coordinates, { renderer: myRenderer } );\n * var circle = L.circle( center, { renderer: myRenderer } );\n * ```\n */\n\nexport var Canvas = Renderer.extend({\n\n\t// @section\n\t// @aka Canvas options\n\toptions: {\n\t\t// @option tolerance: Number = 0\n\t\t// How much to extend the click tolerance around a path/object on the map.\n\t\ttolerance: 0\n\t},\n\n\tgetEvents: function () {\n\t\tvar events = Renderer.prototype.getEvents.call(this);\n\t\tevents.viewprereset = this._onViewPreReset;\n\t\treturn events;\n\t},\n\n\t_onViewPreReset: function () {\n\t\t// Set a flag so that a viewprereset+moveend+viewreset only updates&redraws once\n\t\tthis._postponeUpdatePaths = true;\n\t},\n\n\tonAdd: function () {\n\t\tRenderer.prototype.onAdd.call(this);\n\n\t\t// Redraw vectors since canvas is cleared upon removal,\n\t\t// in case of removing the renderer itself from the map.\n\t\tthis._draw();\n\t},\n\n\t_initContainer: function () {\n\t\tvar container = this._container = document.createElement('canvas');\n\n\t\tDomEvent.on(container, 'mousemove', this._onMouseMove, this);\n\t\tDomEvent.on(container, 'click dblclick mousedown mouseup contextmenu', this._onClick, this);\n\t\tDomEvent.on(container, 'mouseout', this._handleMouseOut, this);\n\t\tcontainer['_leaflet_disable_events'] = true;\n\n\t\tthis._ctx = container.getContext('2d');\n\t},\n\n\t_destroyContainer: function () {\n\t\tUtil.cancelAnimFrame(this._redrawRequest);\n\t\tdelete this._ctx;\n\t\tDomUtil.remove(this._container);\n\t\tDomEvent.off(this._container);\n\t\tdelete this._container;\n\t},\n\n\t_updatePaths: function () {\n\t\tif (this._postponeUpdatePaths) { return; }\n\n\t\tvar layer;\n\t\tthis._redrawBounds = null;\n\t\tfor (var id in this._layers) {\n\t\t\tlayer = this._layers[id];\n\t\t\tlayer._update();\n\t\t}\n\t\tthis._redraw();\n\t},\n\n\t_update: function () {\n\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\n\t\tRenderer.prototype._update.call(this);\n\n\t\tvar b = this._bounds,\n\t\t    container = this._container,\n\t\t    size = b.getSize(),\n\t\t    m = Browser.retina ? 2 : 1;\n\n\t\tDomUtil.setPosition(container, b.min);\n\n\t\t// set canvas size (also clearing it); use double size on retina\n\t\tcontainer.width = m * size.x;\n\t\tcontainer.height = m * size.y;\n\t\tcontainer.style.width = size.x + 'px';\n\t\tcontainer.style.height = size.y + 'px';\n\n\t\tif (Browser.retina) {\n\t\t\tthis._ctx.scale(2, 2);\n\t\t}\n\n\t\t// translate so we use the same path coordinates after canvas element moves\n\t\tthis._ctx.translate(-b.min.x, -b.min.y);\n\n\t\t// Tell paths to redraw themselves\n\t\tthis.fire('update');\n\t},\n\n\t_reset: function () {\n\t\tRenderer.prototype._reset.call(this);\n\n\t\tif (this._postponeUpdatePaths) {\n\t\t\tthis._postponeUpdatePaths = false;\n\t\t\tthis._updatePaths();\n\t\t}\n\t},\n\n\t_initPath: function (layer) {\n\t\tthis._updateDashArray(layer);\n\t\tthis._layers[Util.stamp(layer)] = layer;\n\n\t\tvar order = layer._order = {\n\t\t\tlayer: layer,\n\t\t\tprev: this._drawLast,\n\t\t\tnext: null\n\t\t};\n\t\tif (this._drawLast) { this._drawLast.next = order; }\n\t\tthis._drawLast = order;\n\t\tthis._drawFirst = this._drawFirst || this._drawLast;\n\t},\n\n\t_addPath: function (layer) {\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_removePath: function (layer) {\n\t\tvar order = layer._order;\n\t\tvar next = order.next;\n\t\tvar prev = order.prev;\n\n\t\tif (next) {\n\t\t\tnext.prev = prev;\n\t\t} else {\n\t\t\tthis._drawLast = prev;\n\t\t}\n\t\tif (prev) {\n\t\t\tprev.next = next;\n\t\t} else {\n\t\t\tthis._drawFirst = next;\n\t\t}\n\n\t\tdelete layer._order;\n\n\t\tdelete this._layers[Util.stamp(layer)];\n\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_updatePath: function (layer) {\n\t\t// Redraw the union of the layer's old pixel\n\t\t// bounds and the new pixel bounds.\n\t\tthis._extendRedrawBounds(layer);\n\t\tlayer._project();\n\t\tlayer._update();\n\t\t// The redraw will extend the redraw bounds\n\t\t// with the new pixel bounds.\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_updateStyle: function (layer) {\n\t\tthis._updateDashArray(layer);\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_updateDashArray: function (layer) {\n\t\tif (typeof layer.options.dashArray === 'string') {\n\t\t\tvar parts = layer.options.dashArray.split(/[, ]+/),\n\t\t\t    dashArray = [],\n\t\t\t    dashValue,\n\t\t\t    i;\n\t\t\tfor (i = 0; i < parts.length; i++) {\n\t\t\t\tdashValue = Number(parts[i]);\n\t\t\t\t// Ignore dash array containing invalid lengths\n\t\t\t\tif (isNaN(dashValue)) { return; }\n\t\t\t\tdashArray.push(dashValue);\n\t\t\t}\n\t\t\tlayer.options._dashArray = dashArray;\n\t\t} else {\n\t\t\tlayer.options._dashArray = layer.options.dashArray;\n\t\t}\n\t},\n\n\t_requestRedraw: function (layer) {\n\t\tif (!this._map) { return; }\n\n\t\tthis._extendRedrawBounds(layer);\n\t\tthis._redrawRequest = this._redrawRequest || Util.requestAnimFrame(this._redraw, this);\n\t},\n\n\t_extendRedrawBounds: function (layer) {\n\t\tif (layer._pxBounds) {\n\t\t\tvar padding = (layer.options.weight || 0) + 1;\n\t\t\tthis._redrawBounds = this._redrawBounds || new Bounds();\n\t\t\tthis._redrawBounds.extend(layer._pxBounds.min.subtract([padding, padding]));\n\t\t\tthis._redrawBounds.extend(layer._pxBounds.max.add([padding, padding]));\n\t\t}\n\t},\n\n\t_redraw: function () {\n\t\tthis._redrawRequest = null;\n\n\t\tif (this._redrawBounds) {\n\t\t\tthis._redrawBounds.min._floor();\n\t\t\tthis._redrawBounds.max._ceil();\n\t\t}\n\n\t\tthis._clear(); // clear layers in redraw bounds\n\t\tthis._draw(); // draw layers\n\n\t\tthis._redrawBounds = null;\n\t},\n\n\t_clear: function () {\n\t\tvar bounds = this._redrawBounds;\n\t\tif (bounds) {\n\t\t\tvar size = bounds.getSize();\n\t\t\tthis._ctx.clearRect(bounds.min.x, bounds.min.y, size.x, size.y);\n\t\t} else {\n\t\t\tthis._ctx.save();\n\t\t\tthis._ctx.setTransform(1, 0, 0, 1, 0, 0);\n\t\t\tthis._ctx.clearRect(0, 0, this._container.width, this._container.height);\n\t\t\tthis._ctx.restore();\n\t\t}\n\t},\n\n\t_draw: function () {\n\t\tvar layer, bounds = this._redrawBounds;\n\t\tthis._ctx.save();\n\t\tif (bounds) {\n\t\t\tvar size = bounds.getSize();\n\t\t\tthis._ctx.beginPath();\n\t\t\tthis._ctx.rect(bounds.min.x, bounds.min.y, size.x, size.y);\n\t\t\tthis._ctx.clip();\n\t\t}\n\n\t\tthis._drawing = true;\n\n\t\tfor (var order = this._drawFirst; order; order = order.next) {\n\t\t\tlayer = order.layer;\n\t\t\tif (!bounds || (layer._pxBounds && layer._pxBounds.intersects(bounds))) {\n\t\t\t\tlayer._updatePath();\n\t\t\t}\n\t\t}\n\n\t\tthis._drawing = false;\n\n\t\tthis._ctx.restore();  // Restore state before clipping.\n\t},\n\n\t_updatePoly: function (layer, closed) {\n\t\tif (!this._drawing) { return; }\n\n\t\tvar i, j, len2, p,\n\t\t    parts = layer._parts,\n\t\t    len = parts.length,\n\t\t    ctx = this._ctx;\n\n\t\tif (!len) { return; }\n\n\t\tctx.beginPath();\n\n\t\tfor (i = 0; i < len; i++) {\n\t\t\tfor (j = 0, len2 = parts[i].length; j < len2; j++) {\n\t\t\t\tp = parts[i][j];\n\t\t\t\tctx[j ? 'lineTo' : 'moveTo'](p.x, p.y);\n\t\t\t}\n\t\t\tif (closed) {\n\t\t\t\tctx.closePath();\n\t\t\t}\n\t\t}\n\n\t\tthis._fillStroke(ctx, layer);\n\n\t\t// TODO optimization: 1 fill/stroke for all features with equal style instead of 1 for each feature\n\t},\n\n\t_updateCircle: function (layer) {\n\n\t\tif (!this._drawing || layer._empty()) { return; }\n\n\t\tvar p = layer._point,\n\t\t    ctx = this._ctx,\n\t\t    r = Math.max(Math.round(layer._radius), 1),\n\t\t    s = (Math.max(Math.round(layer._radiusY), 1) || r) / r;\n\n\t\tif (s !== 1) {\n\t\t\tctx.save();\n\t\t\tctx.scale(1, s);\n\t\t}\n\n\t\tctx.beginPath();\n\t\tctx.arc(p.x, p.y / s, r, 0, Math.PI * 2, false);\n\n\t\tif (s !== 1) {\n\t\t\tctx.restore();\n\t\t}\n\n\t\tthis._fillStroke(ctx, layer);\n\t},\n\n\t_fillStroke: function (ctx, layer) {\n\t\tvar options = layer.options;\n\n\t\tif (options.fill) {\n\t\t\tctx.globalAlpha = options.fillOpacity;\n\t\t\tctx.fillStyle = options.fillColor || options.color;\n\t\t\tctx.fill(options.fillRule || 'evenodd');\n\t\t}\n\n\t\tif (options.stroke && options.weight !== 0) {\n\t\t\tif (ctx.setLineDash) {\n\t\t\t\tctx.setLineDash(layer.options && layer.options._dashArray || []);\n\t\t\t}\n\t\t\tctx.globalAlpha = options.opacity;\n\t\t\tctx.lineWidth = options.weight;\n\t\t\tctx.strokeStyle = options.color;\n\t\t\tctx.lineCap = options.lineCap;\n\t\t\tctx.lineJoin = options.lineJoin;\n\t\t\tctx.stroke();\n\t\t}\n\t},\n\n\t// Canvas obviously doesn't have mouse events for individual drawn objects,\n\t// so we emulate that by calculating what's under the mouse on mousemove/click manually\n\n\t_onClick: function (e) {\n\t\tvar point = this._map.mouseEventToLayerPoint(e), layer, clickedLayer;\n\n\t\tfor (var order = this._drawFirst; order; order = order.next) {\n\t\t\tlayer = order.layer;\n\t\t\tif (layer.options.interactive && layer._containsPoint(point)) {\n\t\t\t\tif (!(e.type === 'click' || e.type === 'preclick') || !this._map._draggableMoved(layer)) {\n\t\t\t\t\tclickedLayer = layer;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tthis._fireEvent(clickedLayer ? [clickedLayer] : false, e);\n\t},\n\n\t_onMouseMove: function (e) {\n\t\tif (!this._map || this._map.dragging.moving() || this._map._animatingZoom) { return; }\n\n\t\tvar point = this._map.mouseEventToLayerPoint(e);\n\t\tthis._handleMouseHover(e, point);\n\t},\n\n\n\t_handleMouseOut: function (e) {\n\t\tvar layer = this._hoveredLayer;\n\t\tif (layer) {\n\t\t\t// if we're leaving the layer, fire mouseout\n\t\t\tDomUtil.removeClass(this._container, 'leaflet-interactive');\n\t\t\tthis._fireEvent([layer], e, 'mouseout');\n\t\t\tthis._hoveredLayer = null;\n\t\t\tthis._mouseHoverThrottled = false;\n\t\t}\n\t},\n\n\t_handleMouseHover: function (e, point) {\n\t\tif (this._mouseHoverThrottled) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar layer, candidateHoveredLayer;\n\n\t\tfor (var order = this._drawFirst; order; order = order.next) {\n\t\t\tlayer = order.layer;\n\t\t\tif (layer.options.interactive && layer._containsPoint(point)) {\n\t\t\t\tcandidateHoveredLayer = layer;\n\t\t\t}\n\t\t}\n\n\t\tif (candidateHoveredLayer !== this._hoveredLayer) {\n\t\t\tthis._handleMouseOut(e);\n\n\t\t\tif (candidateHoveredLayer) {\n\t\t\t\tDomUtil.addClass(this._container, 'leaflet-interactive'); // change cursor\n\t\t\t\tthis._fireEvent([candidateHoveredLayer], e, 'mouseover');\n\t\t\t\tthis._hoveredLayer = candidateHoveredLayer;\n\t\t\t}\n\t\t}\n\n\t\tthis._fireEvent(this._hoveredLayer ? [this._hoveredLayer] : false, e);\n\n\t\tthis._mouseHoverThrottled = true;\n\t\tsetTimeout(Util.bind(function () {\n\t\t\tthis._mouseHoverThrottled = false;\n\t\t}, this), 32);\n\t},\n\n\t_fireEvent: function (layers, e, type) {\n\t\tthis._map._fireDOMEvent(e, type || e.type, layers);\n\t},\n\n\t_bringToFront: function (layer) {\n\t\tvar order = layer._order;\n\n\t\tif (!order) { return; }\n\n\t\tvar next = order.next;\n\t\tvar prev = order.prev;\n\n\t\tif (next) {\n\t\t\tnext.prev = prev;\n\t\t} else {\n\t\t\t// Already last\n\t\t\treturn;\n\t\t}\n\t\tif (prev) {\n\t\t\tprev.next = next;\n\t\t} else if (next) {\n\t\t\t// Update first entry unless this is the\n\t\t\t// single entry\n\t\t\tthis._drawFirst = next;\n\t\t}\n\n\t\torder.prev = this._drawLast;\n\t\tthis._drawLast.next = order;\n\n\t\torder.next = null;\n\t\tthis._drawLast = order;\n\n\t\tthis._requestRedraw(layer);\n\t},\n\n\t_bringToBack: function (layer) {\n\t\tvar order = layer._order;\n\n\t\tif (!order) { return; }\n\n\t\tvar next = order.next;\n\t\tvar prev = order.prev;\n\n\t\tif (prev) {\n\t\t\tprev.next = next;\n\t\t} else {\n\t\t\t// Already first\n\t\t\treturn;\n\t\t}\n\t\tif (next) {\n\t\t\tnext.prev = prev;\n\t\t} else if (prev) {\n\t\t\t// Update last entry unless this is the\n\t\t\t// single entry\n\t\t\tthis._drawLast = prev;\n\t\t}\n\n\t\torder.prev = null;\n\n\t\torder.next = this._drawFirst;\n\t\tthis._drawFirst.prev = order;\n\t\tthis._drawFirst = order;\n\n\t\tthis._requestRedraw(layer);\n\t}\n});\n\n// @factory L.canvas(options?: Renderer options)\n// Creates a Canvas renderer with the given options.\nexport function canvas(options) {\n\treturn Browser.canvas ? new Canvas(options) : null;\n}\n", "import * as DomUtil from '../../dom/DomUtil';\nimport * as Util from '../../core/Util';\nimport {Renderer} from './Renderer';\n\n/*\n * Thanks to Dmitry Baranovsky and his Raphael library for inspiration!\n */\n\n\nexport var vmlCreate = (function () {\n\ttry {\n\t\tdocument.namespaces.add('lvml', 'urn:schemas-microsoft-com:vml');\n\t\treturn function (name) {\n\t\t\treturn document.createElement('<lvml:' + name + ' class=\"lvml\">');\n\t\t};\n\t} catch (e) {\n\t\t// Do not return fn from catch block so `e` can be garbage collected\n\t\t// See https://github.com/Leaflet/Leaflet/pull/7279\n\t}\n\treturn function (name) {\n\t\treturn document.createElement('<' + name + ' xmlns=\"urn:schemas-microsoft.com:vml\" class=\"lvml\">');\n\t};\n})();\n\n\n/*\n * @class SVG\n *\n *\n * VML was deprecated in 2012, which means VML functionality exists only for backwards compatibility\n * with old versions of Internet Explorer.\n */\n\n// mixin to redefine some SVG methods to handle VML syntax which is similar but with some differences\nexport var vmlMixin = {\n\n\t_initContainer: function () {\n\t\tthis._container = DomUtil.create('div', 'leaflet-vml-container');\n\t},\n\n\t_update: function () {\n\t\tif (this._map._animatingZoom) { return; }\n\t\tRenderer.prototype._update.call(this);\n\t\tthis.fire('update');\n\t},\n\n\t_initPath: function (layer) {\n\t\tvar container = layer._container = vmlCreate('shape');\n\n\t\tDomUtil.addClass(container, 'leaflet-vml-shape ' + (this.options.className || ''));\n\n\t\tcontainer.coordsize = '1 1';\n\n\t\tlayer._path = vmlCreate('path');\n\t\tcontainer.appendChild(layer._path);\n\n\t\tthis._updateStyle(layer);\n\t\tthis._layers[Util.stamp(layer)] = layer;\n\t},\n\n\t_addPath: function (layer) {\n\t\tvar container = layer._container;\n\t\tthis._container.appendChild(container);\n\n\t\tif (layer.options.interactive) {\n\t\t\tlayer.addInteractiveTarget(container);\n\t\t}\n\t},\n\n\t_removePath: function (layer) {\n\t\tvar container = layer._container;\n\t\tDomUtil.remove(container);\n\t\tlayer.removeInteractiveTarget(container);\n\t\tdelete this._layers[Util.stamp(layer)];\n\t},\n\n\t_updateStyle: function (layer) {\n\t\tvar stroke = layer._stroke,\n\t\t    fill = layer._fill,\n\t\t    options = layer.options,\n\t\t    container = layer._container;\n\n\t\tcontainer.stroked = !!options.stroke;\n\t\tcontainer.filled = !!options.fill;\n\n\t\tif (options.stroke) {\n\t\t\tif (!stroke) {\n\t\t\t\tstroke = layer._stroke = vmlCreate('stroke');\n\t\t\t}\n\t\t\tcontainer.appendChild(stroke);\n\t\t\tstroke.weight = options.weight + 'px';\n\t\t\tstroke.color = options.color;\n\t\t\tstroke.opacity = options.opacity;\n\n\t\t\tif (options.dashArray) {\n\t\t\t\tstroke.dashStyle = Util.isArray(options.dashArray) ?\n\t\t\t\t    options.dashArray.join(' ') :\n\t\t\t\t    options.dashArray.replace(/( *, *)/g, ' ');\n\t\t\t} else {\n\t\t\t\tstroke.dashStyle = '';\n\t\t\t}\n\t\t\tstroke.endcap = options.lineCap.replace('butt', 'flat');\n\t\t\tstroke.joinstyle = options.lineJoin;\n\n\t\t} else if (stroke) {\n\t\t\tcontainer.removeChild(stroke);\n\t\t\tlayer._stroke = null;\n\t\t}\n\n\t\tif (options.fill) {\n\t\t\tif (!fill) {\n\t\t\t\tfill = layer._fill = vmlCreate('fill');\n\t\t\t}\n\t\t\tcontainer.appendChild(fill);\n\t\t\tfill.color = options.fillColor || options.color;\n\t\t\tfill.opacity = options.fillOpacity;\n\n\t\t} else if (fill) {\n\t\t\tcontainer.removeChild(fill);\n\t\t\tlayer._fill = null;\n\t\t}\n\t},\n\n\t_updateCircle: function (layer) {\n\t\tvar p = layer._point.round(),\n\t\t    r = Math.round(layer._radius),\n\t\t    r2 = Math.round(layer._radiusY || r);\n\n\t\tthis._setPath(layer, layer._empty() ? 'M0 0' :\n\t\t\t'AL ' + p.x + ',' + p.y + ' ' + r + ',' + r2 + ' 0,' + (65535 * 360));\n\t},\n\n\t_setPath: function (layer, path) {\n\t\tlayer._path.v = path;\n\t},\n\n\t_bringToFront: function (layer) {\n\t\tDomUtil.toFront(layer._container);\n\t},\n\n\t_bringToBack: function (layer) {\n\t\tDomUtil.toBack(layer._container);\n\t}\n};\n", "import {Renderer} from './Renderer';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as DomEvent from '../../dom/DomEvent';\nimport Browser from '../../core/Browser';\nimport {stamp} from '../../core/Util';\nimport {svgCreate, pointsToPath} from './SVG.Util';\nexport {pointsToPath};\nimport {vmlMixin, vmlCreate} from './SVG.VML';\n\nexport var create = Browser.vml ? vmlCreate : svgCreate;\n\n/*\n * @class SVG\n * @inherits Renderer\n * @aka L.SVG\n *\n * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG).\n * Inherits `Renderer`.\n *\n * Due to [technical limitations](https://caniuse.com/svg), SVG is not\n * available in all web browsers, notably Android 2.x and 3.x.\n *\n * Although SVG is not available on IE7 and IE8, these browsers support\n * [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language)\n * (a now deprecated technology), and the SVG renderer will fall back to VML in\n * this case.\n *\n * @example\n *\n * Use SVG by default for all paths in the map:\n *\n * ```js\n * var map = L.map('map', {\n * \trenderer: L.svg()\n * });\n * ```\n *\n * Use a SVG renderer with extra padding for specific vector geometries:\n *\n * ```js\n * var map = L.map('map');\n * var myRenderer = L.svg({ padding: 0.5 });\n * var line = L.polyline( coordinates, { renderer: myRenderer } );\n * var circle = L.circle( center, { renderer: myRenderer } );\n * ```\n */\n\nexport var SVG = Renderer.extend({\n\n\t_initContainer: function () {\n\t\tthis._container = create('svg');\n\n\t\t// makes it possible to click through svg root; we'll reset it back in individual paths\n\t\tthis._container.setAttribute('pointer-events', 'none');\n\n\t\tthis._rootGroup = create('g');\n\t\tthis._container.appendChild(this._rootGroup);\n\t},\n\n\t_destroyContainer: function () {\n\t\tDomUtil.remove(this._container);\n\t\tDomEvent.off(this._container);\n\t\tdelete this._container;\n\t\tdelete this._rootGroup;\n\t\tdelete this._svgSize;\n\t},\n\n\t_update: function () {\n\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\n\t\tRenderer.prototype._update.call(this);\n\n\t\tvar b = this._bounds,\n\t\t    size = b.getSize(),\n\t\t    container = this._container;\n\n\t\t// set size of svg-container if changed\n\t\tif (!this._svgSize || !this._svgSize.equals(size)) {\n\t\t\tthis._svgSize = size;\n\t\t\tcontainer.setAttribute('width', size.x);\n\t\t\tcontainer.setAttribute('height', size.y);\n\t\t}\n\n\t\t// movement: update container viewBox so that we don't have to change coordinates of individual layers\n\t\tDomUtil.setPosition(container, b.min);\n\t\tcontainer.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\n\t\tthis.fire('update');\n\t},\n\n\t// methods below are called by vector layers implementations\n\n\t_initPath: function (layer) {\n\t\tvar path = layer._path = create('path');\n\n\t\t// @namespace Path\n\t\t// @option className: String = null\n\t\t// Custom class name set on an element. Only for SVG renderer.\n\t\tif (layer.options.className) {\n\t\t\tDomUtil.addClass(path, layer.options.className);\n\t\t}\n\n\t\tif (layer.options.interactive) {\n\t\t\tDomUtil.addClass(path, 'leaflet-interactive');\n\t\t}\n\n\t\tthis._updateStyle(layer);\n\t\tthis._layers[stamp(layer)] = layer;\n\t},\n\n\t_addPath: function (layer) {\n\t\tif (!this._rootGroup) { this._initContainer(); }\n\t\tthis._rootGroup.appendChild(layer._path);\n\t\tlayer.addInteractiveTarget(layer._path);\n\t},\n\n\t_removePath: function (layer) {\n\t\tDomUtil.remove(layer._path);\n\t\tlayer.removeInteractiveTarget(layer._path);\n\t\tdelete this._layers[stamp(layer)];\n\t},\n\n\t_updatePath: function (layer) {\n\t\tlayer._project();\n\t\tlayer._update();\n\t},\n\n\t_updateStyle: function (layer) {\n\t\tvar path = layer._path,\n\t\t    options = layer.options;\n\n\t\tif (!path) { return; }\n\n\t\tif (options.stroke) {\n\t\t\tpath.setAttribute('stroke', options.color);\n\t\t\tpath.setAttribute('stroke-opacity', options.opacity);\n\t\t\tpath.setAttribute('stroke-width', options.weight);\n\t\t\tpath.setAttribute('stroke-linecap', options.lineCap);\n\t\t\tpath.setAttribute('stroke-linejoin', options.lineJoin);\n\n\t\t\tif (options.dashArray) {\n\t\t\t\tpath.setAttribute('stroke-dasharray', options.dashArray);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dasharray');\n\t\t\t}\n\n\t\t\tif (options.dashOffset) {\n\t\t\t\tpath.setAttribute('stroke-dashoffset', options.dashOffset);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dashoffset');\n\t\t\t}\n\t\t} else {\n\t\t\tpath.setAttribute('stroke', 'none');\n\t\t}\n\n\t\tif (options.fill) {\n\t\t\tpath.setAttribute('fill', options.fillColor || options.color);\n\t\t\tpath.setAttribute('fill-opacity', options.fillOpacity);\n\t\t\tpath.setAttribute('fill-rule', options.fillRule || 'evenodd');\n\t\t} else {\n\t\t\tpath.setAttribute('fill', 'none');\n\t\t}\n\t},\n\n\t_updatePoly: function (layer, closed) {\n\t\tthis._setPath(layer, pointsToPath(layer._parts, closed));\n\t},\n\n\t_updateCircle: function (layer) {\n\t\tvar p = layer._point,\n\t\t    r = Math.max(Math.round(layer._radius), 1),\n\t\t    r2 = Math.max(Math.round(layer._radiusY), 1) || r,\n\t\t    arc = 'a' + r + ',' + r2 + ' 0 1,0 ';\n\n\t\t// drawing a circle with two half-arcs\n\t\tvar d = layer._empty() ? 'M0 0' :\n\t\t\t'M' + (p.x - r) + ',' + p.y +\n\t\t\tarc + (r * 2) + ',0 ' +\n\t\t\tarc + (-r * 2) + ',0 ';\n\n\t\tthis._setPath(layer, d);\n\t},\n\n\t_setPath: function (layer, path) {\n\t\tlayer._path.setAttribute('d', path);\n\t},\n\n\t// SVG does not have the concept of zIndex so we resort to changing the DOM order of elements\n\t_bringToFront: function (layer) {\n\t\tDomUtil.toFront(layer._path);\n\t},\n\n\t_bringToBack: function (layer) {\n\t\tDomUtil.toBack(layer._path);\n\t}\n});\n\nif (Browser.vml) {\n\tSVG.include(vmlMixin);\n}\n\n// @namespace SVG\n// @factory L.svg(options?: Renderer options)\n// Creates a SVG renderer with the given options.\nexport function svg(options) {\n\treturn Browser.svg || Browser.vml ? new SVG(options) : null;\n}\n", "import {Map} from '../../map/Map';\nimport {canvas} from './Canvas';\nimport {svg} from './SVG';\n\nMap.include({\n\t// @namespace Map; @method getRenderer(layer: Path): Renderer\n\t// Returns the instance of `Renderer` that should be used to render the given\n\t// `Path`. It will ensure that the `renderer` options of the map and paths\n\t// are respected, and that the renderers do exist on the map.\n\tgetRenderer: function (layer) {\n\t\t// @namespace Path; @option renderer: Renderer\n\t\t// Use this specific instance of `Renderer` for this path. Takes\n\t\t// precedence over the map's [default renderer](#map-renderer).\n\t\tvar renderer = layer.options.renderer || this._getPaneRenderer(layer.options.pane) || this.options.renderer || this._renderer;\n\n\t\tif (!renderer) {\n\t\t\trenderer = this._renderer = this._createRenderer();\n\t\t}\n\n\t\tif (!this.hasLayer(renderer)) {\n\t\t\tthis.addLayer(renderer);\n\t\t}\n\t\treturn renderer;\n\t},\n\n\t_getPaneRenderer: function (name) {\n\t\tif (name === 'overlayPane' || name === undefined) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar renderer = this._paneRenderers[name];\n\t\tif (renderer === undefined) {\n\t\t\trenderer = this._createRenderer({pane: name});\n\t\t\tthis._paneRenderers[name] = renderer;\n\t\t}\n\t\treturn renderer;\n\t},\n\n\t_createRenderer: function (options) {\n\t\t// @namespace Map; @option preferCanvas: Boolean = false\n\t\t// Whether `Path`s should be rendered on a `Canvas` renderer.\n\t\t// By default, all `Path`s are rendered in a `SVG` renderer.\n\t\treturn (this.options.preferCanvas && canvas(options)) || svg(options);\n\t}\n});\n", "import {Polygon} from './Polygon';\nimport {toLatLngBounds} from '../../geo/LatLngBounds';\n\n/*\n * L.Rectangle extends Polygon and creates a rectangle when passed a LatLngBounds object.\n */\n\n/*\n * @class Rectangle\n * @aka L.Rectangle\n * @inherits Polygon\n *\n * A class for drawing rectangle overlays on a map. Extends `Polygon`.\n *\n * @example\n *\n * ```js\n * // define rectangle geographical bounds\n * var bounds = [[54.559322, -5.767822], [56.1210604, -3.021240]];\n *\n * // create an orange rectangle\n * L.rectangle(bounds, {color: \"#ff7800\", weight: 1}).addTo(map);\n *\n * // zoom the map to the rectangle bounds\n * map.fitBounds(bounds);\n * ```\n *\n */\n\n\nexport var Rectangle = Polygon.extend({\n\tinitialize: function (latLngBounds, options) {\n\t\tPolygon.prototype.initialize.call(this, this._boundsToLatLngs(latLngBounds), options);\n\t},\n\n\t// @method setBounds(latLngBounds: LatLngBounds): this\n\t// Redraws the rectangle with the passed bounds.\n\tsetBounds: function (latLngBounds) {\n\t\treturn this.setLatLngs(this._boundsToLatLngs(latLngBounds));\n\t},\n\n\t_boundsToLatLngs: function (latLngBounds) {\n\t\tlatLngBounds = toLatLngBounds(latLngBounds);\n\t\treturn [\n\t\t\tlatLngBounds.getSouthWest(),\n\t\t\tlatLngBounds.getNorthWest(),\n\t\t\tlatLngBounds.getNorthEast(),\n\t\t\tlatLngBounds.getSouthEast()\n\t\t];\n\t}\n});\n\n\n// @factory L.rectangle(latLngBounds: LatLngBounds, options?: Polyline options)\nexport function rectangle(latLngBounds, options) {\n\treturn new Rectangle(latLngBounds, options);\n}\n", "export {Renderer} from './Renderer';\nexport {Canvas, canvas} from './Canvas';\nimport {SVG, create, pointsToPath, svg} from './SVG';\nSVG.create = create;\nSVG.pointsToPath = pointsToPath;\nexport {SVG, svg};\nimport './Renderer.getRenderer';\t// This is a bit of a hack, but needed because circular dependencies\n\nexport {Path} from './Path';\nexport {CircleMarker, circleMarker} from './CircleMarker';\nexport {Circle, circle} from './Circle';\nexport {Polyline, polyline} from './Polyline';\nexport {Polygon, polygon} from './Polygon';\nexport {Rectangle, rectangle} from './Rectangle';\n", "export {Layer} from './Layer';\nexport {LayerGroup, layerGroup} from './LayerGroup';\nexport {FeatureGroup, featureGroup} from './FeatureGroup';\nimport {GeoJSON, geoJSON, geoJson, geometryToLayer, coordsToLatLng, coordsToLatLngs, latLngToCoords, latLngsToCoords, getFeature, asFeature} from './GeoJSON';\nGeoJSON.geometryToLayer = geometryToLayer;\nGeoJSON.coordsToLatLng = coordsToLatLng;\nGeoJSON.coordsToLatLngs = coordsToLatLngs;\nGeoJSON.latLngToCoords = latLngToCoords;\nGeoJSON.latLngsToCoords = latLngsToCoords;\nGeoJSON.getFeature = getFeature;\nGeoJSON.asFeature = asFeature;\nexport {GeoJSON, geoJSON, geoJson};\n\nexport {ImageOverlay, imageOverlay} from './ImageOverlay';\nexport {VideoOverlay, videoOverlay} from './VideoOverlay';\nexport {SVGOverlay, svgOverlay} from './SVGOverlay';\n\nexport {DivOverlay} from './DivOverlay';\nexport {Popup, popup} from './Popup';\nexport {Tooltip, tooltip} from './Tooltip';\n\nexport * from './marker/index';\nexport * from './tile/index';\nexport * from './vector/index';\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport * as DomEvent from '../../dom/DomEvent';\nimport {LatLngBounds} from '../../geo/LatLngBounds';\nimport {Bounds} from '../../geometry/Bounds';\n\n/*\n * L.Handler.BoxZoom is used to add shift-drag zoom interaction to the map\n * (zoom to a selected bounding box), enabled by default.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @option boxZoom: Boolean = true\n\t// Whether the map can be zoomed to a rectangular area specified by\n\t// dragging the mouse while pressing the shift key.\n\tboxZoom: true\n});\n\nexport var BoxZoom = Handler.extend({\n\tinitialize: function (map) {\n\t\tthis._map = map;\n\t\tthis._container = map._container;\n\t\tthis._pane = map._panes.overlayPane;\n\t\tthis._resetStateTimeout = 0;\n\t\tmap.on('unload', this._destroy, this);\n\t},\n\n\taddHooks: function () {\n\t\tDomEvent.on(this._container, 'mousedown', this._onMouseDown, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tDomEvent.off(this._container, 'mousedown', this._onMouseDown, this);\n\t},\n\n\tmoved: function () {\n\t\treturn this._moved;\n\t},\n\n\t_destroy: function () {\n\t\tDomUtil.remove(this._pane);\n\t\tdelete this._pane;\n\t},\n\n\t_resetState: function () {\n\t\tthis._resetStateTimeout = 0;\n\t\tthis._moved = false;\n\t},\n\n\t_clearDeferredResetState: function () {\n\t\tif (this._resetStateTimeout !== 0) {\n\t\t\tclearTimeout(this._resetStateTimeout);\n\t\t\tthis._resetStateTimeout = 0;\n\t\t}\n\t},\n\n\t_onMouseDown: function (e) {\n\t\tif (!e.shiftKey || ((e.which !== 1) && (e.button !== 1))) { return false; }\n\n\t\t// Clear the deferred resetState if it hasn't executed yet, otherwise it\n\t\t// will interrupt the interaction and orphan a box element in the container.\n\t\tthis._clearDeferredResetState();\n\t\tthis._resetState();\n\n\t\tDomUtil.disableTextSelection();\n\t\tDomUtil.disableImageDrag();\n\n\t\tthis._startPoint = this._map.mouseEventToContainerPoint(e);\n\n\t\tDomEvent.on(document, {\n\t\t\tcontextmenu: DomEvent.stop,\n\t\t\tmousemove: this._onMouseMove,\n\t\t\tmouseup: this._onMouseUp,\n\t\t\tkeydown: this._onKeyDown\n\t\t}, this);\n\t},\n\n\t_onMouseMove: function (e) {\n\t\tif (!this._moved) {\n\t\t\tthis._moved = true;\n\n\t\t\tthis._box = DomUtil.create('div', 'leaflet-zoom-box', this._container);\n\t\t\tDomUtil.addClass(this._container, 'leaflet-crosshair');\n\n\t\t\tthis._map.fire('boxzoomstart');\n\t\t}\n\n\t\tthis._point = this._map.mouseEventToContainerPoint(e);\n\n\t\tvar bounds = new Bounds(this._point, this._startPoint),\n\t\t    size = bounds.getSize();\n\n\t\tDomUtil.setPosition(this._box, bounds.min);\n\n\t\tthis._box.style.width  = size.x + 'px';\n\t\tthis._box.style.height = size.y + 'px';\n\t},\n\n\t_finish: function () {\n\t\tif (this._moved) {\n\t\t\tDomUtil.remove(this._box);\n\t\t\tDomUtil.removeClass(this._container, 'leaflet-crosshair');\n\t\t}\n\n\t\tDomUtil.enableTextSelection();\n\t\tDomUtil.enableImageDrag();\n\n\t\tDomEvent.off(document, {\n\t\t\tcontextmenu: DomEvent.stop,\n\t\t\tmousemove: this._onMouseMove,\n\t\t\tmouseup: this._onMouseUp,\n\t\t\tkeydown: this._onKeyDown\n\t\t}, this);\n\t},\n\n\t_onMouseUp: function (e) {\n\t\tif ((e.which !== 1) && (e.button !== 1)) { return; }\n\n\t\tthis._finish();\n\n\t\tif (!this._moved) { return; }\n\t\t// Postpone to next JS tick so internal click event handling\n\t\t// still see it as \"moved\".\n\t\tthis._clearDeferredResetState();\n\t\tthis._resetStateTimeout = setTimeout(Util.bind(this._resetState, this), 0);\n\n\t\tvar bounds = new LatLngBounds(\n\t\t        this._map.containerPointToLatLng(this._startPoint),\n\t\t        this._map.containerPointToLatLng(this._point));\n\n\t\tthis._map\n\t\t\t.fitBounds(bounds)\n\t\t\t.fire('boxzoomend', {boxZoomBounds: bounds});\n\t},\n\n\t_onKeyDown: function (e) {\n\t\tif (e.keyCode === 27) {\n\t\t\tthis._finish();\n\t\t\tthis._clearDeferredResetState();\n\t\t\tthis._resetState();\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property boxZoom: Handler\n// Box (shift-drag with mouse) zoom handler.\nMap.addInitHook('addHandler', 'boxZoom', BoxZoom);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\n\n/*\n * L.Handler.DoubleClickZoom is used to handle double-click zoom on the map, enabled by default.\n */\n\n// @namespace Map\n// @section Interaction Options\n\nMap.mergeOptions({\n\t// @option doubleClickZoom: Boolean|String = true\n\t// Whether the map can be zoomed in by double clicking on it and\n\t// zoomed out by double clicking while holding shift. If passed\n\t// `'center'`, double-click zoom will zoom to the center of the\n\t//  view regardless of where the mouse was.\n\tdoubleClickZoom: true\n});\n\nexport var DoubleClickZoom = Handler.extend({\n\taddHooks: function () {\n\t\tthis._map.on('dblclick', this._onDoubleClick, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tthis._map.off('dblclick', this._onDoubleClick, this);\n\t},\n\n\t_onDoubleClick: function (e) {\n\t\tvar map = this._map,\n\t\t    oldZoom = map.getZoom(),\n\t\t    delta = map.options.zoomDelta,\n\t\t    zoom = e.originalEvent.shiftKey ? oldZoom - delta : oldZoom + delta;\n\n\t\tif (map.options.doubleClickZoom === 'center') {\n\t\t\tmap.setZoom(zoom);\n\t\t} else {\n\t\t\tmap.setZoomAround(e.containerPoint, zoom);\n\t\t}\n\t}\n});\n\n// @section Handlers\n//\n// Map properties include interaction handlers that allow you to control\n// interaction behavior in runtime, enabling or disabling certain features such\n// as dragging or touch zoom (see `Handler` methods). For example:\n//\n// ```js\n// map.doubleClickZoom.disable();\n// ```\n//\n// @property doubleClickZoom: Handler\n// Double click zoom handler.\nMap.addInitHook('addHandler', 'doubleClickZoom', DoubleClickZoom);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport {Draggable} from '../../dom/Draggable';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport {toLatLngBounds as latLngBounds} from '../../geo/LatLngBounds';\nimport {toBounds} from '../../geometry/Bounds';\n\n/*\n * L.Handler.MapDrag is used to make the map draggable (with panning inertia), enabled by default.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @option dragging: Boolean = true\n\t// Whether the map is draggable with mouse/touch or not.\n\tdragging: true,\n\n\t// @section Panning Inertia Options\n\t// @option inertia: Boolean = *\n\t// If enabled, panning of the map will have an inertia effect where\n\t// the map builds momentum while dragging and continues moving in\n\t// the same direction for some time. Feels especially nice on touch\n\t// devices. Enabled by default.\n\tinertia: true,\n\n\t// @option inertiaDeceleration: Number = 3000\n\t// The rate with which the inertial movement slows down, in pixels/second².\n\tinertiaDeceleration: 3400, // px/s^2\n\n\t// @option inertiaMaxSpeed: Number = Infinity\n\t// Max speed of the inertial movement, in pixels/second.\n\tinertiaMaxSpeed: Infinity, // px/s\n\n\t// @option easeLinearity: Number = 0.2\n\teaseLinearity: 0.2,\n\n\t// TODO refactor, move to CRS\n\t// @option worldCopyJump: Boolean = false\n\t// With this option enabled, the map tracks when you pan to another \"copy\"\n\t// of the world and seamlessly jumps to the original one so that all overlays\n\t// like markers and vector layers are still visible.\n\tworldCopyJump: false,\n\n\t// @option maxBoundsViscosity: Number = 0.0\n\t// If `maxBounds` is set, this option will control how solid the bounds\n\t// are when dragging the map around. The default value of `0.0` allows the\n\t// user to drag outside the bounds at normal speed, higher values will\n\t// slow down map dragging outside bounds, and `1.0` makes the bounds fully\n\t// solid, preventing the user from dragging outside the bounds.\n\tmaxBoundsViscosity: 0.0\n});\n\nexport var Drag = Handler.extend({\n\taddHooks: function () {\n\t\tif (!this._draggable) {\n\t\t\tvar map = this._map;\n\n\t\t\tthis._draggable = new Draggable(map._mapPane, map._container);\n\n\t\t\tthis._draggable.on({\n\t\t\t\tdragstart: this._onDragStart,\n\t\t\t\tdrag: this._onDrag,\n\t\t\t\tdragend: this._onDragEnd\n\t\t\t}, this);\n\n\t\t\tthis._draggable.on('predrag', this._onPreDragLimit, this);\n\t\t\tif (map.options.worldCopyJump) {\n\t\t\t\tthis._draggable.on('predrag', this._onPreDragWrap, this);\n\t\t\t\tmap.on('zoomend', this._onZoomEnd, this);\n\n\t\t\t\tmap.whenReady(this._onZoomEnd, this);\n\t\t\t}\n\t\t}\n\t\tDomUtil.addClass(this._map._container, 'leaflet-grab leaflet-touch-drag');\n\t\tthis._draggable.enable();\n\t\tthis._positions = [];\n\t\tthis._times = [];\n\t},\n\n\tremoveHooks: function () {\n\t\tDomUtil.removeClass(this._map._container, 'leaflet-grab');\n\t\tDomUtil.removeClass(this._map._container, 'leaflet-touch-drag');\n\t\tthis._draggable.disable();\n\t},\n\n\tmoved: function () {\n\t\treturn this._draggable && this._draggable._moved;\n\t},\n\n\tmoving: function () {\n\t\treturn this._draggable && this._draggable._moving;\n\t},\n\n\t_onDragStart: function () {\n\t\tvar map = this._map;\n\n\t\tmap._stop();\n\t\tif (this._map.options.maxBounds && this._map.options.maxBoundsViscosity) {\n\t\t\tvar bounds = latLngBounds(this._map.options.maxBounds);\n\n\t\t\tthis._offsetLimit = toBounds(\n\t\t\t\tthis._map.latLngToContainerPoint(bounds.getNorthWest()).multiplyBy(-1),\n\t\t\t\tthis._map.latLngToContainerPoint(bounds.getSouthEast()).multiplyBy(-1)\n\t\t\t\t\t.add(this._map.getSize()));\n\n\t\t\tthis._viscosity = Math.min(1.0, Math.max(0.0, this._map.options.maxBoundsViscosity));\n\t\t} else {\n\t\t\tthis._offsetLimit = null;\n\t\t}\n\n\t\tmap\n\t\t    .fire('movestart')\n\t\t    .fire('dragstart');\n\n\t\tif (map.options.inertia) {\n\t\t\tthis._positions = [];\n\t\t\tthis._times = [];\n\t\t}\n\t},\n\n\t_onDrag: function (e) {\n\t\tif (this._map.options.inertia) {\n\t\t\tvar time = this._lastTime = +new Date(),\n\t\t\t    pos = this._lastPos = this._draggable._absPos || this._draggable._newPos;\n\n\t\t\tthis._positions.push(pos);\n\t\t\tthis._times.push(time);\n\n\t\t\tthis._prunePositions(time);\n\t\t}\n\n\t\tthis._map\n\t\t    .fire('move', e)\n\t\t    .fire('drag', e);\n\t},\n\n\t_prunePositions: function (time) {\n\t\twhile (this._positions.length > 1 && time - this._times[0] > 50) {\n\t\t\tthis._positions.shift();\n\t\t\tthis._times.shift();\n\t\t}\n\t},\n\n\t_onZoomEnd: function () {\n\t\tvar pxCenter = this._map.getSize().divideBy(2),\n\t\t    pxWorldCenter = this._map.latLngToLayerPoint([0, 0]);\n\n\t\tthis._initialWorldOffset = pxWorldCenter.subtract(pxCenter).x;\n\t\tthis._worldWidth = this._map.getPixelWorldBounds().getSize().x;\n\t},\n\n\t_viscousLimit: function (value, threshold) {\n\t\treturn value - (value - threshold) * this._viscosity;\n\t},\n\n\t_onPreDragLimit: function () {\n\t\tif (!this._viscosity || !this._offsetLimit) { return; }\n\n\t\tvar offset = this._draggable._newPos.subtract(this._draggable._startPos);\n\n\t\tvar limit = this._offsetLimit;\n\t\tif (offset.x < limit.min.x) { offset.x = this._viscousLimit(offset.x, limit.min.x); }\n\t\tif (offset.y < limit.min.y) { offset.y = this._viscousLimit(offset.y, limit.min.y); }\n\t\tif (offset.x > limit.max.x) { offset.x = this._viscousLimit(offset.x, limit.max.x); }\n\t\tif (offset.y > limit.max.y) { offset.y = this._viscousLimit(offset.y, limit.max.y); }\n\n\t\tthis._draggable._newPos = this._draggable._startPos.add(offset);\n\t},\n\n\t_onPreDragWrap: function () {\n\t\t// TODO refactor to be able to adjust map pane position after zoom\n\t\tvar worldWidth = this._worldWidth,\n\t\t    halfWidth = Math.round(worldWidth / 2),\n\t\t    dx = this._initialWorldOffset,\n\t\t    x = this._draggable._newPos.x,\n\t\t    newX1 = (x - halfWidth + dx) % worldWidth + halfWidth - dx,\n\t\t    newX2 = (x + halfWidth + dx) % worldWidth - halfWidth - dx,\n\t\t    newX = Math.abs(newX1 + dx) < Math.abs(newX2 + dx) ? newX1 : newX2;\n\n\t\tthis._draggable._absPos = this._draggable._newPos.clone();\n\t\tthis._draggable._newPos.x = newX;\n\t},\n\n\t_onDragEnd: function (e) {\n\t\tvar map = this._map,\n\t\t    options = map.options,\n\n\t\t    noInertia = !options.inertia || e.noInertia || this._times.length < 2;\n\n\t\tmap.fire('dragend', e);\n\n\t\tif (noInertia) {\n\t\t\tmap.fire('moveend');\n\n\t\t} else {\n\t\t\tthis._prunePositions(+new Date());\n\n\t\t\tvar direction = this._lastPos.subtract(this._positions[0]),\n\t\t\t    duration = (this._lastTime - this._times[0]) / 1000,\n\t\t\t    ease = options.easeLinearity,\n\n\t\t\t    speedVector = direction.multiplyBy(ease / duration),\n\t\t\t    speed = speedVector.distanceTo([0, 0]),\n\n\t\t\t    limitedSpeed = Math.min(options.inertiaMaxSpeed, speed),\n\t\t\t    limitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),\n\n\t\t\t    decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease),\n\t\t\t    offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();\n\n\t\t\tif (!offset.x && !offset.y) {\n\t\t\t\tmap.fire('moveend');\n\n\t\t\t} else {\n\t\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\n\t\t\t\tUtil.requestAnimFrame(function () {\n\t\t\t\t\tmap.panBy(offset, {\n\t\t\t\t\t\tduration: decelerationDuration,\n\t\t\t\t\t\teaseLinearity: ease,\n\t\t\t\t\t\tnoMoveStart: true,\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property dragging: Handler\n// Map dragging handler (by both mouse and touch).\nMap.addInitHook('addHandler', 'dragging', Drag);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport {on, off, stop} from '../../dom/DomEvent';\nimport {toPoint} from '../../geometry/Point';\n\n\n/*\n * L.Map.Keyboard is handling keyboard interaction with the map, enabled by default.\n */\n\n// @namespace Map\n// @section Keyboard Navigation Options\nMap.mergeOptions({\n\t// @option keyboard: Boolean = true\n\t// Makes the map focusable and allows users to navigate the map with keyboard\n\t// arrows and `+`/`-` keys.\n\tkeyboard: true,\n\n\t// @option keyboardPanDelta: Number = 80\n\t// Amount of pixels to pan when pressing an arrow key.\n\tkeyboardPanDelta: 80\n});\n\nexport var Keyboard = Handler.extend({\n\n\tkeyCodes: {\n\t\tleft:    [37],\n\t\tright:   [39],\n\t\tdown:    [40],\n\t\tup:      [38],\n\t\tzoomIn:  [187, 107, 61, 171],\n\t\tzoomOut: [189, 109, 54, 173]\n\t},\n\n\tinitialize: function (map) {\n\t\tthis._map = map;\n\n\t\tthis._setPanDelta(map.options.keyboardPanDelta);\n\t\tthis._setZoomDelta(map.options.zoomDelta);\n\t},\n\n\taddHooks: function () {\n\t\tvar container = this._map._container;\n\n\t\t// make the container focusable by tabbing\n\t\tif (container.tabIndex <= 0) {\n\t\t\tcontainer.tabIndex = '0';\n\t\t}\n\n\t\ton(container, {\n\t\t\tfocus: this._onFocus,\n\t\t\tblur: this._onBlur,\n\t\t\tmousedown: this._onMouseDown\n\t\t}, this);\n\n\t\tthis._map.on({\n\t\t\tfocus: this._addHooks,\n\t\t\tblur: this._removeHooks\n\t\t}, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tthis._removeHooks();\n\n\t\toff(this._map._container, {\n\t\t\tfocus: this._onFocus,\n\t\t\tblur: this._onBlur,\n\t\t\tmousedown: this._onMouseDown\n\t\t}, this);\n\n\t\tthis._map.off({\n\t\t\tfocus: this._addHooks,\n\t\t\tblur: this._removeHooks\n\t\t}, this);\n\t},\n\n\t_onMouseDown: function () {\n\t\tif (this._focused) { return; }\n\n\t\tvar body = document.body,\n\t\t    docEl = document.documentElement,\n\t\t    top = body.scrollTop || docEl.scrollTop,\n\t\t    left = body.scrollLeft || docEl.scrollLeft;\n\n\t\tthis._map._container.focus();\n\n\t\twindow.scrollTo(left, top);\n\t},\n\n\t_onFocus: function () {\n\t\tthis._focused = true;\n\t\tthis._map.fire('focus');\n\t},\n\n\t_onBlur: function () {\n\t\tthis._focused = false;\n\t\tthis._map.fire('blur');\n\t},\n\n\t_setPanDelta: function (panDelta) {\n\t\tvar keys = this._panKeys = {},\n\t\t    codes = this.keyCodes,\n\t\t    i, len;\n\n\t\tfor (i = 0, len = codes.left.length; i < len; i++) {\n\t\t\tkeys[codes.left[i]] = [-1 * panDelta, 0];\n\t\t}\n\t\tfor (i = 0, len = codes.right.length; i < len; i++) {\n\t\t\tkeys[codes.right[i]] = [panDelta, 0];\n\t\t}\n\t\tfor (i = 0, len = codes.down.length; i < len; i++) {\n\t\t\tkeys[codes.down[i]] = [0, panDelta];\n\t\t}\n\t\tfor (i = 0, len = codes.up.length; i < len; i++) {\n\t\t\tkeys[codes.up[i]] = [0, -1 * panDelta];\n\t\t}\n\t},\n\n\t_setZoomDelta: function (zoomDelta) {\n\t\tvar keys = this._zoomKeys = {},\n\t\t    codes = this.keyCodes,\n\t\t    i, len;\n\n\t\tfor (i = 0, len = codes.zoomIn.length; i < len; i++) {\n\t\t\tkeys[codes.zoomIn[i]] = zoomDelta;\n\t\t}\n\t\tfor (i = 0, len = codes.zoomOut.length; i < len; i++) {\n\t\t\tkeys[codes.zoomOut[i]] = -zoomDelta;\n\t\t}\n\t},\n\n\t_addHooks: function () {\n\t\ton(document, 'keydown', this._onKeyDown, this);\n\t},\n\n\t_removeHooks: function () {\n\t\toff(document, 'keydown', this._onKeyDown, this);\n\t},\n\n\t_onKeyDown: function (e) {\n\t\tif (e.altKey || e.ctrlKey || e.metaKey) { return; }\n\n\t\tvar key = e.keyCode,\n\t\t    map = this._map,\n\t\t    offset;\n\n\t\tif (key in this._panKeys) {\n\t\t\tif (!map._panAnim || !map._panAnim._inProgress) {\n\t\t\t\toffset = this._panKeys[key];\n\t\t\t\tif (e.shiftKey) {\n\t\t\t\t\toffset = toPoint(offset).multiplyBy(3);\n\t\t\t\t}\n\n\t\t\t\tif (map.options.maxBounds) {\n\t\t\t\t\toffset = map._limitOffset(toPoint(offset), map.options.maxBounds);\n\t\t\t\t}\n\n\t\t\t\tif (map.options.worldCopyJump) {\n\t\t\t\t\tvar newLatLng = map.wrapLatLng(map.unproject(map.project(map.getCenter()).add(offset)));\n\t\t\t\t\tmap.panTo(newLatLng);\n\t\t\t\t} else {\n\t\t\t\t\tmap.panBy(offset);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (key in this._zoomKeys) {\n\t\t\tmap.setZoom(map.getZoom() + (e.shiftKey ? 3 : 1) * this._zoomKeys[key]);\n\n\t\t} else if (key === 27 && map._popup && map._popup.options.closeOnEscapeKey) {\n\t\t\tmap.closePopup();\n\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tstop(e);\n\t}\n});\n\n// @section Handlers\n// @section Handlers\n// @property keyboard: Handler\n// Keyboard navigation handler.\nMap.addInitHook('addHandler', 'keyboard', Keyboard);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as DomEvent from '../../dom/DomEvent';\nimport * as Util from '../../core/Util';\n\n/*\n * L.Handler.ScrollWheelZoom is used by L.Map to enable mouse scroll wheel zoom on the map.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @section Mouse wheel options\n\t// @option scrollWheelZoom: Boolean|String = true\n\t// Whether the map can be zoomed by using the mouse wheel. If passed `'center'`,\n\t// it will zoom to the center of the view regardless of where the mouse was.\n\tscrollWheelZoom: true,\n\n\t// @option wheelDebounceTime: Number = 40\n\t// Limits the rate at which a wheel can fire (in milliseconds). By default\n\t// user can't zoom via wheel more often than once per 40 ms.\n\twheelDebounceTime: 40,\n\n\t// @option wheelPxPerZoomLevel: Number = 60\n\t// How many scroll pixels (as reported by [L.DomEvent.getWheelDelta](#domevent-getwheeldelta))\n\t// mean a change of one full zoom level. Smaller values will make wheel-zooming\n\t// faster (and vice versa).\n\twheelPxPerZoomLevel: 60\n});\n\nexport var ScrollWheelZoom = Handler.extend({\n\taddHooks: function () {\n\t\tDomEvent.on(this._map._container, 'wheel', this._onWheelScroll, this);\n\n\t\tthis._delta = 0;\n\t},\n\n\tremoveHooks: function () {\n\t\tDomEvent.off(this._map._container, 'wheel', this._onWheelScroll, this);\n\t},\n\n\t_onWheelScroll: function (e) {\n\t\tvar delta = DomEvent.getWheelDelta(e);\n\n\t\tvar debounce = this._map.options.wheelDebounceTime;\n\n\t\tthis._delta += delta;\n\t\tthis._lastMousePos = this._map.mouseEventToContainerPoint(e);\n\n\t\tif (!this._startTime) {\n\t\t\tthis._startTime = +new Date();\n\t\t}\n\n\t\tvar left = Math.max(debounce - (+new Date() - this._startTime), 0);\n\n\t\tclearTimeout(this._timer);\n\t\tthis._timer = setTimeout(Util.bind(this._performZoom, this), left);\n\n\t\tDomEvent.stop(e);\n\t},\n\n\t_performZoom: function () {\n\t\tvar map = this._map,\n\t\t    zoom = map.getZoom(),\n\t\t    snap = this._map.options.zoomSnap || 0;\n\n\t\tmap._stop(); // stop panning and fly animations if any\n\n\t\t// map the delta with a sigmoid function to -4..4 range leaning on -1..1\n\t\tvar d2 = this._delta / (this._map.options.wheelPxPerZoomLevel * 4),\n\t\t    d3 = 4 * Math.log(2 / (1 + Math.exp(-Math.abs(d2)))) / Math.LN2,\n\t\t    d4 = snap ? Math.ceil(d3 / snap) * snap : d3,\n\t\t    delta = map._limitZoom(zoom + (this._delta > 0 ? d4 : -d4)) - zoom;\n\n\t\tthis._delta = 0;\n\t\tthis._startTime = null;\n\n\t\tif (!delta) { return; }\n\n\t\tif (map.options.scrollWheelZoom === 'center') {\n\t\t\tmap.setZoom(zoom + delta);\n\t\t} else {\n\t\t\tmap.setZoomAround(this._lastMousePos, zoom + delta);\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property scrollWheelZoom: Handler\n// Scroll wheel zoom handler.\nMap.addInitHook('addHandler', 'scrollWheelZoom', ScrollWheelZoom);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as DomEvent from '../../dom/DomEvent';\nimport {Point} from '../../geometry/Point';\nimport * as Util from '../../core/Util';\nimport Browser from '../../core/Browser';\n\n/*\n * L.Map.TapHold is used to simulate `contextmenu` event on long hold,\n * which otherwise is not fired by mobile Safari.\n */\n\nvar tapHoldDelay = 600;\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @section Touch interaction options\n\t// @option tapHold: Boolean\n\t// Enables simulation of `contextmenu` event, default is `true` for mobile Safari.\n\ttapHold: Browser.touchNative && Browser.safari && Browser.mobile,\n\n\t// @option tapTolerance: Number = 15\n\t// The max number of pixels a user can shift his finger during touch\n\t// for it to be considered a valid tap.\n\ttapTolerance: 15\n});\n\nexport var TapHold = Handler.extend({\n\taddHooks: function () {\n\t\tDomEvent.on(this._map._container, 'touchstart', this._onDown, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tDomEvent.off(this._map._container, 'touchstart', this._onDown, this);\n\t},\n\n\t_onDown: function (e) {\n\t\tclearTimeout(this._holdTimeout);\n\t\tif (e.touches.length !== 1) { return; }\n\n\t\tvar first = e.touches[0];\n\t\tthis._startPos = this._newPos = new Point(first.clientX, first.clientY);\n\n\t\tthis._holdTimeout = setTimeout(Util.bind(function () {\n\t\t\tthis._cancel();\n\t\t\tif (!this._isTapValid()) { return; }\n\n\t\t\t// prevent simulated mouse events https://w3c.github.io/touch-events/#mouse-events\n\t\t\tDomEvent.on(document, 'touchend', DomEvent.preventDefault);\n\t\t\tDomEvent.on(document, 'touchend touchcancel', this._cancelClickPrevent);\n\t\t\tthis._simulateEvent('contextmenu', first);\n\t\t}, this), tapHoldDelay);\n\n\t\tDomEvent.on(document, 'touchend touchcancel contextmenu', this._cancel, this);\n\t\tDomEvent.on(document, 'touchmove', this._onMove, this);\n\t},\n\n\t_cancelClickPrevent: function cancelClickPrevent() {\n\t\tDomEvent.off(document, 'touchend', DomEvent.preventDefault);\n\t\tDomEvent.off(document, 'touchend touchcancel', cancelClickPrevent);\n\t},\n\n\t_cancel: function () {\n\t\tclearTimeout(this._holdTimeout);\n\t\tDomEvent.off(document, 'touchend touchcancel contextmenu', this._cancel, this);\n\t\tDomEvent.off(document, 'touchmove', this._onMove, this);\n\t},\n\n\t_onMove: function (e) {\n\t\tvar first = e.touches[0];\n\t\tthis._newPos = new Point(first.clientX, first.clientY);\n\t},\n\n\t_isTapValid: function () {\n\t\treturn this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance;\n\t},\n\n\t_simulateEvent: function (type, e) {\n\t\tvar simulatedEvent = new MouseEvent(type, {\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t\tview: window,\n\t\t\t// detail: 1,\n\t\t\tscreenX: e.screenX,\n\t\t\tscreenY: e.screenY,\n\t\t\tclientX: e.clientX,\n\t\t\tclientY: e.clientY,\n\t\t\t// button: 2,\n\t\t\t// buttons: 2\n\t\t});\n\n\t\tsimulatedEvent._simulated = true;\n\n\t\te.target.dispatchEvent(simulatedEvent);\n\t}\n});\n\n// @section Handlers\n// @property tapHold: Handler\n// Long tap handler to simulate `contextmenu` event (useful in mobile Safari).\nMap.addInitHook('addHandler', 'tapHold', TapHold);\n", "import {Map} from '../Map';\nimport {Handler} from '../../core/Handler';\nimport * as DomEvent from '../../dom/DomEvent';\nimport * as Util from '../../core/Util';\nimport * as DomUtil from '../../dom/DomUtil';\nimport Browser from '../../core/Browser';\n\n/*\n * L.Handler.TouchZoom is used by L.Map to add pinch zoom on supported mobile browsers.\n */\n\n// @namespace Map\n// @section Interaction Options\nMap.mergeOptions({\n\t// @section Touch interaction options\n\t// @option touchZoom: Boolean|String = *\n\t// Whether the map can be zoomed by touch-dragging with two fingers. If\n\t// passed `'center'`, it will zoom to the center of the view regardless of\n\t// where the touch events (fingers) were. Enabled for touch-capable web\n\t// browsers.\n\ttouchZoom: Browser.touch,\n\n\t// @option bounceAtZoomLimits: Boolean = true\n\t// Set it to false if you don't want the map to zoom beyond min/max zoom\n\t// and then bounce back when pinch-zooming.\n\tbounceAtZoomLimits: true\n});\n\nexport var TouchZoom = Handler.extend({\n\taddHooks: function () {\n\t\tDomUtil.addClass(this._map._container, 'leaflet-touch-zoom');\n\t\tDomEvent.on(this._map._container, 'touchstart', this._onTouchStart, this);\n\t},\n\n\tremoveHooks: function () {\n\t\tDomUtil.removeClass(this._map._container, 'leaflet-touch-zoom');\n\t\tDomEvent.off(this._map._container, 'touchstart', this._onTouchStart, this);\n\t},\n\n\t_onTouchStart: function (e) {\n\t\tvar map = this._map;\n\t\tif (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming) { return; }\n\n\t\tvar p1 = map.mouseEventToContainerPoint(e.touches[0]),\n\t\t    p2 = map.mouseEventToContainerPoint(e.touches[1]);\n\n\t\tthis._centerPoint = map.getSize()._divideBy(2);\n\t\tthis._startLatLng = map.containerPointToLatLng(this._centerPoint);\n\t\tif (map.options.touchZoom !== 'center') {\n\t\t\tthis._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2));\n\t\t}\n\n\t\tthis._startDist = p1.distanceTo(p2);\n\t\tthis._startZoom = map.getZoom();\n\n\t\tthis._moved = false;\n\t\tthis._zooming = true;\n\n\t\tmap._stop();\n\n\t\tDomEvent.on(document, 'touchmove', this._onTouchMove, this);\n\t\tDomEvent.on(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n\t\tDomEvent.preventDefault(e);\n\t},\n\n\t_onTouchMove: function (e) {\n\t\tif (!e.touches || e.touches.length !== 2 || !this._zooming) { return; }\n\n\t\tvar map = this._map,\n\t\t    p1 = map.mouseEventToContainerPoint(e.touches[0]),\n\t\t    p2 = map.mouseEventToContainerPoint(e.touches[1]),\n\t\t    scale = p1.distanceTo(p2) / this._startDist;\n\n\t\tthis._zoom = map.getScaleZoom(scale, this._startZoom);\n\n\t\tif (!map.options.bounceAtZoomLimits && (\n\t\t\t(this._zoom < map.getMinZoom() && scale < 1) ||\n\t\t\t(this._zoom > map.getMaxZoom() && scale > 1))) {\n\t\t\tthis._zoom = map._limitZoom(this._zoom);\n\t\t}\n\n\t\tif (map.options.touchZoom === 'center') {\n\t\t\tthis._center = this._startLatLng;\n\t\t\tif (scale === 1) { return; }\n\t\t} else {\n\t\t\t// Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n\t\t\tvar delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint);\n\t\t\tif (scale === 1 && delta.x === 0 && delta.y === 0) { return; }\n\t\t\tthis._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tmap._moveStart(true, false);\n\t\t\tthis._moved = true;\n\t\t}\n\n\t\tUtil.cancelAnimFrame(this._animRequest);\n\n\t\tvar moveFn = Util.bind(map._move, map, this._center, this._zoom, {pinch: true, round: false}, undefined);\n\t\tthis._animRequest = Util.requestAnimFrame(moveFn, this, true);\n\n\t\tDomEvent.preventDefault(e);\n\t},\n\n\t_onTouchEnd: function () {\n\t\tif (!this._moved || !this._zooming) {\n\t\t\tthis._zooming = false;\n\t\t\treturn;\n\t\t}\n\n\t\tthis._zooming = false;\n\t\tUtil.cancelAnimFrame(this._animRequest);\n\n\t\tDomEvent.off(document, 'touchmove', this._onTouchMove, this);\n\t\tDomEvent.off(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n\t\t// Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.\n\t\tif (this._map.options.zoomAnimation) {\n\t\t\tthis._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap);\n\t\t} else {\n\t\t\tthis._map._resetView(this._center, this._map._limitZoom(this._zoom));\n\t\t}\n\t}\n});\n\n// @section Handlers\n// @property touchZoom: Handler\n// Touch zoom handler.\nMap.addInitHook('addHandler', 'touchZoom', TouchZoom);\n", "import {Map} from './Map';\nimport {BoxZoom} from './handler/Map.BoxZoom';\nMap.BoxZoom = BoxZoom;\nimport {DoubleClickZoom} from './handler/Map.DoubleClickZoom';\nMap.DoubleClickZoom = DoubleClickZoom;\nimport {Drag} from './handler/Map.Drag';\nMap.Drag = Drag;\nimport {Keyboard} from './handler/Map.Keyboard';\nMap.Keyboard = Keyboard;\nimport {ScrollWheelZoom} from './handler/Map.ScrollWheelZoom';\nMap.ScrollWheelZoom = ScrollWheelZoom;\nimport {TapHold} from './handler/Map.TapHold';\nMap.TapHold = TapHold;\nimport {TouchZoom} from './handler/Map.TouchZoom';\nMap.TouchZoom = TouchZoom;\n\nexport {Map, createMap as map} from './Map';\n", "/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n    extendStatics = Object.setPrototypeOf ||\r\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n        function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n    return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n    if (typeof b !== \"function\" && b !== null)\r\n        throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n    extendStatics(d, b);\r\n    function __() { this.constructor = d; }\r\n    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n    __assign = Object.assign || function __assign(t) {\r\n        for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n            s = arguments[i];\r\n            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n        }\r\n        return t;\r\n    }\r\n    return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n    var t = {};\r\n    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n        t[p] = s[p];\r\n    if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n                t[p[i]] = s[p[i]];\r\n        }\r\n    return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n    return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n    function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n    var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n    var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n    var _, done = false;\r\n    for (var i = decorators.length - 1; i >= 0; i--) {\r\n        var context = {};\r\n        for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n        for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n        context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n        var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n        if (kind === \"accessor\") {\r\n            if (result === void 0) continue;\r\n            if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n            if (_ = accept(result.get)) descriptor.get = _;\r\n            if (_ = accept(result.set)) descriptor.set = _;\r\n            if (_ = accept(result.init)) initializers.unshift(_);\r\n        }\r\n        else if (_ = accept(result)) {\r\n            if (kind === \"field\") initializers.unshift(_);\r\n            else descriptor[key] = _;\r\n        }\r\n    }\r\n    if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n    done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n    var useValue = arguments.length > 2;\r\n    for (var i = 0; i < initializers.length; i++) {\r\n        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n    }\r\n    return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n    return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n    if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n    return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n    return new (P || (P = Promise))(function (resolve, reject) {\r\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n    });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n    return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n    function verb(n) { return function (v) { return step([n, v]); }; }\r\n    function step(op) {\r\n        if (f) throw new TypeError(\"Generator is already executing.\");\r\n        while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n            if (y = 0, t) op = [op[0] & 2, t.value];\r\n            switch (op[0]) {\r\n                case 0: case 1: t = op; break;\r\n                case 4: _.label++; return { value: op[1], done: false };\r\n                case 5: _.label++; y = op[1]; op = [0]; continue;\r\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n                default:\r\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n                    if (t[2]) _.ops.pop();\r\n                    _.trys.pop(); continue;\r\n            }\r\n            op = body.call(thisArg, _);\r\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n    }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    var desc = Object.getOwnPropertyDescriptor(m, k);\r\n    if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n        desc = { enumerable: true, get: function() { return m[k]; } };\r\n    }\r\n    Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n    if (k2 === undefined) k2 = k;\r\n    o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n    for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n    var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n    if (m) return m.call(o);\r\n    if (o && typeof o.length === \"number\") return {\r\n        next: function () {\r\n            if (o && i >= o.length) o = void 0;\r\n            return { value: o && o[i++], done: !o };\r\n        }\r\n    };\r\n    throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n    var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n    if (!m) return o;\r\n    var i = m.call(o), r, ar = [], e;\r\n    try {\r\n        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n    }\r\n    catch (error) { e = { error: error }; }\r\n    finally {\r\n        try {\r\n            if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n        }\r\n        finally { if (e) throw e.error; }\r\n    }\r\n    return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n    for (var ar = [], i = 0; i < arguments.length; i++)\r\n        ar = ar.concat(__read(arguments[i]));\r\n    return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n    for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n    for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n        for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n            r[k] = a[j];\r\n    return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n        if (ar || !(i in from)) {\r\n            if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n            ar[i] = from[i];\r\n        }\r\n    }\r\n    return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n    return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n    return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n    function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n    function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n    function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n    function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n    function fulfill(value) { resume(\"next\", value); }\r\n    function reject(value) { resume(\"throw\", value); }\r\n    function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n    var i, p;\r\n    return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n    function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n    if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n    var m = o[Symbol.asyncIterator], i;\r\n    return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n    function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n    function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n    if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n    return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n    Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n    o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n    if (mod && mod.__esModule) return mod;\r\n    var result = {};\r\n    if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n    __setModuleDefault(result, mod);\r\n    return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n    return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n    return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n    if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n    if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n    if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n    return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n    if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n    return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n    if (value !== null && value !== void 0) {\r\n        if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n        var dispose, inner;\r\n        if (async) {\r\n            if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n            dispose = value[Symbol.asyncDispose];\r\n        }\r\n        if (dispose === void 0) {\r\n            if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n            dispose = value[Symbol.dispose];\r\n            if (async) inner = dispose;\r\n        }\r\n        if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n        if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n        env.stack.push({ value: value, dispose: dispose, async: async });\r\n    }\r\n    else if (async) {\r\n        env.stack.push({ async: true });\r\n    }\r\n    return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n    var e = new Error(message);\r\n    return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n    function fail(e) {\r\n        env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n        env.hasError = true;\r\n    }\r\n    var r, s = 0;\r\n    function next() {\r\n        while (r = env.stack.pop()) {\r\n            try {\r\n                if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n                if (r.dispose) {\r\n                    var result = r.dispose.call(r.value);\r\n                    if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n                }\r\n                else s |= 1;\r\n            }\r\n            catch (e) {\r\n                fail(e);\r\n            }\r\n        }\r\n        if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n        if (env.hasError) throw env.error;\r\n    }\r\n    return next();\r\n}\r\n\r\nexport default {\r\n    __extends: __extends,\r\n    __assign: __assign,\r\n    __rest: __rest,\r\n    __decorate: __decorate,\r\n    __param: __param,\r\n    __metadata: __metadata,\r\n    __awaiter: __awaiter,\r\n    __generator: __generator,\r\n    __createBinding: __createBinding,\r\n    __exportStar: __exportStar,\r\n    __values: __values,\r\n    __read: __read,\r\n    __spread: __spread,\r\n    __spreadArrays: __spreadArrays,\r\n    __spreadArray: __spreadArray,\r\n    __await: __await,\r\n    __asyncGenerator: __asyncGenerator,\r\n    __asyncDelegator: __asyncDelegator,\r\n    __asyncValues: __asyncValues,\r\n    __makeTemplateObject: __makeTemplateObject,\r\n    __importStar: __importStar,\r\n    __importDefault: __importDefault,\r\n    __classPrivateFieldGet: __classPrivateFieldGet,\r\n    __classPrivateFieldSet: __classPrivateFieldSet,\r\n    __classPrivateFieldIn: __classPrivateFieldIn,\r\n    __addDisposableResource: __addDisposableResource,\r\n    __disposeResources: __disposeResources,\r\n};\r\n", "'use strict';\n\nmodule.exports = Point;\n\n/**\n * A standalone point geometry with useful accessor, comparison, and\n * modification methods.\n *\n * @class Point\n * @param {Number} x the x-coordinate. this could be longitude or screen\n * pixels, or any other sort of unit.\n * @param {Number} y the y-coordinate. this could be latitude or screen\n * pixels, or any other sort of unit.\n * @example\n * var point = new Point(-77, 38);\n */\nfunction Point(x, y) {\n    this.x = x;\n    this.y = y;\n}\n\nPoint.prototype = {\n\n    /**\n     * Clone this point, returning a new point that can be modified\n     * without affecting the old one.\n     * @return {Point} the clone\n     */\n    clone: function() { return new Point(this.x, this.y); },\n\n    /**\n     * Add this point's x & y coordinates to another point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    add:     function(p) { return this.clone()._add(p); },\n\n    /**\n     * Subtract this point's x & y coordinates to from point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    sub:     function(p) { return this.clone()._sub(p); },\n\n    /**\n     * Multiply this point's x & y coordinates by point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    multByPoint:    function(p) { return this.clone()._multByPoint(p); },\n\n    /**\n     * Divide this point's x & y coordinates by point,\n     * yielding a new point.\n     * @param {Point} p the other point\n     * @return {Point} output point\n     */\n    divByPoint:     function(p) { return this.clone()._divByPoint(p); },\n\n    /**\n     * Multiply this point's x & y coordinates by a factor,\n     * yielding a new point.\n     * @param {Point} k factor\n     * @return {Point} output point\n     */\n    mult:    function(k) { return this.clone()._mult(k); },\n\n    /**\n     * Divide this point's x & y coordinates by a factor,\n     * yielding a new point.\n     * @param {Point} k factor\n     * @return {Point} output point\n     */\n    div:     function(k) { return this.clone()._div(k); },\n\n    /**\n     * Rotate this point around the 0, 0 origin by an angle a,\n     * given in radians\n     * @param {Number} a angle to rotate around, in radians\n     * @return {Point} output point\n     */\n    rotate:  function(a) { return this.clone()._rotate(a); },\n\n    /**\n     * Rotate this point around p point by an angle a,\n     * given in radians\n     * @param {Number} a angle to rotate around, in radians\n     * @param {Point} p Point to rotate around\n     * @return {Point} output point\n     */\n    rotateAround:  function(a,p) { return this.clone()._rotateAround(a,p); },\n\n    /**\n     * Multiply this point by a 4x1 transformation matrix\n     * @param {Array<Number>} m transformation matrix\n     * @return {Point} output point\n     */\n    matMult: function(m) { return this.clone()._matMult(m); },\n\n    /**\n     * Calculate this point but as a unit vector from 0, 0, meaning\n     * that the distance from the resulting point to the 0, 0\n     * coordinate will be equal to 1 and the angle from the resulting\n     * point to the 0, 0 coordinate will be the same as before.\n     * @return {Point} unit vector point\n     */\n    unit:    function() { return this.clone()._unit(); },\n\n    /**\n     * Compute a perpendicular point, where the new y coordinate\n     * is the old x coordinate and the new x coordinate is the old y\n     * coordinate multiplied by -1\n     * @return {Point} perpendicular point\n     */\n    perp:    function() { return this.clone()._perp(); },\n\n    /**\n     * Return a version of this point with the x & y coordinates\n     * rounded to integers.\n     * @return {Point} rounded point\n     */\n    round:   function() { return this.clone()._round(); },\n\n    /**\n     * Return the magitude of this point: this is the Euclidean\n     * distance from the 0, 0 coordinate to this point's x and y\n     * coordinates.\n     * @return {Number} magnitude\n     */\n    mag: function() {\n        return Math.sqrt(this.x * this.x + this.y * this.y);\n    },\n\n    /**\n     * Judge whether this point is equal to another point, returning\n     * true or false.\n     * @param {Point} other the other point\n     * @return {boolean} whether the points are equal\n     */\n    equals: function(other) {\n        return this.x === other.x &&\n               this.y === other.y;\n    },\n\n    /**\n     * Calculate the distance from this point to another point\n     * @param {Point} p the other point\n     * @return {Number} distance\n     */\n    dist: function(p) {\n        return Math.sqrt(this.distSqr(p));\n    },\n\n    /**\n     * Calculate the distance from this point to another point,\n     * without the square root step. Useful if you're comparing\n     * relative distances.\n     * @param {Point} p the other point\n     * @return {Number} distance\n     */\n    distSqr: function(p) {\n        var dx = p.x - this.x,\n            dy = p.y - this.y;\n        return dx * dx + dy * dy;\n    },\n\n    /**\n     * Get the angle from the 0, 0 coordinate to this point, in radians\n     * coordinates.\n     * @return {Number} angle\n     */\n    angle: function() {\n        return Math.atan2(this.y, this.x);\n    },\n\n    /**\n     * Get the angle from this point to another point, in radians\n     * @param {Point} b the other point\n     * @return {Number} angle\n     */\n    angleTo: function(b) {\n        return Math.atan2(this.y - b.y, this.x - b.x);\n    },\n\n    /**\n     * Get the angle between this point and another point, in radians\n     * @param {Point} b the other point\n     * @return {Number} angle\n     */\n    angleWith: function(b) {\n        return this.angleWithSep(b.x, b.y);\n    },\n\n    /*\n     * Find the angle of the two vectors, solving the formula for\n     * the cross product a x b = |a||b|sin(Î¸) for Î¸.\n     * @param {Number} x the x-coordinate\n     * @param {Number} y the y-coordinate\n     * @return {Number} the angle in radians\n     */\n    angleWithSep: function(x, y) {\n        return Math.atan2(\n            this.x * y - this.y * x,\n            this.x * x + this.y * y);\n    },\n\n    _matMult: function(m) {\n        var x = m[0] * this.x + m[1] * this.y,\n            y = m[2] * this.x + m[3] * this.y;\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    _add: function(p) {\n        this.x += p.x;\n        this.y += p.y;\n        return this;\n    },\n\n    _sub: function(p) {\n        this.x -= p.x;\n        this.y -= p.y;\n        return this;\n    },\n\n    _mult: function(k) {\n        this.x *= k;\n        this.y *= k;\n        return this;\n    },\n\n    _div: function(k) {\n        this.x /= k;\n        this.y /= k;\n        return this;\n    },\n\n    _multByPoint: function(p) {\n        this.x *= p.x;\n        this.y *= p.y;\n        return this;\n    },\n\n    _divByPoint: function(p) {\n        this.x /= p.x;\n        this.y /= p.y;\n        return this;\n    },\n\n    _unit: function() {\n        this._div(this.mag());\n        return this;\n    },\n\n    _perp: function() {\n        var y = this.y;\n        this.y = this.x;\n        this.x = -y;\n        return this;\n    },\n\n    _rotate: function(angle) {\n        var cos = Math.cos(angle),\n            sin = Math.sin(angle),\n            x = cos * this.x - sin * this.y,\n            y = sin * this.x + cos * this.y;\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    _rotateAround: function(angle, p) {\n        var cos = Math.cos(angle),\n            sin = Math.sin(angle),\n            x = p.x + cos * (this.x - p.x) - sin * (this.y - p.y),\n            y = p.y + sin * (this.x - p.x) + cos * (this.y - p.y);\n        this.x = x;\n        this.y = y;\n        return this;\n    },\n\n    _round: function() {\n        this.x = Math.round(this.x);\n        this.y = Math.round(this.y);\n        return this;\n    }\n};\n\n/**\n * Construct a point from an array if necessary, otherwise if the input\n * is already a Point, or an unknown type, return it unchanged\n * @param {Array<Number>|Point|*} a any kind of input value\n * @return {Point} constructed point, or passed-through value.\n * @example\n * // this\n * var point = Point.convert([0, 1]);\n * // is equivalent to\n * var point = new Point(0, 1);\n */\nPoint.convert = function (a) {\n    if (a instanceof Point) {\n        return a;\n    }\n    if (Array.isArray(a)) {\n        return new Point(a[0], a[1]);\n    }\n    return a;\n};\n", "'use strict';\n\nmodule.exports = UnitBezier;\n\nfunction UnitBezier(p1x, p1y, p2x, p2y) {\n    // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n    this.cx = 3.0 * p1x;\n    this.bx = 3.0 * (p2x - p1x) - this.cx;\n    this.ax = 1.0 - this.cx - this.bx;\n\n    this.cy = 3.0 * p1y;\n    this.by = 3.0 * (p2y - p1y) - this.cy;\n    this.ay = 1.0 - this.cy - this.by;\n\n    this.p1x = p1x;\n    this.p1y = p1y;\n    this.p2x = p2x;\n    this.p2y = p2y;\n}\n\nUnitBezier.prototype = {\n    sampleCurveX: function (t) {\n        // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n        return ((this.ax * t + this.bx) * t + this.cx) * t;\n    },\n\n    sampleCurveY: function (t) {\n        return ((this.ay * t + this.by) * t + this.cy) * t;\n    },\n\n    sampleCurveDerivativeX: function (t) {\n        return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n    },\n\n    solveCurveX: function (x, epsilon) {\n        if (epsilon === undefined) epsilon = 1e-6;\n\n        if (x < 0.0) return 0.0;\n        if (x > 1.0) return 1.0;\n\n        var t = x;\n\n        // First try a few iterations of Newton's method - normally very fast.\n        for (var i = 0; i < 8; i++) {\n            var x2 = this.sampleCurveX(t) - x;\n            if (Math.abs(x2) < epsilon) return t;\n\n            var d2 = this.sampleCurveDerivativeX(t);\n            if (Math.abs(d2) < 1e-6) break;\n\n            t = t - x2 / d2;\n        }\n\n        // Fall back to the bisection method for reliability.\n        var t0 = 0.0;\n        var t1 = 1.0;\n        t = x;\n\n        for (i = 0; i < 20; i++) {\n            x2 = this.sampleCurveX(t);\n            if (Math.abs(x2 - x) < epsilon) break;\n\n            if (x > x2) {\n                t0 = t;\n            } else {\n                t1 = t;\n            }\n\n            t = (t1 - t0) * 0.5 + t0;\n        }\n\n        return t;\n    },\n\n    solve: function (x, epsilon) {\n        return this.sampleCurveY(this.solveCurveX(x, epsilon));\n    }\n};\n", "let supportsOffscreenCanvas: boolean;\n\nexport function offscreenCanvasSupported(): boolean {\n    if (supportsOffscreenCanvas == null) {\n        supportsOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' &&\n            new OffscreenCanvas(1, 1).getContext('2d') &&\n            typeof createImageBitmap === 'function';\n    }\n\n    return supportsOffscreenCanvas;\n}\n", "import {offscreenCanvasSupported} from './offscreen_canvas_supported';\n\nlet offscreenCanvasDistorted: boolean;\n\n/**\n * Some browsers don't return the exact pixels from a canvas to prevent user fingerprinting (see #3185).\n * This function writes pixels to an OffscreenCanvas and reads them back using getImageData, returning false\n * if they don't match.\n *\n * @returns true if the browser supports OffscreenCanvas but it distorts getImageData results, false otherwise.\n */\nexport function isOffscreenCanvasDistorted(): boolean {\n    if (offscreenCanvasDistorted == null) {\n        offscreenCanvasDistorted = false;\n        if (offscreenCanvasSupported()) {\n            const size = 5;\n            const canvas = new OffscreenCanvas(size, size);\n            const context = canvas.getContext('2d', {willReadFrequently: true});\n            if (context) {\n                // fill each pixel with an RGB value that should make the byte at index i equal to i (except alpha channel):\n                // [0, 1, 2, 255, 4, 5, 6, 255, 8, 9, 10, 255, ...]\n                for (let i = 0; i < size * size; i++) {\n                    const base = i * 4;\n                    context.fillStyle = `rgb(${base},${base + 1},${base + 2})`;\n                    context.fillRect(i % size, Math.floor(i / size), 1, 1);\n                }\n                const data = context.getImageData(0, 0, size, size).data;\n                for (let i = 0; i < size * size * 4; i++) {\n                    if (i % 4 !== 3 && data[i] !== i) {\n                        offscreenCanvasDistorted = true;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    return offscreenCanvasDistorted || false;\n}\n", "import Point from '@mapbox/point-geometry';\nimport UnitBezier from '@mapbox/unitbezier';\nimport {isOffscreenCanvasDistorted} from './offscreen_canvas_distorted';\nimport type {Size} from './image';\nimport type {WorkerGlobalScopeInterface} from './web_worker';\n\n/**\n * For a given collection of 2D points, returns their axis-aligned bounding box,\n * in the format [minX, minY, maxX, maxY].\n */\nexport function getAABB(points: Array<Point>): [number, number, number, number] {\n    let tlX = Infinity;\n    let tlY = Infinity;\n    let brX = -Infinity;\n    let brY = -Infinity;\n\n    for (const p of points) {\n        tlX = Math.min(tlX, p.x);\n        tlY = Math.min(tlY, p.y);\n        brX = Math.max(brX, p.x);\n        brY = Math.max(brY, p.y);\n    }\n\n    return [tlX, tlY, brX, brY];\n}\n\n/**\n * Given a value `t` that varies between 0 and 1, return\n * an interpolation function that eases between 0 and 1 in a pleasing\n * cubic in-out fashion.\n */\nexport function easeCubicInOut(t: number): number {\n    if (t <= 0) return 0;\n    if (t >= 1) return 1;\n    const t2 = t * t,\n        t3 = t2 * t;\n    return 4 * (t < 0.5 ? t3 : 3 * (t - t2) + t3 - 0.75);\n}\n\n/**\n * Given given (x, y), (x1, y1) control points for a bezier curve,\n * return a function that interpolates along that curve.\n *\n * @param p1x - control point 1 x coordinate\n * @param p1y - control point 1 y coordinate\n * @param p2x - control point 2 x coordinate\n * @param p2y - control point 2 y coordinate\n */\nexport function bezier(p1x: number, p1y: number, p2x: number, p2y: number): (t: number) => number {\n    const bezier = new UnitBezier(p1x, p1y, p2x, p2y);\n    return (t: number) => {\n        return bezier.solve(t);\n    };\n}\n\n/**\n * A default bezier-curve powered easing function with\n * control points (0.25, 0.1) and (0.25, 1)\n */\nexport const defaultEasing = bezier(0.25, 0.1, 0.25, 1);\n\n/**\n * constrain n to the given range via min + max\n *\n * @param n - value\n * @param min - the minimum value to be returned\n * @param max - the maximum value to be returned\n * @returns the clamped value\n */\nexport function clamp(n: number, min: number, max: number): number {\n    return Math.min(max, Math.max(min, n));\n}\n\n/**\n * constrain n to the given range, excluding the minimum, via modular arithmetic\n *\n * @param n - value\n * @param min - the minimum value to be returned, exclusive\n * @param max - the maximum value to be returned, inclusive\n * @returns constrained number\n */\nexport function wrap(n: number, min: number, max: number): number {\n    const d = max - min;\n    const w = ((n - min) % d + d) % d + min;\n    return (w === min) ? max : w;\n}\n\n/**\n * Compute the difference between the keys in one object and the keys\n * in another object.\n *\n * @returns keys difference\n */\nexport function keysDifference<S, T>(\n    obj: {[key: string]: S},\n    other: {[key: string]: T}\n): Array<string> {\n    const difference = [];\n    for (const i in obj) {\n        if (!(i in other)) {\n            difference.push(i);\n        }\n    }\n    return difference;\n}\n\n/**\n * Given a destination object and optionally many source objects,\n * copy all properties from the source objects into the destination.\n * The last source object given overrides properties from previous\n * source objects.\n *\n * @param dest - destination object\n * @param sources - sources from which properties are pulled\n */\nexport function extend<T extends {}, U>(dest: T, source: U): T & U;\nexport function extend<T extends {}, U, V>(dest: T, source1: U, source2: V): T & U & V;\nexport function extend<T extends {}, U, V, W>(dest: T, source1: U, source2: V, source3: W): T & U & V & W;\nexport function extend(dest: object, ...sources: Array<any>): any;\nexport function extend(dest: object, ...sources: Array<any>): any {\n    for (const src of sources) {\n        for (const k in src) {\n            dest[k] = src[k];\n        }\n    }\n    return dest;\n}\n\n// See https://stackoverflow.com/questions/49401866/all-possible-keys-of-an-union-type\ntype KeysOfUnion<T> = T extends T ? keyof T: never;\n\n/**\n * Given an object and a number of properties as strings, return version\n * of that object with only those properties.\n *\n * @param src - the object\n * @param properties - an array of property names chosen\n * to appear on the resulting object.\n * @returns object with limited properties.\n * @example\n * ```ts\n * let foo = { name: 'Charlie', age: 10 };\n * let justName = pick(foo, ['name']); // justName = { name: 'Charlie' }\n * ```\n */\nexport function pick<T extends object>(src: T, properties: Array<KeysOfUnion<T>>): Partial<T> {\n    const result: Partial<T> = {};\n    for (let i = 0; i < properties.length; i++) {\n        const k = properties[i];\n        if (k in src) {\n            result[k] = src[k];\n        }\n    }\n    return result;\n}\n\nlet id = 1;\n\n/**\n * Return a unique numeric id, starting at 1 and incrementing with\n * each call.\n *\n * @returns unique numeric id.\n */\nexport function uniqueId(): number {\n    return id++;\n}\n\n/**\n * Return whether a given value is a power of two\n */\nexport function isPowerOfTwo(value: number): boolean {\n    return (Math.log(value) / Math.LN2) % 1 === 0;\n}\n\n/**\n * Return the next power of two, or the input value if already a power of two\n */\nexport function nextPowerOfTwo(value: number): number {\n    if (value <= 1) return 1;\n    return Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n}\n\n/**\n * Create an object by mapping all the values of an existing object while\n * preserving their keys.\n */\nexport function mapObject(input: any, iterator: Function, context?: any): any {\n    const output = {};\n    for (const key in input) {\n        output[key] = iterator.call(context || this, input[key], key, input);\n    }\n    return output;\n}\n\n/**\n * Create an object by filtering out values of an existing object.\n */\nexport function filterObject(input: any, iterator: Function, context?: any): any {\n    const output = {};\n    for (const key in input) {\n        if (iterator.call(context || this, input[key], key, input)) {\n            output[key] = input[key];\n        }\n    }\n    return output;\n}\n\n/**\n * Deeply compares two object literals.\n * @param a - first object literal to be compared\n * @param b - second object literal to be compared\n * @returns true if the two object literals are deeply equal, false otherwise\n */\nexport function deepEqual(a?: unknown | null, b?: unknown | null): boolean {\n    if (Array.isArray(a)) {\n        if (!Array.isArray(b) || a.length !== b.length) return false;\n        for (let i = 0; i < a.length; i++) {\n            if (!deepEqual(a[i], b[i])) return false;\n        }\n        return true;\n    }\n    if (typeof a === 'object' && a !== null && b !== null) {\n        if (!(typeof b === 'object')) return false;\n        const keys = Object.keys(a);\n        if (keys.length !== Object.keys(b).length) return false;\n        for (const key in a) {\n            if (!deepEqual(a[key], b[key])) return false;\n        }\n        return true;\n    }\n    return a === b;\n}\n\n/**\n * Deeply clones two objects.\n */\nexport function clone<T>(input: T): T {\n    if (Array.isArray(input)) {\n        return input.map(clone) as any as T;\n    } else if (typeof input === 'object' && input) {\n        return mapObject(input, clone) as any as T;\n    } else {\n        return input;\n    }\n}\n\n/**\n * Check if two arrays have at least one common element.\n */\nexport function arraysIntersect<T>(a: Array<T>, b: Array<T>): boolean {\n    for (let l = 0; l < a.length; l++) {\n        if (b.indexOf(a[l]) >= 0) return true;\n    }\n    return false;\n}\n\n/**\n * Print a warning message to the console and ensure duplicate warning messages\n * are not printed.\n */\nconst warnOnceHistory: {[key: string]: boolean} = {};\n\nexport function warnOnce(message: string): void {\n    if (!warnOnceHistory[message]) {\n        // console isn't defined in some WebWorkers, see #2558\n        if (typeof console !== 'undefined') console.warn(message);\n        warnOnceHistory[message] = true;\n    }\n}\n\n/**\n * Indicates if the provided Points are in a counter clockwise (true) or clockwise (false) order\n *\n * @returns true for a counter clockwise set of points\n */\n// https://bryceboe.com/2006/10/23/line-segment-intersection-algorithm/\nexport function isCounterClockwise(a: Point, b: Point, c: Point): boolean {\n    return (c.y - a.y) * (b.x - a.x) > (b.y - a.y) * (c.x - a.x);\n}\n\n/**\n * For two lines a and b in 2d space, defined by any two points along the lines,\n * find the intersection point, or return null if the lines are parallel\n *\n * @param a1 - First point on line a\n * @param a2 - Second point on line a\n * @param b1 - First point on line b\n * @param b2 - Second point on line b\n *\n * @returns the intersection point of the two lines or null if they are parallel\n */\nexport function findLineIntersection(a1: Point, a2: Point, b1: Point, b2: Point): Point | null {\n    const aDeltaY = a2.y - a1.y;\n    const aDeltaX = a2.x - a1.x;\n    const bDeltaY = b2.y - b1.y;\n    const bDeltaX = b2.x - b1.x;\n\n    const denominator = (bDeltaY * aDeltaX) - (bDeltaX * aDeltaY);\n\n    if (denominator === 0) {\n        // Lines are parallel\n        return null;\n    }\n\n    const originDeltaY = a1.y - b1.y;\n    const originDeltaX = a1.x - b1.x;\n    const aInterpolation = (bDeltaX * originDeltaY - bDeltaY * originDeltaX) / denominator;\n\n    // Find intersection by projecting out from origin of first segment\n    return new Point(a1.x + (aInterpolation * aDeltaX), a1.y + (aInterpolation * aDeltaY));\n}\n\n/**\n * Converts spherical coordinates to cartesian coordinates.\n *\n * @param spherical - Spherical coordinates, in [radial, azimuthal, polar]\n * @returns cartesian coordinates in [x, y, z]\n */\n\nexport function sphericalToCartesian([r, azimuthal, polar]: [number, number, number]): {\n    x: number;\n    y: number;\n    z: number;\n} {\n    // We abstract \"north\"/\"up\" (compass-wise) to be 0Â° when really this is 90Â° (Ï/2):\n    // correct for that here\n    azimuthal += 90;\n\n    // Convert azimuthal and polar angles to radians\n    azimuthal *= Math.PI / 180;\n    polar *= Math.PI / 180;\n\n    return {\n        x: r * Math.cos(azimuthal) * Math.sin(polar),\n        y: r * Math.sin(azimuthal) * Math.sin(polar),\n        z: r * Math.cos(polar)\n    };\n}\n\n/**\n *  Returns true if the when run in the web-worker context.\n *\n * @returns `true` if the when run in the web-worker context.\n */\nexport function isWorker(self: any): self is WorkerGlobalScopeInterface {\n    // @ts-ignore\n    return typeof WorkerGlobalScope !== 'undefined' && typeof self !== 'undefined' && self instanceof WorkerGlobalScope;\n}\n\n/**\n * Parses data from 'Cache-Control' headers.\n *\n * @param cacheControl - Value of 'Cache-Control' header\n * @returns object containing parsed header info.\n */\n\nexport function parseCacheControl(cacheControl: string): any {\n    // Taken from [Wreck](https://github.com/hapijs/wreck)\n    const re = /(?:^|(?:\\s*\\,\\s*))([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)(?:\\=(?:([^\\x00-\\x20\\(\\)<>@\\,;\\:\\\\\"\\/\\[\\]\\?\\=\\{\\}\\x7F]+)|(?:\\\"((?:[^\"\\\\]|\\\\.)*)\\\")))?/g;\n\n    const header = {};\n    cacheControl.replace(re, ($0, $1, $2, $3) => {\n        const value = $2 || $3;\n        header[$1] = value ? value.toLowerCase() : true;\n        return '';\n    });\n\n    if (header['max-age']) {\n        const maxAge = parseInt(header['max-age'], 10);\n        if (isNaN(maxAge)) delete header['max-age'];\n        else header['max-age'] = maxAge;\n    }\n\n    return header;\n}\n\nlet _isSafari = null;\n\n/**\n * Returns true when run in WebKit derived browsers.\n * This is used as a workaround for a memory leak in Safari caused by using Transferable objects to\n * transfer data between WebWorkers and the main thread.\n * https://github.com/mapbox/mapbox-gl-js/issues/8771\n *\n * This should be removed once the underlying Safari issue is fixed.\n *\n * @param scope - Since this function is used both on the main thread and WebWorker context,\n *      let the calling scope pass in the global scope object.\n * @returns `true` when run in WebKit derived browsers.\n */\nexport function isSafari(scope: any): boolean {\n    if (_isSafari == null) {\n        const userAgent = scope.navigator ? scope.navigator.userAgent : null;\n        _isSafari = !!scope.safari ||\n        !!(userAgent && (/\\b(iPad|iPhone|iPod)\\b/.test(userAgent) || (!!userAgent.match('Safari') && !userAgent.match('Chrome'))));\n    }\n    return _isSafari;\n}\n\nexport function storageAvailable(type: string): boolean {\n    try {\n        const storage = window[type];\n        storage.setItem('_mapbox_test_', 1);\n        storage.removeItem('_mapbox_test_');\n        return true;\n    } catch (e) {\n        return false;\n    }\n}\n\n// The following methods are from https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding#The_Unicode_Problem\n//Unicode compliant base64 encoder for strings\nexport function b64EncodeUnicode(str: string) {\n    return btoa(\n        encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n            (match, p1) => {\n                return String.fromCharCode(Number('0x' + p1)); //eslint-disable-line\n            }\n        )\n    );\n}\n\n// Unicode compliant decoder for base64-encoded strings\nexport function b64DecodeUnicode(str: string) {\n    return decodeURIComponent(atob(str).split('').map((c) => {\n        return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); //eslint-disable-line\n    }).join(''));\n}\n\nexport function isImageBitmap(image: any): image is ImageBitmap {\n    return typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap;\n}\n\n/**\n * Converts an ArrayBuffer to an ImageBitmap.\n *\n * Used mostly for testing purposes only, because mocking libs don't know how to work with ArrayBuffers, but work\n * perfectly fine with ImageBitmaps. Might also be used for environments (other than testing) not supporting\n * ArrayBuffers.\n *\n * @param data - Data to convert\n * @returns - A  promise resolved when the conversion is finished\n */\nexport const arrayBufferToImageBitmap = async (data: ArrayBuffer): Promise<ImageBitmap> => {\n    if (data.byteLength === 0) {\n        return createImageBitmap(new ImageData(1, 1));\n    }\n    const blob: Blob = new Blob([new Uint8Array(data)], {type: 'image/png'});\n    try {\n        return createImageBitmap(blob);\n    } catch (e) {\n        throw new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`);\n    }\n};\n\nconst transparentPngUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=';\n\n/**\n * Converts an ArrayBuffer to an HTMLImageElement.\n *\n * Used mostly for testing purposes only, because mocking libs don't know how to work with ArrayBuffers, but work\n * perfectly fine with ImageBitmaps. Might also be used for environments (other than testing) not supporting\n * ArrayBuffers.\n *\n * @param data - Data to convert\n * @returns - A promise resolved when the conversion is finished\n */\nexport const arrayBufferToImage = (data: ArrayBuffer): Promise<HTMLImageElement> => {\n    return new Promise((resolve, reject) => {\n        const img: HTMLImageElement = new Image();\n        img.onload = () => {\n            resolve(img);\n            URL.revokeObjectURL(img.src);\n            // prevent image dataURI memory leak in Safari;\n            // but don't free the image immediately because it might be uploaded in the next frame\n            // https://github.com/mapbox/mapbox-gl-js/issues/10226\n            img.onload = null;\n            window.requestAnimationFrame(() => { img.src = transparentPngUrl; });\n        };\n        img.onerror = () => reject(new Error('Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.'));\n        const blob: Blob = new Blob([new Uint8Array(data)], {type: 'image/png'});\n        img.src = data.byteLength ? URL.createObjectURL(blob) : transparentPngUrl;\n    });\n};\n\n/**\n * Computes the webcodecs VideoFrame API options to select a rectangle out of\n * an image and write it into the destination rectangle.\n *\n * Rect (x/y/width/height) select the overlapping rectangle from the source image\n * and layout (offset/stride) write that overlapping rectangle to the correct place\n * in the destination image.\n *\n * Offset is the byte offset in the dest image that the first pixel appears at\n * and stride is the number of bytes to the start of the next row:\n * âââââââââââââ\n * â  dest     â\n * â       âââââ¼ââââââââ\n * âoffsetââââââ sourceâ\n * â       âââââ       â\n * â       âââââ¼ââââââââ\n * âstride â ââââ\n * ââââââââ    â\n * âââââââââââââ\n *\n * @param image - source image containing a width and height attribute\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns the layout and rect options to pass into VideoFrame API\n */\nfunction computeVideoFrameParameters(image: Size, x: number, y: number, width: number, height: number): VideoFrameCopyToOptions {\n    const destRowOffset = Math.max(-x, 0) * 4;\n    const firstSourceRow = Math.max(0, y);\n    const firstDestRow = firstSourceRow - y;\n    const offset = firstDestRow * width * 4 + destRowOffset;\n    const stride = width * 4;\n\n    const sourceLeft = Math.max(0, x);\n    const sourceTop = Math.max(0, y);\n    const sourceRight = Math.min(image.width, x + width);\n    const sourceBottom = Math.min(image.height, y + height);\n    return {\n        rect: {\n            x: sourceLeft,\n            y: sourceTop,\n            width: sourceRight - sourceLeft,\n            height: sourceBottom - sourceTop\n        },\n        layout: [{offset, stride}]\n    };\n}\n\n/**\n * Reads pixels from an ImageBitmap/Image/canvas using webcodec VideoFrame API.\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image, or the error if an error occurred\n */\nexport async function readImageUsingVideoFrame(\n    image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Promise<Uint8ClampedArray> {\n    if (typeof VideoFrame === 'undefined') {\n        throw new Error('VideoFrame not supported');\n    }\n    const frame = new VideoFrame(image, {timestamp: 0});\n    try {\n        const format = frame?.format;\n        if (!format || !(format.startsWith('BGR') || format.startsWith('RGB'))) {\n            throw new Error(`Unrecognized format ${format}`);\n        }\n        const swapBR = format.startsWith('BGR');\n        const result = new Uint8ClampedArray(width * height * 4);\n        await frame.copyTo(result, computeVideoFrameParameters(image, x, y, width, height));\n        if (swapBR) {\n            for (let i = 0; i < result.length; i += 4) {\n                const tmp = result[i];\n                result[i] = result[i + 2];\n                result[i + 2] = tmp;\n            }\n        }\n        return result;\n    } finally {\n        frame.close();\n    }\n}\n\nlet offscreenCanvas: OffscreenCanvas;\nlet offscreenCanvasContext: OffscreenCanvasRenderingContext2D;\n\n/**\n * Reads pixels from an ImageBitmap/Image/canvas using OffscreenCanvas\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image, or the error if an error occurred\n */\nexport function readImageDataUsingOffscreenCanvas(\n    imgBitmap: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Uint8ClampedArray {\n    const origWidth = imgBitmap.width;\n    const origHeight = imgBitmap.height;\n    // Lazily initialize OffscreenCanvas\n    if (!offscreenCanvas || !offscreenCanvasContext) {\n        // Dem tiles are typically 256x256\n        offscreenCanvas = new OffscreenCanvas(origWidth, origHeight);\n        offscreenCanvasContext = offscreenCanvas.getContext('2d', {willReadFrequently: true});\n    }\n\n    offscreenCanvas.width = origWidth;\n    offscreenCanvas.height = origHeight;\n\n    offscreenCanvasContext.drawImage(imgBitmap, 0, 0, origWidth, origHeight);\n    const imgData = offscreenCanvasContext.getImageData(x, y, width, height);\n    offscreenCanvasContext.clearRect(0, 0, origWidth, origHeight);\n    return imgData.data;\n}\n\n/**\n * Reads RGBA pixels from an preferring OffscreenCanvas, but falling back to VideoFrame if supported and\n * the browser is mangling OffscreenCanvas getImageData results.\n *\n * @param data - image, imagebitmap, or canvas to parse\n * @param x - top-left x coordinate to read from the image\n * @param y - top-left y coordinate to read from the image\n * @param width - width of the rectangle to read from the image\n * @param height - height of the rectangle to read from the image\n * @returns a promise containing the parsed RGBA pixel values of the image\n */\nexport async function getImageData(\n    image: HTMLImageElement | HTMLCanvasElement | ImageBitmap | OffscreenCanvas,\n    x: number, y: number, width: number, height: number\n): Promise<Uint8ClampedArray> {\n    if (isOffscreenCanvasDistorted()) {\n        try {\n            return await readImageUsingVideoFrame(image, x, y, width, height);\n        } catch (e) {\n            // fall back to OffscreenCanvas\n        }\n    }\n    return readImageDataUsingOffscreenCanvas(image, x, y, width, height);\n}\n\nexport interface Subscription {\n    unsubscribe(): void;\n}\n\nexport interface Subscriber {\n    addEventListener: typeof window.addEventListener;\n    removeEventListener: typeof window.removeEventListener;\n}\n\n/**\n * This method is used in order to register an event listener using a lambda function.\n * The return value will allow unsubscribing from the event, without the need to store the method reference.\n * @param target - The target\n * @param message - The message\n * @param listener - The listener\n * @param options - The options\n * @returns a subscription object that can be used to unsubscribe from the event\n */\nexport function subscribe(target: Subscriber, message: keyof WindowEventMap, listener: (...args: any) => void, options: boolean | AddEventListenerOptions): Subscription {\n    target.addEventListener(message, listener, options);\n    return {\n        unsubscribe: () => {\n            target.removeEventListener(message, listener, options);\n        }\n    };\n}\n\n/**\n * This method converts degrees to radians.\n * The return value is the radian value.\n * @param degrees - The number of degrees\n * @returns radians\n */\nexport function degreesToRadians(degrees: number): number {\n    return degrees * Math.PI / 180;\n}\n\n/**\n * Makes optional keys required and add the the undefined type.\n *\n * ```\n * interface Test {\n *  foo: number;\n *  bar?: number;\n *  baz: number | undefined;\n * }\n *\n * Complete<Test> {\n *  foo: number;\n *  bar: number | undefined;\n *  baz: number | undefined;\n * }\n *\n * ```\n *\n * See https://medium.com/terria/typescript-transforming-optional-properties-to-required-properties-that-may-be-undefined-7482cb4e1585\n */\n\nexport type Complete<T> = {\n    [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);\n}\n\nexport type TileJSON = {\n    tilejson: '2.2.0' | '2.1.0' | '2.0.1' | '2.0.0' | '1.0.0';\n    name?: string;\n    description?: string;\n    version?: string;\n    attribution?: string;\n    template?: string;\n    tiles: Array<string>;\n    grids?: Array<string>;\n    data?: Array<string>;\n    minzoom?: number;\n    maxzoom?: number;\n    bounds?: [number, number, number, number];\n    center?: [number, number, number];\n    vector_layers: [{id: string}]; // this is partial but enough for what we need\n};\n\n/**\n * The maximum world tile zoom (Z).\n * In other words, the upper bound supported for tile zoom.\n */\nexport const MAX_TILE_ZOOM = 25;\n\n/**\n * The minimum world tile zoom (Z).\n * In other words, the lower bound supported for tile zoom.\n */\nexport const MIN_TILE_ZOOM = 0;\n", "/**\n * An error message to use when an operation is aborted\n */\nexport const ABORT_ERROR = 'AbortError';\n\n/**\n * Check if an error is an abort error\n * @param error - An error object\n * @returns - true if the error is an abort error\n */\nexport function isAbortError(error: Error): boolean {\n    return error.message === ABORT_ERROR;\n}\n\n/**\n * Use this when you need to create an abort error.\n * @returns An error object with the message \"AbortError\"\n */\nexport function createAbortError(): Error {\n    return new Error(ABORT_ERROR);\n}\n", "import type {RequestParameters, GetResourceResponse} from './ajax';\n\n/**\n * This method type is used to register a protocol handler.\n * Use the abort controller for aborting requests.\n * Return a promise with the relevant resource response.\n */\nexport type AddProtocolAction = (requestParameters: RequestParameters, abortController: AbortController) => Promise<GetResourceResponse<any>>\n\n/**\n * This is a global config object used to store the configuration\n * It is available in the workers as well.\n * Only serializable data should be stored in it.\n */\ntype Config = {\n    MAX_PARALLEL_IMAGE_REQUESTS: number;\n    MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: number;\n    MAX_TILE_CACHE_ZOOM_LEVELS: number;\n    REGISTERED_PROTOCOLS: {[x: string]: AddProtocolAction };\n    WORKER_URL: string;\n};\n\nexport const config: Config = {\n    MAX_PARALLEL_IMAGE_REQUESTS: 16,\n    MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: 8,\n    MAX_TILE_CACHE_ZOOM_LEVELS: 5,\n    REGISTERED_PROTOCOLS: {},\n    WORKER_URL: ''\n};\n", "import {AddProtocolAction, config} from '../util/config';\n\nexport function getProtocol(url: string) {\n    return config.REGISTERED_PROTOCOLS[url.substring(0, url.indexOf('://'))];\n}\n/**\n * Adds a custom load resource function that will be called when using a URL that starts with a custom url schema.\n * This will happen in the main thread, and workers might call it if they don't know how to handle the protocol.\n * The example below will be triggered for custom:// urls defined in the sources list in the style definitions.\n * The function passed will receive the request parameters and should return with the resulting resource,\n * for example a pbf vector tile, non-compressed, represented as ArrayBuffer.\n *\n * @param customProtocol - the protocol to hook, for example 'custom'\n * @param loadFn - the function to use when trying to fetch a tile specified by the customProtocol\n * @example\n * ```ts\n * // This will fetch a file using the fetch API (this is obviously a non interesting example...)\n * addProtocol('custom', async (params, abortController) => {\n *      const t = await fetch(`https://${params.url.split(\"://\")[1]}`);\n *      if (t.status == 200) {\n *          const buffer = await t.arrayBuffer();\n *          return {data: buffer}\n *      } else {\n *          throw new Error(`Tile fetch error: ${t.statusText}`);\n *      }\n *  });\n * // the following is an example of a way to return an error when trying to load a tile\n * addProtocol('custom2', async (params, abortController) => {\n *      throw new Error('someErrorMessage'));\n * });\n * ```\n */\nexport function addProtocol(customProtocol: string, loadFn: AddProtocolAction) {\n    config.REGISTERED_PROTOCOLS[customProtocol] = loadFn;\n}\n\n/**\n * Removes a previously added protocol in the main thread.\n *\n * @param customProtocol - the custom protocol to remove registration for\n * @example\n * ```ts\n * removeProtocol('custom');\n * ```\n */\nexport function removeProtocol(customProtocol: string) {\n    delete config.REGISTERED_PROTOCOLS[customProtocol];\n}\n", "import {extend, isWorker} from './util';\nimport {createAbortError} from './abort_error';\nimport {getProtocol} from '../source/protocol_crud';\nimport {MessageType} from './actor_messages';\n\n/**\n * This is used to identify the global dispatcher id when sending a message from the worker without a target map id.\n */\nexport const GLOBAL_DISPATCHER_ID = 'global-dispatcher';\n\n/**\n * A type used to store the tile's expiration date and cache control definition\n */\nexport type ExpiryData = {cacheControl?: string | null; expires?: Date | string | null};\n\n/**\n * A `RequestParameters` object to be returned from Map.options.transformRequest callbacks.\n * @example\n * ```ts\n * // use transformRequest to modify requests that begin with `http://myHost`\n * transformRequest: function(url, resourceType) {\n *  if (resourceType === 'Source' && url.indexOf('http://myHost') > -1) {\n *    return {\n *      url: url.replace('http', 'https'),\n *      headers: { 'my-custom-header': true },\n *      credentials: 'include'  // Include cookies for cross-origin requests\n *    }\n *   }\n * }\n * ```\n */\nexport type RequestParameters = {\n    /**\n     * The URL to be requested.\n     */\n    url: string;\n    /**\n     * The headers to be sent with the request.\n     */\n    headers?: any;\n    /**\n     * Request method `'GET' | 'POST' | 'PUT'`.\n     */\n    method?: 'GET' | 'POST' | 'PUT';\n    /**\n     * Request body.\n     */\n    body?: string;\n    /**\n     * Response body type to be returned.\n     */\n    type?: 'string' | 'json' | 'arrayBuffer' | 'image';\n    /**\n     * `'same-origin'|'include'` Use 'include' to send cookies with cross-origin requests.\n     */\n    credentials?: 'same-origin' | 'include';\n    /**\n     * If `true`, Resource Timing API information will be collected for these transformed requests and returned in a resourceTiming property of relevant data events.\n     */\n    collectResourceTiming?: boolean;\n    /**\n     * Parameters supported only by browser fetch API. Property of the Request interface contains the cache mode of the request. It controls how the request will interact with the browser's HTTP cache. (https://developer.mozilla.org/en-US/docs/Web/API/Request/cache)\n     */\n    cache?: RequestCache;\n};\n\n/**\n * The response object returned from a successful AJAx request\n */\nexport type GetResourceResponse<T> = ExpiryData & {\n    data: T;\n}\n\n/**\n * The response callback used in various places\n */\nexport type ResponseCallback<T> = (\n    error?: Error | null,\n    data?: T | null,\n    cacheControl?: string | null,\n    expires?: string | Date | null\n) => void;\n\n/**\n * An error thrown when a HTTP request results in an error response.\n */\nexport class AJAXError extends Error {\n    /**\n     * The response's HTTP status code.\n     */\n    status: number;\n\n    /**\n     * The response's HTTP status text.\n     */\n    statusText: string;\n\n    /**\n     * The request's URL.\n     */\n    url: string;\n\n    /**\n     * The response's body.\n     */\n    body: Blob;\n\n    /**\n     * @param status - The response's HTTP status code.\n     * @param statusText - The response's HTTP status text.\n     * @param url - The request's URL.\n     * @param body - The response's body.\n     */\n    constructor(status: number, statusText: string, url: string, body: Blob) {\n        super(`AJAXError: ${statusText} (${status}): ${url}`);\n        this.status = status;\n        this.statusText = statusText;\n        this.url = url;\n        this.body = body;\n    }\n}\n\n/**\n * Ensure that we're sending the correct referrer from blob URL worker bundles.\n * For files loaded from the local file system, `location.origin` will be set\n * to the string(!) \"null\" (Firefox), or \"file://\" (Chrome, Safari, Edge),\n * and we will set an empty referrer. Otherwise, we're using the document's URL.\n */\nexport const getReferrer = () => isWorker(self) ?\n    self.worker && self.worker.referrer :\n    (window.location.protocol === 'blob:' ? window.parent : window).location.href;\n\n/**\n * Determines whether a URL is a file:// URL. This is obviously the case if it begins\n * with file://. Relative URLs are also file:// URLs iff the original document was loaded\n * via a file:// URL.\n * @param url - The URL to check\n * @returns `true` if the URL is a file:// URL, `false` otherwise\n */\nconst isFileURL = url => /^file:/.test(url) || (/^file:/.test(getReferrer()) && !/^\\w+:/.test(url));\n\nasync function makeFetchRequest(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    const request = new Request(requestParameters.url, {\n        method: requestParameters.method || 'GET',\n        body: requestParameters.body,\n        credentials: requestParameters.credentials,\n        headers: requestParameters.headers,\n        cache: requestParameters.cache,\n        referrer: getReferrer(),\n        signal: abortController.signal\n    });\n\n    // If the user has already set an Accept header, do not overwrite it here\n    if (requestParameters.type === 'json' && !request.headers.has('Accept')) {\n        request.headers.set('Accept', 'application/json');\n    }\n\n    const response = await fetch(request);\n    if (!response.ok) {\n        const body = await response.blob();\n        throw new AJAXError(response.status, response.statusText, requestParameters.url, body);\n    }\n    let parsePromise: Promise<any>;\n    if ((requestParameters.type === 'arrayBuffer' || requestParameters.type === 'image')) {\n        parsePromise = response.arrayBuffer();\n    } else if (requestParameters.type === 'json') {\n        parsePromise = response.json();\n    } else {\n        parsePromise = response.text();\n    }\n    const result = await parsePromise;\n    if (abortController.signal.aborted) {\n        throw createAbortError();\n    }\n    return {data: result, cacheControl: response.headers.get('Cache-Control'), expires: response.headers.get('Expires')};\n}\n\nfunction makeXMLHttpRequest(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    return new Promise((resolve, reject) => {\n        const xhr: XMLHttpRequest = new XMLHttpRequest();\n\n        xhr.open(requestParameters.method || 'GET', requestParameters.url, true);\n        if (requestParameters.type === 'arrayBuffer' || requestParameters.type === 'image') {\n            xhr.responseType = 'arraybuffer';\n        }\n        for (const k in requestParameters.headers) {\n            xhr.setRequestHeader(k, requestParameters.headers[k]);\n        }\n        if (requestParameters.type === 'json') {\n            xhr.responseType = 'text';\n            // Do not overwrite the user-provided Accept header\n            if (!requestParameters.headers?.Accept) {\n                xhr.setRequestHeader('Accept', 'application/json');\n            }\n        }\n        xhr.withCredentials = requestParameters.credentials === 'include';\n        xhr.onerror = () => {\n            reject(new Error(xhr.statusText));\n        };\n        xhr.onload = () => {\n            if (abortController.signal.aborted) {\n                return;\n            }\n            if (((xhr.status >= 200 && xhr.status < 300) || xhr.status === 0) && xhr.response !== null) {\n                let data: unknown = xhr.response;\n                if (requestParameters.type === 'json') {\n                    // We're manually parsing JSON here to get better error messages.\n                    try {\n                        data = JSON.parse(xhr.response);\n                    } catch (err) {\n                        reject(err);\n                        return;\n                    }\n                }\n                resolve({data, cacheControl: xhr.getResponseHeader('Cache-Control'), expires: xhr.getResponseHeader('Expires')});\n            } else {\n                const body = new Blob([xhr.response], {type: xhr.getResponseHeader('Content-Type')});\n                reject(new AJAXError(xhr.status, xhr.statusText, requestParameters.url, body));\n            }\n        };\n        abortController.signal.addEventListener('abort', () => {\n            xhr.abort();\n            reject(createAbortError());\n        });\n        xhr.send(requestParameters.body);\n    });\n}\n\n/**\n * We're trying to use the Fetch API if possible. However, requests for resources with the file:// URI scheme don't work with the Fetch API.\n * In this case we unconditionally use XHR on the current thread since referrers don't matter.\n * This method can also use the registered method if `addProtocol` was called.\n * @param requestParameters - The request parameters\n * @param abortController - The abort controller allowing to cancel the request\n * @returns a promise resolving to the response, including cache control and expiry data\n */\nexport const makeRequest = function(requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<any>> {\n    if (/:\\/\\//.test(requestParameters.url) && !(/^https?:|^file:/.test(requestParameters.url))) {\n        const protocolLoadFn = getProtocol(requestParameters.url);\n        if (protocolLoadFn) {\n            return protocolLoadFn(requestParameters, abortController);\n        }\n        if (isWorker(self) && self.worker && self.worker.actor) {\n            return self.worker.actor.sendAsync({type: MessageType.getResource, data: requestParameters, targetMapId: GLOBAL_DISPATCHER_ID}, abortController);\n        }\n    }\n    if (!isFileURL(requestParameters.url)) {\n        if (fetch && Request && AbortController && Object.prototype.hasOwnProperty.call(Request.prototype, 'signal')) {\n            return makeFetchRequest(requestParameters, abortController);\n        }\n        if (isWorker(self) && self.worker && self.worker.actor) {\n            return self.worker.actor.sendAsync({type: MessageType.getResource, data: requestParameters, mustQueue: true, targetMapId: GLOBAL_DISPATCHER_ID}, abortController);\n        }\n    }\n    return makeXMLHttpRequest(requestParameters, abortController);\n};\n\nexport const getJSON = <T>(requestParameters: RequestParameters, abortController: AbortController): Promise<{data: T} & ExpiryData> => {\n    return makeRequest(extend(requestParameters, {type: 'json'}), abortController);\n};\n\nexport const getArrayBuffer = (requestParameters: RequestParameters, abortController: AbortController): Promise<{data: ArrayBuffer} & ExpiryData> => {\n    return makeRequest(extend(requestParameters, {type: 'arrayBuffer'}), abortController);\n};\n\nexport function sameOrigin(inComingUrl: string) {\n    // A relative URL \"/foo\" or \"./foo\" will throw exception in URL's ctor,\n    // try-catch is expansive so just use a heuristic check to avoid it\n    // also check data URL\n    if (!inComingUrl ||\n        inComingUrl.indexOf('://') <= 0 || // relative URL\n        inComingUrl.indexOf('data:image/') === 0 || // data image URL\n        inComingUrl.indexOf('blob:') === 0) { // blob\n        return true;\n    }\n    const urlObj = new URL(inComingUrl);\n    const locationObj = window.location;\n    return urlObj.protocol === locationObj.protocol && urlObj.host === locationObj.host;\n}\n\nexport const getVideo = (urls: Array<string>): Promise<HTMLVideoElement> => {\n    const video: HTMLVideoElement = window.document.createElement('video');\n    video.muted = true;\n    return new Promise((resolve) => {\n        video.onloadstart = () => {\n            resolve(video);\n        };\n        for (const url of urls) {\n            const s: HTMLSourceElement = window.document.createElement('source');\n            if (!sameOrigin(url)) {\n                video.crossOrigin = 'Anonymous';\n            }\n            s.src = url;\n            video.appendChild(s);\n        }\n    });\n};\n", "import {extend} from './util';\n\n/**\n * A listener method used as a callback to events\n */\nexport type Listener = (a: any) => any;\n\ntype Listeners = {[_: string]: Array<Listener>};\n\nfunction _addEventListener(type: string, listener: Listener, listenerList: Listeners) {\n    const listenerExists = listenerList[type] && listenerList[type].indexOf(listener) !== -1;\n    if (!listenerExists) {\n        listenerList[type] = listenerList[type] || [];\n        listenerList[type].push(listener);\n    }\n}\n\nfunction _removeEventListener(type: string, listener: Listener, listenerList: Listeners) {\n    if (listenerList && listenerList[type]) {\n        const index = listenerList[type].indexOf(listener);\n        if (index !== -1) {\n            listenerList[type].splice(index, 1);\n        }\n    }\n}\n\n/**\n * The event class\n */\nexport class Event {\n    readonly type: string;\n\n    constructor(type: string, data: any = {}) {\n        extend(this, data);\n        this.type = type;\n    }\n}\n\ninterface ErrorLike {\n    message: string;\n}\n\n/**\n * An error event\n */\nexport class ErrorEvent extends Event {\n    error: ErrorLike;\n\n    constructor(error: ErrorLike, data: any = {}) {\n        super('error', extend({error}, data));\n    }\n}\n\n/**\n * Methods mixed in to other classes for event capabilities.\n *\n * @group Event Related\n */\nexport class Evented {\n    _listeners: Listeners;\n    _oneTimeListeners: Listeners;\n    _eventedParent: Evented;\n    _eventedParentData: any | (() => any);\n\n    /**\n     * Adds a listener to a specified event type.\n     *\n     * @param type - The event type to add a listen for.\n     * @param listener - The function to be called when the event is fired.\n     * The listener function is called with the data object passed to `fire`,\n     * extended with `target` and `type` properties.\n     */\n    on(type: string, listener: Listener): this {\n        this._listeners = this._listeners || {};\n        _addEventListener(type, listener, this._listeners);\n\n        return this;\n    }\n\n    /**\n     * Removes a previously registered event listener.\n     *\n     * @param type - The event type to remove listeners for.\n     * @param listener - The listener function to remove.\n     */\n    off(type: string, listener: Listener) {\n        _removeEventListener(type, listener, this._listeners);\n        _removeEventListener(type, listener, this._oneTimeListeners);\n\n        return this;\n    }\n\n    /**\n     * Adds a listener that will be called only once to a specified event type.\n     *\n     * The listener will be called first time the event fires after the listener is registered.\n     *\n     * @param type - The event type to listen for.\n     * @param listener - The function to be called when the event is fired the first time.\n     * @returns `this` or a promise if a listener is not provided\n     */\n    once(type: string, listener?: Listener): this | Promise<any> {\n        if (!listener) {\n            return new Promise((resolve) => this.once(type, resolve));\n        }\n        this._oneTimeListeners = this._oneTimeListeners || {};\n        _addEventListener(type, listener, this._oneTimeListeners);\n\n        return this;\n    }\n\n    fire(event: Event | string, properties?: any) {\n        // Compatibility with (type: string, properties: Object) signature from previous versions.\n        // See https://github.com/mapbox/mapbox-gl-js/issues/6522,\n        //     https://github.com/mapbox/mapbox-gl-draw/issues/766\n        if (typeof event === 'string') {\n            event = new Event(event, properties || {});\n        }\n\n        const type = event.type;\n\n        if (this.listens(type)) {\n            (event as any).target = this;\n\n            // make sure adding or removing listeners inside other listeners won't cause an infinite loop\n            const listeners = this._listeners && this._listeners[type] ? this._listeners[type].slice() : [];\n            for (const listener of listeners) {\n                listener.call(this, event);\n            }\n\n            const oneTimeListeners = this._oneTimeListeners && this._oneTimeListeners[type] ? this._oneTimeListeners[type].slice() : [];\n            for (const listener of oneTimeListeners) {\n                _removeEventListener(type, listener, this._oneTimeListeners);\n                listener.call(this, event);\n            }\n\n            const parent = this._eventedParent;\n            if (parent) {\n                extend(\n                    event,\n                    typeof this._eventedParentData === 'function' ? this._eventedParentData() : this._eventedParentData\n                );\n                parent.fire(event);\n            }\n\n        // To ensure that no error events are dropped, print them to the\n        // console if they have no listeners.\n        } else if (event instanceof ErrorEvent) {\n            console.error(event.error);\n        }\n\n        return this;\n    }\n\n    /**\n     * Returns a true if this instance of Evented or any forwardeed instances of Evented have a listener for the specified type.\n     *\n     * @param type - The event type\n     * @returns `true` if there is at least one registered listener for specified event type, `false` otherwise\n     */\n    listens(type: string): boolean {\n        return (\n            (this._listeners && this._listeners[type] && this._listeners[type].length > 0) ||\n            (this._oneTimeListeners && this._oneTimeListeners[type] && this._oneTimeListeners[type].length > 0) ||\n            (this._eventedParent && this._eventedParent.listens(type))\n        );\n    }\n\n    /**\n     * Bubble all events fired by this instance of Evented to this parent instance of Evented.\n     */\n    setEventedParent(parent?: Evented | null, data?: any | (() => any)) {\n        this._eventedParent = parent;\n        this._eventedParentData = data;\n\n        return this;\n    }\n}\n", "var $version = 8;\nvar $root = {\n\tversion: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: [\n\t\t\t8\n\t\t]\n\t},\n\tname: {\n\t\ttype: \"string\"\n\t},\n\tmetadata: {\n\t\ttype: \"*\"\n\t},\n\tcenter: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\"\n\t},\n\tzoom: {\n\t\ttype: \"number\"\n\t},\n\tbearing: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\tunits: \"degrees\"\n\t},\n\tpitch: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tunits: \"degrees\"\n\t},\n\tlight: {\n\t\ttype: \"light\"\n\t},\n\tsky: {\n\t\ttype: \"sky\"\n\t},\n\tprojection: {\n\t\ttype: \"projection\"\n\t},\n\tterrain: {\n\t\ttype: \"terrain\"\n\t},\n\tsources: {\n\t\trequired: true,\n\t\ttype: \"sources\"\n\t},\n\tsprite: {\n\t\ttype: \"sprite\"\n\t},\n\tglyphs: {\n\t\ttype: \"string\"\n\t},\n\ttransition: {\n\t\ttype: \"transition\"\n\t},\n\tlayers: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tvalue: \"layer\"\n\t}\n};\nvar sources = {\n\t\"*\": {\n\t\ttype: \"source\"\n\t}\n};\nvar source = [\n\t\"source_vector\",\n\t\"source_raster\",\n\t\"source_raster_dem\",\n\t\"source_geojson\",\n\t\"source_video\",\n\t\"source_image\"\n];\nvar source_vector = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvector: {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\ttype: \"string\"\n\t},\n\ttiles: {\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tbounds: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t-180,\n\t\t\t-85.051129,\n\t\t\t180,\n\t\t\t85.051129\n\t\t]\n\t},\n\tscheme: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\txyz: {\n\t\t\t},\n\t\t\ttms: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"xyz\"\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 22\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tpromoteId: {\n\t\ttype: \"promoteId\"\n\t},\n\tvolatile: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\t\"*\": {\n\t\ttype: \"*\"\n\t}\n};\nvar source_raster = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\traster: {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\ttype: \"string\"\n\t},\n\ttiles: {\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tbounds: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t-180,\n\t\t\t-85.051129,\n\t\t\t180,\n\t\t\t85.051129\n\t\t]\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 22\n\t},\n\ttileSize: {\n\t\ttype: \"number\",\n\t\t\"default\": 512,\n\t\tunits: \"pixels\"\n\t},\n\tscheme: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\txyz: {\n\t\t\t},\n\t\t\ttms: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"xyz\"\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tvolatile: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\t\"*\": {\n\t\ttype: \"*\"\n\t}\n};\nvar source_raster_dem = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\t\"raster-dem\": {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\ttype: \"string\"\n\t},\n\ttiles: {\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tbounds: {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t-180,\n\t\t\t-85.051129,\n\t\t\t180,\n\t\t\t85.051129\n\t\t]\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 22\n\t},\n\ttileSize: {\n\t\ttype: \"number\",\n\t\t\"default\": 512,\n\t\tunits: \"pixels\"\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tencoding: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tterrarium: {\n\t\t\t},\n\t\t\tmapbox: {\n\t\t\t},\n\t\t\tcustom: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"mapbox\"\n\t},\n\tredFactor: {\n\t\ttype: \"number\",\n\t\t\"default\": 1\n\t},\n\tblueFactor: {\n\t\ttype: \"number\",\n\t\t\"default\": 1\n\t},\n\tgreenFactor: {\n\t\ttype: \"number\",\n\t\t\"default\": 1\n\t},\n\tbaseShift: {\n\t\ttype: \"number\",\n\t\t\"default\": 0\n\t},\n\tvolatile: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\t\"*\": {\n\t\ttype: \"*\"\n\t}\n};\nvar source_geojson = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tgeojson: {\n\t\t\t}\n\t\t}\n\t},\n\tdata: {\n\t\trequired: true,\n\t\ttype: \"*\"\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\t\"default\": 18\n\t},\n\tattribution: {\n\t\ttype: \"string\"\n\t},\n\tbuffer: {\n\t\ttype: \"number\",\n\t\t\"default\": 128,\n\t\tmaximum: 512,\n\t\tminimum: 0\n\t},\n\tfilter: {\n\t\ttype: \"*\"\n\t},\n\ttolerance: {\n\t\ttype: \"number\",\n\t\t\"default\": 0.375\n\t},\n\tcluster: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tclusterRadius: {\n\t\ttype: \"number\",\n\t\t\"default\": 50,\n\t\tminimum: 0\n\t},\n\tclusterMaxZoom: {\n\t\ttype: \"number\"\n\t},\n\tclusterMinPoints: {\n\t\ttype: \"number\"\n\t},\n\tclusterProperties: {\n\t\ttype: \"*\"\n\t},\n\tlineMetrics: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tgenerateId: {\n\t\ttype: \"boolean\",\n\t\t\"default\": false\n\t},\n\tpromoteId: {\n\t\ttype: \"promoteId\"\n\t}\n};\nvar source_video = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvideo: {\n\t\t\t}\n\t\t}\n\t},\n\turls: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tvalue: \"string\"\n\t},\n\tcoordinates: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tlength: 4,\n\t\tvalue: {\n\t\t\ttype: \"array\",\n\t\t\tlength: 2,\n\t\t\tvalue: \"number\"\n\t\t}\n\t}\n};\nvar source_image = {\n\ttype: {\n\t\trequired: true,\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\timage: {\n\t\t\t}\n\t\t}\n\t},\n\turl: {\n\t\trequired: true,\n\t\ttype: \"string\"\n\t},\n\tcoordinates: {\n\t\trequired: true,\n\t\ttype: \"array\",\n\t\tlength: 4,\n\t\tvalue: {\n\t\t\ttype: \"array\",\n\t\t\tlength: 2,\n\t\t\tvalue: \"number\"\n\t\t}\n\t}\n};\nvar layer = {\n\tid: {\n\t\ttype: \"string\",\n\t\trequired: true\n\t},\n\ttype: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tfill: {\n\t\t\t},\n\t\t\tline: {\n\t\t\t},\n\t\t\tsymbol: {\n\t\t\t},\n\t\t\tcircle: {\n\t\t\t},\n\t\t\theatmap: {\n\t\t\t},\n\t\t\t\"fill-extrusion\": {\n\t\t\t},\n\t\t\traster: {\n\t\t\t},\n\t\t\thillshade: {\n\t\t\t},\n\t\t\tbackground: {\n\t\t\t}\n\t\t},\n\t\trequired: true\n\t},\n\tmetadata: {\n\t\ttype: \"*\"\n\t},\n\tsource: {\n\t\ttype: \"string\"\n\t},\n\t\"source-layer\": {\n\t\ttype: \"string\"\n\t},\n\tminzoom: {\n\t\ttype: \"number\",\n\t\tminimum: 0,\n\t\tmaximum: 24\n\t},\n\tmaxzoom: {\n\t\ttype: \"number\",\n\t\tminimum: 0,\n\t\tmaximum: 24\n\t},\n\tfilter: {\n\t\ttype: \"filter\"\n\t},\n\tlayout: {\n\t\ttype: \"layout\"\n\t},\n\tpaint: {\n\t\ttype: \"paint\"\n\t}\n};\nvar layout = [\n\t\"layout_fill\",\n\t\"layout_line\",\n\t\"layout_circle\",\n\t\"layout_heatmap\",\n\t\"layout_fill-extrusion\",\n\t\"layout_symbol\",\n\t\"layout_raster\",\n\t\"layout_hillshade\",\n\t\"layout_background\"\n];\nvar layout_background = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_fill = {\n\t\"fill-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_circle = {\n\t\"circle-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_heatmap = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_line = {\n\t\"line-cap\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tbutt: {\n\t\t\t},\n\t\t\tround: {\n\t\t\t},\n\t\t\tsquare: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"butt\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-join\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tbevel: {\n\t\t\t},\n\t\t\tround: {\n\t\t\t},\n\t\t\tmiter: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"miter\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-miter-limit\": {\n\t\ttype: \"number\",\n\t\t\"default\": 2,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"line-join\": \"miter\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-round-limit\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1.05,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"line-join\": \"round\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_symbol = {\n\t\"symbol-placement\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tpoint: {\n\t\t\t},\n\t\t\tline: {\n\t\t\t},\n\t\t\t\"line-center\": {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"point\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"symbol-spacing\": {\n\t\ttype: \"number\",\n\t\t\"default\": 250,\n\t\tminimum: 1,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"symbol-placement\": \"line\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"symbol-avoid-edges\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"symbol-sort-key\": {\n\t\ttype: \"number\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"symbol-z-order\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tauto: {\n\t\t\t},\n\t\t\t\"viewport-y\": {\n\t\t\t},\n\t\t\tsource: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-allow-overlap\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t{\n\t\t\t\t\"!\": \"icon-overlap\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-overlap\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnever: {\n\t\t\t},\n\t\t\talways: {\n\t\t\t},\n\t\t\tcooperative: {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-ignore-placement\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-optional\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-rotation-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-size\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tunits: \"factor of the original icon size\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-text-fit\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnone: {\n\t\t\t},\n\t\t\twidth: {\n\t\t\t},\n\t\t\theight: {\n\t\t\t},\n\t\t\tboth: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"none\",\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-text-fit-padding\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 4,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0,\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"icon-text-fit\": [\n\t\t\t\t\t\"both\",\n\t\t\t\t\t\"width\",\n\t\t\t\t\t\"height\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-image\": {\n\t\ttype: \"resolvedImage\",\n\t\ttokens: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-rotate\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\tunits: \"degrees\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-padding\": {\n\t\ttype: \"padding\",\n\t\t\"default\": [\n\t\t\t2\n\t\t],\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-keep-upright\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t{\n\t\t\t\t\"icon-rotation-alignment\": \"map\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"line\",\n\t\t\t\t\t\"line-center\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-offset\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t},\n\t\t\ttop: {\n\t\t\t},\n\t\t\tbottom: {\n\t\t\t},\n\t\t\t\"top-left\": {\n\t\t\t},\n\t\t\t\"top-right\": {\n\t\t\t},\n\t\t\t\"bottom-left\": {\n\t\t\t},\n\t\t\t\"bottom-right\": {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"center\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-pitch-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-pitch-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-rotation-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t},\n\t\t\t\"viewport-glyph\": {\n\t\t\t},\n\t\t\tauto: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"auto\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-field\": {\n\t\ttype: \"formatted\",\n\t\t\"default\": \"\",\n\t\ttokens: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-font\": {\n\t\ttype: \"array\",\n\t\tvalue: \"string\",\n\t\t\"default\": [\n\t\t\t\"Open Sans Regular\",\n\t\t\t\"Arial Unicode MS Regular\"\n\t\t],\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-size\": {\n\t\ttype: \"number\",\n\t\t\"default\": 16,\n\t\tminimum: 0,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-max-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 10,\n\t\tminimum: 0,\n\t\tunits: \"ems\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-line-height\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1.2,\n\t\tunits: \"ems\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-letter-spacing\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tunits: \"ems\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-justify\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tauto: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"center\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-radial-offset\": {\n\t\ttype: \"number\",\n\t\tunits: \"ems\",\n\t\t\"default\": 0,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\t\"property-type\": \"data-driven\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t}\n\t},\n\t\"text-variable-anchor\": {\n\t\ttype: \"array\",\n\t\tvalue: \"enum\",\n\t\tvalues: {\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t},\n\t\t\ttop: {\n\t\t\t},\n\t\t\tbottom: {\n\t\t\t},\n\t\t\t\"top-left\": {\n\t\t\t},\n\t\t\t\"top-right\": {\n\t\t\t},\n\t\t\t\"bottom-left\": {\n\t\t\t},\n\t\t\t\"bottom-right\": {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"point\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-variable-anchor-offset\": {\n\t\ttype: \"variableAnchorOffsetCollection\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"point\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tcenter: {\n\t\t\t},\n\t\t\tleft: {\n\t\t\t},\n\t\t\tright: {\n\t\t\t},\n\t\t\ttop: {\n\t\t\t},\n\t\t\tbottom: {\n\t\t\t},\n\t\t\t\"top-left\": {\n\t\t\t},\n\t\t\t\"top-right\": {\n\t\t\t},\n\t\t\t\"bottom-left\": {\n\t\t\t},\n\t\t\t\"bottom-right\": {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"center\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"!\": \"text-variable-anchor\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-max-angle\": {\n\t\ttype: \"number\",\n\t\t\"default\": 45,\n\t\tunits: \"degrees\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"line\",\n\t\t\t\t\t\"line-center\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-writing-mode\": {\n\t\ttype: \"array\",\n\t\tvalue: \"enum\",\n\t\tvalues: {\n\t\t\thorizontal: {\n\t\t\t},\n\t\t\tvertical: {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"point\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-rotate\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\tunits: \"degrees\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-padding\": {\n\t\ttype: \"number\",\n\t\t\"default\": 2,\n\t\tminimum: 0,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-keep-upright\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": true,\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"text-rotation-alignment\": \"map\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"symbol-placement\": [\n\t\t\t\t\t\"line\",\n\t\t\t\t\t\"line-center\"\n\t\t\t\t]\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-transform\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnone: {\n\t\t\t},\n\t\t\tuppercase: {\n\t\t\t},\n\t\t\tlowercase: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"none\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-offset\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tunits: \"ems\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"!\": \"text-radial-offset\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-allow-overlap\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t{\n\t\t\t\t\"!\": \"text-overlap\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-overlap\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tnever: {\n\t\t\t},\n\t\t\talways: {\n\t\t\t},\n\t\t\tcooperative: {\n\t\t\t}\n\t\t},\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-ignore-placement\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-optional\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": false,\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_raster = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar layout_hillshade = {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n};\nvar filter = {\n\ttype: \"array\",\n\tvalue: \"*\"\n};\nvar filter_operator = {\n\ttype: \"enum\",\n\tvalues: {\n\t\t\"==\": {\n\t\t},\n\t\t\"!=\": {\n\t\t},\n\t\t\">\": {\n\t\t},\n\t\t\">=\": {\n\t\t},\n\t\t\"<\": {\n\t\t},\n\t\t\"<=\": {\n\t\t},\n\t\t\"in\": {\n\t\t},\n\t\t\"!in\": {\n\t\t},\n\t\tall: {\n\t\t},\n\t\tany: {\n\t\t},\n\t\tnone: {\n\t\t},\n\t\thas: {\n\t\t},\n\t\t\"!has\": {\n\t\t}\n\t}\n};\nvar geometry_type = {\n\ttype: \"enum\",\n\tvalues: {\n\t\tPoint: {\n\t\t},\n\t\tLineString: {\n\t\t},\n\t\tPolygon: {\n\t\t}\n\t}\n};\nvar function_stop = {\n\ttype: \"array\",\n\tminimum: 0,\n\tmaximum: 24,\n\tvalue: [\n\t\t\"number\",\n\t\t\"color\"\n\t],\n\tlength: 2\n};\nvar expression$1 = {\n\ttype: \"array\",\n\tvalue: \"*\",\n\tminimum: 1\n};\nvar light = {\n\tanchor: {\n\t\ttype: \"enum\",\n\t\t\"default\": \"viewport\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"property-type\": \"data-constant\",\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t}\n\t},\n\tposition: {\n\t\ttype: \"array\",\n\t\t\"default\": [\n\t\t\t1.15,\n\t\t\t210,\n\t\t\t30\n\t\t],\n\t\tlength: 3,\n\t\tvalue: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t}\n\t},\n\tcolor: {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#ffffff\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\tintensity: {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.5,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t}\n};\nvar sky = {\n\t\"sky-color\": {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#88C6FC\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"horizon-color\": {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#ffffff\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"fog-color\": {\n\t\ttype: \"color\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": \"#ffffff\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"fog-ground-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.5,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"horizon-fog-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.8,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"sky-horizon-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.8,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t},\n\t\"atmosphere-blend\": {\n\t\ttype: \"number\",\n\t\t\"property-type\": \"data-constant\",\n\t\t\"default\": 0.8,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\ttransition: true\n\t}\n};\nvar terrain = {\n\tsource: {\n\t\ttype: \"string\",\n\t\trequired: true\n\t},\n\texaggeration: {\n\t\ttype: \"number\",\n\t\tminimum: 0,\n\t\t\"default\": 1\n\t}\n};\nvar projection = {\n\ttype: {\n\t\ttype: \"enum\",\n\t\t\"default\": \"mercator\",\n\t\tvalues: {\n\t\t\tmercator: {\n\t\t\t},\n\t\t\tglobe: {\n\t\t\t}\n\t\t}\n\t}\n};\nvar paint = [\n\t\"paint_fill\",\n\t\"paint_line\",\n\t\"paint_circle\",\n\t\"paint_heatmap\",\n\t\"paint_fill-extrusion\",\n\t\"paint_symbol\",\n\t\"paint_raster\",\n\t\"paint_hillshade\",\n\t\"paint_background\"\n];\nvar paint_fill = {\n\t\"fill-antialias\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"fill-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-outline-color\": {\n\t\ttype: \"color\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"fill-pattern\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"fill-antialias\": true\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"fill-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t}\n};\nvar paint_line = {\n\t\"line-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"line-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"line-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"line-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-gap-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-offset\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"line-dasharray\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"line widths\",\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"line-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded\"\n\t},\n\t\"line-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t},\n\t\"line-gradient\": {\n\t\ttype: \"color\",\n\t\ttransition: false,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"line-dasharray\"\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"!\": \"line-pattern\"\n\t\t\t},\n\t\t\t{\n\t\t\t\tsource: \"geojson\",\n\t\t\t\thas: {\n\t\t\t\t\tlineMetrics: true\n\t\t\t\t}\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"line-progress\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"color-ramp\"\n\t}\n};\nvar paint_circle = {\n\t\"circle-radius\": {\n\t\ttype: \"number\",\n\t\t\"default\": 5,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"circle-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-pitch-scale\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-pitch-alignment\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"viewport\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"circle-stroke-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-stroke-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"circle-stroke-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t}\n};\nvar paint_heatmap = {\n\t\"heatmap-radius\": {\n\t\ttype: \"number\",\n\t\t\"default\": 30,\n\t\tminimum: 1,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"heatmap-weight\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"heatmap-intensity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"heatmap-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": [\n\t\t\t\"interpolate\",\n\t\t\t[\n\t\t\t\t\"linear\"\n\t\t\t],\n\t\t\t[\n\t\t\t\t\"heatmap-density\"\n\t\t\t],\n\t\t\t0,\n\t\t\t\"rgba(0, 0, 255, 0)\",\n\t\t\t0.1,\n\t\t\t\"royalblue\",\n\t\t\t0.3,\n\t\t\t\"cyan\",\n\t\t\t0.5,\n\t\t\t\"lime\",\n\t\t\t0.7,\n\t\t\t\"yellow\",\n\t\t\t1,\n\t\t\t\"red\"\n\t\t],\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"heatmap-density\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"color-ramp\"\n\t},\n\t\"heatmap-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_symbol = {\n\t\"icon-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-halo-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"rgba(0, 0, 0, 0)\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-halo-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-halo-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"icon-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"icon-image\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"icon-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"icon-image\",\n\t\t\t\"icon-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\toverridable: true,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-halo-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"rgba(0, 0, 0, 0)\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-halo-width\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-halo-blur\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"text-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\trequires: [\n\t\t\t\"text-field\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"text-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"text-field\",\n\t\t\t\"text-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_raster = {\n\t\"raster-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-hue-rotate\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tperiod: 360,\n\t\ttransition: true,\n\t\tunits: \"degrees\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-brightness-min\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-brightness-max\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-saturation\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: -1,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-contrast\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: -1,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-resampling\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tlinear: {\n\t\t\t},\n\t\t\tnearest: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"linear\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"raster-fade-duration\": {\n\t\ttype: \"number\",\n\t\t\"default\": 300,\n\t\tminimum: 0,\n\t\ttransition: false,\n\t\tunits: \"milliseconds\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_hillshade = {\n\t\"hillshade-illumination-direction\": {\n\t\ttype: \"number\",\n\t\t\"default\": 335,\n\t\tminimum: 0,\n\t\tmaximum: 359,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-illumination-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"viewport\",\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-exaggeration\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0.5,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-shadow-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-highlight-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#FFFFFF\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"hillshade-accent-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar paint_background = {\n\t\"background-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"background-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"background-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded\"\n\t},\n\t\"background-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n};\nvar transition = {\n\tduration: {\n\t\ttype: \"number\",\n\t\t\"default\": 300,\n\t\tminimum: 0,\n\t\tunits: \"milliseconds\"\n\t},\n\tdelay: {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tunits: \"milliseconds\"\n\t}\n};\nvar promoteId = {\n\t\"*\": {\n\t\ttype: \"string\"\n\t}\n};\nvar v8Spec = {\n\t$version: $version,\n\t$root: $root,\n\tsources: sources,\n\tsource: source,\n\tsource_vector: source_vector,\n\tsource_raster: source_raster,\n\tsource_raster_dem: source_raster_dem,\n\tsource_geojson: source_geojson,\n\tsource_video: source_video,\n\tsource_image: source_image,\n\tlayer: layer,\n\tlayout: layout,\n\tlayout_background: layout_background,\n\tlayout_fill: layout_fill,\n\tlayout_circle: layout_circle,\n\tlayout_heatmap: layout_heatmap,\n\t\"layout_fill-extrusion\": {\n\tvisibility: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tvisible: {\n\t\t\t},\n\t\t\tnone: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"visible\",\n\t\t\"property-type\": \"constant\"\n\t}\n},\n\tlayout_line: layout_line,\n\tlayout_symbol: layout_symbol,\n\tlayout_raster: layout_raster,\n\tlayout_hillshade: layout_hillshade,\n\tfilter: filter,\n\tfilter_operator: filter_operator,\n\tgeometry_type: geometry_type,\n\t\"function\": {\n\texpression: {\n\t\ttype: \"expression\"\n\t},\n\tstops: {\n\t\ttype: \"array\",\n\t\tvalue: \"function_stop\"\n\t},\n\tbase: {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0\n\t},\n\tproperty: {\n\t\ttype: \"string\",\n\t\t\"default\": \"$zoom\"\n\t},\n\ttype: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tidentity: {\n\t\t\t},\n\t\t\texponential: {\n\t\t\t},\n\t\t\tinterval: {\n\t\t\t},\n\t\t\tcategorical: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"exponential\"\n\t},\n\tcolorSpace: {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\trgb: {\n\t\t\t},\n\t\t\tlab: {\n\t\t\t},\n\t\t\thcl: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"rgb\"\n\t},\n\t\"default\": {\n\t\ttype: \"*\",\n\t\trequired: false\n\t}\n},\n\tfunction_stop: function_stop,\n\texpression: expression$1,\n\tlight: light,\n\tsky: sky,\n\tterrain: terrain,\n\tprojection: projection,\n\tpaint: paint,\n\tpaint_fill: paint_fill,\n\t\"paint_fill-extrusion\": {\n\t\"fill-extrusion-opacity\": {\n\t\ttype: \"number\",\n\t\t\"default\": 1,\n\t\tminimum: 0,\n\t\tmaximum: 1,\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-extrusion-color\": {\n\t\ttype: \"color\",\n\t\t\"default\": \"#000000\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t{\n\t\t\t\t\"!\": \"fill-extrusion-pattern\"\n\t\t\t}\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-extrusion-translate\": {\n\t\ttype: \"array\",\n\t\tvalue: \"number\",\n\t\tlength: 2,\n\t\t\"default\": [\n\t\t\t0,\n\t\t\t0\n\t\t],\n\t\ttransition: true,\n\t\tunits: \"pixels\",\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-extrusion-translate-anchor\": {\n\t\ttype: \"enum\",\n\t\tvalues: {\n\t\t\tmap: {\n\t\t\t},\n\t\t\tviewport: {\n\t\t\t}\n\t\t},\n\t\t\"default\": \"map\",\n\t\trequires: [\n\t\t\t\"fill-extrusion-translate\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t},\n\t\"fill-extrusion-pattern\": {\n\t\ttype: \"resolvedImage\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"cross-faded-data-driven\"\n\t},\n\t\"fill-extrusion-height\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tunits: \"meters\",\n\t\ttransition: true,\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-extrusion-base\": {\n\t\ttype: \"number\",\n\t\t\"default\": 0,\n\t\tminimum: 0,\n\t\tunits: \"meters\",\n\t\ttransition: true,\n\t\trequires: [\n\t\t\t\"fill-extrusion-height\"\n\t\t],\n\t\texpression: {\n\t\t\tinterpolated: true,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\",\n\t\t\t\t\"feature\",\n\t\t\t\t\"feature-state\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-driven\"\n\t},\n\t\"fill-extrusion-vertical-gradient\": {\n\t\ttype: \"boolean\",\n\t\t\"default\": true,\n\t\ttransition: false,\n\t\texpression: {\n\t\t\tinterpolated: false,\n\t\t\tparameters: [\n\t\t\t\t\"zoom\"\n\t\t\t]\n\t\t},\n\t\t\"property-type\": \"data-constant\"\n\t}\n},\n\tpaint_line: paint_line,\n\tpaint_circle: paint_circle,\n\tpaint_heatmap: paint_heatmap,\n\tpaint_symbol: paint_symbol,\n\tpaint_raster: paint_raster,\n\tpaint_hillshade: paint_hillshade,\n\tpaint_background: paint_background,\n\ttransition: transition,\n\t\"property-type\": {\n\t\"data-driven\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"cross-faded\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"cross-faded-data-driven\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"color-ramp\": {\n\t\ttype: \"property-type\"\n\t},\n\t\"data-constant\": {\n\t\ttype: \"property-type\"\n\t},\n\tconstant: {\n\t\ttype: \"property-type\"\n\t}\n},\n\tpromoteId: promoteId\n};\n\nconst refProperties = ['type', 'source', 'source-layer', 'minzoom', 'maxzoom', 'filter', 'layout'];\n\nfunction deref(layer, parent) {\n    const result = {};\n    for (const k in layer) {\n        if (k !== 'ref') {\n            result[k] = layer[k];\n        }\n    }\n    refProperties.forEach((k) => {\n        if (k in parent) {\n            result[k] = parent[k];\n        }\n    });\n    return result;\n}\n/**\n * Given an array of layers, some of which may contain `ref` properties\n * whose value is the `id` of another property, return a new array where\n * such layers have been augmented with the 'type', 'source', etc. properties\n * from the parent layer, and the `ref` property has been removed.\n *\n * The input is not modified. The output may contain references to portions\n * of the input.\n *\n * @private\n * @param {Array<Layer>} layers\n * @returns {Array<Layer>}\n */\nfunction derefLayers(layers) {\n    layers = layers.slice();\n    const map = Object.create(null);\n    for (let i = 0; i < layers.length; i++) {\n        map[layers[i].id] = layers[i];\n    }\n    for (let i = 0; i < layers.length; i++) {\n        if ('ref' in layers[i]) {\n            layers[i] = deref(layers[i], map[layers[i].ref]);\n        }\n    }\n    return layers;\n}\n\n/**\n * Deeply compares two object literals.\n *\n * @private\n */\nfunction deepEqual(a, b) {\n    if (Array.isArray(a)) {\n        if (!Array.isArray(b) || a.length !== b.length)\n            return false;\n        for (let i = 0; i < a.length; i++) {\n            if (!deepEqual(a[i], b[i]))\n                return false;\n        }\n        return true;\n    }\n    if (typeof a === 'object' && a !== null && b !== null) {\n        if (!(typeof b === 'object'))\n            return false;\n        const keys = Object.keys(a);\n        if (keys.length !== Object.keys(b).length)\n            return false;\n        for (const key in a) {\n            if (!deepEqual(a[key], b[key]))\n                return false;\n        }\n        return true;\n    }\n    return a === b;\n}\n\n/**\n * The main reason for this method is to allow type check when adding a command to the array.\n * @param commands - The commands array to add to\n * @param command - The command to add\n */\nfunction addCommand(commands, command) {\n    commands.push(command);\n}\nfunction addSource(sourceId, after, commands) {\n    addCommand(commands, { command: 'addSource', args: [sourceId, after[sourceId]] });\n}\nfunction removeSource(sourceId, commands, sourcesRemoved) {\n    addCommand(commands, { command: 'removeSource', args: [sourceId] });\n    sourcesRemoved[sourceId] = true;\n}\nfunction updateSource(sourceId, after, commands, sourcesRemoved) {\n    removeSource(sourceId, commands, sourcesRemoved);\n    addSource(sourceId, after, commands);\n}\nfunction canUpdateGeoJSON(before, after, sourceId) {\n    let prop;\n    for (prop in before[sourceId]) {\n        if (!Object.prototype.hasOwnProperty.call(before[sourceId], prop))\n            continue;\n        if (prop !== 'data' && !deepEqual(before[sourceId][prop], after[sourceId][prop])) {\n            return false;\n        }\n    }\n    for (prop in after[sourceId]) {\n        if (!Object.prototype.hasOwnProperty.call(after[sourceId], prop))\n            continue;\n        if (prop !== 'data' && !deepEqual(before[sourceId][prop], after[sourceId][prop])) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction diffSources(before, after, commands, sourcesRemoved) {\n    before = before || {};\n    after = after || {};\n    let sourceId;\n    // look for sources to remove\n    for (sourceId in before) {\n        if (!Object.prototype.hasOwnProperty.call(before, sourceId))\n            continue;\n        if (!Object.prototype.hasOwnProperty.call(after, sourceId)) {\n            removeSource(sourceId, commands, sourcesRemoved);\n        }\n    }\n    // look for sources to add/update\n    for (sourceId in after) {\n        if (!Object.prototype.hasOwnProperty.call(after, sourceId))\n            continue;\n        if (!Object.prototype.hasOwnProperty.call(before, sourceId)) {\n            addSource(sourceId, after, commands);\n        }\n        else if (!deepEqual(before[sourceId], after[sourceId])) {\n            if (before[sourceId].type === 'geojson' && after[sourceId].type === 'geojson' && canUpdateGeoJSON(before, after, sourceId)) {\n                addCommand(commands, { command: 'setGeoJSONSourceData', args: [sourceId, after[sourceId].data] });\n            }\n            else {\n                // no update command, must remove then add\n                updateSource(sourceId, after, commands, sourcesRemoved);\n            }\n        }\n    }\n}\nfunction diffLayerPropertyChanges(before, after, commands, layerId, klass, command) {\n    before = before || {};\n    after = after || {};\n    for (const prop in before) {\n        if (!Object.prototype.hasOwnProperty.call(before, prop))\n            continue;\n        if (!deepEqual(before[prop], after[prop])) {\n            commands.push({ command, args: [layerId, prop, after[prop], klass] });\n        }\n    }\n    for (const prop in after) {\n        if (!Object.prototype.hasOwnProperty.call(after, prop) || Object.prototype.hasOwnProperty.call(before, prop))\n            continue;\n        if (!deepEqual(before[prop], after[prop])) {\n            commands.push({ command, args: [layerId, prop, after[prop], klass] });\n        }\n    }\n}\nfunction pluckId(layer) {\n    return layer.id;\n}\nfunction indexById(group, layer) {\n    group[layer.id] = layer;\n    return group;\n}\nfunction diffLayers(before, after, commands) {\n    before = before || [];\n    after = after || [];\n    // order of layers by id\n    const beforeOrder = before.map(pluckId);\n    const afterOrder = after.map(pluckId);\n    // index of layer by id\n    const beforeIndex = before.reduce(indexById, {});\n    const afterIndex = after.reduce(indexById, {});\n    // track order of layers as if they have been mutated\n    const tracker = beforeOrder.slice();\n    // layers that have been added do not need to be diffed\n    const clean = Object.create(null);\n    let layerId;\n    let beforeLayer;\n    let afterLayer;\n    let insertBeforeLayerId;\n    let prop;\n    // remove layers\n    for (let i = 0, d = 0; i < beforeOrder.length; i++) {\n        layerId = beforeOrder[i];\n        if (!Object.prototype.hasOwnProperty.call(afterIndex, layerId)) {\n            addCommand(commands, { command: 'removeLayer', args: [layerId] });\n            tracker.splice(tracker.indexOf(layerId, d), 1);\n        }\n        else {\n            // limit where in tracker we need to look for a match\n            d++;\n        }\n    }\n    // add/reorder layers\n    for (let i = 0, d = 0; i < afterOrder.length; i++) {\n        // work backwards as insert is before an existing layer\n        layerId = afterOrder[afterOrder.length - 1 - i];\n        if (tracker[tracker.length - 1 - i] === layerId)\n            continue;\n        if (Object.prototype.hasOwnProperty.call(beforeIndex, layerId)) {\n            // remove the layer before we insert at the correct position\n            addCommand(commands, { command: 'removeLayer', args: [layerId] });\n            tracker.splice(tracker.lastIndexOf(layerId, tracker.length - d), 1);\n        }\n        else {\n            // limit where in tracker we need to look for a match\n            d++;\n        }\n        // add layer at correct position\n        insertBeforeLayerId = tracker[tracker.length - i];\n        addCommand(commands, { command: 'addLayer', args: [afterIndex[layerId], insertBeforeLayerId] });\n        tracker.splice(tracker.length - i, 0, layerId);\n        clean[layerId] = true;\n    }\n    // update layers\n    for (let i = 0; i < afterOrder.length; i++) {\n        layerId = afterOrder[i];\n        beforeLayer = beforeIndex[layerId];\n        afterLayer = afterIndex[layerId];\n        // no need to update if previously added (new or moved)\n        if (clean[layerId] || deepEqual(beforeLayer, afterLayer))\n            continue;\n        // If source, source-layer, or type have changes, then remove the layer\n        // and add it back 'from scratch'.\n        if (!deepEqual(beforeLayer.source, afterLayer.source) || !deepEqual(beforeLayer['source-layer'], afterLayer['source-layer']) || !deepEqual(beforeLayer.type, afterLayer.type)) {\n            addCommand(commands, { command: 'removeLayer', args: [layerId] });\n            // we add the layer back at the same position it was already in, so\n            // there's no need to update the `tracker`\n            insertBeforeLayerId = tracker[tracker.lastIndexOf(layerId) + 1];\n            addCommand(commands, { command: 'addLayer', args: [afterLayer, insertBeforeLayerId] });\n            continue;\n        }\n        // layout, paint, filter, minzoom, maxzoom\n        diffLayerPropertyChanges(beforeLayer.layout, afterLayer.layout, commands, layerId, null, 'setLayoutProperty');\n        diffLayerPropertyChanges(beforeLayer.paint, afterLayer.paint, commands, layerId, null, 'setPaintProperty');\n        if (!deepEqual(beforeLayer.filter, afterLayer.filter)) {\n            addCommand(commands, { command: 'setFilter', args: [layerId, afterLayer.filter] });\n        }\n        if (!deepEqual(beforeLayer.minzoom, afterLayer.minzoom) || !deepEqual(beforeLayer.maxzoom, afterLayer.maxzoom)) {\n            addCommand(commands, { command: 'setLayerZoomRange', args: [layerId, afterLayer.minzoom, afterLayer.maxzoom] });\n        }\n        // handle all other layer props, including paint.*\n        for (prop in beforeLayer) {\n            if (!Object.prototype.hasOwnProperty.call(beforeLayer, prop))\n                continue;\n            if (prop === 'layout' || prop === 'paint' || prop === 'filter' ||\n                prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom')\n                continue;\n            if (prop.indexOf('paint.') === 0) {\n                diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), 'setPaintProperty');\n            }\n            else if (!deepEqual(beforeLayer[prop], afterLayer[prop])) {\n                addCommand(commands, { command: 'setLayerProperty', args: [layerId, prop, afterLayer[prop]] });\n            }\n        }\n        for (prop in afterLayer) {\n            if (!Object.prototype.hasOwnProperty.call(afterLayer, prop) || Object.prototype.hasOwnProperty.call(beforeLayer, prop))\n                continue;\n            if (prop === 'layout' || prop === 'paint' || prop === 'filter' ||\n                prop === 'metadata' || prop === 'minzoom' || prop === 'maxzoom')\n                continue;\n            if (prop.indexOf('paint.') === 0) {\n                diffLayerPropertyChanges(beforeLayer[prop], afterLayer[prop], commands, layerId, prop.slice(6), 'setPaintProperty');\n            }\n            else if (!deepEqual(beforeLayer[prop], afterLayer[prop])) {\n                addCommand(commands, { command: 'setLayerProperty', args: [layerId, prop, afterLayer[prop]] });\n            }\n        }\n    }\n}\n/**\n * Diff two stylesheet\n *\n * Creates semanticly aware diffs that can easily be applied at runtime.\n * Operations produced by the diff closely resemble the maplibre-gl-js API. Any\n * error creating the diff will fall back to the 'setStyle' operation.\n *\n * Example diff:\n * [\n *     { command: 'setConstant', args: ['@water', '#0000FF'] },\n *     { command: 'setPaintProperty', args: ['background', 'background-color', 'black'] }\n * ]\n *\n * @private\n * @param {*} [before] stylesheet to compare from\n * @param {*} after stylesheet to compare to\n * @returns Array list of changes\n */\nfunction diffStyles(before, after) {\n    if (!before)\n        return [{ command: 'setStyle', args: [after] }];\n    let commands = [];\n    try {\n        // Handle changes to top-level properties\n        if (!deepEqual(before.version, after.version)) {\n            return [{ command: 'setStyle', args: [after] }];\n        }\n        if (!deepEqual(before.center, after.center)) {\n            commands.push({ command: 'setCenter', args: [after.center] });\n        }\n        if (!deepEqual(before.zoom, after.zoom)) {\n            commands.push({ command: 'setZoom', args: [after.zoom] });\n        }\n        if (!deepEqual(before.bearing, after.bearing)) {\n            commands.push({ command: 'setBearing', args: [after.bearing] });\n        }\n        if (!deepEqual(before.pitch, after.pitch)) {\n            commands.push({ command: 'setPitch', args: [after.pitch] });\n        }\n        if (!deepEqual(before.sprite, after.sprite)) {\n            commands.push({ command: 'setSprite', args: [after.sprite] });\n        }\n        if (!deepEqual(before.glyphs, after.glyphs)) {\n            commands.push({ command: 'setGlyphs', args: [after.glyphs] });\n        }\n        if (!deepEqual(before.transition, after.transition)) {\n            commands.push({ command: 'setTransition', args: [after.transition] });\n        }\n        if (!deepEqual(before.light, after.light)) {\n            commands.push({ command: 'setLight', args: [after.light] });\n        }\n        if (!deepEqual(before.terrain, after.terrain)) {\n            commands.push({ command: 'setTerrain', args: [after.terrain] });\n        }\n        if (!deepEqual(before.sky, after.sky)) {\n            commands.push({ command: 'setSky', args: [after.sky] });\n        }\n        if (!deepEqual(before.projection, after.projection)) {\n            commands.push({ command: 'setProjection', args: [after.projection] });\n        }\n        // Handle changes to `sources`\n        // If a source is to be removed, we also--before the removeSource\n        // command--need to remove all the style layers that depend on it.\n        const sourcesRemoved = {};\n        // First collect the {add,remove}Source commands\n        const removeOrAddSourceCommands = [];\n        diffSources(before.sources, after.sources, removeOrAddSourceCommands, sourcesRemoved);\n        // Push a removeLayer command for each style layer that depends on a\n        // source that's being removed.\n        // Also, exclude any such layers them from the input to `diffLayers`\n        // below, so that diffLayers produces the appropriate `addLayers`\n        // command\n        const beforeLayers = [];\n        if (before.layers) {\n            before.layers.forEach((layer) => {\n                if ('source' in layer && sourcesRemoved[layer.source]) {\n                    commands.push({ command: 'removeLayer', args: [layer.id] });\n                }\n                else {\n                    beforeLayers.push(layer);\n                }\n            });\n        }\n        commands = commands.concat(removeOrAddSourceCommands);\n        // Handle changes to `layers`\n        diffLayers(beforeLayers, after.layers, commands);\n    }\n    catch (e) {\n        // fall back to setStyle\n        console.warn('Unable to compute style diff:', e);\n        commands = [{ command: 'setStyle', args: [after] }];\n    }\n    return commands;\n}\n\n// Note: Do not inherit from Error. It breaks when transpiling to ES5.\nclass ValidationError {\n    constructor(key, value, message, identifier) {\n        this.message = (key ? `${key}: ` : '') + message;\n        if (identifier)\n            this.identifier = identifier;\n        if (value !== null && value !== undefined && value.__line__) {\n            this.line = value.__line__;\n        }\n    }\n}\n\n// Note: Do not inherit from Error. It breaks when transpiling to ES5.\nclass ParsingError {\n    constructor(error) {\n        this.error = error;\n        this.message = error.message;\n        const match = error.message.match(/line (\\d+)/);\n        this.line = match ? parseInt(match[1], 10) : 0;\n    }\n}\n\nfunction extendBy(output, ...inputs) {\n    for (const input of inputs) {\n        for (const k in input) {\n            output[k] = input[k];\n        }\n    }\n    return output;\n}\n\nclass ExpressionParsingError extends Error {\n    constructor(key, message) {\n        super(message);\n        this.message = message;\n        this.key = key;\n    }\n}\n\n/**\n * Tracks `let` bindings during expression parsing.\n * @private\n */\nclass Scope {\n    constructor(parent, bindings = []) {\n        this.parent = parent;\n        this.bindings = {};\n        for (const [name, expression] of bindings) {\n            this.bindings[name] = expression;\n        }\n    }\n    concat(bindings) {\n        return new Scope(this, bindings);\n    }\n    get(name) {\n        if (this.bindings[name]) {\n            return this.bindings[name];\n        }\n        if (this.parent) {\n            return this.parent.get(name);\n        }\n        throw new Error(`${name} not found in scope.`);\n    }\n    has(name) {\n        if (this.bindings[name])\n            return true;\n        return this.parent ? this.parent.has(name) : false;\n    }\n}\n\nconst NullType = { kind: 'null' };\nconst NumberType = { kind: 'number' };\nconst StringType = { kind: 'string' };\nconst BooleanType = { kind: 'boolean' };\nconst ColorType = { kind: 'color' };\nconst ObjectType = { kind: 'object' };\nconst ValueType = { kind: 'value' };\nconst ErrorType = { kind: 'error' };\nconst CollatorType = { kind: 'collator' };\nconst FormattedType = { kind: 'formatted' };\nconst PaddingType = { kind: 'padding' };\nconst ResolvedImageType = { kind: 'resolvedImage' };\nconst VariableAnchorOffsetCollectionType = { kind: 'variableAnchorOffsetCollection' };\nfunction array$1(itemType, N) {\n    return {\n        kind: 'array',\n        itemType,\n        N\n    };\n}\nfunction toString$1(type) {\n    if (type.kind === 'array') {\n        const itemType = toString$1(type.itemType);\n        return typeof type.N === 'number' ?\n            `array<${itemType}, ${type.N}>` :\n            type.itemType.kind === 'value' ? 'array' : `array<${itemType}>`;\n    }\n    else {\n        return type.kind;\n    }\n}\nconst valueMemberTypes = [\n    NullType,\n    NumberType,\n    StringType,\n    BooleanType,\n    ColorType,\n    FormattedType,\n    ObjectType,\n    array$1(ValueType),\n    PaddingType,\n    ResolvedImageType,\n    VariableAnchorOffsetCollectionType\n];\n/**\n * Returns null if `t` is a subtype of `expected`; otherwise returns an\n * error message.\n * @private\n */\nfunction checkSubtype(expected, t) {\n    if (t.kind === 'error') {\n        // Error is a subtype of every type\n        return null;\n    }\n    else if (expected.kind === 'array') {\n        if (t.kind === 'array' &&\n            ((t.N === 0 && t.itemType.kind === 'value') || !checkSubtype(expected.itemType, t.itemType)) &&\n            (typeof expected.N !== 'number' || expected.N === t.N)) {\n            return null;\n        }\n    }\n    else if (expected.kind === t.kind) {\n        return null;\n    }\n    else if (expected.kind === 'value') {\n        for (const memberType of valueMemberTypes) {\n            if (!checkSubtype(memberType, t)) {\n                return null;\n            }\n        }\n    }\n    return `Expected ${toString$1(expected)} but found ${toString$1(t)} instead.`;\n}\nfunction isValidType(provided, allowedTypes) {\n    return allowedTypes.some(t => t.kind === provided.kind);\n}\nfunction isValidNativeType(provided, allowedTypes) {\n    return allowedTypes.some(t => {\n        if (t === 'null') {\n            return provided === null;\n        }\n        else if (t === 'array') {\n            return Array.isArray(provided);\n        }\n        else if (t === 'object') {\n            return provided && !Array.isArray(provided) && typeof provided === 'object';\n        }\n        else {\n            return t === typeof provided;\n        }\n    });\n}\n/**\n * Verify whether the specified type is of the same type as the specified sample.\n *\n * @param provided Type to verify\n * @param sample Sample type to reference\n * @returns `true` if both objects are of the same type, `false` otherwise\n * @example basic types\n * if (verifyType(outputType, ValueType)) {\n *     // type narrowed to:\n *     outputType.kind; // 'value'\n * }\n * @example array types\n * if (verifyType(outputType, array(NumberType))) {\n *     // type narrowed to:\n *     outputType.kind; // 'array'\n *     outputType.itemType; // NumberTypeT\n *     outputType.itemType.kind; // 'number'\n * }\n */\nfunction verifyType(provided, sample) {\n    if (provided.kind === 'array' && sample.kind === 'array') {\n        return provided.itemType.kind === sample.itemType.kind && typeof provided.N === 'number';\n    }\n    return provided.kind === sample.kind;\n}\n\n// See https://observablehq.com/@mbostock/lab-and-rgb\nconst Xn = 0.96422, Yn = 1, Zn = 0.82521, t0 = 4 / 29, t1 = 6 / 29, t2 = 3 * t1 * t1, t3 = t1 * t1 * t1, deg2rad = Math.PI / 180, rad2deg = 180 / Math.PI;\nfunction constrainAngle(angle) {\n    angle = angle % 360;\n    if (angle < 0) {\n        angle += 360;\n    }\n    return angle;\n}\nfunction rgbToLab([r, g, b, alpha]) {\n    r = rgb2xyz(r);\n    g = rgb2xyz(g);\n    b = rgb2xyz(b);\n    let x, z;\n    const y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn);\n    if (r === g && g === b) {\n        x = z = y;\n    }\n    else {\n        x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n        z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n    }\n    const l = 116 * y - 16;\n    return [(l < 0) ? 0 : l, 500 * (x - y), 200 * (y - z), alpha];\n}\nfunction rgb2xyz(x) {\n    return (x <= 0.04045) ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\nfunction xyz2lab(t) {\n    return (t > t3) ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\nfunction labToRgb([l, a, b, alpha]) {\n    let y = (l + 16) / 116, x = isNaN(a) ? y : y + a / 500, z = isNaN(b) ? y : y - b / 200;\n    y = Yn * lab2xyz(y);\n    x = Xn * lab2xyz(x);\n    z = Zn * lab2xyz(z);\n    return [\n        xyz2rgb(3.1338561 * x - 1.6168667 * y - 0.4906146 * z), // D50 -> sRGB\n        xyz2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n        xyz2rgb(0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n        alpha,\n    ];\n}\nfunction xyz2rgb(x) {\n    x = (x <= 0.00304) ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055;\n    return (x < 0) ? 0 : (x > 1) ? 1 : x; // clip to 0..1 range\n}\nfunction lab2xyz(t) {\n    return (t > t1) ? t * t * t : t2 * (t - t0);\n}\nfunction rgbToHcl(rgbColor) {\n    const [l, a, b, alpha] = rgbToLab(rgbColor);\n    const c = Math.sqrt(a * a + b * b);\n    const h = Math.round(c * 10000) ? constrainAngle(Math.atan2(b, a) * rad2deg) : NaN;\n    return [h, c, l, alpha];\n}\nfunction hclToRgb([h, c, l, alpha]) {\n    h = isNaN(h) ? 0 : h * deg2rad;\n    return labToRgb([l, Math.cos(h) * c, Math.sin(h) * c, alpha]);\n}\n// https://drafts.csswg.org/css-color-4/#hsl-to-rgb\nfunction hslToRgb([h, s, l, alpha]) {\n    h = constrainAngle(h);\n    s /= 100;\n    l /= 100;\n    function f(n) {\n        const k = (n + h / 30) % 12;\n        const a = s * Math.min(l, 1 - l);\n        return l - a * Math.max(-1, Math.min(k - 3, 9 - k, 1));\n    }\n    return [f(0), f(8), f(4), alpha];\n}\n\n/**\n * CSS color parser compliant with CSS Color 4 Specification.\n * Supports: named colors, `transparent` keyword, all rgb hex notations,\n * rgb(), rgba(), hsl() and hsla() functions.\n * Does not round the parsed values to integers from the range 0..255.\n *\n * Syntax:\n *\n * <alpha-value> = <number> | <percentage>\n *         <hue> = <number> | <angle>\n *\n *         rgb() = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? )\n *         rgb() = rgb( <percentage>#{3} , <alpha-value>? )    | rgb( <number>#{3} , <alpha-value>? )\n *\n *         hsl() = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? )\n *         hsl() = hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )\n *\n * Caveats:\n *   - <angle> - <number> with optional `deg` suffix; `grad`, `rad`, `turn` are not supported\n *   - `none` keyword is not supported\n *   - comments inside rgb()/hsl() are not supported\n *   - legacy color syntax rgba() is supported with an identical grammar and behavior to rgb()\n *   - legacy color syntax hsla() is supported with an identical grammar and behavior to hsl()\n *\n * @param input CSS color string to parse.\n * @returns Color in sRGB color space, with `red`, `green`, `blue`\n * and `alpha` channels normalized to the range 0..1,\n * or `undefined` if the input is not a valid color string.\n */\nfunction parseCssColor(input) {\n    input = input.toLowerCase().trim();\n    if (input === 'transparent') {\n        return [0, 0, 0, 0];\n    }\n    // 'white', 'black', 'blue'\n    const namedColorsMatch = namedColors[input];\n    if (namedColorsMatch) {\n        const [r, g, b] = namedColorsMatch;\n        return [r / 255, g / 255, b / 255, 1];\n    }\n    // #f0c, #f0cf, #ff00cc, #ff00ccff\n    if (input.startsWith('#')) {\n        const hexRegexp = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/;\n        if (hexRegexp.test(input)) {\n            const step = input.length < 6 ? 1 : 2;\n            let i = 1;\n            return [\n                parseHex(input.slice(i, i += step)),\n                parseHex(input.slice(i, i += step)),\n                parseHex(input.slice(i, i += step)),\n                parseHex(input.slice(i, i + step) || 'ff'),\n            ];\n        }\n    }\n    // rgb(128 0 0), rgb(50% 0% 0%), rgba(255,0,255,0.6), rgb(255 0 255 / 60%), rgb(100% 0% 100% /.6)\n    if (input.startsWith('rgb')) {\n        const rgbRegExp = /^rgba?\\(\\s*([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)(%)?(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/;\n        const rgbMatch = input.match(rgbRegExp);\n        if (rgbMatch) {\n            const [_, // eslint-disable-line @typescript-eslint/no-unused-vars\n            r, // <numeric>\n            rp, // %         (optional)\n            f1, // ,         (optional)\n            g, // <numeric>\n            gp, // %         (optional)\n            f2, // ,         (optional)\n            b, // <numeric>\n            bp, // %         (optional)\n            f3, // ,|/       (optional)\n            a, // <numeric> (optional)\n            ap, // %         (optional)\n            ] = rgbMatch;\n            const argFormat = [f1 || ' ', f2 || ' ', f3].join('');\n            if (argFormat === '  ' ||\n                argFormat === '  /' ||\n                argFormat === ',,' ||\n                argFormat === ',,,') {\n                const valFormat = [rp, gp, bp].join('');\n                const maxValue = (valFormat === '%%%') ? 100 :\n                    (valFormat === '') ? 255 : 0;\n                if (maxValue) {\n                    const rgba = [\n                        clamp(+r / maxValue, 0, 1),\n                        clamp(+g / maxValue, 0, 1),\n                        clamp(+b / maxValue, 0, 1),\n                        a ? parseAlpha(+a, ap) : 1,\n                    ];\n                    if (validateNumbers(rgba)) {\n                        return rgba;\n                    }\n                    // invalid numbers\n                }\n                // values must be all numbers or all percentages\n            }\n            return; // comma optional syntax requires no commas at all\n        }\n    }\n    // hsl(120 50% 80%), hsla(120deg,50%,80%,.9), hsl(12e1 50% 80% / 90%)\n    const hslRegExp = /^hsla?\\(\\s*([\\de.+-]+)(?:deg)?(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s+|\\s*(,)\\s*)([\\de.+-]+)%(?:\\s*([,\\/])\\s*([\\de.+-]+)(%)?)?\\s*\\)$/;\n    const hslMatch = input.match(hslRegExp);\n    if (hslMatch) {\n        const [_, // eslint-disable-line @typescript-eslint/no-unused-vars\n        h, // <numeric>\n        f1, // ,         (optional)\n        s, // <numeric>\n        f2, // ,         (optional)\n        l, // <numeric>\n        f3, // ,|/       (optional)\n        a, // <numeric> (optional)\n        ap, // %         (optional)\n        ] = hslMatch;\n        const argFormat = [f1 || ' ', f2 || ' ', f3].join('');\n        if (argFormat === '  ' ||\n            argFormat === '  /' ||\n            argFormat === ',,' ||\n            argFormat === ',,,') {\n            const hsla = [\n                +h,\n                clamp(+s, 0, 100),\n                clamp(+l, 0, 100),\n                a ? parseAlpha(+a, ap) : 1,\n            ];\n            if (validateNumbers(hsla)) {\n                return hslToRgb(hsla);\n            }\n            // invalid numbers\n        }\n        // comma optional syntax requires no commas at all\n    }\n}\nfunction parseHex(hex) {\n    return parseInt(hex.padEnd(2, hex), 16) / 255;\n}\nfunction parseAlpha(a, asPercentage) {\n    return clamp(asPercentage ? (a / 100) : a, 0, 1);\n}\nfunction clamp(n, min, max) {\n    return Math.min(Math.max(min, n), max);\n}\n/**\n * The regular expression for numeric values is not super specific, and it may\n * happen that it will accept a value that is not a valid number. In order to\n * detect and eliminate such values this function exists.\n *\n * @param array Array of uncertain numbers.\n * @returns `true` if the specified array contains only valid numbers, `false` otherwise.\n */\nfunction validateNumbers(array) {\n    return !array.some(Number.isNaN);\n}\n/**\n * To generate:\n * - visit {@link https://www.w3.org/TR/css-color-4/#named-colors}\n * - run in the console:\n * @example\n * copy(`{\\n${[...document.querySelector('.named-color-table tbody').children].map((tr) => `${tr.cells[2].textContent.trim()}: [${tr.cells[4].textContent.trim().split(/\\s+/).join(', ')}],`).join('\\n')}\\n}`);\n */\nconst namedColors = {\n    aliceblue: [240, 248, 255],\n    antiquewhite: [250, 235, 215],\n    aqua: [0, 255, 255],\n    aquamarine: [127, 255, 212],\n    azure: [240, 255, 255],\n    beige: [245, 245, 220],\n    bisque: [255, 228, 196],\n    black: [0, 0, 0],\n    blanchedalmond: [255, 235, 205],\n    blue: [0, 0, 255],\n    blueviolet: [138, 43, 226],\n    brown: [165, 42, 42],\n    burlywood: [222, 184, 135],\n    cadetblue: [95, 158, 160],\n    chartreuse: [127, 255, 0],\n    chocolate: [210, 105, 30],\n    coral: [255, 127, 80],\n    cornflowerblue: [100, 149, 237],\n    cornsilk: [255, 248, 220],\n    crimson: [220, 20, 60],\n    cyan: [0, 255, 255],\n    darkblue: [0, 0, 139],\n    darkcyan: [0, 139, 139],\n    darkgoldenrod: [184, 134, 11],\n    darkgray: [169, 169, 169],\n    darkgreen: [0, 100, 0],\n    darkgrey: [169, 169, 169],\n    darkkhaki: [189, 183, 107],\n    darkmagenta: [139, 0, 139],\n    darkolivegreen: [85, 107, 47],\n    darkorange: [255, 140, 0],\n    darkorchid: [153, 50, 204],\n    darkred: [139, 0, 0],\n    darksalmon: [233, 150, 122],\n    darkseagreen: [143, 188, 143],\n    darkslateblue: [72, 61, 139],\n    darkslategray: [47, 79, 79],\n    darkslategrey: [47, 79, 79],\n    darkturquoise: [0, 206, 209],\n    darkviolet: [148, 0, 211],\n    deeppink: [255, 20, 147],\n    deepskyblue: [0, 191, 255],\n    dimgray: [105, 105, 105],\n    dimgrey: [105, 105, 105],\n    dodgerblue: [30, 144, 255],\n    firebrick: [178, 34, 34],\n    floralwhite: [255, 250, 240],\n    forestgreen: [34, 139, 34],\n    fuchsia: [255, 0, 255],\n    gainsboro: [220, 220, 220],\n    ghostwhite: [248, 248, 255],\n    gold: [255, 215, 0],\n    goldenrod: [218, 165, 32],\n    gray: [128, 128, 128],\n    green: [0, 128, 0],\n    greenyellow: [173, 255, 47],\n    grey: [128, 128, 128],\n    honeydew: [240, 255, 240],\n    hotpink: [255, 105, 180],\n    indianred: [205, 92, 92],\n    indigo: [75, 0, 130],\n    ivory: [255, 255, 240],\n    khaki: [240, 230, 140],\n    lavender: [230, 230, 250],\n    lavenderblush: [255, 240, 245],\n    lawngreen: [124, 252, 0],\n    lemonchiffon: [255, 250, 205],\n    lightblue: [173, 216, 230],\n    lightcoral: [240, 128, 128],\n    lightcyan: [224, 255, 255],\n    lightgoldenrodyellow: [250, 250, 210],\n    lightgray: [211, 211, 211],\n    lightgreen: [144, 238, 144],\n    lightgrey: [211, 211, 211],\n    lightpink: [255, 182, 193],\n    lightsalmon: [255, 160, 122],\n    lightseagreen: [32, 178, 170],\n    lightskyblue: [135, 206, 250],\n    lightslategray: [119, 136, 153],\n    lightslategrey: [119, 136, 153],\n    lightsteelblue: [176, 196, 222],\n    lightyellow: [255, 255, 224],\n    lime: [0, 255, 0],\n    limegreen: [50, 205, 50],\n    linen: [250, 240, 230],\n    magenta: [255, 0, 255],\n    maroon: [128, 0, 0],\n    mediumaquamarine: [102, 205, 170],\n    mediumblue: [0, 0, 205],\n    mediumorchid: [186, 85, 211],\n    mediumpurple: [147, 112, 219],\n    mediumseagreen: [60, 179, 113],\n    mediumslateblue: [123, 104, 238],\n    mediumspringgreen: [0, 250, 154],\n    mediumturquoise: [72, 209, 204],\n    mediumvioletred: [199, 21, 133],\n    midnightblue: [25, 25, 112],\n    mintcream: [245, 255, 250],\n    mistyrose: [255, 228, 225],\n    moccasin: [255, 228, 181],\n    navajowhite: [255, 222, 173],\n    navy: [0, 0, 128],\n    oldlace: [253, 245, 230],\n    olive: [128, 128, 0],\n    olivedrab: [107, 142, 35],\n    orange: [255, 165, 0],\n    orangered: [255, 69, 0],\n    orchid: [218, 112, 214],\n    palegoldenrod: [238, 232, 170],\n    palegreen: [152, 251, 152],\n    paleturquoise: [175, 238, 238],\n    palevioletred: [219, 112, 147],\n    papayawhip: [255, 239, 213],\n    peachpuff: [255, 218, 185],\n    peru: [205, 133, 63],\n    pink: [255, 192, 203],\n    plum: [221, 160, 221],\n    powderblue: [176, 224, 230],\n    purple: [128, 0, 128],\n    rebeccapurple: [102, 51, 153],\n    red: [255, 0, 0],\n    rosybrown: [188, 143, 143],\n    royalblue: [65, 105, 225],\n    saddlebrown: [139, 69, 19],\n    salmon: [250, 128, 114],\n    sandybrown: [244, 164, 96],\n    seagreen: [46, 139, 87],\n    seashell: [255, 245, 238],\n    sienna: [160, 82, 45],\n    silver: [192, 192, 192],\n    skyblue: [135, 206, 235],\n    slateblue: [106, 90, 205],\n    slategray: [112, 128, 144],\n    slategrey: [112, 128, 144],\n    snow: [255, 250, 250],\n    springgreen: [0, 255, 127],\n    steelblue: [70, 130, 180],\n    tan: [210, 180, 140],\n    teal: [0, 128, 128],\n    thistle: [216, 191, 216],\n    tomato: [255, 99, 71],\n    turquoise: [64, 224, 208],\n    violet: [238, 130, 238],\n    wheat: [245, 222, 179],\n    white: [255, 255, 255],\n    whitesmoke: [245, 245, 245],\n    yellow: [255, 255, 0],\n    yellowgreen: [154, 205, 50],\n};\n\n/**\n * Color representation used by WebGL.\n * Defined in sRGB color space and pre-blended with alpha.\n * @private\n */\nclass Color {\n    /**\n     * @param r Red component premultiplied by `alpha` 0..1\n     * @param g Green component premultiplied by `alpha` 0..1\n     * @param b Blue component premultiplied by `alpha` 0..1\n     * @param [alpha=1] Alpha component 0..1\n     * @param [premultiplied=true] Whether the `r`, `g` and `b` values have already\n     * been multiplied by alpha. If `true` nothing happens if `false` then they will\n     * be multiplied automatically.\n     */\n    constructor(r, g, b, alpha = 1, premultiplied = true) {\n        this.r = r;\n        this.g = g;\n        this.b = b;\n        this.a = alpha;\n        if (!premultiplied) {\n            this.r *= alpha;\n            this.g *= alpha;\n            this.b *= alpha;\n            if (!alpha) {\n                // alpha = 0 erases completely rgb channels. This behavior is not desirable\n                // if this particular color is later used in color interpolation.\n                // Because of that, a reference to original color is saved.\n                this.overwriteGetter('rgb', [r, g, b, alpha]);\n            }\n        }\n    }\n    /**\n     * Parses CSS color strings and converts colors to sRGB color space if needed.\n     * Officially supported color formats:\n     * - keyword, e.g. 'aquamarine' or 'steelblue'\n     * - hex (with 3, 4, 6 or 8 digits), e.g. '#f0f' or '#e9bebea9'\n     * - rgb and rgba, e.g. 'rgb(0,240,120)' or 'rgba(0%,94%,47%,0.1)' or 'rgb(0 240 120 / .3)'\n     * - hsl and hsla, e.g. 'hsl(0,0%,83%)' or 'hsla(0,0%,83%,.5)' or 'hsl(0 0% 83% / 20%)'\n     *\n     * @param input CSS color string to parse.\n     * @returns A `Color` instance, or `undefined` if the input is not a valid color string.\n     */\n    static parse(input) {\n        // in zoom-and-property function input could be an instance of Color class\n        if (input instanceof Color) {\n            return input;\n        }\n        if (typeof input !== 'string') {\n            return;\n        }\n        const rgba = parseCssColor(input);\n        if (rgba) {\n            return new Color(...rgba, false);\n        }\n    }\n    /**\n     * Used in color interpolation and by 'to-rgba' expression.\n     *\n     * @returns Gien color, with reversed alpha blending, in sRGB color space.\n     */\n    get rgb() {\n        const { r, g, b, a } = this;\n        const f = a || Infinity; // reverse alpha blending factor\n        return this.overwriteGetter('rgb', [r / f, g / f, b / f, a]);\n    }\n    /**\n     * Used in color interpolation.\n     *\n     * @returns Gien color, with reversed alpha blending, in HCL color space.\n     */\n    get hcl() {\n        return this.overwriteGetter('hcl', rgbToHcl(this.rgb));\n    }\n    /**\n     * Used in color interpolation.\n     *\n     * @returns Gien color, with reversed alpha blending, in LAB color space.\n     */\n    get lab() {\n        return this.overwriteGetter('lab', rgbToLab(this.rgb));\n    }\n    /**\n     * Lazy getter pattern. When getter is called for the first time lazy value\n     * is calculated and then overwrites getter function in given object instance.\n     *\n     * @example:\n     * const redColor = Color.parse('red');\n     * let x = redColor.hcl; // this will invoke `get hcl()`, which will calculate\n     * // the value of red in HCL space and invoke this `overwriteGetter` function\n     * // which in turn will set a field with a key 'hcl' in the `redColor` object.\n     * // In other words it will override `get hcl()` from its `Color` prototype\n     * // with its own property: hcl = [calculated red value in hcl].\n     * let y = redColor.hcl; // next call will no longer invoke getter but simply\n     * // return the previously calculated value\n     * x === y; // true - `x` is exactly the same object as `y`\n     *\n     * @param getterKey Getter key\n     * @param lazyValue Lazily calculated value to be memoized by current instance\n     * @private\n     */\n    overwriteGetter(getterKey, lazyValue) {\n        Object.defineProperty(this, getterKey, { value: lazyValue });\n        return lazyValue;\n    }\n    /**\n     * Used by 'to-string' expression.\n     *\n     * @returns Serialized color in format `rgba(r,g,b,a)`\n     * where r,g,b are numbers within 0..255 and alpha is number within 1..0\n     *\n     * @example\n     * var purple = new Color.parse('purple');\n     * purple.toString; // = \"rgba(128,0,128,1)\"\n     * var translucentGreen = new Color.parse('rgba(26, 207, 26, .73)');\n     * translucentGreen.toString(); // = \"rgba(26,207,26,0.73)\"\n     */\n    toString() {\n        const [r, g, b, a] = this.rgb;\n        return `rgba(${[r, g, b].map(n => Math.round(n * 255)).join(',')},${a})`;\n    }\n}\nColor.black = new Color(0, 0, 0, 1);\nColor.white = new Color(1, 1, 1, 1);\nColor.transparent = new Color(0, 0, 0, 0);\nColor.red = new Color(1, 0, 0, 1);\n\n// Flow type declarations for Intl cribbed from\n// https://github.com/facebook/flow/issues/1270\nclass Collator {\n    constructor(caseSensitive, diacriticSensitive, locale) {\n        if (caseSensitive)\n            this.sensitivity = diacriticSensitive ? 'variant' : 'case';\n        else\n            this.sensitivity = diacriticSensitive ? 'accent' : 'base';\n        this.locale = locale;\n        this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: 'search' });\n    }\n    compare(lhs, rhs) {\n        return this.collator.compare(lhs, rhs);\n    }\n    resolvedLocale() {\n        // We create a Collator without \"usage: search\" because we don't want\n        // the search options encoded in our result (e.g. \"en-u-co-search\")\n        return new Intl.Collator(this.locale ? this.locale : [])\n            .resolvedOptions().locale;\n    }\n}\n\nclass FormattedSection {\n    constructor(text, image, scale, fontStack, textColor) {\n        this.text = text;\n        this.image = image;\n        this.scale = scale;\n        this.fontStack = fontStack;\n        this.textColor = textColor;\n    }\n}\nclass Formatted {\n    constructor(sections) {\n        this.sections = sections;\n    }\n    static fromString(unformatted) {\n        return new Formatted([new FormattedSection(unformatted, null, null, null, null)]);\n    }\n    isEmpty() {\n        if (this.sections.length === 0)\n            return true;\n        return !this.sections.some(section => section.text.length !== 0 ||\n            (section.image && section.image.name.length !== 0));\n    }\n    static factory(text) {\n        if (text instanceof Formatted) {\n            return text;\n        }\n        else {\n            return Formatted.fromString(text);\n        }\n    }\n    toString() {\n        if (this.sections.length === 0)\n            return '';\n        return this.sections.map(section => section.text).join('');\n    }\n}\n\n/**\n * A set of four numbers representing padding around a box. Create instances from\n * bare arrays or numeric values using the static method `Padding.parse`.\n * @private\n */\nclass Padding {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    /**\n     * Numeric padding values\n     * @param input A padding value\n     * @returns A `Padding` instance, or `undefined` if the input is not a valid padding value.\n     */\n    static parse(input) {\n        if (input instanceof Padding) {\n            return input;\n        }\n        // Backwards compatibility: bare number is treated the same as array with single value.\n        // Padding applies to all four sides.\n        if (typeof input === 'number') {\n            return new Padding([input, input, input, input]);\n        }\n        if (!Array.isArray(input)) {\n            return undefined;\n        }\n        if (input.length < 1 || input.length > 4) {\n            return undefined;\n        }\n        for (const val of input) {\n            if (typeof val !== 'number') {\n                return undefined;\n            }\n        }\n        // Expand shortcut properties into explicit 4-sided values\n        switch (input.length) {\n            case 1:\n                input = [input[0], input[0], input[0], input[0]];\n                break;\n            case 2:\n                input = [input[0], input[1], input[0], input[1]];\n                break;\n            case 3:\n                input = [input[0], input[1], input[2], input[1]];\n                break;\n        }\n        return new Padding(input);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n}\n\n/** Set of valid anchor positions, as a set for validation */\nconst anchors = new Set(['center', 'left', 'right', 'top', 'bottom', 'top-left', 'top-right', 'bottom-left', 'bottom-right']);\n/**\n * Utility class to assist managing values for text-variable-anchor-offset property. Create instances from\n * bare arrays using the static method `VariableAnchorOffsetCollection.parse`.\n * @private\n */\nclass VariableAnchorOffsetCollection {\n    constructor(values) {\n        this.values = values.slice();\n    }\n    static parse(input) {\n        if (input instanceof VariableAnchorOffsetCollection) {\n            return input;\n        }\n        if (!Array.isArray(input) ||\n            input.length < 1 ||\n            input.length % 2 !== 0) {\n            return undefined;\n        }\n        for (let i = 0; i < input.length; i += 2) {\n            // Elements in even positions should be anchor positions; Elements in odd positions should be offset values\n            const anchorValue = input[i];\n            const offsetValue = input[i + 1];\n            if (typeof anchorValue !== 'string' || !anchors.has(anchorValue)) {\n                return undefined;\n            }\n            if (!Array.isArray(offsetValue) || offsetValue.length !== 2 || typeof offsetValue[0] !== 'number' || typeof offsetValue[1] !== 'number') {\n                return undefined;\n            }\n        }\n        return new VariableAnchorOffsetCollection(input);\n    }\n    toString() {\n        return JSON.stringify(this.values);\n    }\n}\n\nclass ResolvedImage {\n    constructor(options) {\n        this.name = options.name;\n        this.available = options.available;\n    }\n    toString() {\n        return this.name;\n    }\n    static fromString(name) {\n        if (!name)\n            return null; // treat empty values as no image\n        return new ResolvedImage({ name, available: false });\n    }\n}\n\nfunction validateRGBA(r, g, b, a) {\n    if (!(typeof r === 'number' && r >= 0 && r <= 255 &&\n        typeof g === 'number' && g >= 0 && g <= 255 &&\n        typeof b === 'number' && b >= 0 && b <= 255)) {\n        const value = typeof a === 'number' ? [r, g, b, a] : [r, g, b];\n        return `Invalid rgba value [${value.join(', ')}]: 'r', 'g', and 'b' must be between 0 and 255.`;\n    }\n    if (!(typeof a === 'undefined' || (typeof a === 'number' && a >= 0 && a <= 1))) {\n        return `Invalid rgba value [${[r, g, b, a].join(', ')}]: 'a' must be between 0 and 1.`;\n    }\n    return null;\n}\nfunction isValue(mixed) {\n    if (mixed === null ||\n        typeof mixed === 'string' ||\n        typeof mixed === 'boolean' ||\n        typeof mixed === 'number' ||\n        mixed instanceof Color ||\n        mixed instanceof Collator ||\n        mixed instanceof Formatted ||\n        mixed instanceof Padding ||\n        mixed instanceof VariableAnchorOffsetCollection ||\n        mixed instanceof ResolvedImage) {\n        return true;\n    }\n    else if (Array.isArray(mixed)) {\n        for (const item of mixed) {\n            if (!isValue(item)) {\n                return false;\n            }\n        }\n        return true;\n    }\n    else if (typeof mixed === 'object') {\n        for (const key in mixed) {\n            if (!isValue(mixed[key])) {\n                return false;\n            }\n        }\n        return true;\n    }\n    else {\n        return false;\n    }\n}\nfunction typeOf(value) {\n    if (value === null) {\n        return NullType;\n    }\n    else if (typeof value === 'string') {\n        return StringType;\n    }\n    else if (typeof value === 'boolean') {\n        return BooleanType;\n    }\n    else if (typeof value === 'number') {\n        return NumberType;\n    }\n    else if (value instanceof Color) {\n        return ColorType;\n    }\n    else if (value instanceof Collator) {\n        return CollatorType;\n    }\n    else if (value instanceof Formatted) {\n        return FormattedType;\n    }\n    else if (value instanceof Padding) {\n        return PaddingType;\n    }\n    else if (value instanceof VariableAnchorOffsetCollection) {\n        return VariableAnchorOffsetCollectionType;\n    }\n    else if (value instanceof ResolvedImage) {\n        return ResolvedImageType;\n    }\n    else if (Array.isArray(value)) {\n        const length = value.length;\n        let itemType;\n        for (const item of value) {\n            const t = typeOf(item);\n            if (!itemType) {\n                itemType = t;\n            }\n            else if (itemType === t) {\n                continue;\n            }\n            else {\n                itemType = ValueType;\n                break;\n            }\n        }\n        return array$1(itemType || ValueType, length);\n    }\n    else {\n        return ObjectType;\n    }\n}\nfunction toString(value) {\n    const type = typeof value;\n    if (value === null) {\n        return '';\n    }\n    else if (type === 'string' || type === 'number' || type === 'boolean') {\n        return String(value);\n    }\n    else if (value instanceof Color || value instanceof Formatted || value instanceof Padding || value instanceof VariableAnchorOffsetCollection || value instanceof ResolvedImage) {\n        return value.toString();\n    }\n    else {\n        return JSON.stringify(value);\n    }\n}\n\nclass Literal {\n    constructor(type, value) {\n        this.type = type;\n        this.value = value;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`'literal' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n        if (!isValue(args[1]))\n            return context.error('invalid value');\n        const value = args[1];\n        let type = typeOf(value);\n        // special case: infer the item type if possible for zero-length arrays\n        const expected = context.expectedType;\n        if (type.kind === 'array' &&\n            type.N === 0 &&\n            expected &&\n            expected.kind === 'array' &&\n            (typeof expected.N !== 'number' || expected.N === 0)) {\n            type = expected;\n        }\n        return new Literal(type, value);\n    }\n    evaluate() {\n        return this.value;\n    }\n    eachChild() { }\n    outputDefined() {\n        return true;\n    }\n}\n\nclass RuntimeError {\n    constructor(message) {\n        this.name = 'ExpressionEvaluationError';\n        this.message = message;\n    }\n    toJSON() {\n        return this.message;\n    }\n}\n\nconst types$1 = {\n    string: StringType,\n    number: NumberType,\n    boolean: BooleanType,\n    object: ObjectType\n};\nclass Assertion {\n    constructor(type, args) {\n        this.type = type;\n        this.args = args;\n    }\n    static parse(args, context) {\n        if (args.length < 2)\n            return context.error('Expected at least one argument.');\n        let i = 1;\n        let type;\n        const name = args[0];\n        if (name === 'array') {\n            let itemType;\n            if (args.length > 2) {\n                const type = args[1];\n                if (typeof type !== 'string' || !(type in types$1) || type === 'object')\n                    return context.error('The item type argument of \"array\" must be one of string, number, boolean', 1);\n                itemType = types$1[type];\n                i++;\n            }\n            else {\n                itemType = ValueType;\n            }\n            let N;\n            if (args.length > 3) {\n                if (args[2] !== null &&\n                    (typeof args[2] !== 'number' ||\n                        args[2] < 0 ||\n                        args[2] !== Math.floor(args[2]))) {\n                    return context.error('The length argument to \"array\" must be a positive integer literal', 2);\n                }\n                N = args[2];\n                i++;\n            }\n            type = array$1(itemType, N);\n        }\n        else {\n            if (!types$1[name])\n                throw new Error(`Types doesn't contain name = ${name}`);\n            type = types$1[name];\n        }\n        const parsed = [];\n        for (; i < args.length; i++) {\n            const input = context.parse(args[i], i, ValueType);\n            if (!input)\n                return null;\n            parsed.push(input);\n        }\n        return new Assertion(type, parsed);\n    }\n    evaluate(ctx) {\n        for (let i = 0; i < this.args.length; i++) {\n            const value = this.args[i].evaluate(ctx);\n            const error = checkSubtype(this.type, typeOf(value));\n            if (!error) {\n                return value;\n            }\n            else if (i === this.args.length - 1) {\n                throw new RuntimeError(`Expected value to be of type ${toString$1(this.type)}, but found ${toString$1(typeOf(value))} instead.`);\n            }\n        }\n        throw new Error();\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return this.args.every(arg => arg.outputDefined());\n    }\n}\n\nconst types = {\n    'to-boolean': BooleanType,\n    'to-color': ColorType,\n    'to-number': NumberType,\n    'to-string': StringType\n};\n/**\n * Special form for error-coalescing coercion expressions \"to-number\",\n * \"to-color\".  Since these coercions can fail at runtime, they accept multiple\n * arguments, only evaluating one at a time until one succeeds.\n *\n * @private\n */\nclass Coercion {\n    constructor(type, args) {\n        this.type = type;\n        this.args = args;\n    }\n    static parse(args, context) {\n        if (args.length < 2)\n            return context.error('Expected at least one argument.');\n        const name = args[0];\n        if (!types[name])\n            throw new Error(`Can't parse ${name} as it is not part of the known types`);\n        if ((name === 'to-boolean' || name === 'to-string') && args.length !== 2)\n            return context.error('Expected one argument.');\n        const type = types[name];\n        const parsed = [];\n        for (let i = 1; i < args.length; i++) {\n            const input = context.parse(args[i], i, ValueType);\n            if (!input)\n                return null;\n            parsed.push(input);\n        }\n        return new Coercion(type, parsed);\n    }\n    evaluate(ctx) {\n        switch (this.type.kind) {\n            case 'boolean':\n                return Boolean(this.args[0].evaluate(ctx));\n            case 'color': {\n                let input;\n                let error;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    error = null;\n                    if (input instanceof Color) {\n                        return input;\n                    }\n                    else if (typeof input === 'string') {\n                        const c = ctx.parseColor(input);\n                        if (c)\n                            return c;\n                    }\n                    else if (Array.isArray(input)) {\n                        if (input.length < 3 || input.length > 4) {\n                            error = `Invalid rbga value ${JSON.stringify(input)}: expected an array containing either three or four numeric values.`;\n                        }\n                        else {\n                            error = validateRGBA(input[0], input[1], input[2], input[3]);\n                        }\n                        if (!error) {\n                            return new Color(input[0] / 255, input[1] / 255, input[2] / 255, input[3]);\n                        }\n                    }\n                }\n                throw new RuntimeError(error || `Could not parse color from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'padding': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const pad = Padding.parse(input);\n                    if (pad) {\n                        return pad;\n                    }\n                }\n                throw new RuntimeError(`Could not parse padding from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'variableAnchorOffsetCollection': {\n                let input;\n                for (const arg of this.args) {\n                    input = arg.evaluate(ctx);\n                    const coll = VariableAnchorOffsetCollection.parse(input);\n                    if (coll) {\n                        return coll;\n                    }\n                }\n                throw new RuntimeError(`Could not parse variableAnchorOffsetCollection from value '${typeof input === 'string' ? input : JSON.stringify(input)}'`);\n            }\n            case 'number': {\n                let value = null;\n                for (const arg of this.args) {\n                    value = arg.evaluate(ctx);\n                    if (value === null)\n                        return 0;\n                    const num = Number(value);\n                    if (isNaN(num))\n                        continue;\n                    return num;\n                }\n                throw new RuntimeError(`Could not convert ${JSON.stringify(value)} to number.`);\n            }\n            case 'formatted':\n                // There is no explicit 'to-formatted' but this coercion can be implicitly\n                // created by properties that expect the 'formatted' type.\n                return Formatted.fromString(toString(this.args[0].evaluate(ctx)));\n            case 'resolvedImage':\n                return ResolvedImage.fromString(toString(this.args[0].evaluate(ctx)));\n            default:\n                return toString(this.args[0].evaluate(ctx));\n        }\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return this.args.every(arg => arg.outputDefined());\n    }\n}\n\nconst geometryTypes = ['Unknown', 'Point', 'LineString', 'Polygon'];\nclass EvaluationContext {\n    constructor() {\n        this.globals = null;\n        this.feature = null;\n        this.featureState = null;\n        this.formattedSection = null;\n        this._parseColorCache = {};\n        this.availableImages = null;\n        this.canonical = null;\n    }\n    id() {\n        return this.feature && 'id' in this.feature ? this.feature.id : null;\n    }\n    geometryType() {\n        return this.feature ? typeof this.feature.type === 'number' ? geometryTypes[this.feature.type] : this.feature.type : null;\n    }\n    geometry() {\n        return this.feature && 'geometry' in this.feature ? this.feature.geometry : null;\n    }\n    canonicalID() {\n        return this.canonical;\n    }\n    properties() {\n        return this.feature && this.feature.properties || {};\n    }\n    parseColor(input) {\n        let cached = this._parseColorCache[input];\n        if (!cached) {\n            cached = this._parseColorCache[input] = Color.parse(input);\n        }\n        return cached;\n    }\n}\n\n/**\n * State associated parsing at a given point in an expression tree.\n * @private\n */\nclass ParsingContext {\n    constructor(registry, isConstantFunc, path = [], expectedType, scope = new Scope(), errors = []) {\n        this.registry = registry;\n        this.path = path;\n        this.key = path.map(part => `[${part}]`).join('');\n        this.scope = scope;\n        this.errors = errors;\n        this.expectedType = expectedType;\n        this._isConstant = isConstantFunc;\n    }\n    /**\n     * @param expr the JSON expression to parse\n     * @param index the optional argument index if this expression is an argument of a parent expression that's being parsed\n     * @param options\n     * @param options.omitTypeAnnotations set true to omit inferred type annotations.  Caller beware: with this option set, the parsed expression's type will NOT satisfy `expectedType` if it would normally be wrapped in an inferred annotation.\n     * @private\n     */\n    parse(expr, index, expectedType, bindings, options = {}) {\n        if (index) {\n            return this.concat(index, expectedType, bindings)._parse(expr, options);\n        }\n        return this._parse(expr, options);\n    }\n    _parse(expr, options) {\n        if (expr === null || typeof expr === 'string' || typeof expr === 'boolean' || typeof expr === 'number') {\n            expr = ['literal', expr];\n        }\n        function annotate(parsed, type, typeAnnotation) {\n            if (typeAnnotation === 'assert') {\n                return new Assertion(type, [parsed]);\n            }\n            else if (typeAnnotation === 'coerce') {\n                return new Coercion(type, [parsed]);\n            }\n            else {\n                return parsed;\n            }\n        }\n        if (Array.isArray(expr)) {\n            if (expr.length === 0) {\n                return this.error('Expected an array with at least one element. If you wanted a literal array, use [\"literal\", []].');\n            }\n            const op = expr[0];\n            if (typeof op !== 'string') {\n                this.error(`Expression name must be a string, but found ${typeof op} instead. If you wanted a literal array, use [\"literal\", [...]].`, 0);\n                return null;\n            }\n            const Expr = this.registry[op];\n            if (Expr) {\n                let parsed = Expr.parse(expr, this);\n                if (!parsed)\n                    return null;\n                if (this.expectedType) {\n                    const expected = this.expectedType;\n                    const actual = parsed.type;\n                    // When we expect a number, string, boolean, or array but have a value, wrap it in an assertion.\n                    // When we expect a color or formatted string, but have a string or value, wrap it in a coercion.\n                    // Otherwise, we do static type-checking.\n                    //\n                    // These behaviors are overridable for:\n                    //   * The \"coalesce\" operator, which needs to omit type annotations.\n                    //   * String-valued properties (e.g. `text-field`), where coercion is more convenient than assertion.\n                    //\n                    if ((expected.kind === 'string' || expected.kind === 'number' || expected.kind === 'boolean' || expected.kind === 'object' || expected.kind === 'array') && actual.kind === 'value') {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'assert');\n                    }\n                    else if ((expected.kind === 'color' || expected.kind === 'formatted' || expected.kind === 'resolvedImage') && (actual.kind === 'value' || actual.kind === 'string')) {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');\n                    }\n                    else if (expected.kind === 'padding' && (actual.kind === 'value' || actual.kind === 'number' || actual.kind === 'array')) {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');\n                    }\n                    else if (expected.kind === 'variableAnchorOffsetCollection' && (actual.kind === 'value' || actual.kind === 'array')) {\n                        parsed = annotate(parsed, expected, options.typeAnnotation || 'coerce');\n                    }\n                    else if (this.checkSubtype(expected, actual)) {\n                        return null;\n                    }\n                }\n                // If an expression's arguments are all literals, we can evaluate\n                // it immediately and replace it with a literal value in the\n                // parsed/compiled result. Expressions that expect an image should\n                // not be resolved here so we can later get the available images.\n                if (!(parsed instanceof Literal) && (parsed.type.kind !== 'resolvedImage') && this._isConstant(parsed)) {\n                    const ec = new EvaluationContext();\n                    try {\n                        parsed = new Literal(parsed.type, parsed.evaluate(ec));\n                    }\n                    catch (e) {\n                        this.error(e.message);\n                        return null;\n                    }\n                }\n                return parsed;\n            }\n            return this.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n        }\n        else if (typeof expr === 'undefined') {\n            return this.error('\\'undefined\\' value invalid. Use null instead.');\n        }\n        else if (typeof expr === 'object') {\n            return this.error('Bare objects invalid. Use [\"literal\", {...}] instead.');\n        }\n        else {\n            return this.error(`Expected an array, but found ${typeof expr} instead.`);\n        }\n    }\n    /**\n     * Returns a copy of this context suitable for parsing the subexpression at\n     * index `index`, optionally appending to 'let' binding map.\n     *\n     * Note that `errors` property, intended for collecting errors while\n     * parsing, is copied by reference rather than cloned.\n     * @private\n     */\n    concat(index, expectedType, bindings) {\n        const path = typeof index === 'number' ? this.path.concat(index) : this.path;\n        const scope = bindings ? this.scope.concat(bindings) : this.scope;\n        return new ParsingContext(this.registry, this._isConstant, path, expectedType || null, scope, this.errors);\n    }\n    /**\n     * Push a parsing (or type checking) error into the `this.errors`\n     * @param error The message\n     * @param keys Optionally specify the source of the error at a child\n     * of the current expression at `this.key`.\n     * @private\n     */\n    error(error, ...keys) {\n        const key = `${this.key}${keys.map(k => `[${k}]`).join('')}`;\n        this.errors.push(new ExpressionParsingError(key, error));\n    }\n    /**\n     * Returns null if `t` is a subtype of `expected`; otherwise returns an\n     * error message and also pushes it to `this.errors`.\n     * @param expected The expected type\n     * @param t The actual type\n     * @returns null if `t` is a subtype of `expected`; otherwise returns an error message\n     */\n    checkSubtype(expected, t) {\n        const error = checkSubtype(expected, t);\n        if (error)\n            this.error(error);\n        return error;\n    }\n}\n\nclass Let {\n    constructor(bindings, result) {\n        this.type = result.type;\n        this.bindings = [].concat(bindings);\n        this.result = result;\n    }\n    evaluate(ctx) {\n        return this.result.evaluate(ctx);\n    }\n    eachChild(fn) {\n        for (const binding of this.bindings) {\n            fn(binding[1]);\n        }\n        fn(this.result);\n    }\n    static parse(args, context) {\n        if (args.length < 4)\n            return context.error(`Expected at least 3 arguments, but found ${args.length - 1} instead.`);\n        const bindings = [];\n        for (let i = 1; i < args.length - 1; i += 2) {\n            const name = args[i];\n            if (typeof name !== 'string') {\n                return context.error(`Expected string, but found ${typeof name} instead.`, i);\n            }\n            if (/[^a-zA-Z0-9_]/.test(name)) {\n                return context.error('Variable names must contain only alphanumeric characters or \\'_\\'.', i);\n            }\n            const value = context.parse(args[i + 1], i + 1);\n            if (!value)\n                return null;\n            bindings.push([name, value]);\n        }\n        const result = context.parse(args[args.length - 1], args.length - 1, context.expectedType, bindings);\n        if (!result)\n            return null;\n        return new Let(bindings, result);\n    }\n    outputDefined() {\n        return this.result.outputDefined();\n    }\n}\n\nclass Var {\n    constructor(name, boundExpression) {\n        this.type = boundExpression.type;\n        this.name = name;\n        this.boundExpression = boundExpression;\n    }\n    static parse(args, context) {\n        if (args.length !== 2 || typeof args[1] !== 'string')\n            return context.error('\\'var\\' expression requires exactly one string literal argument.');\n        const name = args[1];\n        if (!context.scope.has(name)) {\n            return context.error(`Unknown variable \"${name}\". Make sure \"${name}\" has been bound in an enclosing \"let\" expression before using it.`, 1);\n        }\n        return new Var(name, context.scope.get(name));\n    }\n    evaluate(ctx) {\n        return this.boundExpression.evaluate(ctx);\n    }\n    eachChild() { }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass At {\n    constructor(type, index, input) {\n        this.type = type;\n        this.index = index;\n        this.input = input;\n    }\n    static parse(args, context) {\n        if (args.length !== 3)\n            return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n        const index = context.parse(args[1], 1, NumberType);\n        const input = context.parse(args[2], 2, array$1(context.expectedType || ValueType));\n        if (!index || !input)\n            return null;\n        const t = input.type;\n        return new At(t.itemType, index, input);\n    }\n    evaluate(ctx) {\n        const index = this.index.evaluate(ctx);\n        const array = this.input.evaluate(ctx);\n        if (index < 0) {\n            throw new RuntimeError(`Array index out of bounds: ${index} < 0.`);\n        }\n        if (index >= array.length) {\n            throw new RuntimeError(`Array index out of bounds: ${index} > ${array.length - 1}.`);\n        }\n        if (index !== Math.floor(index)) {\n            throw new RuntimeError(`Array index must be an integer, but found ${index} instead.`);\n        }\n        return array[index];\n    }\n    eachChild(fn) {\n        fn(this.index);\n        fn(this.input);\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass In {\n    constructor(needle, haystack) {\n        this.type = BooleanType;\n        this.needle = needle;\n        this.haystack = haystack;\n    }\n    static parse(args, context) {\n        if (args.length !== 3) {\n            return context.error(`Expected 2 arguments, but found ${args.length - 1} instead.`);\n        }\n        const needle = context.parse(args[1], 1, ValueType);\n        const haystack = context.parse(args[2], 2, ValueType);\n        if (!needle || !haystack)\n            return null;\n        if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n            return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(needle.type)} instead`);\n        }\n        return new In(needle, haystack);\n    }\n    evaluate(ctx) {\n        const needle = this.needle.evaluate(ctx);\n        const haystack = this.haystack.evaluate(ctx);\n        if (!haystack)\n            return false;\n        if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n            throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(typeOf(needle))} instead.`);\n        }\n        if (!isValidNativeType(haystack, ['string', 'array'])) {\n            throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString$1(typeOf(haystack))} instead.`);\n        }\n        return haystack.indexOf(needle) >= 0;\n    }\n    eachChild(fn) {\n        fn(this.needle);\n        fn(this.haystack);\n    }\n    outputDefined() {\n        return true;\n    }\n}\n\nclass IndexOf {\n    constructor(needle, haystack, fromIndex) {\n        this.type = NumberType;\n        this.needle = needle;\n        this.haystack = haystack;\n        this.fromIndex = fromIndex;\n    }\n    static parse(args, context) {\n        if (args.length <= 2 || args.length >= 5) {\n            return context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);\n        }\n        const needle = context.parse(args[1], 1, ValueType);\n        const haystack = context.parse(args[2], 2, ValueType);\n        if (!needle || !haystack)\n            return null;\n        if (!isValidType(needle.type, [BooleanType, StringType, NumberType, NullType, ValueType])) {\n            return context.error(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(needle.type)} instead`);\n        }\n        if (args.length === 4) {\n            const fromIndex = context.parse(args[3], 3, NumberType);\n            if (!fromIndex)\n                return null;\n            return new IndexOf(needle, haystack, fromIndex);\n        }\n        else {\n            return new IndexOf(needle, haystack);\n        }\n    }\n    evaluate(ctx) {\n        const needle = this.needle.evaluate(ctx);\n        const haystack = this.haystack.evaluate(ctx);\n        if (!isValidNativeType(needle, ['boolean', 'string', 'number', 'null'])) {\n            throw new RuntimeError(`Expected first argument to be of type boolean, string, number or null, but found ${toString$1(typeOf(needle))} instead.`);\n        }\n        let fromIndex;\n        if (this.fromIndex) {\n            fromIndex = this.fromIndex.evaluate(ctx);\n        }\n        if (isValidNativeType(haystack, ['string'])) {\n            const rawIndex = haystack.indexOf(needle, fromIndex);\n            if (rawIndex === -1) {\n                return -1;\n            }\n            else {\n                // The index may be affected by surrogate pairs, so get the length of the preceding substring.\n                return [...haystack.slice(0, rawIndex)].length;\n            }\n        }\n        else if (isValidNativeType(haystack, ['array'])) {\n            return haystack.indexOf(needle, fromIndex);\n        }\n        else {\n            throw new RuntimeError(`Expected second argument to be of type array or string, but found ${toString$1(typeOf(haystack))} instead.`);\n        }\n    }\n    eachChild(fn) {\n        fn(this.needle);\n        fn(this.haystack);\n        if (this.fromIndex) {\n            fn(this.fromIndex);\n        }\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass Match {\n    constructor(inputType, outputType, input, cases, outputs, otherwise) {\n        this.inputType = inputType;\n        this.type = outputType;\n        this.input = input;\n        this.cases = cases;\n        this.outputs = outputs;\n        this.otherwise = otherwise;\n    }\n    static parse(args, context) {\n        if (args.length < 5)\n            return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n        if (args.length % 2 !== 1)\n            return context.error('Expected an even number of arguments.');\n        let inputType;\n        let outputType;\n        if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        const cases = {};\n        const outputs = [];\n        for (let i = 2; i < args.length - 1; i += 2) {\n            let labels = args[i];\n            const value = args[i + 1];\n            if (!Array.isArray(labels)) {\n                labels = [labels];\n            }\n            const labelContext = context.concat(i);\n            if (labels.length === 0) {\n                return labelContext.error('Expected at least one branch label.');\n            }\n            for (const label of labels) {\n                if (typeof label !== 'number' && typeof label !== 'string') {\n                    return labelContext.error('Branch labels must be numbers or strings.');\n                }\n                else if (typeof label === 'number' && Math.abs(label) > Number.MAX_SAFE_INTEGER) {\n                    return labelContext.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);\n                }\n                else if (typeof label === 'number' && Math.floor(label) !== label) {\n                    return labelContext.error('Numeric branch labels must be integer values.');\n                }\n                else if (!inputType) {\n                    inputType = typeOf(label);\n                }\n                else if (labelContext.checkSubtype(inputType, typeOf(label))) {\n                    return null;\n                }\n                if (typeof cases[String(label)] !== 'undefined') {\n                    return labelContext.error('Branch labels must be unique.');\n                }\n                cases[String(label)] = outputs.length;\n            }\n            const result = context.parse(value, i, outputType);\n            if (!result)\n                return null;\n            outputType = outputType || result.type;\n            outputs.push(result);\n        }\n        const input = context.parse(args[1], 1, ValueType);\n        if (!input)\n            return null;\n        const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n        if (!otherwise)\n            return null;\n        if (input.type.kind !== 'value' && context.concat(1).checkSubtype(inputType, input.type)) {\n            return null;\n        }\n        return new Match(inputType, outputType, input, cases, outputs, otherwise);\n    }\n    evaluate(ctx) {\n        const input = this.input.evaluate(ctx);\n        const output = (typeOf(input) === this.inputType && this.outputs[this.cases[input]]) || this.otherwise;\n        return output.evaluate(ctx);\n    }\n    eachChild(fn) {\n        fn(this.input);\n        this.outputs.forEach(fn);\n        fn(this.otherwise);\n    }\n    outputDefined() {\n        return this.outputs.every(out => out.outputDefined()) && this.otherwise.outputDefined();\n    }\n}\n\nclass Case {\n    constructor(type, branches, otherwise) {\n        this.type = type;\n        this.branches = branches;\n        this.otherwise = otherwise;\n    }\n    static parse(args, context) {\n        if (args.length < 4)\n            return context.error(`Expected at least 3 arguments, but found only ${args.length - 1}.`);\n        if (args.length % 2 !== 0)\n            return context.error('Expected an odd number of arguments.');\n        let outputType;\n        if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        const branches = [];\n        for (let i = 1; i < args.length - 1; i += 2) {\n            const test = context.parse(args[i], i, BooleanType);\n            if (!test)\n                return null;\n            const result = context.parse(args[i + 1], i + 1, outputType);\n            if (!result)\n                return null;\n            branches.push([test, result]);\n            outputType = outputType || result.type;\n        }\n        const otherwise = context.parse(args[args.length - 1], args.length - 1, outputType);\n        if (!otherwise)\n            return null;\n        if (!outputType)\n            throw new Error('Can\\'t infer output type');\n        return new Case(outputType, branches, otherwise);\n    }\n    evaluate(ctx) {\n        for (const [test, expression] of this.branches) {\n            if (test.evaluate(ctx)) {\n                return expression.evaluate(ctx);\n            }\n        }\n        return this.otherwise.evaluate(ctx);\n    }\n    eachChild(fn) {\n        for (const [test, expression] of this.branches) {\n            fn(test);\n            fn(expression);\n        }\n        fn(this.otherwise);\n    }\n    outputDefined() {\n        return this.branches.every(([_, out]) => out.outputDefined()) && this.otherwise.outputDefined();\n    }\n}\n\nclass Slice {\n    constructor(type, input, beginIndex, endIndex) {\n        this.type = type;\n        this.input = input;\n        this.beginIndex = beginIndex;\n        this.endIndex = endIndex;\n    }\n    static parse(args, context) {\n        if (args.length <= 2 || args.length >= 5) {\n            return context.error(`Expected 3 or 4 arguments, but found ${args.length - 1} instead.`);\n        }\n        const input = context.parse(args[1], 1, ValueType);\n        const beginIndex = context.parse(args[2], 2, NumberType);\n        if (!input || !beginIndex)\n            return null;\n        if (!isValidType(input.type, [array$1(ValueType), StringType, ValueType])) {\n            return context.error(`Expected first argument to be of type array or string, but found ${toString$1(input.type)} instead`);\n        }\n        if (args.length === 4) {\n            const endIndex = context.parse(args[3], 3, NumberType);\n            if (!endIndex)\n                return null;\n            return new Slice(input.type, input, beginIndex, endIndex);\n        }\n        else {\n            return new Slice(input.type, input, beginIndex);\n        }\n    }\n    evaluate(ctx) {\n        const input = this.input.evaluate(ctx);\n        const beginIndex = this.beginIndex.evaluate(ctx);\n        let endIndex;\n        if (this.endIndex) {\n            endIndex = this.endIndex.evaluate(ctx);\n        }\n        if (isValidNativeType(input, ['string'])) {\n            // Indices may be affected by surrogate pairs.\n            return [...input].slice(beginIndex, endIndex).join('');\n        }\n        else if (isValidNativeType(input, ['array'])) {\n            return input.slice(beginIndex, endIndex);\n        }\n        else {\n            throw new RuntimeError(`Expected first argument to be of type array or string, but found ${toString$1(typeOf(input))} instead.`);\n        }\n    }\n    eachChild(fn) {\n        fn(this.input);\n        fn(this.beginIndex);\n        if (this.endIndex) {\n            fn(this.endIndex);\n        }\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\n/**\n * Returns the index of the last stop <= input, or 0 if it doesn't exist.\n * @private\n */\nfunction findStopLessThanOrEqualTo(stops, input) {\n    const lastIndex = stops.length - 1;\n    let lowerIndex = 0;\n    let upperIndex = lastIndex;\n    let currentIndex = 0;\n    let currentValue, nextValue;\n    while (lowerIndex <= upperIndex) {\n        currentIndex = Math.floor((lowerIndex + upperIndex) / 2);\n        currentValue = stops[currentIndex];\n        nextValue = stops[currentIndex + 1];\n        if (currentValue <= input) {\n            if (currentIndex === lastIndex || input < nextValue) { // Search complete\n                return currentIndex;\n            }\n            lowerIndex = currentIndex + 1;\n        }\n        else if (currentValue > input) {\n            upperIndex = currentIndex - 1;\n        }\n        else {\n            throw new RuntimeError('Input is not a number.');\n        }\n    }\n    return 0;\n}\n\nclass Step {\n    constructor(type, input, stops) {\n        this.type = type;\n        this.input = input;\n        this.labels = [];\n        this.outputs = [];\n        for (const [label, expression] of stops) {\n            this.labels.push(label);\n            this.outputs.push(expression);\n        }\n    }\n    static parse(args, context) {\n        if (args.length - 1 < 4) {\n            return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n        }\n        if ((args.length - 1) % 2 !== 0) {\n            return context.error('Expected an even number of arguments.');\n        }\n        const input = context.parse(args[1], 1, NumberType);\n        if (!input)\n            return null;\n        const stops = [];\n        let outputType = null;\n        if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        for (let i = 1; i < args.length; i += 2) {\n            const label = i === 1 ? -Infinity : args[i];\n            const value = args[i + 1];\n            const labelKey = i;\n            const valueKey = i + 1;\n            if (typeof label !== 'number') {\n                return context.error('Input/output pairs for \"step\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n            }\n            if (stops.length && stops[stops.length - 1][0] >= label) {\n                return context.error('Input/output pairs for \"step\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n            }\n            const parsed = context.parse(value, valueKey, outputType);\n            if (!parsed)\n                return null;\n            outputType = outputType || parsed.type;\n            stops.push([label, parsed]);\n        }\n        return new Step(outputType, input, stops);\n    }\n    evaluate(ctx) {\n        const labels = this.labels;\n        const outputs = this.outputs;\n        if (labels.length === 1) {\n            return outputs[0].evaluate(ctx);\n        }\n        const value = this.input.evaluate(ctx);\n        if (value <= labels[0]) {\n            return outputs[0].evaluate(ctx);\n        }\n        const stopCount = labels.length;\n        if (value >= labels[stopCount - 1]) {\n            return outputs[stopCount - 1].evaluate(ctx);\n        }\n        const index = findStopLessThanOrEqualTo(labels, value);\n        return outputs[index].evaluate(ctx);\n    }\n    eachChild(fn) {\n        fn(this.input);\n        for (const expression of this.outputs) {\n            fn(expression);\n        }\n    }\n    outputDefined() {\n        return this.outputs.every(out => out.outputDefined());\n    }\n}\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar unitbezier = UnitBezier;\n\nfunction UnitBezier(p1x, p1y, p2x, p2y) {\n    // Calculate the polynomial coefficients, implicit first and last control points are (0,0) and (1,1).\n    this.cx = 3.0 * p1x;\n    this.bx = 3.0 * (p2x - p1x) - this.cx;\n    this.ax = 1.0 - this.cx - this.bx;\n\n    this.cy = 3.0 * p1y;\n    this.by = 3.0 * (p2y - p1y) - this.cy;\n    this.ay = 1.0 - this.cy - this.by;\n\n    this.p1x = p1x;\n    this.p1y = p1y;\n    this.p2x = p2x;\n    this.p2y = p2y;\n}\n\nUnitBezier.prototype = {\n    sampleCurveX: function (t) {\n        // `ax t^3 + bx t^2 + cx t' expanded using Horner's rule.\n        return ((this.ax * t + this.bx) * t + this.cx) * t;\n    },\n\n    sampleCurveY: function (t) {\n        return ((this.ay * t + this.by) * t + this.cy) * t;\n    },\n\n    sampleCurveDerivativeX: function (t) {\n        return (3.0 * this.ax * t + 2.0 * this.bx) * t + this.cx;\n    },\n\n    solveCurveX: function (x, epsilon) {\n        if (epsilon === undefined) epsilon = 1e-6;\n\n        if (x < 0.0) return 0.0;\n        if (x > 1.0) return 1.0;\n\n        var t = x;\n\n        // First try a few iterations of Newton's method - normally very fast.\n        for (var i = 0; i < 8; i++) {\n            var x2 = this.sampleCurveX(t) - x;\n            if (Math.abs(x2) < epsilon) return t;\n\n            var d2 = this.sampleCurveDerivativeX(t);\n            if (Math.abs(d2) < 1e-6) break;\n\n            t = t - x2 / d2;\n        }\n\n        // Fall back to the bisection method for reliability.\n        var t0 = 0.0;\n        var t1 = 1.0;\n        t = x;\n\n        for (i = 0; i < 20; i++) {\n            x2 = this.sampleCurveX(t);\n            if (Math.abs(x2 - x) < epsilon) break;\n\n            if (x > x2) {\n                t0 = t;\n            } else {\n                t1 = t;\n            }\n\n            t = (t1 - t0) * 0.5 + t0;\n        }\n\n        return t;\n    },\n\n    solve: function (x, epsilon) {\n        return this.sampleCurveY(this.solveCurveX(x, epsilon));\n    }\n};\n\nvar UnitBezier$1 = /*@__PURE__*/getDefaultExportFromCjs(unitbezier);\n\n/**\n * Checks whether the specified color space is one of the supported interpolation color spaces.\n *\n * @param colorSpace Color space key to verify.\n * @returns `true` if the specified color space is one of the supported\n * interpolation color spaces, `false` otherwise\n */\nfunction isSupportedInterpolationColorSpace(colorSpace) {\n    return colorSpace === 'rgb' || colorSpace === 'hcl' || colorSpace === 'lab';\n}\n/**\n * @param interpolationType Interpolation type\n * @returns interpolation fn\n * @deprecated use `interpolate[type]` instead\n */\nconst interpolateFactory = (interpolationType) => {\n    switch (interpolationType) {\n        case 'number': return number;\n        case 'color': return color;\n        case 'array': return array;\n        case 'padding': return padding;\n        case 'variableAnchorOffsetCollection': return variableAnchorOffsetCollection;\n    }\n};\nfunction number(from, to, t) {\n    return from + t * (to - from);\n}\nfunction color(from, to, t, spaceKey = 'rgb') {\n    switch (spaceKey) {\n        case 'rgb': {\n            const [r, g, b, alpha] = array(from.rgb, to.rgb, t);\n            return new Color(r, g, b, alpha, false);\n        }\n        case 'hcl': {\n            const [hue0, chroma0, light0, alphaF] = from.hcl;\n            const [hue1, chroma1, light1, alphaT] = to.hcl;\n            // https://github.com/gka/chroma.js/blob/cd1b3c0926c7a85cbdc3b1453b3a94006de91a92/src/interpolator/_hsx.js\n            let hue, chroma;\n            if (!isNaN(hue0) && !isNaN(hue1)) {\n                let dh = hue1 - hue0;\n                if (hue1 > hue0 && dh > 180) {\n                    dh -= 360;\n                }\n                else if (hue1 < hue0 && hue0 - hue1 > 180) {\n                    dh += 360;\n                }\n                hue = hue0 + t * dh;\n            }\n            else if (!isNaN(hue0)) {\n                hue = hue0;\n                if (light1 === 1 || light1 === 0)\n                    chroma = chroma0;\n            }\n            else if (!isNaN(hue1)) {\n                hue = hue1;\n                if (light0 === 1 || light0 === 0)\n                    chroma = chroma1;\n            }\n            else {\n                hue = NaN;\n            }\n            const [r, g, b, alpha] = hclToRgb([\n                hue,\n                chroma !== null && chroma !== void 0 ? chroma : number(chroma0, chroma1, t),\n                number(light0, light1, t),\n                number(alphaF, alphaT, t),\n            ]);\n            return new Color(r, g, b, alpha, false);\n        }\n        case 'lab': {\n            const [r, g, b, alpha] = labToRgb(array(from.lab, to.lab, t));\n            return new Color(r, g, b, alpha, false);\n        }\n    }\n}\nfunction array(from, to, t) {\n    return from.map((d, i) => {\n        return number(d, to[i], t);\n    });\n}\nfunction padding(from, to, t) {\n    return new Padding(array(from.values, to.values, t));\n}\nfunction variableAnchorOffsetCollection(from, to, t) {\n    const fromValues = from.values;\n    const toValues = to.values;\n    if (fromValues.length !== toValues.length) {\n        throw new RuntimeError(`Cannot interpolate values of different length. from: ${from.toString()}, to: ${to.toString()}`);\n    }\n    const output = [];\n    for (let i = 0; i < fromValues.length; i += 2) {\n        // Anchor entries must match\n        if (fromValues[i] !== toValues[i]) {\n            throw new RuntimeError(`Cannot interpolate values containing mismatched anchors. from[${i}]: ${fromValues[i]}, to[${i}]: ${toValues[i]}`);\n        }\n        output.push(fromValues[i]);\n        // Interpolate the offset values for each anchor\n        const [fx, fy] = fromValues[i + 1];\n        const [tx, ty] = toValues[i + 1];\n        output.push([number(fx, tx, t), number(fy, ty, t)]);\n    }\n    return new VariableAnchorOffsetCollection(output);\n}\nconst interpolate = {\n    number,\n    color,\n    array,\n    padding,\n    variableAnchorOffsetCollection\n};\n\nclass Interpolate {\n    constructor(type, operator, interpolation, input, stops) {\n        this.type = type;\n        this.operator = operator;\n        this.interpolation = interpolation;\n        this.input = input;\n        this.labels = [];\n        this.outputs = [];\n        for (const [label, expression] of stops) {\n            this.labels.push(label);\n            this.outputs.push(expression);\n        }\n    }\n    static interpolationFactor(interpolation, input, lower, upper) {\n        let t = 0;\n        if (interpolation.name === 'exponential') {\n            t = exponentialInterpolation(input, interpolation.base, lower, upper);\n        }\n        else if (interpolation.name === 'linear') {\n            t = exponentialInterpolation(input, 1, lower, upper);\n        }\n        else if (interpolation.name === 'cubic-bezier') {\n            const c = interpolation.controlPoints;\n            const ub = new UnitBezier$1(c[0], c[1], c[2], c[3]);\n            t = ub.solve(exponentialInterpolation(input, 1, lower, upper));\n        }\n        return t;\n    }\n    static parse(args, context) {\n        let [operator, interpolation, input, ...rest] = args;\n        if (!Array.isArray(interpolation) || interpolation.length === 0) {\n            return context.error('Expected an interpolation type expression.', 1);\n        }\n        if (interpolation[0] === 'linear') {\n            interpolation = { name: 'linear' };\n        }\n        else if (interpolation[0] === 'exponential') {\n            const base = interpolation[1];\n            if (typeof base !== 'number')\n                return context.error('Exponential interpolation requires a numeric base.', 1, 1);\n            interpolation = {\n                name: 'exponential',\n                base\n            };\n        }\n        else if (interpolation[0] === 'cubic-bezier') {\n            const controlPoints = interpolation.slice(1);\n            if (controlPoints.length !== 4 ||\n                controlPoints.some(t => typeof t !== 'number' || t < 0 || t > 1)) {\n                return context.error('Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.', 1);\n            }\n            interpolation = {\n                name: 'cubic-bezier',\n                controlPoints: controlPoints\n            };\n        }\n        else {\n            return context.error(`Unknown interpolation type ${String(interpolation[0])}`, 1, 0);\n        }\n        if (args.length - 1 < 4) {\n            return context.error(`Expected at least 4 arguments, but found only ${args.length - 1}.`);\n        }\n        if ((args.length - 1) % 2 !== 0) {\n            return context.error('Expected an even number of arguments.');\n        }\n        input = context.parse(input, 2, NumberType);\n        if (!input)\n            return null;\n        const stops = [];\n        let outputType = null;\n        if (operator === 'interpolate-hcl' || operator === 'interpolate-lab') {\n            outputType = ColorType;\n        }\n        else if (context.expectedType && context.expectedType.kind !== 'value') {\n            outputType = context.expectedType;\n        }\n        for (let i = 0; i < rest.length; i += 2) {\n            const label = rest[i];\n            const value = rest[i + 1];\n            const labelKey = i + 3;\n            const valueKey = i + 4;\n            if (typeof label !== 'number') {\n                return context.error('Input/output pairs for \"interpolate\" expressions must be defined using literal numeric values (not computed expressions) for the input values.', labelKey);\n            }\n            if (stops.length && stops[stops.length - 1][0] >= label) {\n                return context.error('Input/output pairs for \"interpolate\" expressions must be arranged with input values in strictly ascending order.', labelKey);\n            }\n            const parsed = context.parse(value, valueKey, outputType);\n            if (!parsed)\n                return null;\n            outputType = outputType || parsed.type;\n            stops.push([label, parsed]);\n        }\n        if (!verifyType(outputType, NumberType) &&\n            !verifyType(outputType, ColorType) &&\n            !verifyType(outputType, PaddingType) &&\n            !verifyType(outputType, VariableAnchorOffsetCollectionType) &&\n            !verifyType(outputType, array$1(NumberType))) {\n            return context.error(`Type ${toString$1(outputType)} is not interpolatable.`);\n        }\n        return new Interpolate(outputType, operator, interpolation, input, stops);\n    }\n    evaluate(ctx) {\n        const labels = this.labels;\n        const outputs = this.outputs;\n        if (labels.length === 1) {\n            return outputs[0].evaluate(ctx);\n        }\n        const value = this.input.evaluate(ctx);\n        if (value <= labels[0]) {\n            return outputs[0].evaluate(ctx);\n        }\n        const stopCount = labels.length;\n        if (value >= labels[stopCount - 1]) {\n            return outputs[stopCount - 1].evaluate(ctx);\n        }\n        const index = findStopLessThanOrEqualTo(labels, value);\n        const lower = labels[index];\n        const upper = labels[index + 1];\n        const t = Interpolate.interpolationFactor(this.interpolation, value, lower, upper);\n        const outputLower = outputs[index].evaluate(ctx);\n        const outputUpper = outputs[index + 1].evaluate(ctx);\n        switch (this.operator) {\n            case 'interpolate':\n                return interpolate[this.type.kind](outputLower, outputUpper, t);\n            case 'interpolate-hcl':\n                return interpolate.color(outputLower, outputUpper, t, 'hcl');\n            case 'interpolate-lab':\n                return interpolate.color(outputLower, outputUpper, t, 'lab');\n        }\n    }\n    eachChild(fn) {\n        fn(this.input);\n        for (const expression of this.outputs) {\n            fn(expression);\n        }\n    }\n    outputDefined() {\n        return this.outputs.every(out => out.outputDefined());\n    }\n}\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n * How it works: Two consecutive stop values define a (scaled and shifted) exponential function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n *                     = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`.  In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n*/\nfunction exponentialInterpolation(input, base, lowerValue, upperValue) {\n    const difference = upperValue - lowerValue;\n    const progress = input - lowerValue;\n    if (difference === 0) {\n        return 0;\n    }\n    else if (base === 1) {\n        return progress / difference;\n    }\n    else {\n        return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n    }\n}\n\nclass Coalesce {\n    constructor(type, args) {\n        this.type = type;\n        this.args = args;\n    }\n    static parse(args, context) {\n        if (args.length < 2) {\n            return context.error('Expectected at least one argument.');\n        }\n        let outputType = null;\n        const expectedType = context.expectedType;\n        if (expectedType && expectedType.kind !== 'value') {\n            outputType = expectedType;\n        }\n        const parsedArgs = [];\n        for (const arg of args.slice(1)) {\n            const parsed = context.parse(arg, 1 + parsedArgs.length, outputType, undefined, { typeAnnotation: 'omit' });\n            if (!parsed)\n                return null;\n            outputType = outputType || parsed.type;\n            parsedArgs.push(parsed);\n        }\n        if (!outputType)\n            throw new Error('No output type');\n        // Above, we parse arguments without inferred type annotation so that\n        // they don't produce a runtime error for `null` input, which would\n        // preempt the desired null-coalescing behavior.\n        // Thus, if any of our arguments would have needed an annotation, we\n        // need to wrap the enclosing coalesce expression with it instead.\n        const needsAnnotation = expectedType &&\n            parsedArgs.some(arg => checkSubtype(expectedType, arg.type));\n        return needsAnnotation ?\n            new Coalesce(ValueType, parsedArgs) :\n            new Coalesce(outputType, parsedArgs);\n    }\n    evaluate(ctx) {\n        let result = null;\n        let argCount = 0;\n        let requestedImageName;\n        for (const arg of this.args) {\n            argCount++;\n            result = arg.evaluate(ctx);\n            // we need to keep track of the first requested image in a coalesce statement\n            // if coalesce can't find a valid image, we return the first image name so styleimagemissing can fire\n            if (result && result instanceof ResolvedImage && !result.available) {\n                if (!requestedImageName) {\n                    requestedImageName = result.name;\n                }\n                result = null;\n                if (argCount === this.args.length) {\n                    result = requestedImageName;\n                }\n            }\n            if (result !== null)\n                break;\n        }\n        return result;\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return this.args.every(arg => arg.outputDefined());\n    }\n}\n\nfunction isComparableType(op, type) {\n    if (op === '==' || op === '!=') {\n        // equality operator\n        return type.kind === 'boolean' ||\n            type.kind === 'string' ||\n            type.kind === 'number' ||\n            type.kind === 'null' ||\n            type.kind === 'value';\n    }\n    else {\n        // ordering operator\n        return type.kind === 'string' ||\n            type.kind === 'number' ||\n            type.kind === 'value';\n    }\n}\nfunction eq(ctx, a, b) { return a === b; }\nfunction neq(ctx, a, b) { return a !== b; }\nfunction lt(ctx, a, b) { return a < b; }\nfunction gt(ctx, a, b) { return a > b; }\nfunction lteq(ctx, a, b) { return a <= b; }\nfunction gteq(ctx, a, b) { return a >= b; }\nfunction eqCollate(ctx, a, b, c) { return c.compare(a, b) === 0; }\nfunction neqCollate(ctx, a, b, c) { return !eqCollate(ctx, a, b, c); }\nfunction ltCollate(ctx, a, b, c) { return c.compare(a, b) < 0; }\nfunction gtCollate(ctx, a, b, c) { return c.compare(a, b) > 0; }\nfunction lteqCollate(ctx, a, b, c) { return c.compare(a, b) <= 0; }\nfunction gteqCollate(ctx, a, b, c) { return c.compare(a, b) >= 0; }\n/**\n * Special form for comparison operators, implementing the signatures:\n * - (T, T, ?Collator) => boolean\n * - (T, value, ?Collator) => boolean\n * - (value, T, ?Collator) => boolean\n *\n * For inequalities, T must be either value, string, or number. For ==/!=, it\n * can also be boolean or null.\n *\n * Equality semantics are equivalent to Javascript's strict equality (===/!==)\n * -- i.e., when the arguments' types don't match, == evaluates to false, != to\n * true.\n *\n * When types don't match in an ordering comparison, a runtime error is thrown.\n *\n * @private\n */\nfunction makeComparison(op, compareBasic, compareWithCollator) {\n    const isOrderComparison = op !== '==' && op !== '!=';\n    return class Comparison {\n        constructor(lhs, rhs, collator) {\n            this.type = BooleanType;\n            this.lhs = lhs;\n            this.rhs = rhs;\n            this.collator = collator;\n            this.hasUntypedArgument = lhs.type.kind === 'value' || rhs.type.kind === 'value';\n        }\n        static parse(args, context) {\n            if (args.length !== 3 && args.length !== 4)\n                return context.error('Expected two or three arguments.');\n            const op = args[0];\n            let lhs = context.parse(args[1], 1, ValueType);\n            if (!lhs)\n                return null;\n            if (!isComparableType(op, lhs.type)) {\n                return context.concat(1).error(`\"${op}\" comparisons are not supported for type '${toString$1(lhs.type)}'.`);\n            }\n            let rhs = context.parse(args[2], 2, ValueType);\n            if (!rhs)\n                return null;\n            if (!isComparableType(op, rhs.type)) {\n                return context.concat(2).error(`\"${op}\" comparisons are not supported for type '${toString$1(rhs.type)}'.`);\n            }\n            if (lhs.type.kind !== rhs.type.kind &&\n                lhs.type.kind !== 'value' &&\n                rhs.type.kind !== 'value') {\n                return context.error(`Cannot compare types '${toString$1(lhs.type)}' and '${toString$1(rhs.type)}'.`);\n            }\n            if (isOrderComparison) {\n                // typing rules specific to less/greater than operators\n                if (lhs.type.kind === 'value' && rhs.type.kind !== 'value') {\n                    // (value, T)\n                    lhs = new Assertion(rhs.type, [lhs]);\n                }\n                else if (lhs.type.kind !== 'value' && rhs.type.kind === 'value') {\n                    // (T, value)\n                    rhs = new Assertion(lhs.type, [rhs]);\n                }\n            }\n            let collator = null;\n            if (args.length === 4) {\n                if (lhs.type.kind !== 'string' &&\n                    rhs.type.kind !== 'string' &&\n                    lhs.type.kind !== 'value' &&\n                    rhs.type.kind !== 'value') {\n                    return context.error('Cannot use collator to compare non-string types.');\n                }\n                collator = context.parse(args[3], 3, CollatorType);\n                if (!collator)\n                    return null;\n            }\n            return new Comparison(lhs, rhs, collator);\n        }\n        evaluate(ctx) {\n            const lhs = this.lhs.evaluate(ctx);\n            const rhs = this.rhs.evaluate(ctx);\n            if (isOrderComparison && this.hasUntypedArgument) {\n                const lt = typeOf(lhs);\n                const rt = typeOf(rhs);\n                // check that type is string or number, and equal\n                if (lt.kind !== rt.kind || !(lt.kind === 'string' || lt.kind === 'number')) {\n                    throw new RuntimeError(`Expected arguments for \"${op}\" to be (string, string) or (number, number), but found (${lt.kind}, ${rt.kind}) instead.`);\n                }\n            }\n            if (this.collator && !isOrderComparison && this.hasUntypedArgument) {\n                const lt = typeOf(lhs);\n                const rt = typeOf(rhs);\n                if (lt.kind !== 'string' || rt.kind !== 'string') {\n                    return compareBasic(ctx, lhs, rhs);\n                }\n            }\n            return this.collator ?\n                compareWithCollator(ctx, lhs, rhs, this.collator.evaluate(ctx)) :\n                compareBasic(ctx, lhs, rhs);\n        }\n        eachChild(fn) {\n            fn(this.lhs);\n            fn(this.rhs);\n            if (this.collator) {\n                fn(this.collator);\n            }\n        }\n        outputDefined() {\n            return true;\n        }\n    };\n}\nconst Equals = makeComparison('==', eq, eqCollate);\nconst NotEquals = makeComparison('!=', neq, neqCollate);\nconst LessThan = makeComparison('<', lt, ltCollate);\nconst GreaterThan = makeComparison('>', gt, gtCollate);\nconst LessThanOrEqual = makeComparison('<=', lteq, lteqCollate);\nconst GreaterThanOrEqual = makeComparison('>=', gteq, gteqCollate);\n\nclass CollatorExpression {\n    constructor(caseSensitive, diacriticSensitive, locale) {\n        this.type = CollatorType;\n        this.locale = locale;\n        this.caseSensitive = caseSensitive;\n        this.diacriticSensitive = diacriticSensitive;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error('Expected one argument.');\n        const options = args[1];\n        if (typeof options !== 'object' || Array.isArray(options))\n            return context.error('Collator options argument must be an object.');\n        const caseSensitive = context.parse(options['case-sensitive'] === undefined ? false : options['case-sensitive'], 1, BooleanType);\n        if (!caseSensitive)\n            return null;\n        const diacriticSensitive = context.parse(options['diacritic-sensitive'] === undefined ? false : options['diacritic-sensitive'], 1, BooleanType);\n        if (!diacriticSensitive)\n            return null;\n        let locale = null;\n        if (options['locale']) {\n            locale = context.parse(options['locale'], 1, StringType);\n            if (!locale)\n                return null;\n        }\n        return new CollatorExpression(caseSensitive, diacriticSensitive, locale);\n    }\n    evaluate(ctx) {\n        return new Collator(this.caseSensitive.evaluate(ctx), this.diacriticSensitive.evaluate(ctx), this.locale ? this.locale.evaluate(ctx) : null);\n    }\n    eachChild(fn) {\n        fn(this.caseSensitive);\n        fn(this.diacriticSensitive);\n        if (this.locale) {\n            fn(this.locale);\n        }\n    }\n    outputDefined() {\n        // Technically the set of possible outputs is the combinatoric set of Collators produced\n        // by all possible outputs of locale/caseSensitive/diacriticSensitive\n        // But for the primary use of Collators in comparison operators, we ignore the Collator's\n        // possible outputs anyway, so we can get away with leaving this false for now.\n        return false;\n    }\n}\n\nclass NumberFormat {\n    constructor(number, locale, currency, minFractionDigits, maxFractionDigits) {\n        this.type = StringType;\n        this.number = number;\n        this.locale = locale;\n        this.currency = currency;\n        this.minFractionDigits = minFractionDigits;\n        this.maxFractionDigits = maxFractionDigits;\n    }\n    static parse(args, context) {\n        if (args.length !== 3)\n            return context.error('Expected two arguments.');\n        const number = context.parse(args[1], 1, NumberType);\n        if (!number)\n            return null;\n        const options = args[2];\n        if (typeof options !== 'object' || Array.isArray(options))\n            return context.error('NumberFormat options argument must be an object.');\n        let locale = null;\n        if (options['locale']) {\n            locale = context.parse(options['locale'], 1, StringType);\n            if (!locale)\n                return null;\n        }\n        let currency = null;\n        if (options['currency']) {\n            currency = context.parse(options['currency'], 1, StringType);\n            if (!currency)\n                return null;\n        }\n        let minFractionDigits = null;\n        if (options['min-fraction-digits']) {\n            minFractionDigits = context.parse(options['min-fraction-digits'], 1, NumberType);\n            if (!minFractionDigits)\n                return null;\n        }\n        let maxFractionDigits = null;\n        if (options['max-fraction-digits']) {\n            maxFractionDigits = context.parse(options['max-fraction-digits'], 1, NumberType);\n            if (!maxFractionDigits)\n                return null;\n        }\n        return new NumberFormat(number, locale, currency, minFractionDigits, maxFractionDigits);\n    }\n    evaluate(ctx) {\n        return new Intl.NumberFormat(this.locale ? this.locale.evaluate(ctx) : [], {\n            style: this.currency ? 'currency' : 'decimal',\n            currency: this.currency ? this.currency.evaluate(ctx) : undefined,\n            minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(ctx) : undefined,\n            maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(ctx) : undefined,\n        }).format(this.number.evaluate(ctx));\n    }\n    eachChild(fn) {\n        fn(this.number);\n        if (this.locale) {\n            fn(this.locale);\n        }\n        if (this.currency) {\n            fn(this.currency);\n        }\n        if (this.minFractionDigits) {\n            fn(this.minFractionDigits);\n        }\n        if (this.maxFractionDigits) {\n            fn(this.maxFractionDigits);\n        }\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nclass FormatExpression {\n    constructor(sections) {\n        this.type = FormattedType;\n        this.sections = sections;\n    }\n    static parse(args, context) {\n        if (args.length < 2) {\n            return context.error('Expected at least one argument.');\n        }\n        const firstArg = args[1];\n        if (!Array.isArray(firstArg) && typeof firstArg === 'object') {\n            return context.error('First argument must be an image or text section.');\n        }\n        const sections = [];\n        let nextTokenMayBeObject = false;\n        for (let i = 1; i <= args.length - 1; ++i) {\n            const arg = args[i];\n            if (nextTokenMayBeObject && typeof arg === 'object' && !Array.isArray(arg)) {\n                nextTokenMayBeObject = false;\n                let scale = null;\n                if (arg['font-scale']) {\n                    scale = context.parse(arg['font-scale'], 1, NumberType);\n                    if (!scale)\n                        return null;\n                }\n                let font = null;\n                if (arg['text-font']) {\n                    font = context.parse(arg['text-font'], 1, array$1(StringType));\n                    if (!font)\n                        return null;\n                }\n                let textColor = null;\n                if (arg['text-color']) {\n                    textColor = context.parse(arg['text-color'], 1, ColorType);\n                    if (!textColor)\n                        return null;\n                }\n                const lastExpression = sections[sections.length - 1];\n                lastExpression.scale = scale;\n                lastExpression.font = font;\n                lastExpression.textColor = textColor;\n            }\n            else {\n                const content = context.parse(args[i], 1, ValueType);\n                if (!content)\n                    return null;\n                const kind = content.type.kind;\n                if (kind !== 'string' && kind !== 'value' && kind !== 'null' && kind !== 'resolvedImage')\n                    return context.error('Formatted text type must be \\'string\\', \\'value\\', \\'image\\' or \\'null\\'.');\n                nextTokenMayBeObject = true;\n                sections.push({ content, scale: null, font: null, textColor: null });\n            }\n        }\n        return new FormatExpression(sections);\n    }\n    evaluate(ctx) {\n        const evaluateSection = section => {\n            const evaluatedContent = section.content.evaluate(ctx);\n            if (typeOf(evaluatedContent) === ResolvedImageType) {\n                return new FormattedSection('', evaluatedContent, null, null, null);\n            }\n            return new FormattedSection(toString(evaluatedContent), null, section.scale ? section.scale.evaluate(ctx) : null, section.font ? section.font.evaluate(ctx).join(',') : null, section.textColor ? section.textColor.evaluate(ctx) : null);\n        };\n        return new Formatted(this.sections.map(evaluateSection));\n    }\n    eachChild(fn) {\n        for (const section of this.sections) {\n            fn(section.content);\n            if (section.scale) {\n                fn(section.scale);\n            }\n            if (section.font) {\n                fn(section.font);\n            }\n            if (section.textColor) {\n                fn(section.textColor);\n            }\n        }\n    }\n    outputDefined() {\n        // Technically the combinatoric set of all children\n        // Usually, this.text will be undefined anyway\n        return false;\n    }\n}\n\nclass ImageExpression {\n    constructor(input) {\n        this.type = ResolvedImageType;\n        this.input = input;\n    }\n    static parse(args, context) {\n        if (args.length !== 2) {\n            return context.error('Expected two arguments.');\n        }\n        const name = context.parse(args[1], 1, StringType);\n        if (!name)\n            return context.error('No image name provided.');\n        return new ImageExpression(name);\n    }\n    evaluate(ctx) {\n        const evaluatedImageName = this.input.evaluate(ctx);\n        const value = ResolvedImage.fromString(evaluatedImageName);\n        if (value && ctx.availableImages)\n            value.available = ctx.availableImages.indexOf(evaluatedImageName) > -1;\n        return value;\n    }\n    eachChild(fn) {\n        fn(this.input);\n    }\n    outputDefined() {\n        // The output of image is determined by the list of available images in the evaluation context\n        return false;\n    }\n}\n\nclass Length {\n    constructor(input) {\n        this.type = NumberType;\n        this.input = input;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`Expected 1 argument, but found ${args.length - 1} instead.`);\n        const input = context.parse(args[1], 1);\n        if (!input)\n            return null;\n        if (input.type.kind !== 'array' && input.type.kind !== 'string' && input.type.kind !== 'value')\n            return context.error(`Expected argument of type string or array, but found ${toString$1(input.type)} instead.`);\n        return new Length(input);\n    }\n    evaluate(ctx) {\n        const input = this.input.evaluate(ctx);\n        if (typeof input === 'string') {\n            // The length may be affected by surrogate pairs.\n            return [...input].length;\n        }\n        else if (Array.isArray(input)) {\n            return input.length;\n        }\n        else {\n            throw new RuntimeError(`Expected value to be of type string or array, but found ${toString$1(typeOf(input))} instead.`);\n        }\n    }\n    eachChild(fn) {\n        fn(this.input);\n    }\n    outputDefined() {\n        return false;\n    }\n}\n\nconst EXTENT = 8192;\nfunction getTileCoordinates(p, canonical) {\n    const x = mercatorXfromLng(p[0]);\n    const y = mercatorYfromLat(p[1]);\n    const tilesAtZoom = Math.pow(2, canonical.z);\n    return [Math.round(x * tilesAtZoom * EXTENT), Math.round(y * tilesAtZoom * EXTENT)];\n}\nfunction getLngLatFromTileCoord(coord, canonical) {\n    const tilesAtZoom = Math.pow(2, canonical.z);\n    const x = (coord[0] / EXTENT + canonical.x) / tilesAtZoom;\n    const y = (coord[1] / EXTENT + canonical.y) / tilesAtZoom;\n    return [lngFromMercatorXfromLng(x), latFromMercatorY(y)];\n}\nfunction mercatorXfromLng(lng) {\n    return (180 + lng) / 360;\n}\nfunction lngFromMercatorXfromLng(mercatorX) {\n    return mercatorX * 360 - 180;\n}\nfunction mercatorYfromLat(lat) {\n    return (180 - (180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360)))) / 360;\n}\nfunction latFromMercatorY(mercatorY) {\n    return 360 / Math.PI * Math.atan(Math.exp((180 - mercatorY * 360) * Math.PI / 180)) - 90;\n}\nfunction updateBBox(bbox, coord) {\n    bbox[0] = Math.min(bbox[0], coord[0]);\n    bbox[1] = Math.min(bbox[1], coord[1]);\n    bbox[2] = Math.max(bbox[2], coord[0]);\n    bbox[3] = Math.max(bbox[3], coord[1]);\n}\nfunction boxWithinBox(bbox1, bbox2) {\n    if (bbox1[0] <= bbox2[0])\n        return false;\n    if (bbox1[2] >= bbox2[2])\n        return false;\n    if (bbox1[1] <= bbox2[1])\n        return false;\n    if (bbox1[3] >= bbox2[3])\n        return false;\n    return true;\n}\nfunction rayIntersect(p, p1, p2) {\n    return ((p1[1] > p[1]) !== (p2[1] > p[1])) && (p[0] < (p2[0] - p1[0]) * (p[1] - p1[1]) / (p2[1] - p1[1]) + p1[0]);\n}\nfunction pointOnBoundary(p, p1, p2) {\n    const x1 = p[0] - p1[0];\n    const y1 = p[1] - p1[1];\n    const x2 = p[0] - p2[0];\n    const y2 = p[1] - p2[1];\n    return (x1 * y2 - x2 * y1 === 0) && (x1 * x2 <= 0) && (y1 * y2 <= 0);\n}\n// a, b are end points for line segment1, c and d are end points for line segment2\nfunction segmentIntersectSegment(a, b, c, d) {\n    // check if two segments are parallel or not\n    // precondition is end point a, b is inside polygon, if line a->b is\n    // parallel to polygon edge c->d, then a->b won't intersect with c->d\n    const vectorP = [b[0] - a[0], b[1] - a[1]];\n    const vectorQ = [d[0] - c[0], d[1] - c[1]];\n    if (perp(vectorQ, vectorP) === 0)\n        return false;\n    // If lines are intersecting with each other, the relative location should be:\n    // a and b lie in different sides of segment c->d\n    // c and d lie in different sides of segment a->b\n    if (twoSided(a, b, c, d) && twoSided(c, d, a, b))\n        return true;\n    return false;\n}\nfunction lineIntersectPolygon(p1, p2, polygon) {\n    for (const ring of polygon) {\n        // loop through every edge of the ring\n        for (let j = 0; j < ring.length - 1; ++j) {\n            if (segmentIntersectSegment(p1, p2, ring[j], ring[j + 1])) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n// ray casting algorithm for detecting if point is in polygon\nfunction pointWithinPolygon(point, rings, trueIfOnBoundary = false) {\n    let inside = false;\n    for (const ring of rings) {\n        for (let j = 0; j < ring.length - 1; j++) {\n            if (pointOnBoundary(point, ring[j], ring[j + 1]))\n                return trueIfOnBoundary;\n            if (rayIntersect(point, ring[j], ring[j + 1]))\n                inside = !inside;\n        }\n    }\n    return inside;\n}\nfunction pointWithinPolygons(point, polygons) {\n    for (const polygon of polygons) {\n        if (pointWithinPolygon(point, polygon))\n            return true;\n    }\n    return false;\n}\nfunction lineStringWithinPolygon(line, polygon) {\n    // First, check if geometry points of line segments are all inside polygon\n    for (const point of line) {\n        if (!pointWithinPolygon(point, polygon)) {\n            return false;\n        }\n    }\n    // Second, check if there is line segment intersecting polygon edge\n    for (let i = 0; i < line.length - 1; ++i) {\n        if (lineIntersectPolygon(line[i], line[i + 1], polygon)) {\n            return false;\n        }\n    }\n    return true;\n}\nfunction lineStringWithinPolygons(line, polygons) {\n    for (const polygon of polygons) {\n        if (lineStringWithinPolygon(line, polygon))\n            return true;\n    }\n    return false;\n}\nfunction perp(v1, v2) {\n    return (v1[0] * v2[1] - v1[1] * v2[0]);\n}\n// check if p1 and p2 are in different sides of line segment q1->q2\nfunction twoSided(p1, p2, q1, q2) {\n    // q1->p1 (x1, y1), q1->p2 (x2, y2), q1->q2 (x3, y3)\n    const x1 = p1[0] - q1[0];\n    const y1 = p1[1] - q1[1];\n    const x2 = p2[0] - q1[0];\n    const y2 = p2[1] - q1[1];\n    const x3 = q2[0] - q1[0];\n    const y3 = q2[1] - q1[1];\n    const det1 = (x1 * y3 - x3 * y1);\n    const det2 = (x2 * y3 - x3 * y2);\n    if ((det1 > 0 && det2 < 0) || (det1 < 0 && det2 > 0))\n        return true;\n    return false;\n}\n\nfunction getTilePolygon(coordinates, bbox, canonical) {\n    const polygon = [];\n    for (let i = 0; i < coordinates.length; i++) {\n        const ring = [];\n        for (let j = 0; j < coordinates[i].length; j++) {\n            const coord = getTileCoordinates(coordinates[i][j], canonical);\n            updateBBox(bbox, coord);\n            ring.push(coord);\n        }\n        polygon.push(ring);\n    }\n    return polygon;\n}\nfunction getTilePolygons(coordinates, bbox, canonical) {\n    const polygons = [];\n    for (let i = 0; i < coordinates.length; i++) {\n        const polygon = getTilePolygon(coordinates[i], bbox, canonical);\n        polygons.push(polygon);\n    }\n    return polygons;\n}\nfunction updatePoint(p, bbox, polyBBox, worldSize) {\n    if (p[0] < polyBBox[0] || p[0] > polyBBox[2]) {\n        const halfWorldSize = worldSize * 0.5;\n        let shift = (p[0] - polyBBox[0] > halfWorldSize) ? -worldSize : (polyBBox[0] - p[0] > halfWorldSize) ? worldSize : 0;\n        if (shift === 0) {\n            shift = (p[0] - polyBBox[2] > halfWorldSize) ? -worldSize : (polyBBox[2] - p[0] > halfWorldSize) ? worldSize : 0;\n        }\n        p[0] += shift;\n    }\n    updateBBox(bbox, p);\n}\nfunction resetBBox(bbox) {\n    bbox[0] = bbox[1] = Infinity;\n    bbox[2] = bbox[3] = -Infinity;\n}\nfunction getTilePoints(geometry, pointBBox, polyBBox, canonical) {\n    const worldSize = Math.pow(2, canonical.z) * EXTENT;\n    const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n    const tilePoints = [];\n    for (const points of geometry) {\n        for (const point of points) {\n            const p = [point.x + shifts[0], point.y + shifts[1]];\n            updatePoint(p, pointBBox, polyBBox, worldSize);\n            tilePoints.push(p);\n        }\n    }\n    return tilePoints;\n}\nfunction getTileLines(geometry, lineBBox, polyBBox, canonical) {\n    const worldSize = Math.pow(2, canonical.z) * EXTENT;\n    const shifts = [canonical.x * EXTENT, canonical.y * EXTENT];\n    const tileLines = [];\n    for (const line of geometry) {\n        const tileLine = [];\n        for (const point of line) {\n            const p = [point.x + shifts[0], point.y + shifts[1]];\n            updateBBox(lineBBox, p);\n            tileLine.push(p);\n        }\n        tileLines.push(tileLine);\n    }\n    if (lineBBox[2] - lineBBox[0] <= worldSize / 2) {\n        resetBBox(lineBBox);\n        for (const line of tileLines) {\n            for (const p of line) {\n                updatePoint(p, lineBBox, polyBBox, worldSize);\n            }\n        }\n    }\n    return tileLines;\n}\nfunction pointsWithinPolygons(ctx, polygonGeometry) {\n    const pointBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const canonical = ctx.canonicalID();\n    if (polygonGeometry.type === 'Polygon') {\n        const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n        const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n        if (!boxWithinBox(pointBBox, polyBBox))\n            return false;\n        for (const point of tilePoints) {\n            if (!pointWithinPolygon(point, tilePolygon))\n                return false;\n        }\n    }\n    if (polygonGeometry.type === 'MultiPolygon') {\n        const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n        const tilePoints = getTilePoints(ctx.geometry(), pointBBox, polyBBox, canonical);\n        if (!boxWithinBox(pointBBox, polyBBox))\n            return false;\n        for (const point of tilePoints) {\n            if (!pointWithinPolygons(point, tilePolygons))\n                return false;\n        }\n    }\n    return true;\n}\nfunction linesWithinPolygons(ctx, polygonGeometry) {\n    const lineBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const polyBBox = [Infinity, Infinity, -Infinity, -Infinity];\n    const canonical = ctx.canonicalID();\n    if (polygonGeometry.type === 'Polygon') {\n        const tilePolygon = getTilePolygon(polygonGeometry.coordinates, polyBBox, canonical);\n        const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n        if (!boxWithinBox(lineBBox, polyBBox))\n            return false;\n        for (const line of tileLines) {\n            if (!lineStringWithinPolygon(line, tilePolygon))\n                return false;\n        }\n    }\n    if (polygonGeometry.type === 'MultiPolygon') {\n        const tilePolygons = getTilePolygons(polygonGeometry.coordinates, polyBBox, canonical);\n        const tileLines = getTileLines(ctx.geometry(), lineBBox, polyBBox, canonical);\n        if (!boxWithinBox(lineBBox, polyBBox))\n            return false;\n        for (const line of tileLines) {\n            if (!lineStringWithinPolygons(line, tilePolygons))\n                return false;\n        }\n    }\n    return true;\n}\nclass Within {\n    constructor(geojson, geometries) {\n        this.type = BooleanType;\n        this.geojson = geojson;\n        this.geometries = geometries;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`'within' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n        if (isValue(args[1])) {\n            const geojson = args[1];\n            if (geojson.type === 'FeatureCollection') {\n                const polygonsCoords = [];\n                for (const polygon of geojson.features) {\n                    const { type, coordinates } = polygon.geometry;\n                    if (type === 'Polygon') {\n                        polygonsCoords.push(coordinates);\n                    }\n                    if (type === 'MultiPolygon') {\n                        polygonsCoords.push(...coordinates);\n                    }\n                }\n                if (polygonsCoords.length) {\n                    const multipolygonWrapper = {\n                        type: 'MultiPolygon',\n                        coordinates: polygonsCoords\n                    };\n                    return new Within(geojson, multipolygonWrapper);\n                }\n            }\n            else if (geojson.type === 'Feature') {\n                const type = geojson.geometry.type;\n                if (type === 'Polygon' || type === 'MultiPolygon') {\n                    return new Within(geojson, geojson.geometry);\n                }\n            }\n            else if (geojson.type === 'Polygon' || geojson.type === 'MultiPolygon') {\n                return new Within(geojson, geojson);\n            }\n        }\n        return context.error('\\'within\\' expression requires valid geojson object that contains polygon geometry type.');\n    }\n    evaluate(ctx) {\n        if (ctx.geometry() != null && ctx.canonicalID() != null) {\n            if (ctx.geometryType() === 'Point') {\n                return pointsWithinPolygons(ctx, this.geometries);\n            }\n            else if (ctx.geometryType() === 'LineString') {\n                return linesWithinPolygons(ctx, this.geometries);\n            }\n        }\n        return false;\n    }\n    eachChild() { }\n    outputDefined() {\n        return true;\n    }\n}\n\nclass TinyQueue {\n    constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {\n        this.data = data;\n        this.length = this.data.length;\n        this.compare = compare;\n\n        if (this.length > 0) {\n            for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n        }\n    }\n\n    push(item) {\n        this.data.push(item);\n        this._up(this.length++);\n    }\n\n    pop() {\n        if (this.length === 0) return undefined;\n\n        const top = this.data[0];\n        const bottom = this.data.pop();\n\n        if (--this.length > 0) {\n            this.data[0] = bottom;\n            this._down(0);\n        }\n\n        return top;\n    }\n\n    peek() {\n        return this.data[0];\n    }\n\n    _up(pos) {\n        const {data, compare} = this;\n        const item = data[pos];\n\n        while (pos > 0) {\n            const parent = (pos - 1) >> 1;\n            const current = data[parent];\n            if (compare(item, current) >= 0) break;\n            data[pos] = current;\n            pos = parent;\n        }\n\n        data[pos] = item;\n    }\n\n    _down(pos) {\n        const {data, compare} = this;\n        const halfLength = this.length >> 1;\n        const item = data[pos];\n\n        while (pos < halfLength) {\n            let bestChild = (pos << 1) + 1; // initially it is the left child\n            const right = bestChild + 1;\n\n            if (right < this.length && compare(data[right], data[bestChild]) < 0) {\n                bestChild = right;\n            }\n            if (compare(data[bestChild], item) >= 0) break;\n\n            data[pos] = data[bestChild];\n            pos = bestChild;\n        }\n\n        data[pos] = item;\n    }\n}\n\nfunction quickselect(arr, k, left, right, compare) {\n    quickselectStep(arr, k, left, right || (arr.length - 1), compare || defaultCompare);\n}\n\nfunction quickselectStep(arr, k, left, right, compare) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            var n = right - left + 1;\n            var m = k - left + 1;\n            var z = Math.log(n);\n            var s = 0.5 * Math.exp(2 * z / 3);\n            var sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            var newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            var newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            quickselectStep(arr, k, newLeft, newRight, compare);\n        }\n\n        var t = arr[k];\n        var i = left;\n        var j = right;\n\n        swap(arr, left, k);\n        if (compare(arr[right], t) > 0) swap(arr, left, right);\n\n        while (i < j) {\n            swap(arr, i, j);\n            i++;\n            j--;\n            while (compare(arr[i], t) < 0) i++;\n            while (compare(arr[j], t) > 0) j--;\n        }\n\n        if (compare(arr[left], t) === 0) swap(arr, left, j);\n        else {\n            j++;\n            swap(arr, j, right);\n        }\n\n        if (j <= k) left = j + 1;\n        if (k <= j) right = j - 1;\n    }\n}\n\nfunction swap(arr, i, j) {\n    var tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\nfunction defaultCompare(a, b) {\n    return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * Classifies an array of rings into polygons with outer rings and holes\n * @param rings - the rings to classify\n * @param maxRings - the maximum number of rings to include in a polygon, use 0 to include all rings\n * @returns an array of polygons with internal rings as holes\n */\nfunction classifyRings(rings, maxRings) {\n    const len = rings.length;\n    if (len <= 1)\n        return [rings];\n    const polygons = [];\n    let polygon;\n    let ccw;\n    for (const ring of rings) {\n        const area = calculateSignedArea(ring);\n        if (area === 0)\n            continue;\n        ring.area = Math.abs(area);\n        if (ccw === undefined)\n            ccw = area < 0;\n        if (ccw === area < 0) {\n            if (polygon)\n                polygons.push(polygon);\n            polygon = [ring];\n        }\n        else {\n            polygon.push(ring);\n        }\n    }\n    if (polygon)\n        polygons.push(polygon);\n    // Earcut performance degrades with the # of rings in a polygon. For this\n    // reason, we limit strip out all but the `maxRings` largest rings.\n    if (maxRings > 1) {\n        for (let j = 0; j < polygons.length; j++) {\n            if (polygons[j].length <= maxRings)\n                continue;\n            quickselect(polygons[j], maxRings, 1, polygons[j].length - 1, compareAreas);\n            polygons[j] = polygons[j].slice(0, maxRings);\n        }\n    }\n    return polygons;\n}\nfunction compareAreas(a, b) {\n    return b.area - a.area;\n}\n/**\n * Returns the signed area for the polygon ring.  Positive areas are exterior rings and\n * have a clockwise winding.  Negative areas are interior rings and have a counter clockwise\n * ordering.\n *\n * @param ring - Exterior or interior ring\n * @returns Signed area\n */\nfunction calculateSignedArea(ring) {\n    let sum = 0;\n    for (let i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {\n        p1 = ring[i];\n        p2 = ring[j];\n        sum += (p2.x - p1.x) * (p1.y + p2.y);\n    }\n    return sum;\n}\n\n// This is taken from https://github.com/mapbox/cheap-ruler/ in order to take only the relevant parts\n// Values that define WGS84 ellipsoid model of the Earth\nconst RE = 6378.137; // equatorial radius\nconst FE = 1 / 298.257223563; // flattening\nconst E2 = FE * (2 - FE);\nconst RAD = Math.PI / 180;\nclass CheapRuler {\n    constructor(lat) {\n        // Curvature formulas from https://en.wikipedia.org/wiki/Earth_radius#Meridional\n        const m = RAD * RE * 1000;\n        const coslat = Math.cos(lat * RAD);\n        const w2 = 1 / (1 - E2 * (1 - coslat * coslat));\n        const w = Math.sqrt(w2);\n        // multipliers for converting longitude and latitude degrees into distance\n        this.kx = m * w * coslat; // based on normal radius of curvature\n        this.ky = m * w * w2 * (1 - E2); // based on meridonal radius of curvature\n    }\n    /**\n     * Given two points of the form [longitude, latitude], returns the distance.\n     *\n     * @param a - point [longitude, latitude]\n     * @param b - point [longitude, latitude]\n     * @returns distance\n     * @example\n     * const distance = ruler.distance([30.5, 50.5], [30.51, 50.49]);\n     * //=distance\n     */\n    distance(a, b) {\n        const dx = this.wrap(a[0] - b[0]) * this.kx;\n        const dy = (a[1] - b[1]) * this.ky;\n        return Math.sqrt(dx * dx + dy * dy);\n    }\n    /**\n     * Returns an object of the form {point, index, t}, where point is closest point on the line\n     * from the given point, index is the start index of the segment with the closest point,\n     * and t is a parameter from 0 to 1 that indicates where the closest point is on that segment.\n     *\n     * @param line - an array of points that form the line\n     * @param p - point [longitude, latitude]\n     * @returns the nearest point, its index in the array and the proportion along the line\n     * @example\n     * const point = ruler.pointOnLine(line, [-67.04, 50.5]).point;\n     * //=point\n     */\n    pointOnLine(line, p) {\n        let minDist = Infinity;\n        let minX, minY, minI, minT;\n        for (let i = 0; i < line.length - 1; i++) {\n            let x = line[i][0];\n            let y = line[i][1];\n            let dx = this.wrap(line[i + 1][0] - x) * this.kx;\n            let dy = (line[i + 1][1] - y) * this.ky;\n            let t = 0;\n            if (dx !== 0 || dy !== 0) {\n                t = (this.wrap(p[0] - x) * this.kx * dx + (p[1] - y) * this.ky * dy) / (dx * dx + dy * dy);\n                if (t > 1) {\n                    x = line[i + 1][0];\n                    y = line[i + 1][1];\n                }\n                else if (t > 0) {\n                    x += (dx / this.kx) * t;\n                    y += (dy / this.ky) * t;\n                }\n            }\n            dx = this.wrap(p[0] - x) * this.kx;\n            dy = (p[1] - y) * this.ky;\n            const sqDist = dx * dx + dy * dy;\n            if (sqDist < minDist) {\n                minDist = sqDist;\n                minX = x;\n                minY = y;\n                minI = i;\n                minT = t;\n            }\n        }\n        return {\n            point: [minX, minY],\n            index: minI,\n            t: Math.max(0, Math.min(1, minT))\n        };\n    }\n    wrap(deg) {\n        while (deg < -180)\n            deg += 360;\n        while (deg > 180)\n            deg -= 360;\n        return deg;\n    }\n}\n\nconst MinPointsSize = 100;\nconst MinLinePointsSize = 50;\nfunction compareDistPair(a, b) {\n    return b[0] - a[0];\n}\nfunction getRangeSize(range) {\n    return range[1] - range[0] + 1;\n}\nfunction isRangeSafe(range, threshold) {\n    return range[1] >= range[0] && range[1] < threshold;\n}\nfunction splitRange(range, isLine) {\n    if (range[0] > range[1]) {\n        return [null, null];\n    }\n    const size = getRangeSize(range);\n    if (isLine) {\n        if (size === 2) {\n            return [range, null];\n        }\n        const size1 = Math.floor(size / 2);\n        return [[range[0], range[0] + size1],\n            [range[0] + size1, range[1]]];\n    }\n    if (size === 1) {\n        return [range, null];\n    }\n    const size1 = Math.floor(size / 2) - 1;\n    return [[range[0], range[0] + size1],\n        [range[0] + size1 + 1, range[1]]];\n}\nfunction getBBox(coords, range) {\n    if (!isRangeSafe(range, coords.length)) {\n        return [Infinity, Infinity, -Infinity, -Infinity];\n    }\n    const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n    for (let i = range[0]; i <= range[1]; ++i) {\n        updateBBox(bbox, coords[i]);\n    }\n    return bbox;\n}\nfunction getPolygonBBox(polygon) {\n    const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n    for (const ring of polygon) {\n        for (const coord of ring) {\n            updateBBox(bbox, coord);\n        }\n    }\n    return bbox;\n}\nfunction isValidBBox(bbox) {\n    return bbox[0] !== -Infinity && bbox[1] !== -Infinity && bbox[2] !== Infinity && bbox[3] !== Infinity;\n}\n// Calculate the distance between two bounding boxes.\n// Calculate the delta in x and y direction, and use two fake points {0.0, 0.0}\n// and {dx, dy} to calculate the distance. Distance will be 0.0 if bounding box are overlapping.\nfunction bboxToBBoxDistance(bbox1, bbox2, ruler) {\n    if (!isValidBBox(bbox1) || !isValidBBox(bbox2)) {\n        return NaN;\n    }\n    let dx = 0.0;\n    let dy = 0.0;\n    // bbox1 in left side\n    if (bbox1[2] < bbox2[0]) {\n        dx = bbox2[0] - bbox1[2];\n    }\n    // bbox1 in right side\n    if (bbox1[0] > bbox2[2]) {\n        dx = bbox1[0] - bbox2[2];\n    }\n    // bbox1 in above side\n    if (bbox1[1] > bbox2[3]) {\n        dy = bbox1[1] - bbox2[3];\n    }\n    // bbox1 in down side\n    if (bbox1[3] < bbox2[1]) {\n        dy = bbox2[1] - bbox1[3];\n    }\n    return ruler.distance([0.0, 0.0], [dx, dy]);\n}\nfunction pointToLineDistance(point, line, ruler) {\n    const nearestPoint = ruler.pointOnLine(line, point);\n    return ruler.distance(point, nearestPoint.point);\n}\nfunction segmentToSegmentDistance(p1, p2, q1, q2, ruler) {\n    const dist1 = Math.min(pointToLineDistance(p1, [q1, q2], ruler), pointToLineDistance(p2, [q1, q2], ruler));\n    const dist2 = Math.min(pointToLineDistance(q1, [p1, p2], ruler), pointToLineDistance(q2, [p1, p2], ruler));\n    return Math.min(dist1, dist2);\n}\nfunction lineToLineDistance(line1, range1, line2, range2, ruler) {\n    const rangeSafe = isRangeSafe(range1, line1.length) && isRangeSafe(range2, line2.length);\n    if (!rangeSafe) {\n        return Infinity;\n    }\n    let dist = Infinity;\n    for (let i = range1[0]; i < range1[1]; ++i) {\n        const p1 = line1[i];\n        const p2 = line1[i + 1];\n        for (let j = range2[0]; j < range2[1]; ++j) {\n            const q1 = line2[j];\n            const q2 = line2[j + 1];\n            if (segmentIntersectSegment(p1, p2, q1, q2)) {\n                return 0.0;\n            }\n            dist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n        }\n    }\n    return dist;\n}\nfunction pointsToPointsDistance(points1, range1, points2, range2, ruler) {\n    const rangeSafe = isRangeSafe(range1, points1.length) && isRangeSafe(range2, points2.length);\n    if (!rangeSafe) {\n        return NaN;\n    }\n    let dist = Infinity;\n    for (let i = range1[0]; i <= range1[1]; ++i) {\n        for (let j = range2[0]; j <= range2[1]; ++j) {\n            dist = Math.min(dist, ruler.distance(points1[i], points2[j]));\n            if (dist === 0.0) {\n                return dist;\n            }\n        }\n    }\n    return dist;\n}\nfunction pointToPolygonDistance(point, polygon, ruler) {\n    if (pointWithinPolygon(point, polygon, true)) {\n        return 0.0;\n    }\n    let dist = Infinity;\n    for (const ring of polygon) {\n        const front = ring[0];\n        const back = ring[ring.length - 1];\n        if (front !== back) {\n            dist = Math.min(dist, pointToLineDistance(point, [back, front], ruler));\n            if (dist === 0.0) {\n                return dist;\n            }\n        }\n        const nearestPoint = ruler.pointOnLine(ring, point);\n        dist = Math.min(dist, ruler.distance(point, nearestPoint.point));\n        if (dist === 0.0) {\n            return dist;\n        }\n    }\n    return dist;\n}\nfunction lineToPolygonDistance(line, range, polygon, ruler) {\n    if (!isRangeSafe(range, line.length)) {\n        return NaN;\n    }\n    for (let i = range[0]; i <= range[1]; ++i) {\n        if (pointWithinPolygon(line[i], polygon, true)) {\n            return 0.0;\n        }\n    }\n    let dist = Infinity;\n    for (let i = range[0]; i < range[1]; ++i) {\n        const p1 = line[i];\n        const p2 = line[i + 1];\n        for (const ring of polygon) {\n            for (let j = 0, len = ring.length, k = len - 1; j < len; k = j++) {\n                const q1 = ring[k];\n                const q2 = ring[j];\n                if (segmentIntersectSegment(p1, p2, q1, q2)) {\n                    return 0.0;\n                }\n                dist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n            }\n        }\n    }\n    return dist;\n}\nfunction polygonIntersect(poly1, poly2) {\n    for (const ring of poly1) {\n        for (const point of ring) {\n            if (pointWithinPolygon(point, poly2, true)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\nfunction polygonToPolygonDistance(polygon1, polygon2, ruler, currentMiniDist = Infinity) {\n    const bbox1 = getPolygonBBox(polygon1);\n    const bbox2 = getPolygonBBox(polygon2);\n    if (currentMiniDist !== Infinity && bboxToBBoxDistance(bbox1, bbox2, ruler) >= currentMiniDist) {\n        return currentMiniDist;\n    }\n    if (boxWithinBox(bbox1, bbox2)) {\n        if (polygonIntersect(polygon1, polygon2)) {\n            return 0.0;\n        }\n    }\n    else if (polygonIntersect(polygon2, polygon1)) {\n        return 0.0;\n    }\n    let dist = Infinity;\n    for (const ring1 of polygon1) {\n        for (let i = 0, len1 = ring1.length, l = len1 - 1; i < len1; l = i++) {\n            const p1 = ring1[l];\n            const p2 = ring1[i];\n            for (const ring2 of polygon2) {\n                for (let j = 0, len2 = ring2.length, k = len2 - 1; j < len2; k = j++) {\n                    const q1 = ring2[k];\n                    const q2 = ring2[j];\n                    if (segmentIntersectSegment(p1, p2, q1, q2)) {\n                        return 0.0;\n                    }\n                    dist = Math.min(dist, segmentToSegmentDistance(p1, p2, q1, q2, ruler));\n                }\n            }\n        }\n    }\n    return dist;\n}\nfunction updateQueue(distQueue, miniDist, ruler, points, polyBBox, rangeA) {\n    if (!rangeA) {\n        return;\n    }\n    const tempDist = bboxToBBoxDistance(getBBox(points, rangeA), polyBBox, ruler);\n    // Insert new pair to the queue if the bbox distance is less than\n    // miniDist, The pair with biggest distance will be at the top\n    if (tempDist < miniDist) {\n        distQueue.push([tempDist, rangeA, [0, 0]]);\n    }\n}\nfunction updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, range1, range2) {\n    if (!range1 || !range2) {\n        return;\n    }\n    const tempDist = bboxToBBoxDistance(getBBox(pointSet1, range1), getBBox(pointSet2, range2), ruler);\n    // Insert new pair to the queue if the bbox distance is less than\n    // miniDist, The pair with biggest distance will be at the top\n    if (tempDist < miniDist) {\n        distQueue.push([tempDist, range1, range2]);\n    }\n}\n// Divide and conquer, the time complexity is O(n*lgn), faster than Brute force\n// O(n*n) Most of the time, use index for in-place processing.\nfunction pointsToPolygonDistance(points, isLine, polygon, ruler, currentMiniDist = Infinity) {\n    let miniDist = Math.min(ruler.distance(points[0], polygon[0][0]), currentMiniDist);\n    if (miniDist === 0.0) {\n        return miniDist;\n    }\n    const distQueue = new TinyQueue([[0, [0, points.length - 1], [0, 0]]], compareDistPair);\n    const polyBBox = getPolygonBBox(polygon);\n    while (distQueue.length > 0) {\n        const distPair = distQueue.pop();\n        if (distPair[0] >= miniDist) {\n            continue;\n        }\n        const range = distPair[1];\n        // In case the set size are relatively small, we could use brute-force directly\n        const threshold = isLine ? MinLinePointsSize : MinPointsSize;\n        if (getRangeSize(range) <= threshold) {\n            if (!isRangeSafe(range, points.length)) {\n                return NaN;\n            }\n            if (isLine) {\n                const tempDist = lineToPolygonDistance(points, range, polygon, ruler);\n                if (isNaN(tempDist) || tempDist === 0.0) {\n                    return tempDist;\n                }\n                miniDist = Math.min(miniDist, tempDist);\n            }\n            else {\n                for (let i = range[0]; i <= range[1]; ++i) {\n                    const tempDist = pointToPolygonDistance(points[i], polygon, ruler);\n                    miniDist = Math.min(miniDist, tempDist);\n                    if (miniDist === 0.0) {\n                        return 0.0;\n                    }\n                }\n            }\n        }\n        else {\n            const newRangesA = splitRange(range, isLine);\n            updateQueue(distQueue, miniDist, ruler, points, polyBBox, newRangesA[0]);\n            updateQueue(distQueue, miniDist, ruler, points, polyBBox, newRangesA[1]);\n        }\n    }\n    return miniDist;\n}\nfunction pointSetToPointSetDistance(pointSet1, isLine1, pointSet2, isLine2, ruler, currentMiniDist = Infinity) {\n    let miniDist = Math.min(currentMiniDist, ruler.distance(pointSet1[0], pointSet2[0]));\n    if (miniDist === 0.0) {\n        return miniDist;\n    }\n    const distQueue = new TinyQueue([[0, [0, pointSet1.length - 1], [0, pointSet2.length - 1]]], compareDistPair);\n    while (distQueue.length > 0) {\n        const distPair = distQueue.pop();\n        if (distPair[0] >= miniDist) {\n            continue;\n        }\n        const rangeA = distPair[1];\n        const rangeB = distPair[2];\n        const threshold1 = isLine1 ? MinLinePointsSize : MinPointsSize;\n        const threshold2 = isLine2 ? MinLinePointsSize : MinPointsSize;\n        // In case the set size are relatively small, we could use brute-force directly\n        if (getRangeSize(rangeA) <= threshold1 && getRangeSize(rangeB) <= threshold2) {\n            if (!isRangeSafe(rangeA, pointSet1.length) && isRangeSafe(rangeB, pointSet2.length)) {\n                return NaN;\n            }\n            let tempDist;\n            if (isLine1 && isLine2) {\n                tempDist = lineToLineDistance(pointSet1, rangeA, pointSet2, rangeB, ruler);\n                miniDist = Math.min(miniDist, tempDist);\n            }\n            else if (isLine1 && !isLine2) {\n                const sublibe = pointSet1.slice(rangeA[0], rangeA[1] + 1);\n                for (let i = rangeB[0]; i <= rangeB[1]; ++i) {\n                    tempDist = pointToLineDistance(pointSet2[i], sublibe, ruler);\n                    miniDist = Math.min(miniDist, tempDist);\n                    if (miniDist === 0.0) {\n                        return miniDist;\n                    }\n                }\n            }\n            else if (!isLine1 && isLine2) {\n                const sublibe = pointSet2.slice(rangeB[0], rangeB[1] + 1);\n                for (let i = rangeA[0]; i <= rangeA[1]; ++i) {\n                    tempDist = pointToLineDistance(pointSet1[i], sublibe, ruler);\n                    miniDist = Math.min(miniDist, tempDist);\n                    if (miniDist === 0.0) {\n                        return miniDist;\n                    }\n                }\n            }\n            else {\n                tempDist = pointsToPointsDistance(pointSet1, rangeA, pointSet2, rangeB, ruler);\n                miniDist = Math.min(miniDist, tempDist);\n            }\n        }\n        else {\n            const newRangesA = splitRange(rangeA, isLine1);\n            const newRangesB = splitRange(rangeB, isLine2);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[0], newRangesB[0]);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[0], newRangesB[1]);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[1], newRangesB[0]);\n            updateQueueTwoSets(distQueue, miniDist, ruler, pointSet1, pointSet2, newRangesA[1], newRangesB[1]);\n        }\n    }\n    return miniDist;\n}\nfunction pointToGeometryDistance(ctx, geometries) {\n    const tilePoints = ctx.geometry();\n    const pointPosition = tilePoints.flat().map(p => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n    if (tilePoints.length === 0) {\n        return NaN;\n    }\n    const ruler = new CheapRuler(pointPosition[0][1]);\n    let dist = Infinity;\n    for (const geometry of geometries) {\n        switch (geometry.type) {\n            case 'Point':\n                dist = Math.min(dist, pointSetToPointSetDistance(pointPosition, false, [geometry.coordinates], false, ruler, dist));\n                break;\n            case 'LineString':\n                dist = Math.min(dist, pointSetToPointSetDistance(pointPosition, false, geometry.coordinates, true, ruler, dist));\n                break;\n            case 'Polygon':\n                dist = Math.min(dist, pointsToPolygonDistance(pointPosition, false, geometry.coordinates, ruler, dist));\n                break;\n        }\n        if (dist === 0.0) {\n            return dist;\n        }\n    }\n    return dist;\n}\nfunction lineStringToGeometryDistance(ctx, geometries) {\n    const tileLine = ctx.geometry();\n    const linePositions = tileLine.flat().map(p => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n    if (tileLine.length === 0) {\n        return NaN;\n    }\n    const ruler = new CheapRuler(linePositions[0][1]);\n    let dist = Infinity;\n    for (const geometry of geometries) {\n        switch (geometry.type) {\n            case 'Point':\n                dist = Math.min(dist, pointSetToPointSetDistance(linePositions, true, [geometry.coordinates], false, ruler, dist));\n                break;\n            case 'LineString':\n                dist = Math.min(dist, pointSetToPointSetDistance(linePositions, true, geometry.coordinates, true, ruler, dist));\n                break;\n            case 'Polygon':\n                dist = Math.min(dist, pointsToPolygonDistance(linePositions, true, geometry.coordinates, ruler, dist));\n                break;\n        }\n        if (dist === 0.0) {\n            return dist;\n        }\n    }\n    return dist;\n}\nfunction polygonToGeometryDistance(ctx, geometries) {\n    const tilePolygon = ctx.geometry();\n    if (tilePolygon.length === 0 || tilePolygon[0].length === 0) {\n        return NaN;\n    }\n    const polygons = classifyRings(tilePolygon, 0).map(polygon => {\n        return polygon.map(ring => {\n            return ring.map(p => getLngLatFromTileCoord([p.x, p.y], ctx.canonical));\n        });\n    });\n    const ruler = new CheapRuler(polygons[0][0][0][1]);\n    let dist = Infinity;\n    for (const geometry of geometries) {\n        for (const polygon of polygons) {\n            switch (geometry.type) {\n                case 'Point':\n                    dist = Math.min(dist, pointsToPolygonDistance([geometry.coordinates], false, polygon, ruler, dist));\n                    break;\n                case 'LineString':\n                    dist = Math.min(dist, pointsToPolygonDistance(geometry.coordinates, true, polygon, ruler, dist));\n                    break;\n                case 'Polygon':\n                    dist = Math.min(dist, polygonToPolygonDistance(polygon, geometry.coordinates, ruler, dist));\n                    break;\n            }\n            if (dist === 0.0) {\n                return dist;\n            }\n        }\n    }\n    return dist;\n}\nfunction toSimpleGeometry(geometry) {\n    if (geometry.type === 'MultiPolygon') {\n        return geometry.coordinates.map(polygon => {\n            return {\n                type: 'Polygon',\n                coordinates: polygon\n            };\n        });\n    }\n    if (geometry.type === 'MultiLineString') {\n        return geometry.coordinates.map(lineString => {\n            return {\n                type: 'LineString',\n                coordinates: lineString\n            };\n        });\n    }\n    if (geometry.type === 'MultiPoint') {\n        return geometry.coordinates.map(point => {\n            return {\n                type: 'Point',\n                coordinates: point\n            };\n        });\n    }\n    return [geometry];\n}\nclass Distance {\n    constructor(geojson, geometries) {\n        this.type = NumberType;\n        this.geojson = geojson;\n        this.geometries = geometries;\n    }\n    static parse(args, context) {\n        if (args.length !== 2)\n            return context.error(`'distance' expression requires exactly one argument, but found ${args.length - 1} instead.`);\n        if (isValue(args[1])) {\n            const geojson = args[1];\n            if (geojson.type === 'FeatureCollection') {\n                return new Distance(geojson, geojson.features.map(feature => toSimpleGeometry(feature.geometry)).flat());\n            }\n            else if (geojson.type === 'Feature') {\n                return new Distance(geojson, toSimpleGeometry(geojson.geometry));\n            }\n            else if ('type' in geojson && 'coordinates' in geojson) {\n                return new Distance(geojson, toSimpleGeometry(geojson));\n            }\n        }\n        return context.error('\\'distance\\' expression requires valid geojson object that contains polygon geometry type.');\n    }\n    evaluate(ctx) {\n        if (ctx.geometry() != null && ctx.canonicalID() != null) {\n            if (ctx.geometryType() === 'Point') {\n                return pointToGeometryDistance(ctx, this.geometries);\n            }\n            else if (ctx.geometryType() === 'LineString') {\n                return lineStringToGeometryDistance(ctx, this.geometries);\n            }\n            else if (ctx.geometryType() === 'Polygon') {\n                return polygonToGeometryDistance(ctx, this.geometries);\n            }\n        }\n        return NaN;\n    }\n    eachChild() { }\n    outputDefined() {\n        return true;\n    }\n}\n\nconst expressions$1 = {\n    // special forms\n    '==': Equals,\n    '!=': NotEquals,\n    '>': GreaterThan,\n    '<': LessThan,\n    '>=': GreaterThanOrEqual,\n    '<=': LessThanOrEqual,\n    'array': Assertion,\n    'at': At,\n    'boolean': Assertion,\n    'case': Case,\n    'coalesce': Coalesce,\n    'collator': CollatorExpression,\n    'format': FormatExpression,\n    'image': ImageExpression,\n    'in': In,\n    'index-of': IndexOf,\n    'interpolate': Interpolate,\n    'interpolate-hcl': Interpolate,\n    'interpolate-lab': Interpolate,\n    'length': Length,\n    'let': Let,\n    'literal': Literal,\n    'match': Match,\n    'number': Assertion,\n    'number-format': NumberFormat,\n    'object': Assertion,\n    'slice': Slice,\n    'step': Step,\n    'string': Assertion,\n    'to-boolean': Coercion,\n    'to-color': Coercion,\n    'to-number': Coercion,\n    'to-string': Coercion,\n    'var': Var,\n    'within': Within,\n    'distance': Distance\n};\n\nclass CompoundExpression {\n    constructor(name, type, evaluate, args) {\n        this.name = name;\n        this.type = type;\n        this._evaluate = evaluate;\n        this.args = args;\n    }\n    evaluate(ctx) {\n        return this._evaluate(ctx, this.args);\n    }\n    eachChild(fn) {\n        this.args.forEach(fn);\n    }\n    outputDefined() {\n        return false;\n    }\n    static parse(args, context) {\n        const op = args[0];\n        const definition = CompoundExpression.definitions[op];\n        if (!definition) {\n            return context.error(`Unknown expression \"${op}\". If you wanted a literal array, use [\"literal\", [...]].`, 0);\n        }\n        // Now check argument types against each signature\n        const type = Array.isArray(definition) ?\n            definition[0] : definition.type;\n        const availableOverloads = Array.isArray(definition) ?\n            [[definition[1], definition[2]]] :\n            definition.overloads;\n        const overloads = availableOverloads.filter(([signature]) => (!Array.isArray(signature) || // varags\n            signature.length === args.length - 1 // correct param count\n        ));\n        let signatureContext = null;\n        for (const [params, evaluate] of overloads) {\n            // Use a fresh context for each attempted signature so that, if\n            // we eventually succeed, we haven't polluted `context.errors`.\n            signatureContext = new ParsingContext(context.registry, isExpressionConstant, context.path, null, context.scope);\n            // First parse all the args, potentially coercing to the\n            // types expected by this overload.\n            const parsedArgs = [];\n            let argParseFailed = false;\n            for (let i = 1; i < args.length; i++) {\n                const arg = args[i];\n                const expectedType = Array.isArray(params) ?\n                    params[i - 1] :\n                    params.type;\n                const parsed = signatureContext.parse(arg, 1 + parsedArgs.length, expectedType);\n                if (!parsed) {\n                    argParseFailed = true;\n                    break;\n                }\n                parsedArgs.push(parsed);\n            }\n            if (argParseFailed) {\n                // Couldn't coerce args of this overload to expected type, move\n                // on to next one.\n                continue;\n            }\n            if (Array.isArray(params)) {\n                if (params.length !== parsedArgs.length) {\n                    signatureContext.error(`Expected ${params.length} arguments, but found ${parsedArgs.length} instead.`);\n                    continue;\n                }\n            }\n            for (let i = 0; i < parsedArgs.length; i++) {\n                const expected = Array.isArray(params) ? params[i] : params.type;\n                const arg = parsedArgs[i];\n                signatureContext.concat(i + 1).checkSubtype(expected, arg.type);\n            }\n            if (signatureContext.errors.length === 0) {\n                return new CompoundExpression(op, type, evaluate, parsedArgs);\n            }\n        }\n        if (overloads.length === 1) {\n            context.errors.push(...signatureContext.errors);\n        }\n        else {\n            const expected = overloads.length ? overloads : availableOverloads;\n            const signatures = expected\n                .map(([params]) => stringifySignature(params))\n                .join(' | ');\n            const actualTypes = [];\n            // For error message, re-parse arguments without trying to\n            // apply any coercions\n            for (let i = 1; i < args.length; i++) {\n                const parsed = context.parse(args[i], 1 + actualTypes.length);\n                if (!parsed)\n                    return null;\n                actualTypes.push(toString$1(parsed.type));\n            }\n            context.error(`Expected arguments of type ${signatures}, but found (${actualTypes.join(', ')}) instead.`);\n        }\n        return null;\n    }\n    static register(registry, definitions) {\n        CompoundExpression.definitions = definitions;\n        for (const name in definitions) {\n            registry[name] = CompoundExpression;\n        }\n    }\n}\nfunction rgba(ctx, [r, g, b, a]) {\n    r = r.evaluate(ctx);\n    g = g.evaluate(ctx);\n    b = b.evaluate(ctx);\n    const alpha = a ? a.evaluate(ctx) : 1;\n    const error = validateRGBA(r, g, b, alpha);\n    if (error)\n        throw new RuntimeError(error);\n    return new Color(r / 255, g / 255, b / 255, alpha, false);\n}\nfunction has(key, obj) {\n    return key in obj;\n}\nfunction get(key, obj) {\n    const v = obj[key];\n    return typeof v === 'undefined' ? null : v;\n}\nfunction binarySearch(v, a, i, j) {\n    while (i <= j) {\n        const m = (i + j) >> 1;\n        if (a[m] === v)\n            return true;\n        if (a[m] > v)\n            j = m - 1;\n        else\n            i = m + 1;\n    }\n    return false;\n}\nfunction varargs(type) {\n    return { type };\n}\nCompoundExpression.register(expressions$1, {\n    'error': [\n        ErrorType,\n        [StringType],\n        (ctx, [v]) => { throw new RuntimeError(v.evaluate(ctx)); }\n    ],\n    'typeof': [\n        StringType,\n        [ValueType],\n        (ctx, [v]) => toString$1(typeOf(v.evaluate(ctx)))\n    ],\n    'to-rgba': [\n        array$1(NumberType, 4),\n        [ColorType],\n        (ctx, [v]) => {\n            const [r, g, b, a] = v.evaluate(ctx).rgb;\n            return [r * 255, g * 255, b * 255, a];\n        },\n    ],\n    'rgb': [\n        ColorType,\n        [NumberType, NumberType, NumberType],\n        rgba\n    ],\n    'rgba': [\n        ColorType,\n        [NumberType, NumberType, NumberType, NumberType],\n        rgba\n    ],\n    'has': {\n        type: BooleanType,\n        overloads: [\n            [\n                [StringType],\n                (ctx, [key]) => has(key.evaluate(ctx), ctx.properties())\n            ], [\n                [StringType, ObjectType],\n                (ctx, [key, obj]) => has(key.evaluate(ctx), obj.evaluate(ctx))\n            ]\n        ]\n    },\n    'get': {\n        type: ValueType,\n        overloads: [\n            [\n                [StringType],\n                (ctx, [key]) => get(key.evaluate(ctx), ctx.properties())\n            ], [\n                [StringType, ObjectType],\n                (ctx, [key, obj]) => get(key.evaluate(ctx), obj.evaluate(ctx))\n            ]\n        ]\n    },\n    'feature-state': [\n        ValueType,\n        [StringType],\n        (ctx, [key]) => get(key.evaluate(ctx), ctx.featureState || {})\n    ],\n    'properties': [\n        ObjectType,\n        [],\n        (ctx) => ctx.properties()\n    ],\n    'geometry-type': [\n        StringType,\n        [],\n        (ctx) => ctx.geometryType()\n    ],\n    'id': [\n        ValueType,\n        [],\n        (ctx) => ctx.id()\n    ],\n    'zoom': [\n        NumberType,\n        [],\n        (ctx) => ctx.globals.zoom\n    ],\n    'heatmap-density': [\n        NumberType,\n        [],\n        (ctx) => ctx.globals.heatmapDensity || 0\n    ],\n    'line-progress': [\n        NumberType,\n        [],\n        (ctx) => ctx.globals.lineProgress || 0\n    ],\n    'accumulated': [\n        ValueType,\n        [],\n        (ctx) => ctx.globals.accumulated === undefined ? null : ctx.globals.accumulated\n    ],\n    '+': [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => {\n            let result = 0;\n            for (const arg of args) {\n                result += arg.evaluate(ctx);\n            }\n            return result;\n        }\n    ],\n    '*': [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => {\n            let result = 1;\n            for (const arg of args) {\n                result *= arg.evaluate(ctx);\n            }\n            return result;\n        }\n    ],\n    '-': {\n        type: NumberType,\n        overloads: [\n            [\n                [NumberType, NumberType],\n                (ctx, [a, b]) => a.evaluate(ctx) - b.evaluate(ctx)\n            ], [\n                [NumberType],\n                (ctx, [a]) => -a.evaluate(ctx)\n            ]\n        ]\n    },\n    '/': [\n        NumberType,\n        [NumberType, NumberType],\n        (ctx, [a, b]) => a.evaluate(ctx) / b.evaluate(ctx)\n    ],\n    '%': [\n        NumberType,\n        [NumberType, NumberType],\n        (ctx, [a, b]) => a.evaluate(ctx) % b.evaluate(ctx)\n    ],\n    'ln2': [\n        NumberType,\n        [],\n        () => Math.LN2\n    ],\n    'pi': [\n        NumberType,\n        [],\n        () => Math.PI\n    ],\n    'e': [\n        NumberType,\n        [],\n        () => Math.E\n    ],\n    '^': [\n        NumberType,\n        [NumberType, NumberType],\n        (ctx, [b, e]) => Math.pow(b.evaluate(ctx), e.evaluate(ctx))\n    ],\n    'sqrt': [\n        NumberType,\n        [NumberType],\n        (ctx, [x]) => Math.sqrt(x.evaluate(ctx))\n    ],\n    'log10': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN10\n    ],\n    'ln': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.log(n.evaluate(ctx))\n    ],\n    'log2': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.log(n.evaluate(ctx)) / Math.LN2\n    ],\n    'sin': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.sin(n.evaluate(ctx))\n    ],\n    'cos': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.cos(n.evaluate(ctx))\n    ],\n    'tan': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.tan(n.evaluate(ctx))\n    ],\n    'asin': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.asin(n.evaluate(ctx))\n    ],\n    'acos': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.acos(n.evaluate(ctx))\n    ],\n    'atan': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.atan(n.evaluate(ctx))\n    ],\n    'min': [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => Math.min(...args.map(arg => arg.evaluate(ctx)))\n    ],\n    'max': [\n        NumberType,\n        varargs(NumberType),\n        (ctx, args) => Math.max(...args.map(arg => arg.evaluate(ctx)))\n    ],\n    'abs': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.abs(n.evaluate(ctx))\n    ],\n    'round': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => {\n            const v = n.evaluate(ctx);\n            // Javascript's Math.round() rounds towards +Infinity for halfway\n            // values, even when they're negative. It's more common to round\n            // away from 0 (e.g., this is what python and C++ do)\n            return v < 0 ? -Math.round(-v) : Math.round(v);\n        }\n    ],\n    'floor': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.floor(n.evaluate(ctx))\n    ],\n    'ceil': [\n        NumberType,\n        [NumberType],\n        (ctx, [n]) => Math.ceil(n.evaluate(ctx))\n    ],\n    'filter-==': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => ctx.properties()[k.value] === v.value\n    ],\n    'filter-id-==': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => ctx.id() === v.value\n    ],\n    'filter-type-==': [\n        BooleanType,\n        [StringType],\n        (ctx, [v]) => ctx.geometryType() === v.value\n    ],\n    'filter-<': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a < b;\n        }\n    ],\n    'filter-id-<': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a < b;\n        }\n    ],\n    'filter->': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a > b;\n        }\n    ],\n    'filter-id->': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a > b;\n        }\n    ],\n    'filter-<=': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a <= b;\n        }\n    ],\n    'filter-id-<=': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a <= b;\n        }\n    ],\n    'filter->=': [\n        BooleanType,\n        [StringType, ValueType],\n        (ctx, [k, v]) => {\n            const a = ctx.properties()[k.value];\n            const b = v.value;\n            return typeof a === typeof b && a >= b;\n        }\n    ],\n    'filter-id->=': [\n        BooleanType,\n        [ValueType],\n        (ctx, [v]) => {\n            const a = ctx.id();\n            const b = v.value;\n            return typeof a === typeof b && a >= b;\n        }\n    ],\n    'filter-has': [\n        BooleanType,\n        [ValueType],\n        (ctx, [k]) => k.value in ctx.properties()\n    ],\n    'filter-has-id': [\n        BooleanType,\n        [],\n        (ctx) => (ctx.id() !== null && ctx.id() !== undefined)\n    ],\n    'filter-type-in': [\n        BooleanType,\n        [array$1(StringType)],\n        (ctx, [v]) => v.value.indexOf(ctx.geometryType()) >= 0\n    ],\n    'filter-id-in': [\n        BooleanType,\n        [array$1(ValueType)],\n        (ctx, [v]) => v.value.indexOf(ctx.id()) >= 0\n    ],\n    'filter-in-small': [\n        BooleanType,\n        [StringType, array$1(ValueType)],\n        // assumes v is an array literal\n        (ctx, [k, v]) => v.value.indexOf(ctx.properties()[k.value]) >= 0\n    ],\n    'filter-in-large': [\n        BooleanType,\n        [StringType, array$1(ValueType)],\n        // assumes v is a array literal with values sorted in ascending order and of a single type\n        (ctx, [k, v]) => binarySearch(ctx.properties()[k.value], v.value, 0, v.value.length - 1)\n    ],\n    'all': {\n        type: BooleanType,\n        overloads: [\n            [\n                [BooleanType, BooleanType],\n                (ctx, [a, b]) => a.evaluate(ctx) && b.evaluate(ctx)\n            ],\n            [\n                varargs(BooleanType),\n                (ctx, args) => {\n                    for (const arg of args) {\n                        if (!arg.evaluate(ctx))\n                            return false;\n                    }\n                    return true;\n                }\n            ]\n        ]\n    },\n    'any': {\n        type: BooleanType,\n        overloads: [\n            [\n                [BooleanType, BooleanType],\n                (ctx, [a, b]) => a.evaluate(ctx) || b.evaluate(ctx)\n            ],\n            [\n                varargs(BooleanType),\n                (ctx, args) => {\n                    for (const arg of args) {\n                        if (arg.evaluate(ctx))\n                            return true;\n                    }\n                    return false;\n                }\n            ]\n        ]\n    },\n    '!': [\n        BooleanType,\n        [BooleanType],\n        (ctx, [b]) => !b.evaluate(ctx)\n    ],\n    'is-supported-script': [\n        BooleanType,\n        [StringType],\n        // At parse time this will always return true, so we need to exclude this expression with isGlobalPropertyConstant\n        (ctx, [s]) => {\n            const isSupportedScript = ctx.globals && ctx.globals.isSupportedScript;\n            if (isSupportedScript) {\n                return isSupportedScript(s.evaluate(ctx));\n            }\n            return true;\n        }\n    ],\n    'upcase': [\n        StringType,\n        [StringType],\n        (ctx, [s]) => s.evaluate(ctx).toUpperCase()\n    ],\n    'downcase': [\n        StringType,\n        [StringType],\n        (ctx, [s]) => s.evaluate(ctx).toLowerCase()\n    ],\n    'concat': [\n        StringType,\n        varargs(ValueType),\n        (ctx, args) => args.map(arg => toString(arg.evaluate(ctx))).join('')\n    ],\n    'resolved-locale': [\n        StringType,\n        [CollatorType],\n        (ctx, [collator]) => collator.evaluate(ctx).resolvedLocale()\n    ]\n});\nfunction stringifySignature(signature) {\n    if (Array.isArray(signature)) {\n        return `(${signature.map(toString$1).join(', ')})`;\n    }\n    else {\n        return `(${toString$1(signature.type)}...)`;\n    }\n}\nfunction isExpressionConstant(expression) {\n    if (expression instanceof Var) {\n        return isExpressionConstant(expression.boundExpression);\n    }\n    else if (expression instanceof CompoundExpression && expression.name === 'error') {\n        return false;\n    }\n    else if (expression instanceof CollatorExpression) {\n        // Although the results of a Collator expression with fixed arguments\n        // generally shouldn't change between executions, we can't serialize them\n        // as constant expressions because results change based on environment.\n        return false;\n    }\n    else if (expression instanceof Within) {\n        return false;\n    }\n    else if (expression instanceof Distance) {\n        return false;\n    }\n    const isTypeAnnotation = expression instanceof Coercion ||\n        expression instanceof Assertion;\n    let childrenConstant = true;\n    expression.eachChild(child => {\n        // We can _almost_ assume that if `expressions` children are constant,\n        // they would already have been evaluated to Literal values when they\n        // were parsed.  Type annotations are the exception, because they might\n        // have been inferred and added after a child was parsed.\n        // So we recurse into isConstant() for the children of type annotations,\n        // but otherwise simply check whether they are Literals.\n        if (isTypeAnnotation) {\n            childrenConstant = childrenConstant && isExpressionConstant(child);\n        }\n        else {\n            childrenConstant = childrenConstant && child instanceof Literal;\n        }\n    });\n    if (!childrenConstant) {\n        return false;\n    }\n    return isFeatureConstant(expression) &&\n        isGlobalPropertyConstant(expression, ['zoom', 'heatmap-density', 'line-progress', 'accumulated', 'is-supported-script']);\n}\nfunction isFeatureConstant(e) {\n    if (e instanceof CompoundExpression) {\n        if (e.name === 'get' && e.args.length === 1) {\n            return false;\n        }\n        else if (e.name === 'feature-state') {\n            return false;\n        }\n        else if (e.name === 'has' && e.args.length === 1) {\n            return false;\n        }\n        else if (e.name === 'properties' ||\n            e.name === 'geometry-type' ||\n            e.name === 'id') {\n            return false;\n        }\n        else if (/^filter-/.test(e.name)) {\n            return false;\n        }\n    }\n    if (e instanceof Within) {\n        return false;\n    }\n    if (e instanceof Distance) {\n        return false;\n    }\n    let result = true;\n    e.eachChild(arg => {\n        if (result && !isFeatureConstant(arg)) {\n            result = false;\n        }\n    });\n    return result;\n}\nfunction isStateConstant(e) {\n    if (e instanceof CompoundExpression) {\n        if (e.name === 'feature-state') {\n            return false;\n        }\n    }\n    let result = true;\n    e.eachChild(arg => {\n        if (result && !isStateConstant(arg)) {\n            result = false;\n        }\n    });\n    return result;\n}\nfunction isGlobalPropertyConstant(e, properties) {\n    if (e instanceof CompoundExpression && properties.indexOf(e.name) >= 0) {\n        return false;\n    }\n    let result = true;\n    e.eachChild((arg) => {\n        if (result && !isGlobalPropertyConstant(arg, properties)) {\n            result = false;\n        }\n    });\n    return result;\n}\n\nfunction success(value) {\n    return { result: 'success', value };\n}\nfunction error(value) {\n    return { result: 'error', value };\n}\n\nfunction supportsPropertyExpression(spec) {\n    return spec['property-type'] === 'data-driven' || spec['property-type'] === 'cross-faded-data-driven';\n}\nfunction supportsZoomExpression(spec) {\n    return !!spec.expression && spec.expression.parameters.indexOf('zoom') > -1;\n}\nfunction supportsInterpolation(spec) {\n    return !!spec.expression && spec.expression.interpolated;\n}\n\nfunction getType(val) {\n    if (val instanceof Number) {\n        return 'number';\n    }\n    else if (val instanceof String) {\n        return 'string';\n    }\n    else if (val instanceof Boolean) {\n        return 'boolean';\n    }\n    else if (Array.isArray(val)) {\n        return 'array';\n    }\n    else if (val === null) {\n        return 'null';\n    }\n    else {\n        return typeof val;\n    }\n}\n\nfunction isFunction$1(value) {\n    return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\nfunction identityFunction(x) {\n    return x;\n}\nfunction createFunction(parameters, propertySpec) {\n    const isColor = propertySpec.type === 'color';\n    const zoomAndFeatureDependent = parameters.stops && typeof parameters.stops[0][0] === 'object';\n    const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n    const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n    const type = parameters.type || (supportsInterpolation(propertySpec) ? 'exponential' : 'interval');\n    if (isColor || propertySpec.type === 'padding') {\n        const parseFn = isColor ? Color.parse : Padding.parse;\n        parameters = extendBy({}, parameters);\n        if (parameters.stops) {\n            parameters.stops = parameters.stops.map((stop) => {\n                return [stop[0], parseFn(stop[1])];\n            });\n        }\n        if (parameters.default) {\n            parameters.default = parseFn(parameters.default);\n        }\n        else {\n            parameters.default = parseFn(propertySpec.default);\n        }\n    }\n    if (parameters.colorSpace && !isSupportedInterpolationColorSpace(parameters.colorSpace)) {\n        throw new Error(`Unknown color space: \"${parameters.colorSpace}\"`);\n    }\n    let innerFun;\n    let hashedStops;\n    let categoricalKeyType;\n    if (type === 'exponential') {\n        innerFun = evaluateExponentialFunction;\n    }\n    else if (type === 'interval') {\n        innerFun = evaluateIntervalFunction;\n    }\n    else if (type === 'categorical') {\n        innerFun = evaluateCategoricalFunction;\n        // For categorical functions, generate an Object as a hashmap of the stops for fast searching\n        hashedStops = Object.create(null);\n        for (const stop of parameters.stops) {\n            hashedStops[stop[0]] = stop[1];\n        }\n        // Infer key type based on first stop key-- used to encforce strict type checking later\n        categoricalKeyType = typeof parameters.stops[0][0];\n    }\n    else if (type === 'identity') {\n        innerFun = evaluateIdentityFunction;\n    }\n    else {\n        throw new Error(`Unknown function type \"${type}\"`);\n    }\n    if (zoomAndFeatureDependent) {\n        const featureFunctions = {};\n        const zoomStops = [];\n        for (let s = 0; s < parameters.stops.length; s++) {\n            const stop = parameters.stops[s];\n            const zoom = stop[0].zoom;\n            if (featureFunctions[zoom] === undefined) {\n                featureFunctions[zoom] = {\n                    zoom,\n                    type: parameters.type,\n                    property: parameters.property,\n                    default: parameters.default,\n                    stops: []\n                };\n                zoomStops.push(zoom);\n            }\n            featureFunctions[zoom].stops.push([stop[0].value, stop[1]]);\n        }\n        const featureFunctionStops = [];\n        for (const z of zoomStops) {\n            featureFunctionStops.push([featureFunctions[z].zoom, createFunction(featureFunctions[z], propertySpec)]);\n        }\n        const interpolationType = { name: 'linear' };\n        return {\n            kind: 'composite',\n            interpolationType,\n            interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n            zoomStops: featureFunctionStops.map(s => s[0]),\n            evaluate({ zoom }, properties) {\n                return evaluateExponentialFunction({\n                    stops: featureFunctionStops,\n                    base: parameters.base\n                }, propertySpec, zoom).evaluate(zoom, properties);\n            }\n        };\n    }\n    else if (zoomDependent) {\n        const interpolationType = type === 'exponential' ?\n            { name: 'exponential', base: parameters.base !== undefined ? parameters.base : 1 } : null;\n        return {\n            kind: 'camera',\n            interpolationType,\n            interpolationFactor: Interpolate.interpolationFactor.bind(undefined, interpolationType),\n            zoomStops: parameters.stops.map(s => s[0]),\n            evaluate: ({ zoom }) => innerFun(parameters, propertySpec, zoom, hashedStops, categoricalKeyType)\n        };\n    }\n    else {\n        return {\n            kind: 'source',\n            evaluate(_, feature) {\n                const value = feature && feature.properties ? feature.properties[parameters.property] : undefined;\n                if (value === undefined) {\n                    return coalesce$1(parameters.default, propertySpec.default);\n                }\n                return innerFun(parameters, propertySpec, value, hashedStops, categoricalKeyType);\n            }\n        };\n    }\n}\nfunction coalesce$1(a, b, c) {\n    if (a !== undefined)\n        return a;\n    if (b !== undefined)\n        return b;\n    if (c !== undefined)\n        return c;\n}\nfunction evaluateCategoricalFunction(parameters, propertySpec, input, hashedStops, keyType) {\n    const evaluated = typeof input === keyType ? hashedStops[input] : undefined; // Enforce strict typing on input\n    return coalesce$1(evaluated, parameters.default, propertySpec.default);\n}\nfunction evaluateIntervalFunction(parameters, propertySpec, input) {\n    // Edge cases\n    if (getType(input) !== 'number')\n        return coalesce$1(parameters.default, propertySpec.default);\n    const n = parameters.stops.length;\n    if (n === 1)\n        return parameters.stops[0][1];\n    if (input <= parameters.stops[0][0])\n        return parameters.stops[0][1];\n    if (input >= parameters.stops[n - 1][0])\n        return parameters.stops[n - 1][1];\n    const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n    return parameters.stops[index][1];\n}\nfunction evaluateExponentialFunction(parameters, propertySpec, input) {\n    const base = parameters.base !== undefined ? parameters.base : 1;\n    // Edge cases\n    if (getType(input) !== 'number')\n        return coalesce$1(parameters.default, propertySpec.default);\n    const n = parameters.stops.length;\n    if (n === 1)\n        return parameters.stops[0][1];\n    if (input <= parameters.stops[0][0])\n        return parameters.stops[0][1];\n    if (input >= parameters.stops[n - 1][0])\n        return parameters.stops[n - 1][1];\n    const index = findStopLessThanOrEqualTo(parameters.stops.map((stop) => stop[0]), input);\n    const t = interpolationFactor(input, base, parameters.stops[index][0], parameters.stops[index + 1][0]);\n    const outputLower = parameters.stops[index][1];\n    const outputUpper = parameters.stops[index + 1][1];\n    const interp = interpolate[propertySpec.type] || identityFunction;\n    if (typeof outputLower.evaluate === 'function') {\n        return {\n            evaluate(...args) {\n                const evaluatedLower = outputLower.evaluate.apply(undefined, args);\n                const evaluatedUpper = outputUpper.evaluate.apply(undefined, args);\n                // Special case for fill-outline-color, which has no spec default.\n                if (evaluatedLower === undefined || evaluatedUpper === undefined) {\n                    return undefined;\n                }\n                return interp(evaluatedLower, evaluatedUpper, t, parameters.colorSpace);\n            }\n        };\n    }\n    return interp(outputLower, outputUpper, t, parameters.colorSpace);\n}\nfunction evaluateIdentityFunction(parameters, propertySpec, input) {\n    switch (propertySpec.type) {\n        case 'color':\n            input = Color.parse(input);\n            break;\n        case 'formatted':\n            input = Formatted.fromString(input.toString());\n            break;\n        case 'resolvedImage':\n            input = ResolvedImage.fromString(input.toString());\n            break;\n        case 'padding':\n            input = Padding.parse(input);\n            break;\n        default:\n            if (getType(input) !== propertySpec.type && (propertySpec.type !== 'enum' || !propertySpec.values[input])) {\n                input = undefined;\n            }\n    }\n    return coalesce$1(input, parameters.default, propertySpec.default);\n}\n/**\n * Returns a ratio that can be used to interpolate between exponential function\n * stops.\n *\n * How it works:\n * Two consecutive stop values define a (scaled and shifted) exponential\n * function `f(x) = a * base^x + b`, where `base` is the user-specified base,\n * and `a` and `b` are constants affording sufficient degrees of freedom to fit\n * the function to the given stops.\n *\n * Here's a bit of algebra that lets us compute `f(x)` directly from the stop\n * values without explicitly solving for `a` and `b`:\n *\n * First stop value: `f(x0) = y0 = a * base^x0 + b`\n * Second stop value: `f(x1) = y1 = a * base^x1 + b`\n * => `y1 - y0 = a(base^x1 - base^x0)`\n * => `a = (y1 - y0)/(base^x1 - base^x0)`\n *\n * Desired value: `f(x) = y = a * base^x + b`\n * => `f(x) = y0 + a * (base^x - base^x0)`\n *\n * From the above, we can replace the `a` in `a * (base^x - base^x0)` and do a\n * little algebra:\n * ```\n * a * (base^x - base^x0) = (y1 - y0)/(base^x1 - base^x0) * (base^x - base^x0)\n *                     = (y1 - y0) * (base^x - base^x0) / (base^x1 - base^x0)\n * ```\n *\n * If we let `(base^x - base^x0) / (base^x1 base^x0)`, then we have\n * `f(x) = y0 + (y1 - y0) * ratio`.  In other words, `ratio` may be treated as\n * an interpolation factor between the two stops' output values.\n *\n * (Note: a slightly different form for `ratio`,\n * `(base^(x-x0) - 1) / (base^(x1-x0) - 1) `, is equivalent, but requires fewer\n * expensive `Math.pow()` operations.)\n *\n * @private\n */\nfunction interpolationFactor(input, base, lowerValue, upperValue) {\n    const difference = upperValue - lowerValue;\n    const progress = input - lowerValue;\n    if (difference === 0) {\n        return 0;\n    }\n    else if (base === 1) {\n        return progress / difference;\n    }\n    else {\n        return (Math.pow(base, progress) - 1) / (Math.pow(base, difference) - 1);\n    }\n}\n\nclass StyleExpression {\n    constructor(expression, propertySpec) {\n        this.expression = expression;\n        this._warningHistory = {};\n        this._evaluator = new EvaluationContext();\n        this._defaultValue = propertySpec ? getDefaultValue(propertySpec) : null;\n        this._enumValues = propertySpec && propertySpec.type === 'enum' ? propertySpec.values : null;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        this._evaluator.globals = globals;\n        this._evaluator.feature = feature;\n        this._evaluator.featureState = featureState;\n        this._evaluator.canonical = canonical;\n        this._evaluator.availableImages = availableImages || null;\n        this._evaluator.formattedSection = formattedSection;\n        return this.expression.evaluate(this._evaluator);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        this._evaluator.globals = globals;\n        this._evaluator.feature = feature || null;\n        this._evaluator.featureState = featureState || null;\n        this._evaluator.canonical = canonical;\n        this._evaluator.availableImages = availableImages || null;\n        this._evaluator.formattedSection = formattedSection || null;\n        try {\n            const val = this.expression.evaluate(this._evaluator);\n            // eslint-disable-next-line no-self-compare\n            if (val === null || val === undefined || (typeof val === 'number' && val !== val)) {\n                return this._defaultValue;\n            }\n            if (this._enumValues && !(val in this._enumValues)) {\n                throw new RuntimeError(`Expected value to be one of ${Object.keys(this._enumValues).map(v => JSON.stringify(v)).join(', ')}, but found ${JSON.stringify(val)} instead.`);\n            }\n            return val;\n        }\n        catch (e) {\n            if (!this._warningHistory[e.message]) {\n                this._warningHistory[e.message] = true;\n                if (typeof console !== 'undefined') {\n                    console.warn(e.message);\n                }\n            }\n            return this._defaultValue;\n        }\n    }\n}\nfunction isExpression(expression) {\n    return Array.isArray(expression) && expression.length > 0 &&\n        typeof expression[0] === 'string' && expression[0] in expressions$1;\n}\n/**\n * Parse and typecheck the given style spec JSON expression.  If\n * options.defaultValue is provided, then the resulting StyleExpression's\n * `evaluate()` method will handle errors by logging a warning (once per\n * message) and returning the default value.  Otherwise, it will throw\n * evaluation errors.\n *\n * @private\n */\nfunction createExpression(expression, propertySpec) {\n    const parser = new ParsingContext(expressions$1, isExpressionConstant, [], propertySpec ? getExpectedType(propertySpec) : undefined);\n    // For string-valued properties, coerce to string at the top level rather than asserting.\n    const parsed = parser.parse(expression, undefined, undefined, undefined, propertySpec && propertySpec.type === 'string' ? { typeAnnotation: 'coerce' } : undefined);\n    if (!parsed) {\n        return error(parser.errors);\n    }\n    return success(new StyleExpression(parsed, propertySpec));\n}\nclass ZoomConstantExpression {\n    constructor(kind, expression) {\n        this.kind = kind;\n        this._styleExpression = expression;\n        this.isStateDependent = kind !== 'constant' && !isStateConstant(expression.expression);\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n}\nclass ZoomDependentExpression {\n    constructor(kind, expression, zoomStops, interpolationType) {\n        this.kind = kind;\n        this.zoomStops = zoomStops;\n        this._styleExpression = expression;\n        this.isStateDependent = kind !== 'camera' && !isStateConstant(expression.expression);\n        this.interpolationType = interpolationType;\n    }\n    evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        return this._styleExpression.evaluateWithoutErrorHandling(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    evaluate(globals, feature, featureState, canonical, availableImages, formattedSection) {\n        return this._styleExpression.evaluate(globals, feature, featureState, canonical, availableImages, formattedSection);\n    }\n    interpolationFactor(input, lower, upper) {\n        if (this.interpolationType) {\n            return Interpolate.interpolationFactor(this.interpolationType, input, lower, upper);\n        }\n        else {\n            return 0;\n        }\n    }\n}\nfunction isZoomExpression(expression) {\n    return expression._styleExpression !== undefined;\n}\nfunction createPropertyExpression(expressionInput, propertySpec) {\n    const expression = createExpression(expressionInput, propertySpec);\n    if (expression.result === 'error') {\n        return expression;\n    }\n    const parsed = expression.value.expression;\n    const isFeatureConstantResult = isFeatureConstant(parsed);\n    if (!isFeatureConstantResult && !supportsPropertyExpression(propertySpec)) {\n        return error([new ExpressionParsingError('', 'data expressions not supported')]);\n    }\n    const isZoomConstant = isGlobalPropertyConstant(parsed, ['zoom']);\n    if (!isZoomConstant && !supportsZoomExpression(propertySpec)) {\n        return error([new ExpressionParsingError('', 'zoom expressions not supported')]);\n    }\n    const zoomCurve = findZoomCurve(parsed);\n    if (!zoomCurve && !isZoomConstant) {\n        return error([new ExpressionParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.')]);\n    }\n    else if (zoomCurve instanceof ExpressionParsingError) {\n        return error([zoomCurve]);\n    }\n    else if (zoomCurve instanceof Interpolate && !supportsInterpolation(propertySpec)) {\n        return error([new ExpressionParsingError('', '\"interpolate\" expressions cannot be used with this property')]);\n    }\n    if (!zoomCurve) {\n        return success(isFeatureConstantResult ?\n            new ZoomConstantExpression('constant', expression.value) :\n            new ZoomConstantExpression('source', expression.value));\n    }\n    const interpolationType = zoomCurve instanceof Interpolate ? zoomCurve.interpolation : undefined;\n    return success(isFeatureConstantResult ?\n        new ZoomDependentExpression('camera', expression.value, zoomCurve.labels, interpolationType) :\n        new ZoomDependentExpression('composite', expression.value, zoomCurve.labels, interpolationType));\n}\n// serialization wrapper for old-style stop functions normalized to the\n// expression interface\nclass StylePropertyFunction {\n    constructor(parameters, specification) {\n        this._parameters = parameters;\n        this._specification = specification;\n        extendBy(this, createFunction(this._parameters, this._specification));\n    }\n    static deserialize(serialized) {\n        return new StylePropertyFunction(serialized._parameters, serialized._specification);\n    }\n    static serialize(input) {\n        return {\n            _parameters: input._parameters,\n            _specification: input._specification\n        };\n    }\n}\nfunction normalizePropertyExpression(value, specification) {\n    if (isFunction$1(value)) {\n        return new StylePropertyFunction(value, specification);\n    }\n    else if (isExpression(value)) {\n        const expression = createPropertyExpression(value, specification);\n        if (expression.result === 'error') {\n            // this should have been caught in validation\n            throw new Error(expression.value.map(err => `${err.key}: ${err.message}`).join(', '));\n        }\n        return expression.value;\n    }\n    else {\n        let constant = value;\n        if (specification.type === 'color' && typeof value === 'string') {\n            constant = Color.parse(value);\n        }\n        else if (specification.type === 'padding' && (typeof value === 'number' || Array.isArray(value))) {\n            constant = Padding.parse(value);\n        }\n        else if (specification.type === 'variableAnchorOffsetCollection' && Array.isArray(value)) {\n            constant = VariableAnchorOffsetCollection.parse(value);\n        }\n        return {\n            kind: 'constant',\n            evaluate: () => constant\n        };\n    }\n}\n// Zoom-dependent expressions may only use [\"zoom\"] as the input to a top-level \"step\" or \"interpolate\"\n// expression (collectively referred to as a \"curve\"). The curve may be wrapped in one or more \"let\" or\n// \"coalesce\" expressions.\nfunction findZoomCurve(expression) {\n    let result = null;\n    if (expression instanceof Let) {\n        result = findZoomCurve(expression.result);\n    }\n    else if (expression instanceof Coalesce) {\n        for (const arg of expression.args) {\n            result = findZoomCurve(arg);\n            if (result) {\n                break;\n            }\n        }\n    }\n    else if ((expression instanceof Step || expression instanceof Interpolate) &&\n        expression.input instanceof CompoundExpression &&\n        expression.input.name === 'zoom') {\n        result = expression;\n    }\n    if (result instanceof ExpressionParsingError) {\n        return result;\n    }\n    expression.eachChild((child) => {\n        const childResult = findZoomCurve(child);\n        if (childResult instanceof ExpressionParsingError) {\n            result = childResult;\n        }\n        else if (!result && childResult) {\n            result = new ExpressionParsingError('', '\"zoom\" expression may only be used as input to a top-level \"step\" or \"interpolate\" expression.');\n        }\n        else if (result && childResult && result !== childResult) {\n            result = new ExpressionParsingError('', 'Only one zoom-based \"step\" or \"interpolate\" subexpression may be used in an expression.');\n        }\n    });\n    return result;\n}\nfunction getExpectedType(spec) {\n    const types = {\n        color: ColorType,\n        string: StringType,\n        number: NumberType,\n        enum: StringType,\n        boolean: BooleanType,\n        formatted: FormattedType,\n        padding: PaddingType,\n        resolvedImage: ResolvedImageType,\n        variableAnchorOffsetCollection: VariableAnchorOffsetCollectionType\n    };\n    if (spec.type === 'array') {\n        return array$1(types[spec.value] || ValueType, spec.length);\n    }\n    return types[spec.type];\n}\nfunction getDefaultValue(spec) {\n    if (spec.type === 'color' && isFunction$1(spec.default)) {\n        // Special case for heatmap-color: it uses the 'default:' to define a\n        // default color ramp, but createExpression expects a simple value to fall\n        // back to in case of runtime errors\n        return new Color(0, 0, 0, 0);\n    }\n    else if (spec.type === 'color') {\n        return Color.parse(spec.default) || null;\n    }\n    else if (spec.type === 'padding') {\n        return Padding.parse(spec.default) || null;\n    }\n    else if (spec.type === 'variableAnchorOffsetCollection') {\n        return VariableAnchorOffsetCollection.parse(spec.default) || null;\n    }\n    else if (spec.default === undefined) {\n        return null;\n    }\n    else {\n        return spec.default;\n    }\n}\n\nfunction isExpressionFilter(filter) {\n    if (filter === true || filter === false) {\n        return true;\n    }\n    if (!Array.isArray(filter) || filter.length === 0) {\n        return false;\n    }\n    switch (filter[0]) {\n        case 'has':\n            return filter.length >= 2 && filter[1] !== '$id' && filter[1] !== '$type';\n        case 'in':\n            return filter.length >= 3 && (typeof filter[1] !== 'string' || Array.isArray(filter[2]));\n        case '!in':\n        case '!has':\n        case 'none':\n            return false;\n        case '==':\n        case '!=':\n        case '>':\n        case '>=':\n        case '<':\n        case '<=':\n            return filter.length !== 3 || (Array.isArray(filter[1]) || Array.isArray(filter[2]));\n        case 'any':\n        case 'all':\n            for (const f of filter.slice(1)) {\n                if (!isExpressionFilter(f) && typeof f !== 'boolean') {\n                    return false;\n                }\n            }\n            return true;\n        default:\n            return true;\n    }\n}\nconst filterSpec = {\n    'type': 'boolean',\n    'default': false,\n    'transition': false,\n    'property-type': 'data-driven',\n    'expression': {\n        'interpolated': false,\n        'parameters': ['zoom', 'feature']\n    }\n};\n/**\n * Given a filter expressed as nested arrays, return a new function\n * that evaluates whether a given feature (with a .properties or .tags property)\n * passes its test.\n *\n * @private\n * @param {Array} filter MapLibre filter\n * @returns {Function} filter-evaluating function\n */\nfunction createFilter(filter) {\n    if (filter === null || filter === undefined) {\n        return { filter: () => true, needGeometry: false };\n    }\n    if (!isExpressionFilter(filter)) {\n        filter = convertFilter$1(filter);\n    }\n    const compiled = createExpression(filter, filterSpec);\n    if (compiled.result === 'error') {\n        throw new Error(compiled.value.map(err => `${err.key}: ${err.message}`).join(', '));\n    }\n    else {\n        const needGeometry = geometryNeeded(filter);\n        return { filter: (globalProperties, feature, canonical) => compiled.value.evaluate(globalProperties, feature, {}, canonical),\n            needGeometry };\n    }\n}\n// Comparison function to sort numbers and strings\nfunction compare(a, b) {\n    return a < b ? -1 : a > b ? 1 : 0;\n}\nfunction geometryNeeded(filter) {\n    if (!Array.isArray(filter))\n        return false;\n    if (filter[0] === 'within' || filter[0] === 'distance')\n        return true;\n    for (let index = 1; index < filter.length; index++) {\n        if (geometryNeeded(filter[index]))\n            return true;\n    }\n    return false;\n}\nfunction convertFilter$1(filter) {\n    if (!filter)\n        return true;\n    const op = filter[0];\n    if (filter.length <= 1)\n        return (op !== 'any');\n    const converted = op === '==' ? convertComparisonOp$1(filter[1], filter[2], '==') :\n        op === '!=' ? convertNegation(convertComparisonOp$1(filter[1], filter[2], '==')) :\n            op === '<' ||\n                op === '>' ||\n                op === '<=' ||\n                op === '>=' ? convertComparisonOp$1(filter[1], filter[2], op) :\n                op === 'any' ? convertDisjunctionOp(filter.slice(1)) :\n                    op === 'all' ? ['all'].concat(filter.slice(1).map(convertFilter$1)) :\n                        op === 'none' ? ['all'].concat(filter.slice(1).map(convertFilter$1).map(convertNegation)) :\n                            op === 'in' ? convertInOp$1(filter[1], filter.slice(2)) :\n                                op === '!in' ? convertNegation(convertInOp$1(filter[1], filter.slice(2))) :\n                                    op === 'has' ? convertHasOp$1(filter[1]) :\n                                        op === '!has' ? convertNegation(convertHasOp$1(filter[1])) :\n                                            true;\n    return converted;\n}\nfunction convertComparisonOp$1(property, value, op) {\n    switch (property) {\n        case '$type':\n            return [`filter-type-${op}`, value];\n        case '$id':\n            return [`filter-id-${op}`, value];\n        default:\n            return [`filter-${op}`, property, value];\n    }\n}\nfunction convertDisjunctionOp(filters) {\n    return ['any'].concat(filters.map(convertFilter$1));\n}\nfunction convertInOp$1(property, values) {\n    if (values.length === 0) {\n        return false;\n    }\n    switch (property) {\n        case '$type':\n            return ['filter-type-in', ['literal', values]];\n        case '$id':\n            return ['filter-id-in', ['literal', values]];\n        default:\n            if (values.length > 200 && !values.some(v => typeof v !== typeof values[0])) {\n                return ['filter-in-large', property, ['literal', values.sort(compare)]];\n            }\n            else {\n                return ['filter-in-small', property, ['literal', values]];\n            }\n    }\n}\nfunction convertHasOp$1(property) {\n    switch (property) {\n        case '$type':\n            return true;\n        case '$id':\n            return ['filter-has-id'];\n        default:\n            return ['filter-has', property];\n    }\n}\nfunction convertNegation(filter) {\n    return ['!', filter];\n}\n\n/*\n * Convert the given filter to an expression, storing the expected types for\n * any feature properties referenced in expectedTypes.\n *\n * These expected types are needed in order to construct preflight type checks\n * needed for handling 'any' filters. A preflight type check is necessary in\n * order to mimic legacy filters' semantics around expected type mismatches.\n * For example, consider the legacy filter:\n *\n *     [\"any\", [\"all\", [\">\", \"y\", 0], [\">\", \"y\", 0]], [\">\", \"x\", 0]]\n *\n * Naively, we might convert this to the expression:\n *\n *     [\"any\", [\"all\", [\">\", [\"get\", \"y\"], 0], [\">\", [\"get\", \"z\"], 0]], [\">\", [\"get\", \"x\"], 0]]\n *\n * But if we tried to evaluate this against, say `{x: 1, y: null, z: 0}`, the\n * [\">\", [\"get\", \"y\"], 0] would cause an evaluation error, leading to the\n * entire filter returning false. Legacy filter semantics, though, ask for\n * [\">\", \"y\", 0] to simply return `false` when `y` is of the wrong type,\n * allowing the subsequent terms of the outer \"any\" expression to be evaluated\n * (resulting, in this case, in a `true` value, because x > 0).\n *\n * We account for this by inserting a preflight type-checking expression before\n * each \"any\" term, allowing us to avoid evaluating the actual converted filter\n * if any type mismatches would cause it to produce an evalaution error:\n *\n *     [\"any\",\n *       [\"case\",\n *         [\"all\", [\"==\", [\"typeof\", [\"get\", \"y\"]], \"number\"], [\"==\", [\"typeof\", [\"get\", \"z\"], \"number]],\n *         [\"all\", [\">\", [\"get\", \"y\"], 0], [\">\", [\"get\", \"z\"], 0]],\n *         false\n *       ],\n *       [\"case\",\n *         [\"==\", [\"typeof\", [\"get\", \"x\"], \"number\"]],\n *         [\">\", [\"get\", \"x\"], 0],\n *         false\n *       ]\n *     ]\n *\n * An alternative, possibly more direct approach would be to use type checks\n * in the conversion of each comparison operator, so that the converted version\n * of each individual ==, >=, etc. would mimic the legacy filter semantics. The\n * downside of this approach is that it can lead to many more type checks than\n * would otherwise be necessary: outside the context of an \"any\" expression,\n * bailing out due to a runtime type error (expression semantics) and returning\n * false (legacy filter semantics) are equivalent: they cause the filter to\n * produce a `false` result.\n */\nfunction convertFilter(filter, expectedTypes = {}) {\n    if (isExpressionFilter(filter))\n        return filter;\n    if (!filter)\n        return true;\n    const legacyFilter = filter;\n    const legacyOp = legacyFilter[0];\n    if (filter.length <= 1)\n        return (legacyOp !== 'any');\n    switch (legacyOp) {\n        case '==':\n        case '!=':\n        case '<':\n        case '>':\n        case '<=':\n        case '>=': {\n            const [, property, value] = filter;\n            return convertComparisonOp(property, value, legacyOp, expectedTypes);\n        }\n        case 'any': {\n            const [, ...conditions] = legacyFilter;\n            const children = conditions.map((f) => {\n                const types = {};\n                const child = convertFilter(f, types);\n                const typechecks = runtimeTypeChecks(types);\n                return typechecks === true ? child : ['case', typechecks, child, false];\n            });\n            return ['any', ...children];\n        }\n        case 'all': {\n            const [, ...conditions] = legacyFilter;\n            const children = conditions.map(f => convertFilter(f, expectedTypes));\n            return children.length > 1 ? ['all', ...children] : children[0];\n        }\n        case 'none': {\n            const [, ...conditions] = legacyFilter;\n            return ['!', convertFilter(['any', ...conditions], {})];\n        }\n        case 'in': {\n            const [, property, ...values] = legacyFilter;\n            return convertInOp(property, values);\n        }\n        case '!in': {\n            const [, property, ...values] = legacyFilter;\n            return convertInOp(property, values, true);\n        }\n        case 'has':\n            return convertHasOp(legacyFilter[1]);\n        case '!has':\n            return ['!', convertHasOp(legacyFilter[1])];\n        default:\n            return true;\n    }\n}\n// Given a set of feature properties and an expected type for each one,\n// construct an boolean expression that tests whether each property has the\n// right type.\n// E.g.: for {name: 'string', population: 'number'}, return\n// [ 'all',\n//   ['==', ['typeof', ['get', 'name'], 'string']],\n//   ['==', ['typeof', ['get', 'population'], 'number]]\n// ]\nfunction runtimeTypeChecks(expectedTypes) {\n    const conditions = [];\n    for (const property in expectedTypes) {\n        const get = property === '$id' ? ['id'] : ['get', property];\n        conditions.push(['==', ['typeof', get], expectedTypes[property]]);\n    }\n    if (conditions.length === 0)\n        return true;\n    if (conditions.length === 1)\n        return conditions[0];\n    return ['all', ...conditions];\n}\nfunction convertComparisonOp(property, value, op, expectedTypes) {\n    let get;\n    if (property === '$type') {\n        return [op, ['geometry-type'], value];\n    }\n    else if (property === '$id') {\n        get = ['id'];\n    }\n    else {\n        get = ['get', property];\n    }\n    if (expectedTypes && value !== null) {\n        const type = typeof value;\n        expectedTypes[property] = type;\n    }\n    if (op === '==' && property !== '$id' && value === null) {\n        return [\n            'all',\n            ['has', property], // missing property != null for legacy filters\n            ['==', get, null]\n        ];\n    }\n    else if (op === '!=' && property !== '$id' && value === null) {\n        return [\n            'any',\n            ['!', ['has', property]], // missing property != null for legacy filters\n            ['!=', get, null]\n        ];\n    }\n    return [op, get, value];\n}\nfunction convertInOp(property, values, negate = false) {\n    if (values.length === 0)\n        return negate;\n    let get;\n    if (property === '$type') {\n        get = ['geometry-type'];\n    }\n    else if (property === '$id') {\n        get = ['id'];\n    }\n    else {\n        get = ['get', property];\n    }\n    // Determine if the list of values to be searched is homogenously typed.\n    // If so (and if the type is string or number), then we can use a\n    // [match, input, [...values], true, false] construction rather than a\n    // bunch of `==` tests.\n    let uniformTypes = true;\n    const type = typeof values[0];\n    for (const value of values) {\n        if (typeof value !== type) {\n            uniformTypes = false;\n            break;\n        }\n    }\n    if (uniformTypes && (type === 'string' || type === 'number')) {\n        // Match expressions must have unique values.\n        const uniqueValues = values.sort().filter((v, i) => i === 0 || values[i - 1] !== v);\n        return ['match', get, uniqueValues, !negate, negate];\n    }\n    if (negate) {\n        return ['all', ...values.map(v => ['!=', get, v])];\n    }\n    else {\n        return ['any', ...values.map(v => ['==', get, v])];\n    }\n}\nfunction convertHasOp(property) {\n    if (property === '$type') {\n        return true;\n    }\n    else if (property === '$id') {\n        return ['!=', ['id'], null];\n    }\n    else {\n        return ['has', property];\n    }\n}\n\nfunction convertLiteral(value) {\n    return typeof value === 'object' ? ['literal', value] : value;\n}\nfunction convertFunction(parameters, propertySpec) {\n    let stops = parameters.stops;\n    if (!stops) {\n        // identity function\n        return convertIdentityFunction(parameters, propertySpec);\n    }\n    const zoomAndFeatureDependent = stops && typeof stops[0][0] === 'object';\n    const featureDependent = zoomAndFeatureDependent || parameters.property !== undefined;\n    const zoomDependent = zoomAndFeatureDependent || !featureDependent;\n    stops = stops.map((stop) => {\n        if (!featureDependent && propertySpec.tokens && typeof stop[1] === 'string') {\n            return [stop[0], convertTokenString(stop[1])];\n        }\n        return [stop[0], convertLiteral(stop[1])];\n    });\n    if (zoomAndFeatureDependent) {\n        return convertZoomAndPropertyFunction(parameters, propertySpec, stops);\n    }\n    else if (zoomDependent) {\n        return convertZoomFunction(parameters, propertySpec, stops);\n    }\n    else {\n        return convertPropertyFunction(parameters, propertySpec, stops);\n    }\n}\nfunction convertIdentityFunction(parameters, propertySpec) {\n    const get = ['get', parameters.property];\n    if (parameters.default === undefined) {\n        // By default, expressions for string-valued properties get coerced. To preserve\n        // legacy function semantics, insert an explicit assertion instead.\n        return propertySpec.type === 'string' ? ['string', get] : get;\n    }\n    else if (propertySpec.type === 'enum') {\n        return [\n            'match',\n            get,\n            Object.keys(propertySpec.values),\n            get,\n            parameters.default\n        ];\n    }\n    else {\n        const expression = [propertySpec.type === 'color' ? 'to-color' : propertySpec.type, get, convertLiteral(parameters.default)];\n        if (propertySpec.type === 'array') {\n            expression.splice(1, 0, propertySpec.value, propertySpec.length || null);\n        }\n        return expression;\n    }\n}\nfunction getInterpolateOperator(parameters) {\n    switch (parameters.colorSpace) {\n        case 'hcl': return 'interpolate-hcl';\n        case 'lab': return 'interpolate-lab';\n        default: return 'interpolate';\n    }\n}\nfunction convertZoomAndPropertyFunction(parameters, propertySpec, stops) {\n    const featureFunctionParameters = {};\n    const featureFunctionStops = {};\n    const zoomStops = [];\n    for (let s = 0; s < stops.length; s++) {\n        const stop = stops[s];\n        const zoom = stop[0].zoom;\n        if (featureFunctionParameters[zoom] === undefined) {\n            featureFunctionParameters[zoom] = {\n                zoom,\n                type: parameters.type,\n                property: parameters.property,\n                default: parameters.default,\n            };\n            featureFunctionStops[zoom] = [];\n            zoomStops.push(zoom);\n        }\n        featureFunctionStops[zoom].push([stop[0].value, stop[1]]);\n    }\n    // the interpolation type for the zoom dimension of a zoom-and-property\n    // function is determined directly from the style property specification\n    // for which it's being used: linear for interpolatable properties, step\n    // otherwise.\n    const functionType = getFunctionType({}, propertySpec);\n    if (functionType === 'exponential') {\n        const expression = [getInterpolateOperator(parameters), ['linear'], ['zoom']];\n        for (const z of zoomStops) {\n            const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n            appendStopPair(expression, z, output, false);\n        }\n        return expression;\n    }\n    else {\n        const expression = ['step', ['zoom']];\n        for (const z of zoomStops) {\n            const output = convertPropertyFunction(featureFunctionParameters[z], propertySpec, featureFunctionStops[z]);\n            appendStopPair(expression, z, output, true);\n        }\n        fixupDegenerateStepCurve(expression);\n        return expression;\n    }\n}\nfunction coalesce(a, b) {\n    if (a !== undefined)\n        return a;\n    if (b !== undefined)\n        return b;\n}\nfunction getFallback(parameters, propertySpec) {\n    const defaultValue = convertLiteral(coalesce(parameters.default, propertySpec.default));\n    /*\n     * Some fields with type: resolvedImage have an undefined default.\n     * Because undefined is an invalid value for resolvedImage, set fallback to\n     * an empty string instead of undefined to ensure output\n     * passes validation.\n     */\n    if (defaultValue === undefined && propertySpec.type === 'resolvedImage') {\n        return '';\n    }\n    return defaultValue;\n}\nfunction convertPropertyFunction(parameters, propertySpec, stops) {\n    const type = getFunctionType(parameters, propertySpec);\n    const get = ['get', parameters.property];\n    if (type === 'categorical' && typeof stops[0][0] === 'boolean') {\n        const expression = ['case'];\n        for (const stop of stops) {\n            expression.push(['==', get, stop[0]], stop[1]);\n        }\n        expression.push(getFallback(parameters, propertySpec));\n        return expression;\n    }\n    else if (type === 'categorical') {\n        const expression = ['match', get];\n        for (const stop of stops) {\n            appendStopPair(expression, stop[0], stop[1], false);\n        }\n        expression.push(getFallback(parameters, propertySpec));\n        return expression;\n    }\n    else if (type === 'interval') {\n        const expression = ['step', ['number', get]];\n        for (const stop of stops) {\n            appendStopPair(expression, stop[0], stop[1], true);\n        }\n        fixupDegenerateStepCurve(expression);\n        return parameters.default === undefined ? expression : [\n            'case',\n            ['==', ['typeof', get], 'number'],\n            expression,\n            convertLiteral(parameters.default)\n        ];\n    }\n    else if (type === 'exponential') {\n        const base = parameters.base !== undefined ? parameters.base : 1;\n        const expression = [\n            getInterpolateOperator(parameters),\n            base === 1 ? ['linear'] : ['exponential', base],\n            ['number', get]\n        ];\n        for (const stop of stops) {\n            appendStopPair(expression, stop[0], stop[1], false);\n        }\n        return parameters.default === undefined ? expression : [\n            'case',\n            ['==', ['typeof', get], 'number'],\n            expression,\n            convertLiteral(parameters.default)\n        ];\n    }\n    else {\n        throw new Error(`Unknown property function type ${type}`);\n    }\n}\nfunction convertZoomFunction(parameters, propertySpec, stops, input = ['zoom']) {\n    const type = getFunctionType(parameters, propertySpec);\n    let expression;\n    let isStep = false;\n    if (type === 'interval') {\n        expression = ['step', input];\n        isStep = true;\n    }\n    else if (type === 'exponential') {\n        const base = parameters.base !== undefined ? parameters.base : 1;\n        expression = [getInterpolateOperator(parameters), base === 1 ? ['linear'] : ['exponential', base], input];\n    }\n    else {\n        throw new Error(`Unknown zoom function type \"${type}\"`);\n    }\n    for (const stop of stops) {\n        appendStopPair(expression, stop[0], stop[1], isStep);\n    }\n    fixupDegenerateStepCurve(expression);\n    return expression;\n}\nfunction fixupDegenerateStepCurve(expression) {\n    // degenerate step curve (i.e. a constant function): add a noop stop\n    if (expression[0] === 'step' && expression.length === 3) {\n        expression.push(0);\n        expression.push(expression[3]);\n    }\n}\nfunction appendStopPair(curve, input, output, isStep) {\n    // Skip duplicate stop values. They were not validated for functions, but they are for expressions.\n    // https://github.com/mapbox/mapbox-gl-js/issues/4107\n    if (curve.length > 3 && input === curve[curve.length - 2]) {\n        return;\n    }\n    // step curves don't get the first input value, as it is redundant.\n    if (!(isStep && curve.length === 2)) {\n        curve.push(input);\n    }\n    curve.push(output);\n}\nfunction getFunctionType(parameters, propertySpec) {\n    if (parameters.type) {\n        return parameters.type;\n    }\n    else {\n        return propertySpec.expression.interpolated ? 'exponential' : 'interval';\n    }\n}\n// \"String with {name} token\" => [\"concat\", \"String with \", [\"get\", \"name\"], \" token\"]\nfunction convertTokenString(s) {\n    const result = ['concat'];\n    const re = /{([^{}]+)}/g;\n    let pos = 0;\n    for (let match = re.exec(s); match !== null; match = re.exec(s)) {\n        const literal = s.slice(pos, re.lastIndex - match[0].length);\n        pos = re.lastIndex;\n        if (literal.length > 0)\n            result.push(literal);\n        result.push(['get', match[1]]);\n    }\n    if (result.length === 1) {\n        return s;\n    }\n    if (pos < s.length) {\n        result.push(s.slice(pos));\n    }\n    else if (result.length === 2) {\n        return ['to-string', result[1]];\n    }\n    return result;\n}\n\nfunction getPropertyReference(propertyName) {\n    for (let i = 0; i < v8Spec.layout.length; i++) {\n        for (const key in v8Spec[v8Spec.layout[i]]) {\n            if (key === propertyName)\n                return v8Spec[v8Spec.layout[i]][key];\n        }\n    }\n    for (let i = 0; i < v8Spec.paint.length; i++) {\n        for (const key in v8Spec[v8Spec.paint[i]]) {\n            if (key === propertyName)\n                return v8Spec[v8Spec.paint[i]][key];\n        }\n    }\n    return null;\n}\nfunction eachSource(style, callback) {\n    for (const k in style.sources) {\n        callback(style.sources[k]);\n    }\n}\nfunction eachLayer(style, callback) {\n    for (const layer of style.layers) {\n        callback(layer);\n    }\n}\nfunction eachProperty(style, options, callback) {\n    function inner(layer, propertyType) {\n        const properties = layer[propertyType];\n        if (!properties)\n            return;\n        Object.keys(properties).forEach((key) => {\n            callback({\n                path: [layer.id, propertyType, key],\n                key,\n                value: properties[key],\n                reference: getPropertyReference(key),\n                set(x) {\n                    properties[key] = x;\n                }\n            });\n        });\n    }\n    eachLayer(style, (layer) => {\n        if (options.paint) {\n            inner(layer, 'paint');\n        }\n        if (options.layout) {\n            inner(layer, 'layout');\n        }\n    });\n}\n\nfunction stringify$1(obj) {\n    const type = typeof obj;\n    if (type === 'number' || type === 'boolean' || type === 'string' || obj === undefined || obj === null)\n        return JSON.stringify(obj);\n    if (Array.isArray(obj)) {\n        let str = '[';\n        for (const val of obj) {\n            str += `${stringify$1(val)},`;\n        }\n        return `${str}]`;\n    }\n    const keys = Object.keys(obj).sort();\n    let str = '{';\n    for (let i = 0; i < keys.length; i++) {\n        str += `${JSON.stringify(keys[i])}:${stringify$1(obj[keys[i]])},`;\n    }\n    return `${str}}`;\n}\nfunction getKey(layer) {\n    let key = '';\n    for (const k of refProperties) {\n        key += `/${stringify$1(layer[k])}`;\n    }\n    return key;\n}\n/**\n * Given an array of layers, return an array of arrays of layers where all\n * layers in each group have identical layout-affecting properties. These\n * are the properties that were formerly used by explicit `ref` mechanism\n * for layers: 'type', 'source', 'source-layer', 'minzoom', 'maxzoom',\n * 'filter', and 'layout'.\n *\n * The input is not modified. The output layers are references to the\n * input layers.\n *\n * @private\n * @param {Array<Layer>} layers\n * @param {Object} [cachedKeys] - an object to keep already calculated keys.\n * @returns {Array<Array<Layer>>}\n */\nfunction groupByLayout(layers, cachedKeys) {\n    const groups = {};\n    for (let i = 0; i < layers.length; i++) {\n        const k = (cachedKeys && cachedKeys[layers[i].id]) || getKey(layers[i]);\n        // update the cache if there is one\n        if (cachedKeys)\n            cachedKeys[layers[i].id] = k;\n        let group = groups[k];\n        if (!group) {\n            group = groups[k] = [];\n        }\n        group.push(layers[i]);\n    }\n    const result = [];\n    for (const k in groups) {\n        result.push(groups[k]);\n    }\n    return result;\n}\n\nfunction emptyStyle() {\n    const style = {};\n    const version = v8Spec['$version'];\n    for (const styleKey in v8Spec['$root']) {\n        const spec = v8Spec['$root'][styleKey];\n        if (spec.required) {\n            let value = null;\n            if (styleKey === 'version') {\n                value = version;\n            }\n            else {\n                if (spec.type === 'array') {\n                    value = [];\n                }\n                else {\n                    value = {};\n                }\n            }\n            if (value != null) {\n                style[styleKey] = value;\n            }\n        }\n    }\n    return style;\n}\n\nfunction validateConstants(options) {\n    const key = options.key;\n    const constants = options.value;\n    if (constants) {\n        return [new ValidationError(key, constants, 'constants have been deprecated as of v8')];\n    }\n    else {\n        return [];\n    }\n}\n\n// Turn jsonlint-lines-primitives objects into primitive objects\nfunction unbundle(value) {\n    if (value instanceof Number || value instanceof String || value instanceof Boolean) {\n        return value.valueOf();\n    }\n    else {\n        return value;\n    }\n}\nfunction deepUnbundle(value) {\n    if (Array.isArray(value)) {\n        return value.map(deepUnbundle);\n    }\n    else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) {\n        const unbundledValue = {};\n        for (const key in value) {\n            unbundledValue[key] = deepUnbundle(value[key]);\n        }\n        return unbundledValue;\n    }\n    return unbundle(value);\n}\n\nfunction validateObject(options) {\n    const key = options.key;\n    const object = options.value;\n    const elementSpecs = options.valueSpec || {};\n    const elementValidators = options.objectElementValidators || {};\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    const validateSpec = options.validateSpec;\n    let errors = [];\n    const type = getType(object);\n    if (type !== 'object') {\n        return [new ValidationError(key, object, `object expected, ${type} found`)];\n    }\n    for (const objectKey in object) {\n        const elementSpecKey = objectKey.split('.')[0]; // treat 'paint.*' as 'paint'\n        const elementSpec = elementSpecs[elementSpecKey] || elementSpecs['*'];\n        let validateElement;\n        if (elementValidators[elementSpecKey]) {\n            validateElement = elementValidators[elementSpecKey];\n        }\n        else if (elementSpecs[elementSpecKey]) {\n            validateElement = validateSpec;\n        }\n        else if (elementValidators['*']) {\n            validateElement = elementValidators['*'];\n        }\n        else if (elementSpecs['*']) {\n            validateElement = validateSpec;\n        }\n        else {\n            errors.push(new ValidationError(key, object[objectKey], `unknown property \"${objectKey}\"`));\n            continue;\n        }\n        errors = errors.concat(validateElement({\n            key: (key ? `${key}.` : key) + objectKey,\n            value: object[objectKey],\n            valueSpec: elementSpec,\n            style,\n            styleSpec,\n            object,\n            objectKey,\n            validateSpec,\n        }, object));\n    }\n    for (const elementSpecKey in elementSpecs) {\n        // Don't check `required` when there's a custom validator for that property.\n        if (elementValidators[elementSpecKey]) {\n            continue;\n        }\n        if (elementSpecs[elementSpecKey].required && elementSpecs[elementSpecKey]['default'] === undefined && object[elementSpecKey] === undefined) {\n            errors.push(new ValidationError(key, object, `missing required property \"${elementSpecKey}\"`));\n        }\n    }\n    return errors;\n}\n\nfunction validateArray(options) {\n    const array = options.value;\n    const arraySpec = options.valueSpec;\n    const validateSpec = options.validateSpec;\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    const key = options.key;\n    const validateArrayElement = options.arrayElementValidator || validateSpec;\n    if (getType(array) !== 'array') {\n        return [new ValidationError(key, array, `array expected, ${getType(array)} found`)];\n    }\n    if (arraySpec.length && array.length !== arraySpec.length) {\n        return [new ValidationError(key, array, `array length ${arraySpec.length} expected, length ${array.length} found`)];\n    }\n    if (arraySpec['min-length'] && array.length < arraySpec['min-length']) {\n        return [new ValidationError(key, array, `array length at least ${arraySpec['min-length']} expected, length ${array.length} found`)];\n    }\n    let arrayElementSpec = {\n        'type': arraySpec.value,\n        'values': arraySpec.values\n    };\n    if (styleSpec.$version < 7) {\n        arrayElementSpec['function'] = arraySpec.function;\n    }\n    if (getType(arraySpec.value) === 'object') {\n        arrayElementSpec = arraySpec.value;\n    }\n    let errors = [];\n    for (let i = 0; i < array.length; i++) {\n        errors = errors.concat(validateArrayElement({\n            array,\n            arrayIndex: i,\n            value: array[i],\n            valueSpec: arrayElementSpec,\n            validateSpec: options.validateSpec,\n            style,\n            styleSpec,\n            key: `${key}[${i}]`\n        }));\n    }\n    return errors;\n}\n\nfunction validateNumber(options) {\n    const key = options.key;\n    const value = options.value;\n    const valueSpec = options.valueSpec;\n    let type = getType(value);\n    // eslint-disable-next-line no-self-compare\n    if (type === 'number' && value !== value) {\n        type = 'NaN';\n    }\n    if (type !== 'number') {\n        return [new ValidationError(key, value, `number expected, ${type} found`)];\n    }\n    if ('minimum' in valueSpec && value < valueSpec.minimum) {\n        return [new ValidationError(key, value, `${value} is less than the minimum value ${valueSpec.minimum}`)];\n    }\n    if ('maximum' in valueSpec && value > valueSpec.maximum) {\n        return [new ValidationError(key, value, `${value} is greater than the maximum value ${valueSpec.maximum}`)];\n    }\n    return [];\n}\n\nfunction validateFunction(options) {\n    const functionValueSpec = options.valueSpec;\n    const functionType = unbundle(options.value.type);\n    let stopKeyType;\n    let stopDomainValues = {};\n    let previousStopDomainValue;\n    let previousStopDomainZoom;\n    const isZoomFunction = functionType !== 'categorical' && options.value.property === undefined;\n    const isPropertyFunction = !isZoomFunction;\n    const isZoomAndPropertyFunction = getType(options.value.stops) === 'array' &&\n        getType(options.value.stops[0]) === 'array' &&\n        getType(options.value.stops[0][0]) === 'object';\n    const errors = validateObject({\n        key: options.key,\n        value: options.value,\n        valueSpec: options.styleSpec.function,\n        validateSpec: options.validateSpec,\n        style: options.style,\n        styleSpec: options.styleSpec,\n        objectElementValidators: {\n            stops: validateFunctionStops,\n            default: validateFunctionDefault\n        }\n    });\n    if (functionType === 'identity' && isZoomFunction) {\n        errors.push(new ValidationError(options.key, options.value, 'missing required property \"property\"'));\n    }\n    if (functionType !== 'identity' && !options.value.stops) {\n        errors.push(new ValidationError(options.key, options.value, 'missing required property \"stops\"'));\n    }\n    if (functionType === 'exponential' && options.valueSpec.expression && !supportsInterpolation(options.valueSpec)) {\n        errors.push(new ValidationError(options.key, options.value, 'exponential functions not supported'));\n    }\n    if (options.styleSpec.$version >= 8) {\n        if (isPropertyFunction && !supportsPropertyExpression(options.valueSpec)) {\n            errors.push(new ValidationError(options.key, options.value, 'property functions not supported'));\n        }\n        else if (isZoomFunction && !supportsZoomExpression(options.valueSpec)) {\n            errors.push(new ValidationError(options.key, options.value, 'zoom functions not supported'));\n        }\n    }\n    if ((functionType === 'categorical' || isZoomAndPropertyFunction) && options.value.property === undefined) {\n        errors.push(new ValidationError(options.key, options.value, '\"property\" property is required'));\n    }\n    return errors;\n    function validateFunctionStops(options) {\n        if (functionType === 'identity') {\n            return [new ValidationError(options.key, options.value, 'identity function may not have a \"stops\" property')];\n        }\n        let errors = [];\n        const value = options.value;\n        errors = errors.concat(validateArray({\n            key: options.key,\n            value,\n            valueSpec: options.valueSpec,\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec: options.styleSpec,\n            arrayElementValidator: validateFunctionStop\n        }));\n        if (getType(value) === 'array' && value.length === 0) {\n            errors.push(new ValidationError(options.key, value, 'array must have at least one stop'));\n        }\n        return errors;\n    }\n    function validateFunctionStop(options) {\n        let errors = [];\n        const value = options.value;\n        const key = options.key;\n        if (getType(value) !== 'array') {\n            return [new ValidationError(key, value, `array expected, ${getType(value)} found`)];\n        }\n        if (value.length !== 2) {\n            return [new ValidationError(key, value, `array length 2 expected, length ${value.length} found`)];\n        }\n        if (isZoomAndPropertyFunction) {\n            if (getType(value[0]) !== 'object') {\n                return [new ValidationError(key, value, `object expected, ${getType(value[0])} found`)];\n            }\n            if (value[0].zoom === undefined) {\n                return [new ValidationError(key, value, 'object stop key must have zoom')];\n            }\n            if (value[0].value === undefined) {\n                return [new ValidationError(key, value, 'object stop key must have value')];\n            }\n            if (previousStopDomainZoom && previousStopDomainZoom > unbundle(value[0].zoom)) {\n                return [new ValidationError(key, value[0].zoom, 'stop zoom values must appear in ascending order')];\n            }\n            if (unbundle(value[0].zoom) !== previousStopDomainZoom) {\n                previousStopDomainZoom = unbundle(value[0].zoom);\n                previousStopDomainValue = undefined;\n                stopDomainValues = {};\n            }\n            errors = errors.concat(validateObject({\n                key: `${key}[0]`,\n                value: value[0],\n                valueSpec: { zoom: {} },\n                validateSpec: options.validateSpec,\n                style: options.style,\n                styleSpec: options.styleSpec,\n                objectElementValidators: { zoom: validateNumber, value: validateStopDomainValue }\n            }));\n        }\n        else {\n            errors = errors.concat(validateStopDomainValue({\n                key: `${key}[0]`,\n                value: value[0],\n                valueSpec: {},\n                validateSpec: options.validateSpec,\n                style: options.style,\n                styleSpec: options.styleSpec\n            }, value));\n        }\n        if (isExpression(deepUnbundle(value[1]))) {\n            return errors.concat([new ValidationError(`${key}[1]`, value[1], 'expressions are not allowed in function stops.')]);\n        }\n        return errors.concat(options.validateSpec({\n            key: `${key}[1]`,\n            value: value[1],\n            valueSpec: functionValueSpec,\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec: options.styleSpec\n        }));\n    }\n    function validateStopDomainValue(options, stop) {\n        const type = getType(options.value);\n        const value = unbundle(options.value);\n        const reportValue = options.value !== null ? options.value : stop;\n        if (!stopKeyType) {\n            stopKeyType = type;\n        }\n        else if (type !== stopKeyType) {\n            return [new ValidationError(options.key, reportValue, `${type} stop domain type must match previous stop domain type ${stopKeyType}`)];\n        }\n        if (type !== 'number' && type !== 'string' && type !== 'boolean') {\n            return [new ValidationError(options.key, reportValue, 'stop domain value must be a number, string, or boolean')];\n        }\n        if (type !== 'number' && functionType !== 'categorical') {\n            let message = `number expected, ${type} found`;\n            if (supportsPropertyExpression(functionValueSpec) && functionType === undefined) {\n                message += '\\nIf you intended to use a categorical function, specify `\"type\": \"categorical\"`.';\n            }\n            return [new ValidationError(options.key, reportValue, message)];\n        }\n        if (functionType === 'categorical' && type === 'number' && (!isFinite(value) || Math.floor(value) !== value)) {\n            return [new ValidationError(options.key, reportValue, `integer expected, found ${value}`)];\n        }\n        if (functionType !== 'categorical' && type === 'number' && previousStopDomainValue !== undefined && value < previousStopDomainValue) {\n            return [new ValidationError(options.key, reportValue, 'stop domain values must appear in ascending order')];\n        }\n        else {\n            previousStopDomainValue = value;\n        }\n        if (functionType === 'categorical' && value in stopDomainValues) {\n            return [new ValidationError(options.key, reportValue, 'stop domain values must be unique')];\n        }\n        else {\n            stopDomainValues[value] = true;\n        }\n        return [];\n    }\n    function validateFunctionDefault(options) {\n        return options.validateSpec({\n            key: options.key,\n            value: options.value,\n            valueSpec: functionValueSpec,\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec: options.styleSpec\n        });\n    }\n}\n\nfunction validateExpression(options) {\n    const expression = (options.expressionContext === 'property' ? createPropertyExpression : createExpression)(deepUnbundle(options.value), options.valueSpec);\n    if (expression.result === 'error') {\n        return expression.value.map((error) => {\n            return new ValidationError(`${options.key}${error.key}`, options.value, error.message);\n        });\n    }\n    const expressionObj = expression.value.expression || expression.value._styleExpression.expression;\n    if (options.expressionContext === 'property' && (options.propertyKey === 'text-font') &&\n        !expressionObj.outputDefined()) {\n        return [new ValidationError(options.key, options.value, `Invalid data expression for \"${options.propertyKey}\". Output values must be contained as literals within the expression.`)];\n    }\n    if (options.expressionContext === 'property' && options.propertyType === 'layout' &&\n        (!isStateConstant(expressionObj))) {\n        return [new ValidationError(options.key, options.value, '\"feature-state\" data expressions are not supported with layout properties.')];\n    }\n    if (options.expressionContext === 'filter' && !isStateConstant(expressionObj)) {\n        return [new ValidationError(options.key, options.value, '\"feature-state\" data expressions are not supported with filters.')];\n    }\n    if (options.expressionContext && options.expressionContext.indexOf('cluster') === 0) {\n        if (!isGlobalPropertyConstant(expressionObj, ['zoom', 'feature-state'])) {\n            return [new ValidationError(options.key, options.value, '\"zoom\" and \"feature-state\" expressions are not supported with cluster properties.')];\n        }\n        if (options.expressionContext === 'cluster-initial' && !isFeatureConstant(expressionObj)) {\n            return [new ValidationError(options.key, options.value, 'Feature data expressions are not supported with initial expression part of cluster properties.')];\n        }\n    }\n    return [];\n}\n\nfunction validateBoolean(options) {\n    const value = options.value;\n    const key = options.key;\n    const type = getType(value);\n    if (type !== 'boolean') {\n        return [new ValidationError(key, value, `boolean expected, ${type} found`)];\n    }\n    return [];\n}\n\nfunction validateColor(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type !== 'string') {\n        return [new ValidationError(key, value, `color expected, ${type} found`)];\n    }\n    if (!Color.parse(String(value))) { // cast String object to string primitive\n        return [new ValidationError(key, value, `color expected, \"${value}\" found`)];\n    }\n    return [];\n}\n\nfunction validateEnum(options) {\n    const key = options.key;\n    const value = options.value;\n    const valueSpec = options.valueSpec;\n    const errors = [];\n    if (Array.isArray(valueSpec.values)) { // <=v7\n        if (valueSpec.values.indexOf(unbundle(value)) === -1) {\n            errors.push(new ValidationError(key, value, `expected one of [${valueSpec.values.join(', ')}], ${JSON.stringify(value)} found`));\n        }\n    }\n    else { // >=v8\n        if (Object.keys(valueSpec.values).indexOf(unbundle(value)) === -1) {\n            errors.push(new ValidationError(key, value, `expected one of [${Object.keys(valueSpec.values).join(', ')}], ${JSON.stringify(value)} found`));\n        }\n    }\n    return errors;\n}\n\nfunction validateFilter(options) {\n    if (isExpressionFilter(deepUnbundle(options.value))) {\n        return validateExpression(extendBy({}, options, {\n            expressionContext: 'filter',\n            valueSpec: { value: 'boolean' }\n        }));\n    }\n    else {\n        return validateNonExpressionFilter(options);\n    }\n}\nfunction validateNonExpressionFilter(options) {\n    const value = options.value;\n    const key = options.key;\n    if (getType(value) !== 'array') {\n        return [new ValidationError(key, value, `array expected, ${getType(value)} found`)];\n    }\n    const styleSpec = options.styleSpec;\n    let type;\n    let errors = [];\n    if (value.length < 1) {\n        return [new ValidationError(key, value, 'filter array must have at least 1 element')];\n    }\n    errors = errors.concat(validateEnum({\n        key: `${key}[0]`,\n        value: value[0],\n        valueSpec: styleSpec.filter_operator,\n        style: options.style,\n        styleSpec: options.styleSpec\n    }));\n    switch (unbundle(value[0])) {\n        case '<':\n        case '<=':\n        case '>':\n        case '>=':\n            if (value.length >= 2 && unbundle(value[1]) === '$type') {\n                errors.push(new ValidationError(key, value, `\"$type\" cannot be use with operator \"${value[0]}\"`));\n            }\n        /* falls through */\n        case '==':\n        case '!=':\n            if (value.length !== 3) {\n                errors.push(new ValidationError(key, value, `filter array for operator \"${value[0]}\" must have 3 elements`));\n            }\n        /* falls through */\n        case 'in':\n        case '!in':\n            if (value.length >= 2) {\n                type = getType(value[1]);\n                if (type !== 'string') {\n                    errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${type} found`));\n                }\n            }\n            for (let i = 2; i < value.length; i++) {\n                type = getType(value[i]);\n                if (unbundle(value[1]) === '$type') {\n                    errors = errors.concat(validateEnum({\n                        key: `${key}[${i}]`,\n                        value: value[i],\n                        valueSpec: styleSpec.geometry_type,\n                        style: options.style,\n                        styleSpec: options.styleSpec\n                    }));\n                }\n                else if (type !== 'string' && type !== 'number' && type !== 'boolean') {\n                    errors.push(new ValidationError(`${key}[${i}]`, value[i], `string, number, or boolean expected, ${type} found`));\n                }\n            }\n            break;\n        case 'any':\n        case 'all':\n        case 'none':\n            for (let i = 1; i < value.length; i++) {\n                errors = errors.concat(validateNonExpressionFilter({\n                    key: `${key}[${i}]`,\n                    value: value[i],\n                    style: options.style,\n                    styleSpec: options.styleSpec\n                }));\n            }\n            break;\n        case 'has':\n        case '!has':\n            type = getType(value[1]);\n            if (value.length !== 2) {\n                errors.push(new ValidationError(key, value, `filter array for \"${value[0]}\" operator must have 2 elements`));\n            }\n            else if (type !== 'string') {\n                errors.push(new ValidationError(`${key}[1]`, value[1], `string expected, ${type} found`));\n            }\n            break;\n    }\n    return errors;\n}\n\nfunction validateProperty(options, propertyType) {\n    const key = options.key;\n    const validateSpec = options.validateSpec;\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    const value = options.value;\n    const propertyKey = options.objectKey;\n    const layerSpec = styleSpec[`${propertyType}_${options.layerType}`];\n    if (!layerSpec)\n        return [];\n    const transitionMatch = propertyKey.match(/^(.*)-transition$/);\n    if (propertyType === 'paint' && transitionMatch && layerSpec[transitionMatch[1]] && layerSpec[transitionMatch[1]].transition) {\n        return validateSpec({\n            key,\n            value,\n            valueSpec: styleSpec.transition,\n            style,\n            styleSpec\n        });\n    }\n    const valueSpec = options.valueSpec || layerSpec[propertyKey];\n    if (!valueSpec) {\n        return [new ValidationError(key, value, `unknown property \"${propertyKey}\"`)];\n    }\n    let tokenMatch;\n    if (getType(value) === 'string' && supportsPropertyExpression(valueSpec) && !valueSpec.tokens && (tokenMatch = /^{([^}]+)}$/.exec(value))) {\n        return [new ValidationError(key, value, `\"${propertyKey}\" does not support interpolation syntax\\n` +\n                `Use an identity property function instead: \\`{ \"type\": \"identity\", \"property\": ${JSON.stringify(tokenMatch[1])} }\\`.`)];\n    }\n    const errors = [];\n    if (options.layerType === 'symbol') {\n        if (propertyKey === 'text-field' && style && !style.glyphs) {\n            errors.push(new ValidationError(key, value, 'use of \"text-field\" requires a style \"glyphs\" property'));\n        }\n        if (propertyKey === 'text-font' && isFunction$1(deepUnbundle(value)) && unbundle(value.type) === 'identity') {\n            errors.push(new ValidationError(key, value, '\"text-font\" does not support identity functions'));\n        }\n    }\n    return errors.concat(validateSpec({\n        key: options.key,\n        value,\n        valueSpec,\n        style,\n        styleSpec,\n        expressionContext: 'property',\n        propertyType,\n        propertyKey\n    }));\n}\n\nfunction validatePaintProperty(options) {\n    return validateProperty(options, 'paint');\n}\n\nfunction validateLayoutProperty(options) {\n    return validateProperty(options, 'layout');\n}\n\nfunction validateLayer(options) {\n    let errors = [];\n    const layer = options.value;\n    const key = options.key;\n    const style = options.style;\n    const styleSpec = options.styleSpec;\n    if (!layer.type && !layer.ref) {\n        errors.push(new ValidationError(key, layer, 'either \"type\" or \"ref\" is required'));\n    }\n    let type = unbundle(layer.type);\n    const ref = unbundle(layer.ref);\n    if (layer.id) {\n        const layerId = unbundle(layer.id);\n        for (let i = 0; i < options.arrayIndex; i++) {\n            const otherLayer = style.layers[i];\n            if (unbundle(otherLayer.id) === layerId) {\n                errors.push(new ValidationError(key, layer.id, `duplicate layer id \"${layer.id}\", previously used at line ${otherLayer.id.__line__}`));\n            }\n        }\n    }\n    if ('ref' in layer) {\n        ['type', 'source', 'source-layer', 'filter', 'layout'].forEach((p) => {\n            if (p in layer) {\n                errors.push(new ValidationError(key, layer[p], `\"${p}\" is prohibited for ref layers`));\n            }\n        });\n        let parent;\n        style.layers.forEach((layer) => {\n            if (unbundle(layer.id) === ref)\n                parent = layer;\n        });\n        if (!parent) {\n            errors.push(new ValidationError(key, layer.ref, `ref layer \"${ref}\" not found`));\n        }\n        else if (parent.ref) {\n            errors.push(new ValidationError(key, layer.ref, 'ref cannot reference another ref layer'));\n        }\n        else {\n            type = unbundle(parent.type);\n        }\n    }\n    else if (type !== 'background') {\n        if (!layer.source) {\n            errors.push(new ValidationError(key, layer, 'missing required property \"source\"'));\n        }\n        else {\n            const source = style.sources && style.sources[layer.source];\n            const sourceType = source && unbundle(source.type);\n            if (!source) {\n                errors.push(new ValidationError(key, layer.source, `source \"${layer.source}\" not found`));\n            }\n            else if (sourceType === 'vector' && type === 'raster') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster source`));\n            }\n            else if (sourceType !== 'raster-dem' && type === 'hillshade') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a raster-dem source`));\n            }\n            else if (sourceType === 'raster' && type !== 'raster') {\n                errors.push(new ValidationError(key, layer.source, `layer \"${layer.id}\" requires a vector source`));\n            }\n            else if (sourceType === 'vector' && !layer['source-layer']) {\n                errors.push(new ValidationError(key, layer, `layer \"${layer.id}\" must specify a \"source-layer\"`));\n            }\n            else if (sourceType === 'raster-dem' && type !== 'hillshade') {\n                errors.push(new ValidationError(key, layer.source, 'raster-dem source can only be used with layer type \\'hillshade\\'.'));\n            }\n            else if (type === 'line' && layer.paint && layer.paint['line-gradient'] &&\n                (sourceType !== 'geojson' || !source.lineMetrics)) {\n                errors.push(new ValidationError(key, layer, `layer \"${layer.id}\" specifies a line-gradient, which requires a GeoJSON source with \\`lineMetrics\\` enabled.`));\n            }\n        }\n    }\n    errors = errors.concat(validateObject({\n        key,\n        value: layer,\n        valueSpec: styleSpec.layer,\n        style: options.style,\n        styleSpec: options.styleSpec,\n        validateSpec: options.validateSpec,\n        objectElementValidators: {\n            '*'() {\n                return [];\n            },\n            // We don't want to enforce the spec's `\"requires\": true` for backward compatibility with refs;\n            // the actual requirement is validated above. See https://github.com/mapbox/mapbox-gl-js/issues/5772.\n            type() {\n                return options.validateSpec({\n                    key: `${key}.type`,\n                    value: layer.type,\n                    valueSpec: styleSpec.layer.type,\n                    style: options.style,\n                    styleSpec: options.styleSpec,\n                    validateSpec: options.validateSpec,\n                    object: layer,\n                    objectKey: 'type'\n                });\n            },\n            filter: validateFilter,\n            layout(options) {\n                return validateObject({\n                    layer,\n                    key: options.key,\n                    value: options.value,\n                    style: options.style,\n                    styleSpec: options.styleSpec,\n                    validateSpec: options.validateSpec,\n                    objectElementValidators: {\n                        '*'(options) {\n                            return validateLayoutProperty(extendBy({ layerType: type }, options));\n                        }\n                    }\n                });\n            },\n            paint(options) {\n                return validateObject({\n                    layer,\n                    key: options.key,\n                    value: options.value,\n                    style: options.style,\n                    styleSpec: options.styleSpec,\n                    validateSpec: options.validateSpec,\n                    objectElementValidators: {\n                        '*'(options) {\n                            return validatePaintProperty(extendBy({ layerType: type }, options));\n                        }\n                    }\n                });\n            }\n        }\n    }));\n    return errors;\n}\n\nfunction validateString(options) {\n    const value = options.value;\n    const key = options.key;\n    const type = getType(value);\n    if (type !== 'string') {\n        return [new ValidationError(key, value, `string expected, ${type} found`)];\n    }\n    return [];\n}\n\nfunction validateRasterDEMSource(options) {\n    var _a;\n    const sourceName = (_a = options.sourceName) !== null && _a !== void 0 ? _a : '';\n    const rasterDEM = options.value;\n    const styleSpec = options.styleSpec;\n    const rasterDEMSpec = styleSpec.source_raster_dem;\n    const style = options.style;\n    let errors = [];\n    const rootType = getType(rasterDEM);\n    if (rasterDEM === undefined) {\n        return errors;\n    }\n    else if (rootType !== 'object') {\n        errors.push(new ValidationError('source_raster_dem', rasterDEM, `object expected, ${rootType} found`));\n        return errors;\n    }\n    const encoding = unbundle(rasterDEM.encoding);\n    const isCustomEncoding = encoding === 'custom';\n    const customEncodingKeys = ['redFactor', 'greenFactor', 'blueFactor', 'baseShift'];\n    const encodingName = options.value.encoding ? `\"${options.value.encoding}\"` : 'Default';\n    for (const key in rasterDEM) {\n        if (!isCustomEncoding && customEncodingKeys.includes(key)) {\n            errors.push(new ValidationError(key, rasterDEM[key], `In \"${sourceName}\": \"${key}\" is only valid when \"encoding\" is set to \"custom\". ${encodingName} encoding found`));\n        }\n        else if (rasterDEMSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: rasterDEM[key],\n                valueSpec: rasterDEMSpec[key],\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors.push(new ValidationError(key, rasterDEM[key], `unknown property \"${key}\"`));\n        }\n    }\n    return errors;\n}\n\nconst objectElementValidators = {\n    promoteId: validatePromoteId\n};\nfunction validateSource(options) {\n    const value = options.value;\n    const key = options.key;\n    const styleSpec = options.styleSpec;\n    const style = options.style;\n    const validateSpec = options.validateSpec;\n    if (!value.type) {\n        return [new ValidationError(key, value, '\"type\" is required')];\n    }\n    const type = unbundle(value.type);\n    let errors;\n    switch (type) {\n        case 'vector':\n        case 'raster':\n            errors = validateObject({\n                key,\n                value,\n                valueSpec: styleSpec[`source_${type.replace('-', '_')}`],\n                style: options.style,\n                styleSpec,\n                objectElementValidators,\n                validateSpec,\n            });\n            return errors;\n        case 'raster-dem':\n            errors = validateRasterDEMSource({\n                sourceName: key,\n                value,\n                style: options.style,\n                styleSpec,\n                validateSpec,\n            });\n            return errors;\n        case 'geojson':\n            errors = validateObject({\n                key,\n                value,\n                valueSpec: styleSpec.source_geojson,\n                style,\n                styleSpec,\n                validateSpec,\n                objectElementValidators\n            });\n            if (value.cluster) {\n                for (const prop in value.clusterProperties) {\n                    const [operator, mapExpr] = value.clusterProperties[prop];\n                    const reduceExpr = typeof operator === 'string' ? [operator, ['accumulated'], ['get', prop]] : operator;\n                    errors.push(...validateExpression({\n                        key: `${key}.${prop}.map`,\n                        value: mapExpr,\n                        validateSpec,\n                        expressionContext: 'cluster-map'\n                    }));\n                    errors.push(...validateExpression({\n                        key: `${key}.${prop}.reduce`,\n                        value: reduceExpr,\n                        validateSpec,\n                        expressionContext: 'cluster-reduce'\n                    }));\n                }\n            }\n            return errors;\n        case 'video':\n            return validateObject({\n                key,\n                value,\n                valueSpec: styleSpec.source_video,\n                style,\n                validateSpec,\n                styleSpec\n            });\n        case 'image':\n            return validateObject({\n                key,\n                value,\n                valueSpec: styleSpec.source_image,\n                style,\n                validateSpec,\n                styleSpec\n            });\n        case 'canvas':\n            return [new ValidationError(key, null, 'Please use runtime APIs to add canvas sources, rather than including them in stylesheets.', 'source.canvas')];\n        default:\n            return validateEnum({\n                key: `${key}.type`,\n                value: value.type,\n                valueSpec: { values: ['vector', 'raster', 'raster-dem', 'geojson', 'video', 'image'] },\n                style,\n                validateSpec,\n                styleSpec\n            });\n    }\n}\nfunction validatePromoteId({ key, value }) {\n    if (getType(value) === 'string') {\n        return validateString({ key, value });\n    }\n    else {\n        const errors = [];\n        for (const prop in value) {\n            errors.push(...validateString({ key: `${key}.${prop}`, value: value[prop] }));\n        }\n        return errors;\n    }\n}\n\nfunction validateLight(options) {\n    const light = options.value;\n    const styleSpec = options.styleSpec;\n    const lightSpec = styleSpec.light;\n    const style = options.style;\n    let errors = [];\n    const rootType = getType(light);\n    if (light === undefined) {\n        return errors;\n    }\n    else if (rootType !== 'object') {\n        errors = errors.concat([new ValidationError('light', light, `object expected, ${rootType} found`)]);\n        return errors;\n    }\n    for (const key in light) {\n        const transitionMatch = key.match(/^(.*)-transition$/);\n        if (transitionMatch && lightSpec[transitionMatch[1]] && lightSpec[transitionMatch[1]].transition) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: light[key],\n                valueSpec: styleSpec.transition,\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else if (lightSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: light[key],\n                valueSpec: lightSpec[key],\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([new ValidationError(key, light[key], `unknown property \"${key}\"`)]);\n        }\n    }\n    return errors;\n}\n\nfunction validateSky(options) {\n    const sky = options.value;\n    const styleSpec = options.styleSpec;\n    const skySpec = styleSpec.sky;\n    const style = options.style;\n    const rootType = getType(sky);\n    if (sky === undefined) {\n        return [];\n    }\n    else if (rootType !== 'object') {\n        return [new ValidationError('sky', sky, `object expected, ${rootType} found`)];\n    }\n    let errors = [];\n    for (const key in sky) {\n        if (skySpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: sky[key],\n                valueSpec: skySpec[key],\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([new ValidationError(key, sky[key], `unknown property \"${key}\"`)]);\n        }\n    }\n    return errors;\n}\n\nfunction validateTerrain(options) {\n    const terrain = options.value;\n    const styleSpec = options.styleSpec;\n    const terrainSpec = styleSpec.terrain;\n    const style = options.style;\n    let errors = [];\n    const rootType = getType(terrain);\n    if (terrain === undefined) {\n        return errors;\n    }\n    else if (rootType !== 'object') {\n        errors = errors.concat([new ValidationError('terrain', terrain, `object expected, ${rootType} found`)]);\n        return errors;\n    }\n    for (const key in terrain) {\n        if (terrainSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: terrain[key],\n                valueSpec: terrainSpec[key],\n                validateSpec: options.validateSpec,\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([new ValidationError(key, terrain[key], `unknown property \"${key}\"`)]);\n        }\n    }\n    return errors;\n}\n\nfunction validateFormatted(options) {\n    if (validateString(options).length === 0) {\n        return [];\n    }\n    return validateExpression(options);\n}\n\nfunction validateImage(options) {\n    if (validateString(options).length === 0) {\n        return [];\n    }\n    return validateExpression(options);\n}\n\nfunction validatePadding(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    if (type === 'array') {\n        if (value.length < 1 || value.length > 4) {\n            return [new ValidationError(key, value, `padding requires 1 to 4 values; ${value.length} values found`)];\n        }\n        const arrayElementSpec = {\n            type: 'number'\n        };\n        let errors = [];\n        for (let i = 0; i < value.length; i++) {\n            errors = errors.concat(options.validateSpec({\n                key: `${key}[${i}]`,\n                value: value[i],\n                validateSpec: options.validateSpec,\n                valueSpec: arrayElementSpec\n            }));\n        }\n        return errors;\n    }\n    else {\n        return validateNumber({\n            key,\n            value,\n            valueSpec: {}\n        });\n    }\n}\n\nfunction validateVariableAnchorOffsetCollection(options) {\n    const key = options.key;\n    const value = options.value;\n    const type = getType(value);\n    const styleSpec = options.styleSpec;\n    if (type !== 'array' || value.length < 1 || value.length % 2 !== 0) {\n        return [new ValidationError(key, value, 'variableAnchorOffsetCollection requires a non-empty array of even length')];\n    }\n    let errors = [];\n    for (let i = 0; i < value.length; i += 2) {\n        // Elements in even positions should be values from text-anchor enum\n        errors = errors.concat(validateEnum({\n            key: `${key}[${i}]`,\n            value: value[i],\n            valueSpec: styleSpec['layout_symbol']['text-anchor']\n        }));\n        // Elements in odd positions should be points (2-element numeric arrays)\n        errors = errors.concat(validateArray({\n            key: `${key}[${i + 1}]`,\n            value: value[i + 1],\n            valueSpec: {\n                length: 2,\n                value: 'number'\n            },\n            validateSpec: options.validateSpec,\n            style: options.style,\n            styleSpec\n        }));\n    }\n    return errors;\n}\n\nfunction validateSprite(options) {\n    let errors = [];\n    const sprite = options.value;\n    const key = options.key;\n    if (!Array.isArray(sprite)) {\n        return validateString({\n            key,\n            value: sprite\n        });\n    }\n    else {\n        const allSpriteIds = [];\n        const allSpriteURLs = [];\n        for (const i in sprite) {\n            if (sprite[i].id && allSpriteIds.includes(sprite[i].id))\n                errors.push(new ValidationError(key, sprite, `all the sprites' ids must be unique, but ${sprite[i].id} is duplicated`));\n            allSpriteIds.push(sprite[i].id);\n            if (sprite[i].url && allSpriteURLs.includes(sprite[i].url))\n                errors.push(new ValidationError(key, sprite, `all the sprites' URLs must be unique, but ${sprite[i].url} is duplicated`));\n            allSpriteURLs.push(sprite[i].url);\n            const pairSpec = {\n                id: {\n                    type: 'string',\n                    required: true,\n                },\n                url: {\n                    type: 'string',\n                    required: true,\n                }\n            };\n            errors = errors.concat(validateObject({\n                key: `${key}[${i}]`,\n                value: sprite[i],\n                valueSpec: pairSpec,\n                validateSpec: options.validateSpec,\n            }));\n        }\n        return errors;\n    }\n}\n\nfunction validateProjection(options) {\n    const projection = options.value;\n    const styleSpec = options.styleSpec;\n    const projectionSpec = styleSpec.projection;\n    const style = options.style;\n    const rootType = getType(projection);\n    if (projection === undefined) {\n        return [];\n    }\n    else if (rootType !== 'object') {\n        return [new ValidationError('projection', projection, `object expected, ${rootType} found`)];\n    }\n    let errors = [];\n    for (const key in projection) {\n        if (projectionSpec[key]) {\n            errors = errors.concat(options.validateSpec({\n                key,\n                value: projection[key],\n                valueSpec: projectionSpec[key],\n                style,\n                styleSpec\n            }));\n        }\n        else {\n            errors = errors.concat([new ValidationError(key, projection[key], `unknown property \"${key}\"`)]);\n        }\n    }\n    return errors;\n}\n\nconst VALIDATORS = {\n    '*'() {\n        return [];\n    },\n    'array': validateArray,\n    'boolean': validateBoolean,\n    'number': validateNumber,\n    'color': validateColor,\n    'constants': validateConstants,\n    'enum': validateEnum,\n    'filter': validateFilter,\n    'function': validateFunction,\n    'layer': validateLayer,\n    'object': validateObject,\n    'source': validateSource,\n    'light': validateLight,\n    'sky': validateSky,\n    'terrain': validateTerrain,\n    'projection': validateProjection,\n    'string': validateString,\n    'formatted': validateFormatted,\n    'resolvedImage': validateImage,\n    'padding': validatePadding,\n    'variableAnchorOffsetCollection': validateVariableAnchorOffsetCollection,\n    'sprite': validateSprite,\n};\n/**\n * Main recursive validation function used internally.\n * You should use `validateStyleMin` in the browser or `validateStyle` in node env.\n * @param options - the options object\n * @param options.key - string representing location of validation in style tree. Used only\n * for more informative error reporting.\n * @param options.value - current value from style being evaluated. May be anything from a\n * high level object that needs to be descended into deeper or a simple\n * scalar value.\n * @param options.valueSpec - current spec being evaluated. Tracks value.\n * @param options.styleSpec - current full spec being evaluated.\n * @param options.validateSpec - the validate function itself\n * @param options.style - the style object\n * @param options.objectElementValidators - optional object of functions that will be called\n * @returns an array of errors, or an empty array if no errors are found.\n */\nfunction validate(options) {\n    const value = options.value;\n    const valueSpec = options.valueSpec;\n    const styleSpec = options.styleSpec;\n    options.validateSpec = validate;\n    if (valueSpec.expression && isFunction$1(unbundle(value))) {\n        return validateFunction(options);\n    }\n    else if (valueSpec.expression && isExpression(deepUnbundle(value))) {\n        return validateExpression(options);\n    }\n    else if (valueSpec.type && VALIDATORS[valueSpec.type]) {\n        return VALIDATORS[valueSpec.type](options);\n    }\n    else {\n        const valid = validateObject(extendBy({}, options, {\n            valueSpec: valueSpec.type ? styleSpec[valueSpec.type] : valueSpec\n        }));\n        return valid;\n    }\n}\n\nfunction validateGlyphsUrl(options) {\n    const value = options.value;\n    const key = options.key;\n    const errors = validateString(options);\n    if (errors.length)\n        return errors;\n    if (value.indexOf('{fontstack}') === -1) {\n        errors.push(new ValidationError(key, value, '\"glyphs\" url must include a \"{fontstack}\" token'));\n    }\n    if (value.indexOf('{range}') === -1) {\n        errors.push(new ValidationError(key, value, '\"glyphs\" url must include a \"{range}\" token'));\n    }\n    return errors;\n}\n\n/**\n * Validate a MapLibre style against the style specification.\n * Use this when running in the browser.\n *\n * @param style - The style to be validated.\n * @param styleSpec - The style specification to validate against.\n * If omitted, the latest style spec is used.\n * @returns an array of errors, or an empty array if no errors are found.\n * @example\n *   const validate = require('@maplibre/maplibre-gl-style-spec/').validateStyleMin;\n *   const errors = validate(style);\n */\nfunction validateStyleMin(style, styleSpec = v8Spec) {\n    let errors = [];\n    errors = errors.concat(validate({\n        key: '',\n        value: style,\n        valueSpec: styleSpec.$root,\n        styleSpec,\n        style,\n        validateSpec: validate,\n        objectElementValidators: {\n            glyphs: validateGlyphsUrl,\n            '*'() {\n                return [];\n            }\n        }\n    }));\n    if (style['constants']) {\n        errors = errors.concat(validateConstants({\n            key: 'constants',\n            value: style['constants'],\n            style,\n            styleSpec,\n            validateSpec: validate,\n        }));\n    }\n    return sortErrors(errors);\n}\nvalidateStyleMin.source = wrapCleanErrors(injectValidateSpec(validateSource));\nvalidateStyleMin.sprite = wrapCleanErrors(injectValidateSpec(validateSprite));\nvalidateStyleMin.glyphs = wrapCleanErrors(injectValidateSpec(validateGlyphsUrl));\nvalidateStyleMin.light = wrapCleanErrors(injectValidateSpec(validateLight));\nvalidateStyleMin.sky = wrapCleanErrors(injectValidateSpec(validateSky));\nvalidateStyleMin.terrain = wrapCleanErrors(injectValidateSpec(validateTerrain));\nvalidateStyleMin.layer = wrapCleanErrors(injectValidateSpec(validateLayer));\nvalidateStyleMin.filter = wrapCleanErrors(injectValidateSpec(validateFilter));\nvalidateStyleMin.paintProperty = wrapCleanErrors(injectValidateSpec(validatePaintProperty));\nvalidateStyleMin.layoutProperty = wrapCleanErrors(injectValidateSpec(validateLayoutProperty));\nfunction injectValidateSpec(validator) {\n    return function (options) {\n        return validator({\n            ...options,\n            validateSpec: validate,\n        });\n    };\n}\nfunction sortErrors(errors) {\n    return [].concat(errors).sort((a, b) => {\n        return a.line - b.line;\n    });\n}\nfunction wrapCleanErrors(inner) {\n    return function (...args) {\n        return sortErrors(inner.apply(this, args));\n    };\n}\n\n// Note: This regex matches even invalid JSON strings, but since weâre\n// working on the output of `JSON.stringify` we know that only valid strings\n// are present (unless the user supplied a weird `options.indent` but in\n// that case we donât care since the output would be invalid anyway).\nconst stringOrChar = /(\"(?:[^\\\\\"]|\\\\.)*\")|[:,]/g;\n\nfunction stringify(passedObj, options = {}) {\n  const indent = JSON.stringify(\n    [1],\n    undefined,\n    options.indent === undefined ? 2 : options.indent\n  ).slice(2, -3);\n\n  const maxLength =\n    indent === \"\"\n      ? Infinity\n      : options.maxLength === undefined\n      ? 80\n      : options.maxLength;\n\n  let { replacer } = options;\n\n  return (function _stringify(obj, currentIndent, reserved) {\n    if (obj && typeof obj.toJSON === \"function\") {\n      obj = obj.toJSON();\n    }\n\n    const string = JSON.stringify(obj, replacer);\n\n    if (string === undefined) {\n      return string;\n    }\n\n    const length = maxLength - currentIndent.length - reserved;\n\n    if (string.length <= length) {\n      const prettified = string.replace(\n        stringOrChar,\n        (match, stringLiteral) => {\n          return stringLiteral || `${match} `;\n        }\n      );\n      if (prettified.length <= length) {\n        return prettified;\n      }\n    }\n\n    if (replacer != null) {\n      obj = JSON.parse(string);\n      replacer = undefined;\n    }\n\n    if (typeof obj === \"object\" && obj !== null) {\n      const nextIndent = currentIndent + indent;\n      const items = [];\n      let index = 0;\n      let start;\n      let end;\n\n      if (Array.isArray(obj)) {\n        start = \"[\";\n        end = \"]\";\n        const { length } = obj;\n        for (; index < length; index++) {\n          items.push(\n            _stringify(obj[index], nextIndent, index === length - 1 ? 0 : 1) ||\n              \"null\"\n          );\n        }\n      } else {\n        start = \"{\";\n        end = \"}\";\n        const keys = Object.keys(obj);\n        const { length } = keys;\n        for (; index < length; index++) {\n          const key = keys[index];\n          const keyPart = `${JSON.stringify(key)}: `;\n          const value = _stringify(\n            obj[key],\n            nextIndent,\n            keyPart.length + (index === length - 1 ? 0 : 1)\n          );\n          if (value !== undefined) {\n            items.push(keyPart + value);\n          }\n        }\n      }\n\n      if (items.length > 0) {\n        return [start, indent + items.join(`,\\n${nextIndent}`), end].join(\n          `\\n${currentIndent}`\n        );\n      }\n    }\n\n    return string;\n  })(passedObj, \"\", 0);\n}\n\nfunction sortKeysBy(obj, reference) {\n    const result = {};\n    for (const key in reference) {\n        if (obj[key] !== undefined) {\n            result[key] = obj[key];\n        }\n    }\n    for (const key in obj) {\n        if (result[key] === undefined) {\n            result[key] = obj[key];\n        }\n    }\n    return result;\n}\n/**\n * Format a MapLibre Style.  Returns a stringified style with its keys\n * sorted in the same order as the reference style.\n *\n * The optional `space` argument is passed to\n * [`JSON.stringify`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)\n * to generate formatted output.\n *\n * If `space` is unspecified, a default of `2` spaces will be used.\n *\n * @private\n * @param {Object} style a MapLibre Style\n * @param {number} [space] space argument to pass to `JSON.stringify`\n * @returns {string} stringified formatted JSON\n * @example\n * var fs = require('fs');\n * var format = require('maplibre-gl-style-spec').format;\n * var style = fs.readFileSync('./source.json', 'utf8');\n * fs.writeFileSync('./dest.json', format(style));\n * fs.writeFileSync('./dest.min.json', format(style, 0));\n */\nfunction format(style, space = 2) {\n    style = sortKeysBy(style, v8Spec.$root);\n    if (style.layers) {\n        style.layers = style.layers.map((layer) => sortKeysBy(layer, v8Spec.layer));\n    }\n    return stringify(style, { indent: space });\n}\n\nfunction eachLayout(layer, callback) {\n    for (const k in layer) {\n        if (k.indexOf('layout') === 0) {\n            callback(layer[k], k);\n        }\n    }\n}\nfunction eachPaint(layer, callback) {\n    for (const k in layer) {\n        if (k.indexOf('paint') === 0) {\n            callback(layer[k], k);\n        }\n    }\n}\nfunction resolveConstant(style, value) {\n    if (typeof value === 'string' && value[0] === '@') {\n        return resolveConstant(style, style.constants[value]);\n    }\n    else {\n        return value;\n    }\n}\nfunction isFunction(value) {\n    return Array.isArray(value.stops);\n}\nfunction renameProperty(obj, from, to) {\n    obj[to] = obj[from];\n    delete obj[from];\n}\nfunction migrateV8(style) {\n    style.version = 8;\n    // Rename properties, reverse coordinates in source and layers\n    eachSource(style, (source) => {\n        if (source.type === 'video' && source['url'] !== undefined) {\n            renameProperty(source, 'url', 'urls');\n        }\n        if (source.type === 'video') {\n            source.coordinates.forEach((coord) => {\n                return coord.reverse();\n            });\n        }\n    });\n    eachLayer(style, (layer) => {\n        eachLayout(layer, (layout) => {\n            if (layout['symbol-min-distance'] !== undefined) {\n                renameProperty(layout, 'symbol-min-distance', 'symbol-spacing');\n            }\n        });\n        eachPaint(layer, (paint) => {\n            if (paint['background-image'] !== undefined) {\n                renameProperty(paint, 'background-image', 'background-pattern');\n            }\n            if (paint['line-image'] !== undefined) {\n                renameProperty(paint, 'line-image', 'line-pattern');\n            }\n            if (paint['fill-image'] !== undefined) {\n                renameProperty(paint, 'fill-image', 'fill-pattern');\n            }\n        });\n    });\n    // Inline Constants\n    eachProperty(style, { paint: true, layout: true }, (property) => {\n        const value = resolveConstant(style, property.value);\n        if (isFunction(value)) {\n            value.stops.forEach((stop) => {\n                stop[1] = resolveConstant(style, stop[1]);\n            });\n        }\n        property.set(value);\n    });\n    delete style['constants'];\n    eachLayer(style, (layer) => {\n        // get rid of text-max-size, icon-max-size\n        // turn text-size, icon-size into layout properties\n        // https://github.com/mapbox/mapbox-gl-style-spec/issues/255\n        eachLayout(layer, (layout) => {\n            delete layout['text-max-size'];\n            delete layout['icon-max-size'];\n        });\n        eachPaint(layer, (paint) => {\n            if (paint['text-size']) {\n                if (!layer.layout)\n                    layer.layout = {};\n                layer.layout['text-size'] = paint['text-size'];\n                delete paint['text-size'];\n            }\n            if (paint['icon-size']) {\n                if (!layer.layout)\n                    layer.layout = {};\n                layer.layout['icon-size'] = paint['icon-size'];\n                delete paint['icon-size'];\n            }\n        });\n    });\n    function migrateFontStack(font) {\n        function splitAndTrim(string) {\n            return string.split(',').map((s) => {\n                return s.trim();\n            });\n        }\n        if (Array.isArray(font)) {\n            // Assume it's a previously migrated font-array.\n            return font;\n        }\n        else if (typeof font === 'string') {\n            return splitAndTrim(font);\n        }\n        else if (typeof font === 'object') {\n            font.stops.forEach((stop) => {\n                stop[1] = splitAndTrim(stop[1]);\n            });\n            return font;\n        }\n        else {\n            throw new Error('unexpected font value');\n        }\n    }\n    eachLayer(style, (layer) => {\n        eachLayout(layer, (layout) => {\n            if (layout['text-font']) {\n                layout['text-font'] = migrateFontStack(layout['text-font']);\n            }\n        });\n    });\n    // Reverse order of symbol layers. This is an imperfect migration.\n    //\n    // The order of a symbol layer in the layers list affects two things:\n    // - how it is drawn relative to other layers (like oneway arrows below bridges)\n    // - the placement priority compared to other layers\n    //\n    // It's impossible to reverse the placement priority without breaking the draw order\n    // in some cases. This migration only reverses the order of symbol layers that\n    // are above all other types of layers.\n    //\n    // Symbol layers that are at the top of the map preserve their priority.\n    // Symbol layers that are below another type (line, fill) of layer preserve their draw order.\n    let firstSymbolLayer = 0;\n    for (let i = style.layers.length - 1; i >= 0; i--) {\n        const layer = style.layers[i];\n        if (layer.type !== 'symbol') {\n            firstSymbolLayer = i + 1;\n            break;\n        }\n    }\n    const symbolLayers = style.layers.splice(firstSymbolLayer);\n    symbolLayers.reverse();\n    style.layers = style.layers.concat(symbolLayers);\n    return style;\n}\n\n/**\n * Migrate the given style object in place to use expressions. Specifically,\n * this will convert (a) \"stop\" functions, and (b) legacy filters to their\n * expression equivalents.\n * @param style The style object to migrate.\n * @returns The migrated style object.\n */\nfunction expressions(style) {\n    const converted = [];\n    eachLayer(style, (layer) => {\n        if (layer.filter) {\n            layer.filter = convertFilter(layer.filter);\n        }\n    });\n    eachProperty(style, { paint: true, layout: true }, ({ path, value, reference, set }) => {\n        if (isExpression(value))\n            return;\n        if (typeof value === 'object' && !Array.isArray(value)) {\n            set(convertFunction(value, reference));\n            converted.push(path.join('.'));\n        }\n        else if (reference.tokens && typeof value === 'string') {\n            set(convertTokenString(value));\n        }\n    });\n    return style;\n}\n\n/**\n * Migrate color style values to supported format.\n *\n * @param colorToMigrate Color value to migrate, could be a string or an expression.\n * @returns Color style value in supported format.\n */\nfunction migrateColors(colorToMigrate) {\n    return JSON.parse(migrateHslColors(JSON.stringify(colorToMigrate)));\n}\n/**\n * Created to migrate from colors supported by the former CSS color parsing\n * library `csscolorparser` but not compliant with the CSS Color specification,\n * like `hsl(900, 0.15, 90%)`.\n *\n * @param colorToMigrate Serialized color style value.\n * @returns A serialized color style value in which all non-standard hsl color values\n * have been converted to a format that complies with the CSS Color specification.\n *\n * @example\n * migrateHslColors('\"hsl(900, 0.15, 90%)\"'); // returns '\"hsl(900, 15%, 90%)\"'\n * migrateHslColors('\"hsla(900, .15, .9)\"'); // returns '\"hsl(900, 15%, 90%)\"'\n * migrateHslColors('\"hsl(900, 15%, 90%)\"'); // returns '\"hsl(900, 15%, 90%)\"' - no changes\n */\nfunction migrateHslColors(colorToMigrate) {\n    return colorToMigrate.replace(/\"hsla?\\((.+?)\\)\"/gi, (match, hslArgs) => {\n        const argsMatch = hslArgs.match(/^(.+?)\\s*,\\s*(.+?)\\s*,\\s*(.+?)(?:\\s*,\\s*(.+))?$/i);\n        if (argsMatch) {\n            let [h, s, l, a] = argsMatch.slice(1);\n            [s, l] = [s, l].map(v => v.endsWith('%') ? v : `${parseFloat(v) * 100}%`);\n            return `\"hsl${typeof a === 'string' ? 'a' : ''}(${[h, s, l, a].filter(Boolean).join(',')})\"`;\n        }\n        return match;\n    });\n}\n\n/**\n * Migrate a Mapbox/MapLibre GL Style to the latest version.\n *\n * @param style - a MapLibre Style\n * @returns a migrated style\n * @example\n * const fs = require('fs');\n * csont migrate = require('@maplibre/maplibre-gl-style-spec').migrate;\n * const style = fs.readFileSync('./style.json', 'utf8');\n * fs.writeFileSync('./style.json', JSON.stringify(migrate(style)));\n */\nfunction migrate(style) {\n    let migrated = false;\n    if (style.version === 7) {\n        style = migrateV8(style);\n        migrated = true;\n    }\n    if (style.version === 8) {\n        migrated = !!expressions(style);\n        migrated = true;\n    }\n    eachProperty(style, { paint: true, layout: true }, ({ value, reference, set }) => {\n        if (reference.type === 'color') {\n            set(migrateColors(value));\n        }\n    });\n    if (!migrated) {\n        throw new Error(`Cannot migrate from ${style.version}`);\n    }\n    return style;\n}\n\nconst v8 = v8Spec;\nconst expression = {\n    StyleExpression,\n    StylePropertyFunction,\n    ZoomConstantExpression,\n    ZoomDependentExpression,\n    createExpression,\n    createPropertyExpression,\n    isExpression,\n    isExpressionFilter,\n    isZoomExpression,\n    normalizePropertyExpression,\n};\nconst styleFunction = {\n    convertFunction,\n    createFunction,\n    isFunction: isFunction$1\n};\nconst visit = { eachLayer, eachProperty, eachSource };\n\nexport { Color, ColorType, CompoundExpression, EvaluationContext, FormatExpression, Formatted, FormattedSection, FormattedType, Interpolate, Literal, NullType, Padding, ParsingError, ResolvedImage, Step, StyleExpression, StylePropertyFunction, ValidationError, VariableAnchorOffsetCollection, ZoomConstantExpression, ZoomDependentExpression, classifyRings, convertFilter, convertFunction, createExpression, createFunction, createPropertyExpression, derefLayers, diffStyles as diff, emptyStyle, expression, expressions$1 as expressions, createFilter as featureFilter, format, styleFunction as function, groupByLayout, interpolateFactory, interpolate as interpolates, isExpression, isFunction$1 as isFunction, isZoomExpression, v8Spec as latest, migrate, normalizePropertyExpression, supportsPropertyExpression, toString$1 as toString, typeOf, v8, validate, validateStyleMin, visit };\n//# sourceMappingURL=index.mjs.map\n", "import {validateStyleMin} from '@maplibre/maplibre-gl-style-spec';\nimport {ErrorEvent} from '../util/evented';\n\nimport type {Evented} from '../util/evented';\n\ntype ValidationError = {\n    message: string;\n    line: number;\n    identifier?: string;\n};\n\nexport type Validator = (a: any) => ReadonlyArray<ValidationError>;\n\ntype ValidateStyle = {\n    source: Validator;\n    sprite: Validator;\n    glyphs: Validator;\n    layer: Validator;\n    light: Validator;\n    sky: Validator;\n    terrain: Validator;\n    filter: Validator;\n    paintProperty: Validator;\n    layoutProperty: Validator;\n    (b: any, a?: any | null): ReadonlyArray<ValidationError>;\n};\n\nexport const validateStyle = (validateStyleMin as unknown as ValidateStyle);\n\nexport const validateSource = validateStyle.source;\nexport const validateLight = validateStyle.light;\nexport const validateSky = validateStyle.sky;\nexport const validateTerrain = validateStyle.terrain;\nexport const validateFilter = validateStyle.filter;\nexport const validatePaintProperty = validateStyle.paintProperty;\nexport const validateLayoutProperty = validateStyle.layoutProperty;\n\nexport function emitValidationErrors(\n    emitter: Evented,\n    errors?: ReadonlyArray<{\n        message: string;\n        identifier?: string;\n    }> | null\n): boolean {\n    let hasErrors = false;\n    if (errors && errors.length) {\n        for (const error of errors) {\n            emitter.fire(new ErrorEvent(new Error(error.message)));\n            hasErrors = true;\n        }\n    }\n    return hasErrors;\n}\n", "/*\nThis file was copied from https://github.com/mapbox/grid-index and was\nmigrated from JavaScript to TypeScript.\n\nCopyright (c) 2016, Mapbox\n\nPermission to use, copy, modify, and/or distribute this software for any purpose\nwith or without fee is hereby granted, provided that the above copyright notice\nand this permission notice appear in all copies.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS\nOF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\nTORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\nTHIS SOFTWARE.\n*/\n\nconst NUM_PARAMS = 3;\n\nexport type SerializedGrid = {\n    buffer: ArrayBuffer;\n};\n\nexport class TransferableGridIndex {\n    cells: number[][];\n    arrayBuffer: ArrayBuffer;\n    d: number;\n    keys: number[];\n    bboxes: number[];\n    n: number;\n    extent: number;\n    padding: number;\n    scale: any;\n    uid: number;\n    min: number;\n    max: number;\n\n    constructor(extent: number | ArrayBuffer, n?: number, padding?: number) {\n        const cells = this.cells = [];\n\n        if (extent instanceof ArrayBuffer) {\n            this.arrayBuffer = extent;\n            const array = new Int32Array(this.arrayBuffer);\n            extent = array[0];\n            n = array[1];\n            padding = array[2];\n\n            this.d = n + 2 * padding;\n            for (let k = 0; k < this.d * this.d; k++) {\n                const start = array[NUM_PARAMS + k];\n                const end = array[NUM_PARAMS + k + 1];\n                cells.push(start === end ? null : array.subarray(start, end));\n            }\n            const keysOffset = array[NUM_PARAMS + cells.length];\n            const bboxesOffset = array[NUM_PARAMS + cells.length + 1];\n            this.keys = array.subarray(keysOffset, bboxesOffset) as any as number[];\n            this.bboxes = array.subarray(bboxesOffset) as any as number[];\n\n            this.insert = this._insertReadonly;\n\n        } else {\n            this.d = n + 2 * padding;\n            for (let i = 0; i < this.d * this.d; i++) {\n                cells.push([]);\n            }\n            this.keys = [];\n            this.bboxes = [];\n        }\n\n        this.n = n;\n        this.extent = extent;\n        this.padding = padding;\n        this.scale = n / extent;\n        this.uid = 0;\n\n        const p = (padding / n) * extent;\n        this.min = -p;\n        this.max = extent + p;\n    }\n\n    insert(key: number, x1: number, y1: number, x2: number, y2: number) {\n        this._forEachCell(x1, y1, x2, y2, this._insertCell, this.uid++, undefined, undefined);\n        this.keys.push(key);\n        this.bboxes.push(x1);\n        this.bboxes.push(y1);\n        this.bboxes.push(x2);\n        this.bboxes.push(y2);\n    }\n\n    _insertReadonly() {\n        throw new Error('Cannot insert into a GridIndex created from an ArrayBuffer.');\n    }\n\n    _insertCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number) {\n        this.cells[cellIndex].push(uid);\n    }\n\n    query(x1: number, y1: number, x2: number, y2: number, intersectionTest?: Function): number[] {\n        const min = this.min;\n        const max = this.max;\n        if (x1 <= min && y1 <= min && max <= x2 && max <= y2 && !intersectionTest) {\n            // We use `Array#slice` because `this.keys` may be a `Int32Array` and\n            // some browsers (Safari and IE) do not support `TypedArray#slice`\n            // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/slice#Browser_compatibility\n            return Array.prototype.slice.call(this.keys);\n\n        } else {\n            const result = [];\n            const seenUids = {};\n            this._forEachCell(x1, y1, x2, y2, this._queryCell, result, seenUids, intersectionTest);\n            return result;\n        }\n    }\n\n    _queryCell(x1: number, y1: number, x2: number, y2:number, cellIndex:number, result, seenUids, intersectionTest: Function) {\n        const cell = this.cells[cellIndex];\n        if (cell !== null) {\n            const keys = this.keys;\n            const bboxes = this.bboxes;\n            for (let u = 0; u < cell.length; u++) {\n                const uid = cell[u];\n                if (seenUids[uid] === undefined) {\n                    const offset = uid * 4;\n                    if (intersectionTest ?\n                        intersectionTest(bboxes[offset + 0], bboxes[offset + 1], bboxes[offset + 2], bboxes[offset + 3]) :\n                        ((x1 <= bboxes[offset + 2]) &&\n                        (y1 <= bboxes[offset + 3]) &&\n                        (x2 >= bboxes[offset + 0]) &&\n                        (y2 >= bboxes[offset + 1]))) {\n                        seenUids[uid] = true;\n                        result.push(keys[uid]);\n                    } else {\n                        seenUids[uid] = false;\n                    }\n                }\n            }\n        }\n    }\n\n    _forEachCell(x1: number, y1: number, x2:number, y2:number, fn: Function, arg1, arg2, intersectionTest) {\n        const cx1 = this._convertToCellCoord(x1);\n        const cy1 = this._convertToCellCoord(y1);\n        const cx2 = this._convertToCellCoord(x2);\n        const cy2 = this._convertToCellCoord(y2);\n        for (let x = cx1; x <= cx2; x++) {\n            for (let y = cy1; y <= cy2; y++) {\n                const cellIndex = this.d * y + x;\n                if (intersectionTest && !intersectionTest(\n                    this._convertFromCellCoord(x),\n                    this._convertFromCellCoord(y),\n                    this._convertFromCellCoord(x + 1),\n                    this._convertFromCellCoord(y + 1))) continue;\n                if (fn.call(this, x1, y1, x2, y2, cellIndex, arg1, arg2, intersectionTest)) return;\n            }\n        }\n    }\n\n    _convertFromCellCoord (x) {\n        return (x - this.padding) / this.scale;\n    }\n\n    _convertToCellCoord(x) {\n        return Math.max(0, Math.min(this.d - 1, Math.floor(x * this.scale) + this.padding));\n    }\n\n    toArrayBuffer(): ArrayBuffer {\n        if (this.arrayBuffer) return this.arrayBuffer;\n\n        const cells = this.cells;\n\n        const metadataLength = NUM_PARAMS + this.cells.length + 1 + 1;\n        let totalCellLength = 0;\n        for (let i = 0; i < this.cells.length; i++) {\n            totalCellLength += this.cells[i].length;\n        }\n\n        const array = new Int32Array(metadataLength + totalCellLength + this.keys.length + this.bboxes.length);\n        array[0] = this.extent;\n        array[1] = this.n;\n        array[2] = this.padding;\n\n        let offset = metadataLength;\n        for (let k = 0; k < cells.length; k++) {\n            const cell = cells[k];\n            array[NUM_PARAMS + k] = offset;\n            array.set(cell, offset);\n            offset += cell.length;\n        }\n\n        array[NUM_PARAMS + cells.length] = offset;\n        array.set(this.keys, offset);\n        offset += this.keys.length;\n\n        array[NUM_PARAMS + cells.length + 1] = offset;\n        array.set(this.bboxes, offset);\n        offset += this.bboxes.length;\n\n        return array.buffer;\n    }\n\n    public static serialize(grid: TransferableGridIndex, transferables?: Array<Transferable>): SerializedGrid {\n        const buffer = grid.toArrayBuffer();\n        if (transferables) {\n            transferables.push(buffer);\n        }\n        return {buffer};\n    }\n\n    public static deserialize(serialized: SerializedGrid): TransferableGridIndex {\n        return new TransferableGridIndex(serialized.buffer);\n    }\n}\n", "import {TransferableGridIndex} from './transferable_grid_index';\nimport {Color, CompoundExpression, expressions, ResolvedImage, StylePropertyFunction,\n    StyleExpression, ZoomDependentExpression, ZoomConstantExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {AJAXError} from './ajax';\nimport {isImageBitmap} from './util';\n\n/**\n * A class that is serialized to and json, that can be constructed back to the original class in the worker or in the main thread\n */\ntype SerializedObject<S extends Serialized = any> = {\n    [_: string]: S;\n};\n\n/**\n * All the possible values that can be serialized and sent to and from the worker\n */\nexport type Serialized = null | void | boolean | number | string | Boolean | Number | String | Date | RegExp | ArrayBuffer | ArrayBufferView | ImageData | ImageBitmap | Blob | Array<Serialized> | SerializedObject;\n\ntype Registry = {\n    [_: string]: {\n        klass: {\n            new (...args: any): any;\n            deserialize?: (input: Serialized) => unknown;\n            serialize?: (input: any, transferables: Transferable[]) => SerializedObject;\n        };\n        omit: ReadonlyArray<string>;\n        shallow: ReadonlyArray<string>;\n    };\n};\n\n/**\n * Register options\n */\ntype RegisterOptions<T> = {\n    /**\n     * List of properties to omit from serialization (e.g., cached/computed properties)\n     */\n    omit?: ReadonlyArray<keyof T>;\n    /**\n     * List of properties that should be serialized by a simple shallow copy, rather than by a recursive call to serialize().\n     */\n    shallow?: ReadonlyArray<keyof T>;\n};\n\nconst registry: Registry = {};\n\n/**\n * Register the given class as serializable.\n *\n * @param options - the registration options\n */\nexport function register<T extends any>(\n    name: string,\n    klass: {\n        new (...args: any): T;\n    },\n    options: RegisterOptions<T> = {}\n) {\n    if (registry[name]) throw new Error(`${name} is already registered.`);\n    ((Object.defineProperty as any))(klass, '_classRegistryKey', {\n        value: name,\n        writeable: false\n    });\n    registry[name] = {\n        klass,\n        omit: options.omit as ReadonlyArray<string> || [],\n        shallow: options.shallow as ReadonlyArray<string> || []\n    };\n}\n\nregister('Object', Object);\nregister('TransferableGridIndex', TransferableGridIndex);\n\nregister('Color', Color);\nregister('Error', Error);\nregister('AJAXError', AJAXError);\nregister('ResolvedImage', ResolvedImage);\n\nregister('StylePropertyFunction', StylePropertyFunction);\nregister('StyleExpression', StyleExpression, {omit: ['_evaluator']});\n\nregister('ZoomDependentExpression', ZoomDependentExpression);\nregister('ZoomConstantExpression', ZoomConstantExpression);\nregister('CompoundExpression', CompoundExpression, {omit: ['_evaluate']});\nfor (const name in expressions) {\n    if ((expressions[name] as any)._classRegistryKey) continue;\n    register(`Expression_${name}`, expressions[name]);\n}\n\nfunction isArrayBuffer(value: any): value is ArrayBuffer {\n    return value && typeof ArrayBuffer !== 'undefined' &&\n           (value instanceof ArrayBuffer || (value.constructor && value.constructor.name === 'ArrayBuffer'));\n}\n\nfunction getClassRegistryKey(input: Object|SerializedObject): string {\n    const klass = (input.constructor as any);\n    return (input as SerializedObject).$name || klass._classRegistryKey;\n}\n\nfunction isRegistered(input: unknown): boolean {\n    if (input === null || typeof input !== 'object') {\n        return false;\n    }\n    const classRegistryKey = getClassRegistryKey(input);\n    if (classRegistryKey && classRegistryKey !== 'Object') {\n        return true;\n    }\n    return false;\n}\n\nfunction isSerializeHandledByBuiltin(input: unknown) {\n    return (!isRegistered(input) && (\n        input === null ||\n        input === undefined ||\n        typeof input === 'boolean' ||\n        typeof input === 'number' ||\n        typeof input === 'string' ||\n        input instanceof Boolean ||\n        input instanceof Number ||\n        input instanceof String ||\n        input instanceof Date ||\n        input instanceof RegExp ||\n        input instanceof Blob ||\n        input instanceof Error ||\n        isArrayBuffer(input) ||\n        isImageBitmap(input) ||\n        ArrayBuffer.isView(input) ||\n        input instanceof ImageData)\n    );\n}\n\n/**\n * Serialize the given object for transfer to or from a web worker.\n *\n * For non-builtin types, recursively serialize each property (possibly\n * omitting certain properties - see register()), and package the result along\n * with the constructor's `name` so that the appropriate constructor can be\n * looked up in `deserialize()`.\n *\n * If a `transferables` array is provided, add any transferable objects (i.e.,\n * any ArrayBuffers or ArrayBuffer views) to the list. (If a copy is needed,\n * this should happen in the client code, before using serialize().)\n */\nexport function serialize(input: unknown, transferables?: Array<Transferable> | null): Serialized {\n    if (isSerializeHandledByBuiltin(input)) {\n        if (isArrayBuffer(input) || isImageBitmap(input)) {\n            if (transferables) {\n                transferables.push(input);\n            }\n        }\n        if (ArrayBuffer.isView(input)) {\n            const view = input;\n            if (transferables) {\n                transferables.push(view.buffer);\n            }\n        }\n        if (input instanceof ImageData) {\n            if (transferables) {\n                transferables.push(input.data.buffer);\n            }\n        }\n        return input;\n    }\n\n    if (Array.isArray(input)) {\n        const serialized: Array<Serialized> = [];\n        for (const item of input) {\n            serialized.push(serialize(item, transferables));\n        }\n        return serialized;\n    }\n\n    if (typeof input !== 'object') {\n        throw new Error(`can't serialize object of type ${typeof input}`);\n    }\n    const classRegistryKey = getClassRegistryKey(input);\n    if (!classRegistryKey) {\n        throw new Error(`can't serialize object of unregistered class ${input.constructor.name}`);\n    }\n    if (!registry[classRegistryKey]) throw new Error(`${classRegistryKey} is not registered.`);\n    const {klass} = registry[classRegistryKey];\n    const properties: SerializedObject = klass.serialize ?\n        // (Temporary workaround) allow a class to provide static\n        // `serialize()` and `deserialize()` methods to bypass the generic\n        // approach.\n        // This temporary workaround lets us use the generic serialization\n        // approach for objects whose members include instances of dynamic\n        // StructArray types. Once we refactor StructArray to be static,\n        // we can remove this complexity.\n        (klass.serialize(input, transferables) as SerializedObject) : {};\n\n    if (!klass.serialize) {\n        for (const key in input) {\n            if (!input.hasOwnProperty(key)) continue; // eslint-disable-line no-prototype-builtins\n            if (registry[classRegistryKey].omit.indexOf(key) >= 0) continue;\n            const property = input[key];\n            properties[key] = registry[classRegistryKey].shallow.indexOf(key) >= 0 ?\n                property :\n                serialize(property, transferables);\n        }\n        if (input instanceof Error) {\n            properties.message = input.message;\n        }\n    } else {\n        if (transferables && properties === transferables[transferables.length - 1]) {\n            throw new Error('statically serialized object won\\'t survive transfer of $name property');\n        }\n    }\n\n    if (properties.$name) {\n        throw new Error('$name property is reserved for worker serialization logic.');\n    }\n    if (classRegistryKey !== 'Object') {\n        properties.$name = classRegistryKey;\n    }\n\n    return properties;\n}\n\nexport function deserialize(input: Serialized): unknown {\n    if (isSerializeHandledByBuiltin(input)) {\n        return input;\n    }\n\n    if (Array.isArray(input)) {\n        return input.map(deserialize);\n    }\n\n    if (typeof input !== 'object') {\n        throw new Error(`can't deserialize object of type ${typeof input}`);\n    }\n    const classRegistryKey = getClassRegistryKey(input) || 'Object';\n    if (!registry[classRegistryKey]) {\n        throw new Error(`can't deserialize unregistered class ${classRegistryKey}`);\n    }\n    const {klass} = registry[classRegistryKey];\n    if (!klass) {\n        throw new Error(`can't deserialize unregistered class ${classRegistryKey}`);\n    }\n\n    if (klass.deserialize) {\n        return klass.deserialize(input);\n    }\n\n    const result = Object.create(klass.prototype);\n\n    for (const key of Object.keys(input)) {\n        if (key === '$name') continue;\n        const value = (input as SerializedObject)[key];\n        result[key] = registry[classRegistryKey].shallow.indexOf(key) >= 0 ? value : deserialize(value);\n    }\n\n    return result;\n}\n", "export class ZoomHistory {\n    lastZoom: number;\n    lastFloorZoom: number;\n    lastIntegerZoom: number;\n    lastIntegerZoomTime: number;\n    first: boolean;\n\n    constructor() {\n        this.first = true;\n    }\n\n    update(z: number, now: number) {\n        const floorZ = Math.floor(z);\n\n        if (this.first) {\n            this.first = false;\n            this.lastIntegerZoom = floorZ;\n            this.lastIntegerZoomTime = 0;\n            this.lastZoom = z;\n            this.lastFloorZoom = floorZ;\n            return true;\n        }\n\n        if (this.lastFloorZoom > floorZ) {\n            this.lastIntegerZoom = floorZ + 1;\n            this.lastIntegerZoomTime = now;\n        } else if (this.lastFloorZoom < floorZ) {\n            this.lastIntegerZoom = floorZ;\n            this.lastIntegerZoomTime = now;\n        }\n\n        if (z !== this.lastZoom) {\n            this.lastZoom = z;\n            this.lastFloorZoom = floorZ;\n            return true;\n        }\n\n        return false;\n    }\n}\n", "// The following table comes from <https://www.unicode.org/Public/16.0.0/ucd/Blocks.txt>.\n// Keep it synchronized with <https://www.unicode.org/Public/UCD/latest/ucd/Blocks.txt>.\n\ntype UnicodeBlockLookup = {[key: string]: (char: number) => boolean};\n\nexport const unicodeBlockLookup: UnicodeBlockLookup = {\n    // 'Basic Latin': (char) => char >= 0x0000 && char <= 0x007F,\n    'Latin-1 Supplement': (char) => char >= 0x0080 && char <= 0x00FF,\n    // 'Latin Extended-A': (char) => char >= 0x0100 && char <= 0x017F,\n    // 'Latin Extended-B': (char) => char >= 0x0180 && char <= 0x024F,\n    // 'IPA Extensions': (char) => char >= 0x0250 && char <= 0x02AF,\n    // 'Spacing Modifier Letters': (char) => char >= 0x02B0 && char <= 0x02FF,\n    // 'Combining Diacritical Marks': (char) => char >= 0x0300 && char <= 0x036F,\n    // 'Greek and Coptic': (char) => char >= 0x0370 && char <= 0x03FF,\n    // 'Cyrillic': (char) => char >= 0x0400 && char <= 0x04FF,\n    // 'Cyrillic Supplement': (char) => char >= 0x0500 && char <= 0x052F,\n    // 'Armenian': (char) => char >= 0x0530 && char <= 0x058F,\n    //'Hebrew': (char) => char >= 0x0590 && char <= 0x05FF,\n    // 'Arabic': (char) => char >= 0x0600 && char <= 0x06FF,\n    //'Syriac': (char) => char >= 0x0700 && char <= 0x074F,\n    // 'Arabic Supplement': (char) => char >= 0x0750 && char <= 0x077F,\n    // 'Thaana': (char) => char >= 0x0780 && char <= 0x07BF,\n    // 'NKo': (char) => char >= 0x07C0 && char <= 0x07FF,\n    // 'Samaritan': (char) => char >= 0x0800 && char <= 0x083F,\n    // 'Mandaic': (char) => char >= 0x0840 && char <= 0x085F,\n    // 'Syriac Supplement': (char) => char >= 0x0860 && char <= 0x086F,\n    // 'Arabic Extended-B': (char) => char >= 0x0870 && char <= 0x089F,\n    // 'Arabic Extended-A': (char) => char >= 0x08A0 && char <= 0x08FF,\n    // 'Devanagari': (char) => char >= 0x0900 && char <= 0x097F,\n    // 'Bengali': (char) => char >= 0x0980 && char <= 0x09FF,\n    // 'Gurmukhi': (char) => char >= 0x0A00 && char <= 0x0A7F,\n    // 'Gujarati': (char) => char >= 0x0A80 && char <= 0x0AFF,\n    // 'Oriya': (char) => char >= 0x0B00 && char <= 0x0B7F,\n    // 'Tamil': (char) => char >= 0x0B80 && char <= 0x0BFF,\n    // 'Telugu': (char) => char >= 0x0C00 && char <= 0x0C7F,\n    // 'Kannada': (char) => char >= 0x0C80 && char <= 0x0CFF,\n    // 'Malayalam': (char) => char >= 0x0D00 && char <= 0x0D7F,\n    // 'Sinhala': (char) => char >= 0x0D80 && char <= 0x0DFF,\n    // 'Thai': (char) => char >= 0x0E00 && char <= 0x0E7F,\n    // 'Lao': (char) => char >= 0x0E80 && char <= 0x0EFF,\n    // 'Tibetan': (char) => char >= 0x0F00 && char <= 0x0FFF,\n    // 'Myanmar': (char) => char >= 0x1000 && char <= 0x109F,\n    // 'Georgian': (char) => char >= 0x10A0 && char <= 0x10FF,\n    'Hangul Jamo': (char) => char >= 0x1100 && char <= 0x11FF,\n    // 'Ethiopic': (char) => char >= 0x1200 && char <= 0x137F,\n    // 'Ethiopic Supplement': (char) => char >= 0x1380 && char <= 0x139F,\n    // 'Cherokee': (char) => char >= 0x13A0 && char <= 0x13FF,\n    // 'Unified Canadian Aboriginal Syllabics': (char) => char >= 0x1400 && char <= 0x167F,\n    // 'Ogham': (char) => char >= 0x1680 && char <= 0x169F,\n    // 'Runic': (char) => char >= 0x16A0 && char <= 0x16FF,\n    // 'Tagalog': (char) => char >= 0x1700 && char <= 0x171F,\n    // 'Hanunoo': (char) => char >= 0x1720 && char <= 0x173F,\n    // 'Buhid': (char) => char >= 0x1740 && char <= 0x175F,\n    // 'Tagbanwa': (char) => char >= 0x1760 && char <= 0x177F,\n    'Khmer': (char) => char >= 0x1780 && char <= 0x17FF,\n    // 'Mongolian': (char) => char >= 0x1800 && char <= 0x18AF,\n    // 'Unified Canadian Aboriginal Syllabics Extended': (char) => char >= 0x18B0 && char <= 0x18FF,\n    // 'Limbu': (char) => char >= 0x1900 && char <= 0x194F,\n    // 'Tai Le': (char) => char >= 0x1950 && char <= 0x197F,\n    // 'New Tai Lue': (char) => char >= 0x1980 && char <= 0x19DF,\n    // 'Khmer Symbols': (char) => char >= 0x19E0 && char <= 0x19FF,\n    // 'Buginese': (char) => char >= 0x1A00 && char <= 0x1A1F,\n    // 'Tai Tham': (char) => char >= 0x1A20 && char <= 0x1AAF,\n    // 'Combining Diacritical Marks Extended': (char) => char >= 0x1AB0 && char <= 0x1AFF,\n    // 'Balinese': (char) => char >= 0x1B00 && char <= 0x1B7F,\n    // 'Sundanese': (char) => char >= 0x1B80 && char <= 0x1BBF,\n    // 'Batak': (char) => char >= 0x1BC0 && char <= 0x1BFF,\n    // 'Lepcha': (char) => char >= 0x1C00 && char <= 0x1C4F,\n    // 'Ol Chiki': (char) => char >= 0x1C50 && char <= 0x1C7F,\n    // 'Cyrillic Extended-C': (char) => char >= 0x1C80 && char <= 0x1C8F,\n    // 'Georgian Extended': (char) => char >= 0x1C90 && char <= 0x1CBF,\n    // 'Sundanese Supplement': (char) => char >= 0x1CC0 && char <= 0x1CCF,\n    // 'Vedic Extensions': (char) => char >= 0x1CD0 && char <= 0x1CFF,\n    // 'Phonetic Extensions': (char) => char >= 0x1D00 && char <= 0x1D7F,\n    // 'Phonetic Extensions Supplement': (char) => char >= 0x1D80 && char <= 0x1DBF,\n    // 'Combining Diacritical Marks Supplement': (char) => char >= 0x1DC0 && char <= 0x1DFF,\n    // 'Latin Extended Additional': (char) => char >= 0x1E00 && char <= 0x1EFF,\n    // 'Greek Extended': (char) => char >= 0x1F00 && char <= 0x1FFF,\n    'General Punctuation': (char) => char >= 0x2000 && char <= 0x206F,\n    // 'Superscripts and Subscripts': (char) => char >= 0x2070 && char <= 0x209F,\n    // 'Currency Symbols': (char) => char >= 0x20A0 && char <= 0x20CF,\n    // 'Combining Diacritical Marks for Symbols': (char) => char >= 0x20D0 && char <= 0x20FF,\n    'Letterlike Symbols': (char) => char >= 0x2100 && char <= 0x214F,\n    'Number Forms': (char) => char >= 0x2150 && char <= 0x218F,\n    // 'Arrows': (char) => char >= 0x2190 && char <= 0x21FF,\n    // 'Mathematical Operators': (char) => char >= 0x2200 && char <= 0x22FF,\n    'Miscellaneous Technical': (char) => char >= 0x2300 && char <= 0x23FF,\n    'Control Pictures': (char) => char >= 0x2400 && char <= 0x243F,\n    'Optical Character Recognition': (char) => char >= 0x2440 && char <= 0x245F,\n    'Enclosed Alphanumerics': (char) => char >= 0x2460 && char <= 0x24FF,\n    // 'Box Drawing': (char) => char >= 0x2500 && char <= 0x257F,\n    // 'Block Elements': (char) => char >= 0x2580 && char <= 0x259F,\n    'Geometric Shapes': (char) => char >= 0x25A0 && char <= 0x25FF,\n    'Miscellaneous Symbols': (char) => char >= 0x2600 && char <= 0x26FF,\n    // 'Dingbats': (char) => char >= 0x2700 && char <= 0x27BF,\n    // 'Miscellaneous Mathematical Symbols-A': (char) => char >= 0x27C0 && char <= 0x27EF,\n    // 'Supplemental Arrows-A': (char) => char >= 0x27F0 && char <= 0x27FF,\n    // 'Braille Patterns': (char) => char >= 0x2800 && char <= 0x28FF,\n    // 'Supplemental Arrows-B': (char) => char >= 0x2900 && char <= 0x297F,\n    // 'Miscellaneous Mathematical Symbols-B': (char) => char >= 0x2980 && char <= 0x29FF,\n    // 'Supplemental Mathematical Operators': (char) => char >= 0x2A00 && char <= 0x2AFF,\n    'Miscellaneous Symbols and Arrows': (char) => char >= 0x2B00 && char <= 0x2BFF,\n    // 'Glagolitic': (char) => char >= 0x2C00 && char <= 0x2C5F,\n    // 'Latin Extended-C': (char) => char >= 0x2C60 && char <= 0x2C7F,\n    // 'Coptic': (char) => char >= 0x2C80 && char <= 0x2CFF,\n    // 'Georgian Supplement': (char) => char >= 0x2D00 && char <= 0x2D2F,\n    // 'Tifinagh': (char) => char >= 0x2D30 && char <= 0x2D7F,\n    // 'Ethiopic Extended': (char) => char >= 0x2D80 && char <= 0x2DDF,\n    // 'Cyrillic Extended-A': (char) => char >= 0x2DE0 && char <= 0x2DFF,\n    // 'Supplemental Punctuation': (char) => char >= 0x2E00 && char <= 0x2E7F,\n    // 'CJK Radicals Supplement': (char) => char >= 0x2E80 && char <= 0x2EFF,\n    // 'Kangxi Radicals': (char) => char >= 0x2F00 && char <= 0x2FDF,\n    'Ideographic Description Characters': (char) => char >= 0x2FF0 && char <= 0x2FFF,\n    'CJK Symbols and Punctuation': (char) => char >= 0x3000 && char <= 0x303F,\n    // 'Hiragana': (char) => char >= 0x3040 && char <= 0x309F,\n    'Katakana': (char) => char >= 0x30A0 && char <= 0x30FF,\n    // 'Bopomofo': (char) => char >= 0x3100 && char <= 0x312F,\n    // 'Hangul Compatibility Jamo': (char) => char >= 0x3130 && char <= 0x318F,\n    'Kanbun': (char) => char >= 0x3190 && char <= 0x319F,\n    // 'Bopomofo Extended': (char) => char >= 0x31A0 && char <= 0x31BF,\n    'CJK Strokes': (char) => char >= 0x31C0 && char <= 0x31EF,\n    // 'Katakana Phonetic Extensions': (char) => char >= 0x31F0 && char <= 0x31FF,\n    'Enclosed CJK Letters and Months': (char) => char >= 0x3200 && char <= 0x32FF,\n    'CJK Compatibility': (char) => char >= 0x3300 && char <= 0x33FF,\n    // 'CJK Unified Ideographs Extension A': (char) => char >= 0x3400 && char <= 0x4DBF,\n    'Yijing Hexagram Symbols': (char) => char >= 0x4DC0 && char <= 0x4DFF,\n    // 'CJK Unified Ideographs': (char) => char >= 0x4E00 && char <= 0x9FFF,\n    // 'Yi Syllables': (char) => char >= 0xA000 && char <= 0xA48F,\n    // 'Yi Radicals': (char) => char >= 0xA490 && char <= 0xA4CF,\n    // 'Lisu': (char) => char >= 0xA4D0 && char <= 0xA4FF,\n    // 'Vai': (char) => char >= 0xA500 && char <= 0xA63F,\n    // 'Cyrillic Extended-B': (char) => char >= 0xA640 && char <= 0xA69F,\n    // 'Bamum': (char) => char >= 0xA6A0 && char <= 0xA6FF,\n    // 'Modifier Tone Letters': (char) => char >= 0xA700 && char <= 0xA71F,\n    // 'Latin Extended-D': (char) => char >= 0xA720 && char <= 0xA7FF,\n    // 'Syloti Nagri': (char) => char >= 0xA800 && char <= 0xA82F,\n    // 'Common Indic Number Forms': (char) => char >= 0xA830 && char <= 0xA83F,\n    // 'Phags-pa': (char) => char >= 0xA840 && char <= 0xA87F,\n    // 'Saurashtra': (char) => char >= 0xA880 && char <= 0xA8DF,\n    // 'Devanagari Extended': (char) => char >= 0xA8E0 && char <= 0xA8FF,\n    // 'Kayah Li': (char) => char >= 0xA900 && char <= 0xA92F,\n    // 'Rejang': (char) => char >= 0xA930 && char <= 0xA95F,\n    // 'Hangul Jamo Extended-A': (char) => char >= 0xA960 && char <= 0xA97F,\n    // 'Javanese': (char) => char >= 0xA980 && char <= 0xA9DF,\n    // 'Myanmar Extended-B': (char) => char >= 0xA9E0 && char <= 0xA9FF,\n    // 'Cham': (char) => char >= 0xAA00 && char <= 0xAA5F,\n    // 'Myanmar Extended-A': (char) => char >= 0xAA60 && char <= 0xAA7F,\n    // 'Tai Viet': (char) => char >= 0xAA80 && char <= 0xAADF,\n    // 'Meetei Mayek Extensions': (char) => char >= 0xAAE0 && char <= 0xAAFF,\n    // 'Ethiopic Extended-A': (char) => char >= 0xAB00 && char <= 0xAB2F,\n    // 'Latin Extended-E': (char) => char >= 0xAB30 && char <= 0xAB6F,\n    // 'Cherokee Supplement': (char) => char >= 0xAB70 && char <= 0xABBF,\n    // 'Meetei Mayek': (char) => char >= 0xABC0 && char <= 0xABFF,\n    // 'Hangul Syllables': (char) => char >= 0xAC00 && char <= 0xD7AF,\n    // 'Hangul Jamo Extended-B': (char) => char >= 0xD7B0 && char <= 0xD7FF,\n    // 'High Surrogates': (char) => char >= 0xD800 && char <= 0xDB7F,\n    // 'High Private Use Surrogates': (char) => char >= 0xDB80 && char <= 0xDBFF,\n    // 'Low Surrogates': (char) => char >= 0xDC00 && char <= 0xDFFF,\n    'Private Use Area': (char) => char >= 0xE000 && char <= 0xF8FF,\n    // 'CJK Compatibility Ideographs': (char) => char >= 0xF900 && char <= 0xFAFF,\n    // 'Alphabetic Presentation Forms': (char) => char >= 0xFB00 && char <= 0xFB4F,\n    // 'Arabic Presentation Forms-A': (char) => char >= 0xFB50 && char <= 0xFDFF,\n    // 'Variation Selectors': (char) => char >= 0xFE00 && char <= 0xFE0F,\n    'Vertical Forms': (char) => char >= 0xFE10 && char <= 0xFE1F,\n    // 'Combining Half Marks': (char) => char >= 0xFE20 && char <= 0xFE2F,\n    'CJK Compatibility Forms': (char) => char >= 0xFE30 && char <= 0xFE4F,\n    'Small Form Variants': (char) => char >= 0xFE50 && char <= 0xFE6F,\n    // 'Arabic Presentation Forms-B': (char) => char >= 0xFE70 && char <= 0xFEFF,\n    'Halfwidth and Fullwidth Forms': (char) => char >= 0xFF00 && char <= 0xFFEF\n    // 'Specials': (char) => char >= 0xFFF0 && char <= 0xFFFF,\n    // 'Linear B Syllabary': (char) => char >= 0x10000 && char <= 0x1007F,\n    // 'Linear B Ideograms': (char) => char >= 0x10080 && char <= 0x100FF,\n    // 'Aegean Numbers': (char) => char >= 0x10100 && char <= 0x1013F,\n    // 'Ancient Greek Numbers': (char) => char >= 0x10140 && char <= 0x1018F,\n    // 'Ancient Symbols': (char) => char >= 0x10190 && char <= 0x101CF,\n    // 'Phaistos Disc': (char) => char >= 0x101D0 && char <= 0x101FF,\n    // 'Lycian': (char) => char >= 0x10280 && char <= 0x1029F,\n    // 'Carian': (char) => char >= 0x102A0 && char <= 0x102DF,\n    // 'Coptic Epact Numbers': (char) => char >= 0x102E0 && char <= 0x102FF,\n    // 'Old Italic': (char) => char >= 0x10300 && char <= 0x1032F,\n    // 'Gothic': (char) => char >= 0x10330 && char <= 0x1034F,\n    // 'Old Permic': (char) => char >= 0x10350 && char <= 0x1037F,\n    // 'Ugaritic': (char) => char >= 0x10380 && char <= 0x1039F,\n    // 'Old Persian': (char) => char >= 0x103A0 && char <= 0x103DF,\n    // 'Deseret': (char) => char >= 0x10400 && char <= 0x1044F,\n    // 'Shavian': (char) => char >= 0x10450 && char <= 0x1047F,\n    // 'Osmanya': (char) => char >= 0x10480 && char <= 0x104AF,\n    // 'Osage': (char) => char >= 0x104B0 && char <= 0x104FF,\n    // 'Elbasan': (char) => char >= 0x10500 && char <= 0x1052F,\n    // 'Caucasian Albanian': (char) => char >= 0x10530 && char <= 0x1056F,\n    // 'Vithkuqi': (char) => char >= 0x10570 && char <= 0x105BF,\n    // 'Todhri': (char) => char >= 0x105C0 && char <= 0x105FF,\n    // 'Linear A': (char) => char >= 0x10600 && char <= 0x1077F,\n    // 'Latin Extended-F': (char) => char >= 0x10780 && char <= 0x107BF,\n    // 'Cypriot Syllabary': (char) => char >= 0x10800 && char <= 0x1083F,\n    // 'Imperial Aramaic': (char) => char >= 0x10840 && char <= 0x1085F,\n    // 'Palmyrene': (char) => char >= 0x10860 && char <= 0x1087F,\n    // 'Nabataean': (char) => char >= 0x10880 && char <= 0x108AF,\n    // 'Hatran': (char) => char >= 0x108E0 && char <= 0x108FF,\n    // 'Phoenician': (char) => char >= 0x10900 && char <= 0x1091F,\n    // 'Lydian': (char) => char >= 0x10920 && char <= 0x1093F,\n    // 'Meroitic Hieroglyphs': (char) => char >= 0x10980 && char <= 0x1099F,\n    // 'Meroitic Cursive': (char) => char >= 0x109A0 && char <= 0x109FF,\n    // 'Kharoshthi': (char) => char >= 0x10A00 && char <= 0x10A5F,\n    // 'Old South Arabian': (char) => char >= 0x10A60 && char <= 0x10A7F,\n    // 'Old North Arabian': (char) => char >= 0x10A80 && char <= 0x10A9F,\n    // 'Manichaean': (char) => char >= 0x10AC0 && char <= 0x10AFF,\n    // 'Avestan': (char) => char >= 0x10B00 && char <= 0x10B3F,\n    // 'Inscriptional Parthian': (char) => char >= 0x10B40 && char <= 0x10B5F,\n    // 'Inscriptional Pahlavi': (char) => char >= 0x10B60 && char <= 0x10B7F,\n    // 'Psalter Pahlavi': (char) => char >= 0x10B80 && char <= 0x10BAF,\n    // 'Old Turkic': (char) => char >= 0x10C00 && char <= 0x10C4F,\n    // 'Old Hungarian': (char) => char >= 0x10C80 && char <= 0x10CFF,\n    // 'Hanifi Rohingya': (char) => char >= 0x10D00 && char <= 0x10D3F,\n    // 'Garay': (char) => char >= 0x10D40 && char <= 0x10D8F,\n    // 'Rumi Numeral Symbols': (char) => char >= 0x10E60 && char <= 0x10E7F,\n    // 'Yezidi': (char) => char >= 0x10E80 && char <= 0x10EBF,\n    // 'Arabic Extended-C': (char) => char >= 0x10EC0 && char <= 0x10EFF,\n    // 'Old Sogdian': (char) => char >= 0x10F00 && char <= 0x10F2F,\n    // 'Sogdian': (char) => char >= 0x10F30 && char <= 0x10F6F,\n    // 'Old Uyghur': (char) => char >= 0x10F70 && char <= 0x10FAF,\n    // 'Chorasmian': (char) => char >= 0x10FB0 && char <= 0x10FDF,\n    // 'Elymaic': (char) => char >= 0x10FE0 && char <= 0x10FFF,\n    // 'Brahmi': (char) => char >= 0x11000 && char <= 0x1107F,\n    // 'Kaithi': (char) => char >= 0x11080 && char <= 0x110CF,\n    // 'Sora Sompeng': (char) => char >= 0x110D0 && char <= 0x110FF,\n    // 'Chakma': (char) => char >= 0x11100 && char <= 0x1114F,\n    // 'Mahajani': (char) => char >= 0x11150 && char <= 0x1117F,\n    // 'Sharada': (char) => char >= 0x11180 && char <= 0x111DF,\n    // 'Sinhala Archaic Numbers': (char) => char >= 0x111E0 && char <= 0x111FF,\n    // 'Khojki': (char) => char >= 0x11200 && char <= 0x1124F,\n    // 'Multani': (char) => char >= 0x11280 && char <= 0x112AF,\n    // 'Khudawadi': (char) => char >= 0x112B0 && char <= 0x112FF,\n    // 'Grantha': (char) => char >= 0x11300 && char <= 0x1137F,\n    // 'Tulu-Tigalari': (char) => char >= 0x11380 && char <= 0x113FF,\n    // 'Newa': (char) => char >= 0x11400 && char <= 0x1147F,\n    // 'Tirhuta': (char) => char >= 0x11480 && char <= 0x114DF,\n    // 'Siddham': (char) => char >= 0x11580 && char <= 0x115FF,\n    // 'Modi': (char) => char >= 0x11600 && char <= 0x1165F,\n    // 'Mongolian Supplement': (char) => char >= 0x11660 && char <= 0x1167F,\n    // 'Takri': (char) => char >= 0x11680 && char <= 0x116CF,\n    // 'Myanmar Extended-C': (char) => char >= 0x116D0 && char <= 0x116FF,\n    // 'Ahom': (char) => char >= 0x11700 && char <= 0x1174F,\n    // 'Dogra': (char) => char >= 0x11800 && char <= 0x1184F,\n    // 'Warang Citi': (char) => char >= 0x118A0 && char <= 0x118FF,\n    // 'Dives Akuru': (char) => char >= 0x11900 && char <= 0x1195F,\n    // 'Nandinagari': (char) => char >= 0x119A0 && char <= 0x119FF,\n    // 'Zanabazar Square': (char) => char >= 0x11A00 && char <= 0x11A4F,\n    // 'Soyombo': (char) => char >= 0x11A50 && char <= 0x11AAF,\n    // 'Unified Canadian Aboriginal Syllabics Extended-A': (char) => char >= 0x11AB0 && char <= 0x11ABF,\n    // 'Pau Cin Hau': (char) => char >= 0x11AC0 && char <= 0x11AFF,\n    // 'Devanagari Extended-A': (char) => char >= 0x11B00 && char <= 0x11B5F,\n    // 'Sunuwar': (char) => char >= 0x11BC0 && char <= 0x11BFF,\n    // 'Bhaiksuki': (char) => char >= 0x11C00 && char <= 0x11C6F,\n    // 'Marchen': (char) => char >= 0x11C70 && char <= 0x11CBF,\n    // 'Masaram Gondi': (char) => char >= 0x11D00 && char <= 0x11D5F,\n    // 'Gunjala Gondi': (char) => char >= 0x11D60 && char <= 0x11DAF,\n    // 'Makasar': (char) => char >= 0x11EE0 && char <= 0x11EFF,\n    // 'Kawi': (char) => char >= 0x11F00 && char <= 0x11F5F,\n    // 'Lisu Supplement': (char) => char >= 0x11FB0 && char <= 0x11FBF,\n    // 'Tamil Supplement': (char) => char >= 0x11FC0 && char <= 0x11FFF,\n    // 'Cuneiform': (char) => char >= 0x12000 && char <= 0x123FF,\n    // 'Cuneiform Numbers and Punctuation': (char) => char >= 0x12400 && char <= 0x1247F,\n    // 'Early Dynastic Cuneiform': (char) => char >= 0x12480 && char <= 0x1254F,\n    // 'Cypro-Minoan': (char) => char >= 0x12F90 && char <= 0x12FFF,\n    // 'Egyptian Hieroglyphs': (char) => char >= 0x13000 && char <= 0x1342F,\n    // 'Egyptian Hieroglyph Format Controls': (char) => char >= 0x13430 && char <= 0x1345F,\n    // 'Egyptian Hieroglyphs Extended-A': (char) => char >= 0x13460 && char <= 0x143FF,\n    // 'Anatolian Hieroglyphs': (char) => char >= 0x14400 && char <= 0x1467F,\n    // 'Gurung Khema': (char) => char >= 0x16100 && char <= 0x1613F,\n    // 'Bamum Supplement': (char) => char >= 0x16800 && char <= 0x16A3F,\n    // 'Mro': (char) => char >= 0x16A40 && char <= 0x16A6F,\n    // 'Tangsa': (char) => char >= 0x16A70 && char <= 0x16ACF,\n    // 'Bassa Vah': (char) => char >= 0x16AD0 && char <= 0x16AFF,\n    // 'Pahawh Hmong': (char) => char >= 0x16B00 && char <= 0x16B8F,\n    // 'Kirat Rai': (char) => char >= 0x16D40 && char <= 0x16D7F,\n    // 'Medefaidrin': (char) => char >= 0x16E40 && char <= 0x16E9F,\n    // 'Miao': (char) => char >= 0x16F00 && char <= 0x16F9F,\n    // 'Ideographic Symbols and Punctuation': (char) => char >= 0x16FE0 && char <= 0x16FFF,\n    // 'Tangut': (char) => char >= 0x17000 && char <= 0x187FF,\n    // 'Tangut Components': (char) => char >= 0x18800 && char <= 0x18AFF,\n    // 'Khitan Small Script': (char) => char >= 0x18B00 && char <= 0x18CFF,\n    // 'Tangut Supplement': (char) => char >= 0x18D00 && char <= 0x18D7F,\n    // 'Kana Extended-B': (char) => char >= 0x1AFF0 && char <= 0x1AFFF,\n    // 'Kana Supplement': (char) => char >= 0x1B000 && char <= 0x1B0FF,\n    // 'Kana Extended-A': (char) => char >= 0x1B100 && char <= 0x1B12F,\n    // 'Small Kana Extension': (char) => char >= 0x1B130 && char <= 0x1B16F,\n    // 'Nushu': (char) => char >= 0x1B170 && char <= 0x1B2FF,\n    // 'Duployan': (char) => char >= 0x1BC00 && char <= 0x1BC9F,\n    // 'Shorthand Format Controls': (char) => char >= 0x1BCA0 && char <= 0x1BCAF,\n    // 'Symbols for Legacy Computing Supplement': (char) => char >= 0x1CC00 && char <= 0x1CEBF,\n    // 'Znamenny Musical Notation': (char) => char >= 0x1CF00 && char <= 0x1CFCF,\n    // 'Byzantine Musical Symbols': (char) => char >= 0x1D000 && char <= 0x1D0FF,\n    // 'Musical Symbols': (char) => char >= 0x1D100 && char <= 0x1D1FF,\n    // 'Ancient Greek Musical Notation': (char) => char >= 0x1D200 && char <= 0x1D24F,\n    // 'Kaktovik Numerals': (char) => char >= 0x1D2C0 && char <= 0x1D2DF,\n    // 'Mayan Numerals': (char) => char >= 0x1D2E0 && char <= 0x1D2FF,\n    // 'Tai Xuan Jing Symbols': (char) => char >= 0x1D300 && char <= 0x1D35F,\n    // 'Counting Rod Numerals': (char) => char >= 0x1D360 && char <= 0x1D37F,\n    // 'Mathematical Alphanumeric Symbols': (char) => char >= 0x1D400 && char <= 0x1D7FF,\n    // 'Sutton SignWriting': (char) => char >= 0x1D800 && char <= 0x1DAAF,\n    // 'Latin Extended-G': (char) => char >= 0x1DF00 && char <= 0x1DFFF,\n    // 'Glagolitic Supplement': (char) => char >= 0x1E000 && char <= 0x1E02F,\n    // 'Cyrillic Extended-D': (char) => char >= 0x1E030 && char <= 0x1E08F,\n    // 'Nyiakeng Puachue Hmong': (char) => char >= 0x1E100 && char <= 0x1E14F,\n    // 'Toto': (char) => char >= 0x1E290 && char <= 0x1E2BF,\n    // 'Wancho': (char) => char >= 0x1E2C0 && char <= 0x1E2FF,\n    // 'Nag Mundari': (char) => char >= 0x1E4D0 && char <= 0x1E4FF,\n    // 'Ol Onal': (char) => char >= 0x1E5D0 && char <= 0x1E5FF,\n    // 'Ethiopic Extended-B': (char) => char >= 0x1E7E0 && char <= 0x1E7FF,\n    // 'Mende Kikakui': (char) => char >= 0x1E800 && char <= 0x1E8DF,\n    // 'Adlam': (char) => char >= 0x1E900 && char <= 0x1E95F,\n    // 'Indic Siyaq Numbers': (char) => char >= 0x1EC70 && char <= 0x1ECBF,\n    // 'Ottoman Siyaq Numbers': (char) => char >= 0x1ED00 && char <= 0x1ED4F,\n    // 'Arabic Mathematical Alphabetic Symbols': (char) => char >= 0x1EE00 && char <= 0x1EEFF,\n    // 'Mahjong Tiles': (char) => char >= 0x1F000 && char <= 0x1F02F,\n    // 'Domino Tiles': (char) => char >= 0x1F030 && char <= 0x1F09F,\n    // 'Playing Cards': (char) => char >= 0x1F0A0 && char <= 0x1F0FF,\n    // 'Enclosed Alphanumeric Supplement': (char) => char >= 0x1F100 && char <= 0x1F1FF,\n    // 'Enclosed Ideographic Supplement': (char) => char >= 0x1F200 && char <= 0x1F2FF,\n    // 'Miscellaneous Symbols and Pictographs': (char) => char >= 0x1F300 && char <= 0x1F5FF,\n    // 'Emoticons': (char) => char >= 0x1F600 && char <= 0x1F64F,\n    // 'Ornamental Dingbats': (char) => char >= 0x1F650 && char <= 0x1F67F,\n    // 'Transport and Map Symbols': (char) => char >= 0x1F680 && char <= 0x1F6FF,\n    // 'Alchemical Symbols': (char) => char >= 0x1F700 && char <= 0x1F77F,\n    // 'Geometric Shapes Extended': (char) => char >= 0x1F780 && char <= 0x1F7FF,\n    // 'Supplemental Arrows-C': (char) => char >= 0x1F800 && char <= 0x1F8FF,\n    // 'Supplemental Symbols and Pictographs': (char) => char >= 0x1F900 && char <= 0x1F9FF,\n    // 'Chess Symbols': (char) => char >= 0x1FA00 && char <= 0x1FA6F,\n    // 'Symbols and Pictographs Extended-A': (char) => char >= 0x1FA70 && char <= 0x1FAFF,\n    // 'Symbols for Legacy Computing': (char) => char >= 0x1FB00 && char <= 0x1FBFF,\n    // 'CJK Unified Ideographs Extension B': (char) => char >= 0x20000 && char <= 0x2A6DF,\n    // 'CJK Unified Ideographs Extension C': (char) => char >= 0x2A700 && char <= 0x2B73F,\n    // 'CJK Unified Ideographs Extension D': (char) => char >= 0x2B740 && char <= 0x2B81F,\n    // 'CJK Unified Ideographs Extension E': (char) => char >= 0x2B820 && char <= 0x2CEAF,\n    // 'CJK Unified Ideographs Extension F': (char) => char >= 0x2CEB0 && char <= 0x2EBEF,\n    // 'CJK Unified Ideographs Extension I': (char) => char >= 0x2EBF0 && char <= 0x2EE5F,\n    // 'CJK Unified Ideographs Extension G': (char) => char >= 0x30000 && char <= 0x3134F,\n    // 'CJK Unified Ideographs Extension H': (char) => char >= 0x31350 && char <= 0x323AF,\n    // 'CJK Compatibility Ideographs Supplement': (char) => char >= 0x2F800 && char <= 0x2FA1F,\n    // 'Tags': (char) => char >= 0xE0000 && char <= 0xE007F,\n    // 'Variation Selectors Supplement': (char) => char >= 0xE0100 && char <= 0xE01EF,\n    // 'Supplementary Private Use Area-A': (char) => char >= 0xF0000 && char <= 0xFFFFF,\n    // 'Supplementary Private Use Area-B': (char) => char >= 0x100000 && char <= 0x10FFFF,\n};\n", "/* eslint-disable new-cap */\n\nimport {unicodeBlockLookup as isChar} from './is_char_in_unicode_block';\n\nexport function allowsIdeographicBreaking(chars: string) {\n    for (const char of chars) {\n        if (!charAllowsIdeographicBreaking(char.charCodeAt(0))) return false;\n    }\n    return true;\n}\n\nexport function allowsVerticalWritingMode(chars: string) {\n    for (const char of chars) {\n        if (charHasUprightVerticalOrientation(char.charCodeAt(0))) return true;\n    }\n    return false;\n}\n\nexport function allowsLetterSpacing(chars: string) {\n    for (const char of chars) {\n        if (!charAllowsLetterSpacing(char.charCodeAt(0))) return false;\n    }\n    return true;\n}\n\n/**\n * Returns a regular expression matching the given script codes, excluding any\n * code that the execution environment lacks support for in regular expressions.\n */\nfunction sanitizedRegExpFromScriptCodes(scriptCodes: Array<string>): RegExp {\n    const supportedPropertyEscapes = scriptCodes.map(code => {\n        try {\n            return new RegExp(`\\\\p{sc=${code}}`, 'u').source;\n        } catch (e) {\n            return null;\n        }\n    }).filter(pe => pe);\n    return new RegExp(supportedPropertyEscapes.join('|'), 'u');\n}\n\n/**\n * ISO 15924 script codes of scripts that disallow letter spacing as of Unicode\n * 16.0.0.\n *\n * In general, cursive scripts are incompatible with letter spacing.\n */\nconst cursiveScriptCodes = [\n    'Arab', // Arabic\n    'Dupl', // Duployan\n    'Mong', // Mongolian\n    'Ougr', // Old Uyghur\n    'Syrc', // Syriac\n];\n\nconst cursiveScriptRegExp = sanitizedRegExpFromScriptCodes(cursiveScriptCodes);\n\nexport function charAllowsLetterSpacing(char: number) {\n    return !cursiveScriptRegExp.test(String.fromCodePoint(char));\n}\n\n/**\n * ISO 15924 script codes of scripts that allow ideographic line breaking beyond\n * the CJKV scripts that are considered ideographic in Unicode 16.0.0.\n */\nconst ideographicBreakingScriptCodes = [\n    'Bopo', // Bopomofo\n    'Hani', // Han\n    'Hira', // Hiragana\n    'Kana', // Katakana\n    'Kits', // Khitan Small Script\n    'Nshu', // Nushu\n    'Tang', // Tangut\n    'Yiii', // Yi\n];\n\nconst ideographicBreakingRegExp = sanitizedRegExpFromScriptCodes(ideographicBreakingScriptCodes);\n\nexport function charAllowsIdeographicBreaking(char: number) {\n    // Return early for characters outside all ideographic ranges.\n    if (char < 0x2E80) return false;\n\n    if (isChar['CJK Compatibility Forms'](char)) return true;\n    if (isChar['CJK Compatibility'](char)) return true;\n    if (isChar['CJK Strokes'](char)) return true;\n    if (isChar['CJK Symbols and Punctuation'](char)) return true;\n    if (isChar['Enclosed CJK Letters and Months'](char)) return true;\n    if (isChar['Halfwidth and Fullwidth Forms'](char)) return true;\n    if (isChar['Ideographic Description Characters'](char)) return true;\n    if (isChar['Vertical Forms'](char)) return true;\n    return ideographicBreakingRegExp.test(String.fromCodePoint(char));\n}\n\n// The following logic comes from\n// <https://www.unicode.org/Public/16.0.0/ucd/VerticalOrientation.txt>.\n// Keep it synchronized with\n// <https://www.unicode.org/Public/UCD/latest/ucd/VerticalOrientation.txt>.\n// The data file denotes with âUâ or âTuâ any codepoint that may be drawn\n// upright in vertical text but does not distinguish between upright and\n// âneutralâ characters.\n\n// Blocks in the Unicode supplementary planes are excluded from this module due\n// to <https://github.com/mapbox/mapbox-gl/issues/29>.\n\n/**\n * Returns true if the given Unicode codepoint identifies a character with\n * upright orientation.\n *\n * A character has upright orientation if it is drawn upright (unrotated)\n * whether the line is oriented horizontally or vertically, even if both\n * adjacent characters can be rotated. For example, a Chinese character is\n * always drawn upright. An uprightly oriented character causes an adjacent\n * âneutralâ character to be drawn upright as well.\n */\nexport function charHasUprightVerticalOrientation(char: number) {\n    if (char === 0x02EA /* modifier letter yin departing tone mark */ ||\n        char === 0x02EB /* modifier letter yang departing tone mark */) {\n        return true;\n    }\n\n    // Return early for characters outside all ranges whose characters remain\n    // upright in vertical writing mode.\n    if (char < 0x1100) return false;\n\n    if (isChar['CJK Compatibility Forms'](char)) {\n        if (!((char >= 0xFE49 /* dashed overline */ && char <= 0xFE4F) /* wavy low line */)) {\n            return true;\n        }\n    }\n    if (isChar['CJK Compatibility'](char)) return true;\n    if (isChar['CJK Strokes'](char)) return true;\n    if (isChar['CJK Symbols and Punctuation'](char)) {\n        if (!((char >= 0x3008 /* left angle bracket */ && char <= 0x3011) /* right black lenticular bracket */) &&\n            !((char >= 0x3014 /* left tortoise shell bracket */ && char <= 0x301F) /* low double prime quotation mark */) &&\n            char !== 0x3030 /* wavy dash */) {\n            return true;\n        }\n    }\n    if (isChar['Enclosed CJK Letters and Months'](char)) return true;\n    if (isChar['Ideographic Description Characters'](char)) return true;\n    if (isChar['Kanbun'](char)) return true;\n    if (isChar['Katakana'](char)) {\n        if (char !== 0x30FC /* katakana-hiragana prolonged sound mark */) {\n            return true;\n        }\n    }\n    if (isChar['Halfwidth and Fullwidth Forms'](char)) {\n        if (char !== 0xFF08 /* fullwidth left parenthesis */ &&\n            char !== 0xFF09 /* fullwidth right parenthesis */ &&\n            char !== 0xFF0D /* fullwidth hyphen-minus */ &&\n            !((char >= 0xFF1A /* fullwidth colon */ && char <= 0xFF1E) /* fullwidth greater-than sign */) &&\n            char !== 0xFF3B /* fullwidth left square bracket */ &&\n            char !== 0xFF3D /* fullwidth right square bracket */ &&\n            char !== 0xFF3F /* fullwidth low line */ &&\n            !(char >= 0xFF5B /* fullwidth left curly bracket */ && char <= 0xFFDF) &&\n            char !== 0xFFE3 /* fullwidth macron */ &&\n            !(char >= 0xFFE8 /* halfwidth forms light vertical */ && char <= 0xFFEF)) {\n            return true;\n        }\n    }\n    if (isChar['Small Form Variants'](char)) {\n        if (!((char >= 0xFE58 /* small em dash */ && char <= 0xFE5E) /* small right tortoise shell bracket */) &&\n            !((char >= 0xFE63 /* small hyphen-minus */ && char <= 0xFE66) /* small equals sign */)) {\n            return true;\n        }\n    }\n    if (isChar['Vertical Forms'](char)) return true;\n    if (isChar['Yijing Hexagram Symbols'](char)) return true;\n\n    if (/* Canadian Aboriginal */ /\\p{sc=Cans}/u.test(String.fromCodePoint(char))) return true;\n    if (/* Hangul */ /\\p{sc=Hang}/u.test(String.fromCodePoint(char))) return true;\n    if (ideographicBreakingRegExp.test(String.fromCodePoint(char))) return true;\n\n    return false;\n}\n\n/**\n * Returns true if the given Unicode codepoint identifies a character with\n * neutral orientation.\n *\n * A character has neutral orientation if it may be drawn rotated or unrotated\n * when the line is oriented vertically, depending on the orientation of the\n * adjacent characters. For example, along a vertically oriented line, the vulgar\n * fraction Â½ is drawn upright among Chinese characters but rotated among Latin\n * letters. A neutrally oriented character does not influence whether an\n * adjacent character is drawn upright or rotated.\n */\nexport function charHasNeutralVerticalOrientation(char: number) {\n    if (isChar['Latin-1 Supplement'](char)) {\n        if (char === 0x00A7 /* section sign */ ||\n            char === 0x00A9 /* copyright sign */ ||\n            char === 0x00AE /* registered sign */ ||\n            char === 0x00B1 /* plus-minus sign */ ||\n            char === 0x00BC /* vulgar fraction one quarter */ ||\n            char === 0x00BD /* vulgar fraction one half */ ||\n            char === 0x00BE /* vulgar fraction three quarters */ ||\n            char === 0x00D7 /* multiplication sign */ ||\n            char === 0x00F7 /* division sign */) {\n            return true;\n        }\n    }\n    if (isChar['General Punctuation'](char)) {\n        if (char === 0x2016 /* double vertical line */ ||\n            char === 0x2020 /* dagger */ ||\n            char === 0x2021 /* double dagger */ ||\n            char === 0x2030 /* per mille sign */ ||\n            char === 0x2031 /* per ten thousand sign */ ||\n            char === 0x203B /* reference mark */ ||\n            char === 0x203C /* double exclamation mark */ ||\n            char === 0x2042 /* asterism */ ||\n            char === 0x2047 /* double question mark */ ||\n            char === 0x2048 /* question exclamation mark */ ||\n            char === 0x2049 /* exclamation question mark */ ||\n            char === 0x2051 /* two asterisks aligned vertically */) {\n            return true;\n        }\n    }\n    if (isChar['Letterlike Symbols'](char)) return true;\n    if (isChar['Number Forms'](char)) return true;\n    if (isChar['Miscellaneous Technical'](char)) {\n        if ((char >= 0x2300 /* diameter sign */ && char <= 0x2307 /* wavy line */) ||\n            (char >= 0x230C /* bottom right crop */ && char <= 0x231F /* bottom right corner */) ||\n            (char >= 0x2324 /* up arrowhead between two horizontal bars */ && char <= 0x2328 /* keyboard */) ||\n            char === 0x232B /* erase to the left */ ||\n            (char >= 0x237D /* shouldered open box */ && char <= 0x239A /* clear screen symbol */) ||\n            (char >= 0x23BE /* dentistry symbol light vertical and top right */ && char <= 0x23CD /* square foot */) ||\n            char === 0x23CF /* eject symbol */ ||\n            (char >= 0x23D1 /* metrical breve */ && char <= 0x23DB /* fuse */) ||\n            (char >= 0x23E2 /* white trapezium */ && char <= 0x23FF)) {\n            return true;\n        }\n    }\n    if (isChar['Control Pictures'](char) && char !== 0x2423 /* open box */) return true;\n    if (isChar['Optical Character Recognition'](char)) return true;\n    if (isChar['Enclosed Alphanumerics'](char)) return true;\n    if (isChar['Geometric Shapes'](char)) return true;\n    if (isChar['Miscellaneous Symbols'](char)) {\n        if (!((char >= 0x261A /* black left pointing index */ && char <= 0x261F) /* white down pointing index */)) {\n            return true;\n        }\n    }\n    if (isChar['Miscellaneous Symbols and Arrows'](char)) {\n        if ((char >= 0x2B12 /* square with top half black */ && char <= 0x2B2F /* white vertical ellipse */) ||\n            (char >= 0x2B50 /* white medium star */ && char <= 0x2B59 /* heavy circled saltire */) ||\n            (char >= 0x2BB8 /* upwards white arrow from bar with horizontal bar */ && char <= 0x2BEB)) {\n            return true;\n        }\n    }\n    if (isChar['CJK Symbols and Punctuation'](char)) return true;\n    if (isChar['Katakana'](char)) return true;\n    if (isChar['Private Use Area'](char)) return true;\n    if (isChar['CJK Compatibility Forms'](char)) return true;\n    if (isChar['Small Form Variants'](char)) return true;\n    if (isChar['Halfwidth and Fullwidth Forms'](char)) return true;\n\n    if (char === 0x221E /* infinity */ ||\n        char === 0x2234 /* therefore */ ||\n        char === 0x2235 /* because */ ||\n        (char >= 0x2700 /* black safety scissors */ && char <= 0x2767 /* rotated floral heart bullet */) ||\n        (char >= 0x2776 /* dingbat negative circled digit one */ && char <= 0x2793 /* dingbat negative circled sans-serif number ten */) ||\n        char === 0xFFFC /* object replacement character */ ||\n        char === 0xFFFD /* replacement character */) {\n        return true;\n    }\n\n    return false;\n}\n\n/**\n * Returns true if the given Unicode codepoint identifies a character with\n * rotated orientation.\n *\n * A character has rotated orientation if it is drawn rotated when the line is\n * oriented vertically, even if both adjacent characters are upright. For\n * example, a Latin letter is drawn rotated along a vertical line. A rotated\n * character causes an adjacent âneutralâ character to be drawn rotated as well.\n */\nexport function charHasRotatedVerticalOrientation(char: number) {\n    return !(charHasUprightVerticalOrientation(char) ||\n             charHasNeutralVerticalOrientation(char));\n}\n\nexport function charInComplexShapingScript(char: number) {\n    return /\\p{sc=Arab}/u.test(String.fromCodePoint(char));\n}\n\n/**\n * ISO 15924 script codes of scripts that are primarily written horizontally\n * right-to-left according to Unicode 16.0.0.\n */\nconst rtlScriptCodes = [\n    'Adlm', // Adlam\n    'Arab', // Arabic\n    'Armi', // Imperial Aramaic\n    'Avst', // Avestan\n    'Chrs', // Chorasmian\n    'Cprt', // Cypriot\n    'Egyp', // Egyptian Hieroglyphs\n    'Elym', // Elymaic\n    'Gara', // Garay\n    'Hatr', // Hatran\n    'Hebr', // Hebrew\n    'Hung', // Old Hungarian\n    'Khar', // Kharoshthi\n    'Lydi', // Lydian\n    'Mand', // Mandaic\n    'Mani', // Manichaean\n    'Mend', // Mende Kikakui\n    'Merc', // Meroitic Cursive\n    'Mero', // Meroitic Hieroglyphs\n    'Narb', // Old North Arabian\n    'Nbat', // Nabataean\n    'Nkoo', // NKo\n    'Orkh', // Old Turkic\n    'Palm', // Palmyrene\n    'Phli', // Inscriptional Pahlavi\n    'Phlp', // Psalter Pahlavi\n    'Phnx', // Phoenician\n    'Prti', // Inscriptional Parthian\n    'Rohg', // Hanifi Rohingya\n    'Samr', // Samaritan\n    'Sarb', // Old South Arabian\n    'Sogo', // Old Sogdian\n    'Syrc', // Syriac\n    'Thaa', // Thaana\n    'Todr', // Todhri\n    'Yezi', // Yezidi\n];\n\nconst rtlScriptRegExp = sanitizedRegExpFromScriptCodes(rtlScriptCodes);\n\nexport function charInRTLScript(char: number) {\n    return rtlScriptRegExp.test(String.fromCodePoint(char));\n}\n\nexport function charInSupportedScript(char: number, canRenderRTL: boolean) {\n    // This is a rough heuristic: whether we \"can render\" a script\n    // actually depends on the properties of the font being used\n    // and whether differences from the ideal rendering are considered\n    // semantically significant.\n\n    // Even in Latin script, we \"can't render\" combinations such as the fi\n    // ligature, but we don't consider that semantically significant.\n    if (!canRenderRTL && charInRTLScript(char)) {\n        return false;\n    }\n    if ((char >= 0x0900 && char <= 0x0DFF) ||\n        // Main blocks for Indic scripts and Sinhala\n        (char >= 0x0F00 && char <= 0x109F) ||\n        // Main blocks for Tibetan and Myanmar\n        isChar['Khmer'](char)) {\n        // These blocks cover common scripts that require\n        // complex text shaping, based on unicode script metadata:\n        // https://www.unicode.org/repos/cldr/trunk/common/properties/scriptMetadata.txt\n        // where \"Web Rank <= 32\" \"Shaping Required = YES\"\n        return false;\n    }\n    return true;\n}\n\nexport function stringContainsRTLText(chars: string): boolean {\n    for (const char of chars) {\n        if (charInRTLScript(char.charCodeAt(0))) {\n            return true;\n        }\n    }\n    return false;\n}\n\nexport function isStringInSupportedScript(chars: string, canRenderRTL: boolean) {\n    for (const char of chars) {\n        if (!charInSupportedScript(char.charCodeAt(0), canRenderRTL)) {\n            return false;\n        }\n    }\n    return true;\n}\n", "import {PluginState, RTLPluginStatus} from './rtl_text_plugin_status';\n\nexport interface RTLTextPlugin {\n    applyArabicShaping: (a: string) => string;\n    processBidirectionalText: ((b: string, a: Array<number>) => Array<string>);\n    processStyledBidirectionalText: ((c: string, b: Array<number>, a: Array<number>) => Array<[string, Array<number>]>);\n}\n\nclass RTLWorkerPlugin implements RTLTextPlugin {\n    applyArabicShaping: (a: string) => string = null;\n    processBidirectionalText: ((b: string, a: Array<number>) => Array<string>) = null;\n    processStyledBidirectionalText: ((c: string, b: Array<number>, a: Array<number>) => Array<[string, Array<number>]>) = null;\n    pluginStatus: RTLPluginStatus = 'unavailable';\n    pluginURL: string = null;\n\n    setState(state: PluginState) {\n        this.pluginStatus = state.pluginStatus;\n        this.pluginURL = state.pluginURL;\n    }\n\n    getState(): PluginState {\n        return {\n            pluginStatus: this.pluginStatus,\n            pluginURL: this.pluginURL\n        };\n    }\n\n    setMethods(rtlTextPlugin: RTLTextPlugin) {\n        this.applyArabicShaping = rtlTextPlugin.applyArabicShaping;\n        this.processBidirectionalText = rtlTextPlugin.processBidirectionalText;\n        this.processStyledBidirectionalText = rtlTextPlugin.processStyledBidirectionalText;\n    }\n\n    isParsed(): boolean {\n        return this.applyArabicShaping != null &&\n            this.processBidirectionalText != null &&\n            this.processStyledBidirectionalText != null;\n    }\n\n    getPluginURL(): string {\n        return this.pluginURL;\n    }\n\n    getRTLTextPluginStatus() {\n        return this.pluginStatus;\n    }\n}\n\nexport const rtlWorkerPlugin = new RTLWorkerPlugin();\n", "import {ZoomHistory} from './zoom_history';\nimport {isStringInSupportedScript} from '../util/script_detection';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\n\nimport type {TransitionSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type CrossfadeParameters = {\n    fromScale: number;\n    toScale: number;\n    t: number;\n};\n\n/**\n * @internal\n * A parameter that can be evaluated to a value\n */\nexport class EvaluationParameters {\n    zoom: number;\n    now: number;\n    fadeDuration: number;\n    zoomHistory: ZoomHistory;\n    transition: TransitionSpecification;\n\n    // \"options\" may also be another EvaluationParameters to copy, see CrossFadedProperty.possiblyEvaluate\n    constructor(zoom: number, options?: any) {\n        this.zoom = zoom;\n\n        if (options) {\n            this.now = options.now;\n            this.fadeDuration = options.fadeDuration;\n            this.zoomHistory = options.zoomHistory;\n            this.transition = options.transition;\n        } else {\n            this.now = 0;\n            this.fadeDuration = 0;\n            this.zoomHistory = new ZoomHistory();\n            this.transition = {};\n        }\n    }\n\n    isSupportedScript(str: string): boolean {\n        return isStringInSupportedScript(str, rtlWorkerPlugin.getRTLTextPluginStatus() === 'loaded');\n    }\n\n    crossFadingFactor() {\n        if (this.fadeDuration === 0) {\n            return 1;\n        } else {\n            return Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1);\n        }\n    }\n\n    getCrossfadeParameters(): CrossfadeParameters {\n        const z = this.zoom;\n        const fraction = z - Math.floor(z);\n        const t = this.crossFadingFactor();\n\n        return z > this.zoomHistory.lastIntegerZoom ?\n            {fromScale: 2, toScale: 1, t: fraction + (1 - fraction) * t} :\n            {fromScale: 0.5, toScale: 1, t: 1 - (1 - t) * fraction};\n    }\n}\n", "import {clone, extend, easeCubicInOut} from '../util/util';\nimport {interpolates, Color, StylePropertySpecification, normalizePropertyExpression,\n    Feature,\n    FeatureState,\n    StylePropertyExpression,\n    SourceExpression,\n    CompositeExpression, TransitionSpecification,\n    PropertyValueSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from '../util/web_worker_transfer';\nimport {EvaluationParameters} from './evaluation_parameters';\n\nimport {CanonicalTileID} from '../source/tile_id';\n\ntype TimePoint = number;\n\n/**\n * A from-to type\n */\nexport type CrossFaded<T> = {\n    to: T;\n    from: T;\n};\n\n/**\n * @internal\n *  Implementations of the `Property` interface:\n *\n *  * Hold metadata about a property that's independent of any specific value: stuff like the type of the value,\n *    the default value, etc. This comes from the style specification JSON.\n *  * Define behavior that needs to be polymorphic across different properties: \"possibly evaluating\"\n *    an input value (see below), and interpolating between two possibly-evaluted values.\n *\n *  The type `T` is the fully-evaluated value type (e.g. `number`, `string`, `Color`).\n *  The type `R` is the intermediate \"possibly evaluated\" value type. See below.\n *\n *  There are two main implementations of the interface -- one for properties that allow data-driven values,\n *  and one for properties that don't. There are a few \"special case\" implementations as well: one for properties\n *  which cross-fade between two values rather than interpolating, one for `heatmap-color` and `line-gradient`,\n *  and one for `light-position`.\n */\nexport interface Property<T, R> {\n    specification: StylePropertySpecification;\n    possiblyEvaluate(\n        value: PropertyValue<T, R>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): R;\n    interpolate(a: R, b: R, t: number): R;\n}\n\n/**\n * @internal\n *  `PropertyValue` represents the value part of a property key-value unit. It's used to represent both\n *  paint and layout property values, and regardless of whether or not their property supports data-driven\n *  expressions.\n *\n *  `PropertyValue` stores the raw input value as seen in a style or a runtime styling API call, i.e. one of the\n *  following:\n *\n *    * A constant value of the type appropriate for the property\n *    * A function which produces a value of that type (but functions are quasi-deprecated in favor of expressions)\n *    * An expression which produces a value of that type\n *    * \"undefined\"/\"not present\", in which case the property is assumed to take on its default value.\n *\n *  In addition to storing the original input value, `PropertyValue` also stores a normalized representation,\n *  effectively treating functions as if they are expressions, and constant or default values as if they are\n *  (constant) expressions.\n */\nexport class PropertyValue<T, R> {\n    property: Property<T, R>;\n    value: PropertyValueSpecification<T> | void;\n    expression: StylePropertyExpression;\n\n    constructor(property: Property<T, R>, value: PropertyValueSpecification<T> | void) {\n        this.property = property;\n        this.value = value;\n        this.expression = normalizePropertyExpression(value === undefined ? property.specification.default : value, property.specification);\n    }\n\n    isDataDriven(): boolean {\n        return this.expression.kind === 'source' || this.expression.kind === 'composite';\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): R {\n        return this.property.possiblyEvaluate(this, parameters, canonical, availableImages);\n    }\n}\n\nexport type TransitionParameters = {\n    now: TimePoint;\n    transition: TransitionSpecification;\n};\n\n/**\n * @internal\n * Paint properties are _transitionable_: they can change in a fluid manner, interpolating or cross-fading between\n * old and new value. The duration of the transition, and the delay before it begins, is configurable.\n *\n * `TransitionablePropertyValue` is a compositional class that stores both the property value and that transition\n * configuration.\n *\n * A `TransitionablePropertyValue` can calculate the next step in the evaluation chain for paint property values:\n * `TransitioningPropertyValue`.\n */\nclass TransitionablePropertyValue<T, R> {\n    property: Property<T, R>;\n    value: PropertyValue<T, R>;\n    transition: TransitionSpecification | void;\n\n    constructor(property: Property<T, R>) {\n        this.property = property;\n        this.value = new PropertyValue(property, undefined);\n    }\n\n    transitioned(parameters: TransitionParameters, prior: TransitioningPropertyValue<T, R>): TransitioningPropertyValue<T, R> {\n        return new TransitioningPropertyValue(this.property, this.value, prior,\n            extend({}, parameters.transition, this.transition), parameters.now);\n    }\n\n    untransitioned(): TransitioningPropertyValue<T, R> {\n        return new TransitioningPropertyValue(this.property, this.value, null, {}, 0);\n    }\n}\n\n/**\n * @internal\n * `Transitionable` stores a map of all (property name, `TransitionablePropertyValue`) pairs for paint properties of a\n * given layer type. It can calculate the `TransitioningPropertyValue`s for all of them at once, producing a\n * `Transitioning` instance for the same set of properties.\n */\nexport class Transitionable<Props> {\n    _properties: Properties<Props>;\n    _values: {[K in keyof Props]: TransitionablePropertyValue<any, unknown>};\n\n    constructor(properties: Properties<Props>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultTransitionablePropertyValues) as any);\n    }\n\n    getValue<S extends keyof Props, T>(name: S): PropertyValueSpecification<T> | void {\n        return clone(this._values[name].value.value);\n    }\n\n    setValue<S extends keyof Props, T>(name: S, value: PropertyValueSpecification<T> | void) {\n        if (!Object.prototype.hasOwnProperty.call(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property);\n        }\n        // Note that we do not _remove_ an own property in the case where a value is being reset\n        // to the default: the transition might still be non-default.\n        this._values[name].value = new PropertyValue(this._values[name].property, value === null ? undefined : clone(value));\n    }\n\n    getTransition<S extends keyof Props>(name: S): TransitionSpecification | void {\n        return clone(this._values[name].transition);\n    }\n\n    setTransition<S extends keyof Props>(name: S, value: TransitionSpecification | void) {\n        if (!Object.prototype.hasOwnProperty.call(this._values, name)) {\n            this._values[name] = new TransitionablePropertyValue(this._values[name].property);\n        }\n        this._values[name].transition = clone(value) || undefined;\n    }\n\n    serialize() {\n        const result: any = {};\n        for (const property of Object.keys(this._values)) {\n            const value = this.getValue(property as keyof Props);\n            if (value !== undefined) {\n                result[property] = value;\n            }\n\n            const transition = this.getTransition(property as keyof Props);\n            if (transition !== undefined) {\n                result[`${property}-transition`] = transition;\n            }\n        }\n        return result;\n    }\n\n    transitioned(parameters: TransitionParameters, prior: Transitioning<Props>): Transitioning<Props> {\n        const result = new Transitioning(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].transitioned(parameters, prior._values[property]);\n        }\n        return result;\n    }\n\n    untransitioned(): Transitioning<Props> {\n        const result = new Transitioning(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].untransitioned();\n        }\n        return result;\n    }\n}\n\n/**\n * @internal\n * `TransitioningPropertyValue` implements the first of two intermediate steps in the evaluation chain of a paint\n * property value. In this step, transitions between old and new values are handled: as long as the transition is in\n * progress, `TransitioningPropertyValue` maintains a reference to the prior value, and interpolates between it and\n * the new value based on the current time and the configured transition duration and delay. The product is the next\n * step in the evaluation chain: the \"possibly evaluated\" result type `R`. See below for more on this concept.\n */\nclass TransitioningPropertyValue<T, R> {\n    property: Property<T, R>;\n    value: PropertyValue<T, R>;\n    prior: TransitioningPropertyValue<T, R>;\n    begin: TimePoint;\n    end: TimePoint;\n\n    constructor(property: Property<T, R>,\n        value: PropertyValue<T, R>,\n        prior: TransitioningPropertyValue<T, R>,\n        transition: TransitionSpecification,\n        now: TimePoint) {\n        this.property = property;\n        this.value = value;\n        this.begin = now + transition.delay || 0;\n        this.end = this.begin + transition.duration || 0;\n        if (property.specification.transition && (transition.delay || transition.duration)) {\n            this.prior = prior;\n        }\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical: CanonicalTileID,\n        availableImages: Array<string>\n    ): R {\n        const now = parameters.now || 0;\n        const finalValue = this.value.possiblyEvaluate(parameters, canonical, availableImages);\n        const prior = this.prior;\n        if (!prior) {\n            // No prior value.\n            return finalValue;\n        } else if (now > this.end) {\n            // Transition from prior value is now complete.\n            this.prior = null;\n            return finalValue;\n        } else if (this.value.isDataDriven()) {\n            // Transitions to data-driven properties are not supported.\n            // We snap immediately to the data-driven value so that, when we perform layout,\n            // we see the data-driven function and can use it to populate vertex buffers.\n            this.prior = null;\n            return finalValue;\n        } else if (now < this.begin) {\n            // Transition hasn't started yet.\n            return prior.possiblyEvaluate(parameters, canonical, availableImages);\n        } else {\n            // Interpolate between recursively-calculated prior value and final.\n            const t = (now - this.begin) / (this.end - this.begin);\n            return this.property.interpolate(prior.possiblyEvaluate(parameters, canonical, availableImages), finalValue, easeCubicInOut(t));\n        }\n    }\n}\n\n/**\n * @internal\n * `Transitioning` stores a map of all (property name, `TransitioningPropertyValue`) pairs for paint properties of a\n * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a\n * `PossiblyEvaluated` instance for the same set of properties.\n */\nexport class Transitioning<Props> {\n    _properties: Properties<Props>;\n    _values: {[K in keyof Props]: PossiblyEvaluatedPropertyValue<unknown>};\n\n    constructor(properties: Properties<Props>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultTransitioningPropertyValues) as any);\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluated<Props, any> {\n        const result = new PossiblyEvaluated(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].possiblyEvaluate(parameters, canonical, availableImages);\n        }\n        return result;\n    }\n\n    hasTransition() {\n        for (const property of Object.keys(this._values)) {\n            if (this._values[property].prior) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n\n// ------- Layout -------\n\n/**\n * Because layout properties are not transitionable, they have a simpler representation and evaluation chain than\n * paint properties: `PropertyValue`s are possibly evaluated, producing possibly evaluated values, which are then\n * fully evaluated.\n *\n * `Layout` stores a map of all (property name, `PropertyValue`) pairs for layout properties of a\n * given layer type. It can calculate the possibly-evaluated values for all of them at once, producing a\n * `PossiblyEvaluated` instance for the same set of properties.\n */\nexport class Layout<Props> {\n    _properties: Properties<Props>;\n    _values: {[K in keyof Props]: PropertyValue<any, PossiblyEvaluatedPropertyValue<any>>};\n\n    constructor(properties: Properties<Props>) {\n        this._properties = properties;\n        this._values = (Object.create(properties.defaultPropertyValues) as any);\n    }\n\n    hasValue<S extends keyof Props>(name: S) {\n        return this._values[name].value !== undefined;\n    }\n\n    getValue<S extends keyof Props>(name: S) {\n        return clone(this._values[name].value);\n    }\n\n    setValue<S extends keyof Props>(name: S, value: any) {\n        this._values[name] = new PropertyValue(this._values[name].property, value === null ? undefined : clone(value)) as any;\n    }\n\n    serialize() {\n        const result: any = {};\n        for (const property of Object.keys(this._values)) {\n            const value = this.getValue(property as keyof Props);\n            if (value !== undefined) {\n                result[property] = value;\n            }\n        }\n        return result;\n    }\n\n    possiblyEvaluate(\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluated<Props, any> {\n        const result = new PossiblyEvaluated(this._properties);\n        for (const property of Object.keys(this._values)) {\n            result._values[property] = this._values[property].possiblyEvaluate(parameters, canonical, availableImages);\n        }\n        return result;\n    }\n}\n\n// ------- PossiblyEvaluated -------\n\n/**\n * \"Possibly evaluated value\" is an intermediate stage in the evaluation chain for both paint and layout property\n * values. The purpose of this stage is to optimize away unnecessary recalculations for data-driven properties. Code\n * which uses data-driven property values must assume that the value is dependent on feature data, and request that it\n * be evaluated for each feature. But when that property value is in fact a constant or camera function, the calculation\n * will not actually depend on the feature, and we can benefit from returning the prior result of having done the\n * evaluation once, ahead of time, in an intermediate step whose inputs are just the value and \"global\" parameters\n * such as current zoom level.\n *\n * `PossiblyEvaluatedValue` represents the three possible outcomes of this step: if the input value was a constant or\n * camera expression, then the \"possibly evaluated\" result is a constant value. Otherwise, the input value was either\n * a source or composite expression, and we must defer final evaluation until supplied a feature. We separate\n * the source and composite cases because they are handled differently when generating GL attributes, buffers, and\n * uniforms.\n *\n * Note that `PossiblyEvaluatedValue` (and `PossiblyEvaluatedPropertyValue`, below) are _not_ used for properties that\n * do not allow data-driven values. For such properties, we know that the \"possibly evaluated\" result is always a constant\n * scalar value. See below.\n */\ntype PossiblyEvaluatedValue<T> = {\n    kind: 'constant';\n    value: T;\n} | SourceExpression | CompositeExpression;\n\n/**\n * @internal\n * `PossiblyEvaluatedPropertyValue` is used for data-driven paint and layout property values. It holds a\n * `PossiblyEvaluatedValue` and the `GlobalProperties` that were used to generate it. You're not allowed to supply\n * a different set of `GlobalProperties` when performing the final evaluation because they would be ignored in the\n * case where the input value was a constant or camera function.\n */\nexport class PossiblyEvaluatedPropertyValue<T> {\n    property: DataDrivenProperty<T>;\n    value: PossiblyEvaluatedValue<T>;\n    parameters: EvaluationParameters;\n\n    constructor(property: DataDrivenProperty<T>, value: PossiblyEvaluatedValue<T>, parameters: EvaluationParameters) {\n        this.property = property;\n        this.value = value;\n        this.parameters = parameters;\n    }\n\n    isConstant(): boolean {\n        return this.value.kind === 'constant';\n    }\n\n    constantOr(value: T): T {\n        if (this.value.kind === 'constant') {\n            return this.value.value;\n        } else {\n            return value;\n        }\n    }\n\n    evaluate(\n        feature: Feature,\n        featureState: FeatureState,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): T {\n        return this.property.evaluate(this.value, this.parameters, feature, featureState, canonical, availableImages);\n    }\n}\n\n/**\n * @internal\n * `PossiblyEvaluated` stores a map of all (property name, `R`) pairs for paint or layout properties of a\n * given layer type.\n */\nexport class PossiblyEvaluated<Props, PossibleEvaluatedProps> {\n    _properties: Properties<Props>;\n    _values: PossibleEvaluatedProps;\n\n    constructor(properties: Properties<Props>) {\n        this._properties = properties;\n        this._values = Object.create(properties.defaultPossiblyEvaluatedValues);\n    }\n\n    get<S extends keyof PossibleEvaluatedProps>(name: S): PossibleEvaluatedProps[S] {\n        return this._values[name];\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for properties that do not permit data-driven (source or composite) expressions.\n * This restriction allows us to declare statically that the result of possibly evaluating this kind of property\n * is in fact always the scalar type `T`, and can be used without further evaluating the value on a per-feature basis.\n */\nexport class DataConstantProperty<T> implements Property<T, T> {\n    specification: StylePropertySpecification;\n\n    constructor(specification: StylePropertySpecification) {\n        this.specification = specification;\n    }\n\n    possiblyEvaluate(value: PropertyValue<T, T>, parameters: EvaluationParameters): T {\n        if (value.isDataDriven()) throw new Error('Value should not be data driven');\n        return value.expression.evaluate(parameters);\n    }\n\n    interpolate(a: T, b: T, t: number): T {\n        const interpolationType = this.specification.type as keyof typeof interpolates;\n        const interpolationFn = interpolates[interpolationType] as ((from: T, to: T, t: number) => T) | undefined;\n        if (interpolationFn) {\n            return interpolationFn(a, b, t);\n        } else {\n            return a;\n        }\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for properties that permit data-driven (source or composite) expressions.\n * The result of possibly evaluating this kind of property is `PossiblyEvaluatedPropertyValue<T>`; obtaining\n * a scalar value `T` requires further evaluation on a per-feature basis.\n */\nexport class DataDrivenProperty<T> implements Property<T, PossiblyEvaluatedPropertyValue<T>> {\n    specification: StylePropertySpecification;\n    overrides: any;\n\n    constructor(specification: StylePropertySpecification, overrides?: any) {\n        this.specification = specification;\n        this.overrides = overrides;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<T, PossiblyEvaluatedPropertyValue<T>>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluatedPropertyValue<T> {\n        if (value.expression.kind === 'constant' || value.expression.kind === 'camera') {\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: value.expression.evaluate(parameters, null, {}, canonical, availableImages)}, parameters);\n        } else {\n            return new PossiblyEvaluatedPropertyValue(this, value.expression, parameters);\n        }\n    }\n\n    interpolate(\n        a: PossiblyEvaluatedPropertyValue<T>,\n        b: PossiblyEvaluatedPropertyValue<T>,\n        t: number\n    ): PossiblyEvaluatedPropertyValue<T> {\n        // If either possibly-evaluated value is non-constant, give up: we aren't able to interpolate data-driven values.\n        if (a.value.kind !== 'constant' || b.value.kind !== 'constant') {\n            return a;\n        }\n\n        // Special case hack solely for fill-outline-color. The undefined value is subsequently handled in\n        // FillStyleLayer#recalculate, which sets fill-outline-color to the fill-color value if the former\n        // is a PossiblyEvaluatedPropertyValue containing a constant undefined value. In addition to the\n        // return value here, the other source of a PossiblyEvaluatedPropertyValue containing a constant\n        // undefined value is the \"default value\" for fill-outline-color held in\n        // `Properties#defaultPossiblyEvaluatedValues`, which serves as the prototype of\n        // `PossiblyEvaluated#_values`.\n        if (a.value.value === undefined || b.value.value === undefined) {\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: undefined}, a.parameters);\n        }\n\n        const interpolationType = this.specification.type as keyof typeof interpolates;\n        const interpolationFn = interpolates[interpolationType] as ((from: T, to: T, t: number) => T) | undefined;\n        if (interpolationFn) {\n            const interpolatedValue = interpolationFn(a.value.value, b.value.value, t);\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: interpolatedValue}, a.parameters);\n        } else {\n            return a;\n        }\n    }\n\n    evaluate(\n        value: PossiblyEvaluatedValue<T>,\n        parameters: EvaluationParameters,\n        feature: Feature,\n        featureState: FeatureState,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): T {\n        if (value.kind === 'constant') {\n            return value.value;\n        } else {\n            return value.evaluate(parameters, feature, featureState, canonical, availableImages);\n        }\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for  data driven `line-pattern` which are transitioned by cross-fading\n * rather than interpolation.\n */\n\nexport class CrossFadedDataDrivenProperty<T> extends DataDrivenProperty<CrossFaded<T>> {\n\n    possiblyEvaluate(\n        value: PropertyValue<CrossFaded<T>, PossiblyEvaluatedPropertyValue<CrossFaded<T>>>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): PossiblyEvaluatedPropertyValue<CrossFaded<T>> {\n        if (value.value === undefined) {\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: undefined}, parameters);\n        } else if (value.expression.kind === 'constant') {\n            const evaluatedValue = value.expression.evaluate(parameters, null, {}, canonical, availableImages);\n            const isImageExpression = value.property.specification.type as any === 'resolvedImage';\n            const constantValue = isImageExpression && typeof evaluatedValue !== 'string' ? evaluatedValue.name : evaluatedValue;\n            const constant = this._calculate(constantValue, constantValue, constantValue, parameters);\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: constant}, parameters);\n        } else if (value.expression.kind === 'camera') {\n            const cameraVal = this._calculate(\n                value.expression.evaluate({zoom: parameters.zoom - 1.0}),\n                value.expression.evaluate({zoom: parameters.zoom}),\n                value.expression.evaluate({zoom: parameters.zoom + 1.0}),\n                parameters);\n            return new PossiblyEvaluatedPropertyValue(this, {kind: 'constant', value: cameraVal}, parameters);\n        } else {\n            // source or composite expression\n            return new PossiblyEvaluatedPropertyValue(this, value.expression, parameters);\n        }\n    }\n\n    evaluate(\n        value: PossiblyEvaluatedValue<CrossFaded<T>>,\n        globals: EvaluationParameters,\n        feature: Feature,\n        featureState: FeatureState,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): CrossFaded<T> {\n        if (value.kind === 'source') {\n            const constant = value.evaluate(globals, feature, featureState, canonical, availableImages);\n            return this._calculate(constant, constant, constant, globals);\n        } else if (value.kind === 'composite') {\n            return this._calculate(\n                value.evaluate({zoom: Math.floor(globals.zoom) - 1.0}, feature, featureState),\n                value.evaluate({zoom: Math.floor(globals.zoom)}, feature, featureState),\n                value.evaluate({zoom: Math.floor(globals.zoom) + 1.0}, feature, featureState),\n                globals);\n        } else {\n            return value.value;\n        }\n    }\n\n    _calculate(min: T, mid: T, max: T, parameters: EvaluationParameters): CrossFaded<T> {\n        const z = parameters.zoom;\n        return z > parameters.zoomHistory.lastIntegerZoom ? {from: min, to: mid} : {from: max, to: mid};\n    }\n\n    interpolate(a: PossiblyEvaluatedPropertyValue<CrossFaded<T>>): PossiblyEvaluatedPropertyValue<CrossFaded<T>> {\n        return a;\n    }\n}\n/**\n * @internal\n * An implementation of `Property` for `*-pattern` and `line-dasharray`, which are transitioned by cross-fading\n * rather than interpolation.\n */\nexport class CrossFadedProperty<T> implements Property<T, CrossFaded<T>> {\n    specification: StylePropertySpecification;\n\n    constructor(specification: StylePropertySpecification) {\n        this.specification = specification;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<T, CrossFaded<T>>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): CrossFaded<T> {\n        if (value.value === undefined) {\n            return undefined;\n        } else if (value.expression.kind === 'constant') {\n            const constant = value.expression.evaluate(parameters, null, {}, canonical, availableImages);\n            return this._calculate(constant, constant, constant, parameters);\n        } else {\n            return this._calculate(\n                value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom - 1.0), parameters)),\n                value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom), parameters)),\n                value.expression.evaluate(new EvaluationParameters(Math.floor(parameters.zoom + 1.0), parameters)),\n                parameters);\n        }\n    }\n\n    _calculate(min: T, mid: T, max: T, parameters: EvaluationParameters): CrossFaded<T> {\n        const z = parameters.zoom;\n        return z > parameters.zoomHistory.lastIntegerZoom ? {from: min, to: mid} : {from: max, to: mid};\n    }\n\n    interpolate(a?: CrossFaded<T> | null): CrossFaded<T> {\n        return a;\n    }\n}\n\n/**\n * @internal\n * An implementation of `Property` for `heatmap-color` and `line-gradient`. Interpolation is a no-op, and\n * evaluation returns a boolean value in order to indicate its presence, but the real\n * evaluation happens in StyleLayer classes.\n */\n\nexport class ColorRampProperty implements Property<Color, boolean> {\n    specification: StylePropertySpecification;\n\n    constructor(specification: StylePropertySpecification) {\n        this.specification = specification;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<Color, boolean>,\n        parameters: EvaluationParameters,\n        canonical?: CanonicalTileID,\n        availableImages?: Array<string>\n    ): boolean {\n        return !!value.expression.evaluate(parameters, null, {}, canonical, availableImages);\n    }\n\n    interpolate(): boolean { return false; }\n}\n\n/**\n * @internal\n * `Properties` holds objects containing default values for the layout or paint property set of a given\n * layer type. These objects are immutable, and they are used as the prototypes for the `_values` members of\n * `Transitionable`, `Transitioning`, `Layout`, and `PossiblyEvaluated`. This allows these classes to avoid\n * doing work in the common case where a property has no explicit value set and should be considered to take\n * on the default value: using `for (const property of Object.keys(this._values))`, they can iterate over\n * only the _own_ properties of `_values`, skipping repeated calculation of transitions and possible/final\n * evaluations for defaults, the result of which will always be the same.\n */\nexport class Properties<Props> {\n    properties: Props;\n    defaultPropertyValues: {[K in keyof Props]: PropertyValue<unknown, any>};\n    defaultTransitionablePropertyValues: {[K in keyof Props]: TransitionablePropertyValue<unknown, unknown>};\n    defaultTransitioningPropertyValues: {[K in keyof Props]: TransitioningPropertyValue<unknown, unknown>};\n    defaultPossiblyEvaluatedValues: {[K in keyof Props]: PossiblyEvaluatedPropertyValue<unknown>};\n    overridableProperties: Array<string>;\n\n    constructor(properties: Props) {\n        this.properties = properties;\n        this.defaultPropertyValues = ({} as any);\n        this.defaultTransitionablePropertyValues = ({} as any);\n        this.defaultTransitioningPropertyValues = ({} as any);\n        this.defaultPossiblyEvaluatedValues = ({} as any);\n        this.overridableProperties = ([] as any);\n\n        for (const property in properties) {\n            const prop = properties[property] as any;\n            if (prop.specification.overridable) {\n                this.overridableProperties.push(property);\n            }\n            const defaultPropertyValue = this.defaultPropertyValues[property] =\n                new PropertyValue(prop, undefined);\n            const defaultTransitionablePropertyValue = this.defaultTransitionablePropertyValues[property] =\n                new TransitionablePropertyValue(prop);\n            this.defaultTransitioningPropertyValues[property] =\n                defaultTransitionablePropertyValue.untransitioned();\n            this.defaultPossiblyEvaluatedValues[property] =\n                defaultPropertyValue.possiblyEvaluate({} as any);\n        }\n    }\n}\n\nregister('DataDrivenProperty', DataDrivenProperty);\nregister('DataConstantProperty', DataConstantProperty);\nregister('CrossFadedDataDrivenProperty', CrossFadedDataDrivenProperty);\nregister('CrossFadedProperty', CrossFadedProperty);\nregister('ColorRampProperty', ColorRampProperty);\n", "import {filterObject} from '../util/util';\n\nimport {latest as styleSpec, supportsPropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {\n    validateStyle,\n    validateLayoutProperty,\n    validatePaintProperty,\n    emitValidationErrors\n} from './validate_style';\nimport {Evented} from '../util/evented';\nimport {Layout, Transitionable, Transitioning, Properties, PossiblyEvaluated, PossiblyEvaluatedPropertyValue} from './properties';\n\nimport type {Bucket} from '../data/bucket';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureFilter, FeatureState,\n    LayerSpecification,\n    FilterSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {TransitionParameters, PropertyValue} from './properties';\nimport {EvaluationParameters} from './evaluation_parameters';\nimport type {CrossfadeParameters} from './evaluation_parameters';\n\nimport type {Transform} from '../geo/transform';\nimport type {CustomLayerInterface} from './style_layer/custom_style_layer';\nimport type {Map} from '../ui/map';\nimport type {StyleSetterOptions} from './style';\nimport {mat4} from 'gl-matrix';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\n\nconst TRANSITION_SUFFIX = '-transition';\n\n/**\n * A base class for style layers\n */\nexport abstract class StyleLayer extends Evented {\n    id: string;\n    metadata: unknown;\n    type: LayerSpecification['type'] | CustomLayerInterface['type'];\n    source: string;\n    sourceLayer: string;\n    minzoom: number;\n    maxzoom: number;\n    filter: FilterSpecification | void;\n    visibility: 'visible' | 'none' | void;\n    _crossfadeParameters: CrossfadeParameters;\n\n    _unevaluatedLayout: Layout<any>;\n    readonly layout: unknown;\n\n    _transitionablePaint: Transitionable<any>;\n    _transitioningPaint: Transitioning<any>;\n    readonly paint: unknown;\n\n    _featureFilter: FeatureFilter;\n\n    readonly onAdd: ((map: Map) => void);\n    readonly onRemove: ((map: Map) => void);\n\n    queryRadius?(bucket: Bucket): number;\n    queryIntersectsFeature?(\n        queryGeometry: Array<Point>,\n        feature: VectorTileFeature,\n        featureState: FeatureState,\n        geometry: Array<Array<Point>>,\n        zoom: number,\n        transform: Transform,\n        pixelsToTileUnits: number,\n        pixelPosMatrix: mat4\n    ): boolean | number;\n\n    constructor(layer: LayerSpecification | CustomLayerInterface, properties: Readonly<{\n        layout?: Properties<any>;\n        paint?: Properties<any>;\n    }>) {\n        super();\n\n        this.id = layer.id;\n        this.type = layer.type;\n        this._featureFilter = {filter: () => true, needGeometry: false};\n\n        if (layer.type === 'custom') return;\n\n        layer = (layer as any as LayerSpecification);\n\n        this.metadata = layer.metadata;\n        this.minzoom = layer.minzoom;\n        this.maxzoom = layer.maxzoom;\n\n        if (layer.type !== 'background') {\n            this.source = layer.source;\n            this.sourceLayer = layer['source-layer'];\n            this.filter = layer.filter;\n        }\n\n        if (properties.layout) {\n            this._unevaluatedLayout = new Layout(properties.layout);\n        }\n\n        if (properties.paint) {\n            this._transitionablePaint = new Transitionable(properties.paint);\n\n            for (const property in layer.paint) {\n                this.setPaintProperty(property, layer.paint[property], {validate: false});\n            }\n            for (const property in layer.layout) {\n                this.setLayoutProperty(property, layer.layout[property], {validate: false});\n            }\n\n            this._transitioningPaint = this._transitionablePaint.untransitioned();\n            //$FlowFixMe\n            this.paint = new PossiblyEvaluated(properties.paint);\n        }\n    }\n\n    getCrossfadeParameters() {\n        return this._crossfadeParameters;\n    }\n\n    getLayoutProperty(name: string) {\n        if (name === 'visibility') {\n            return this.visibility;\n        }\n\n        return this._unevaluatedLayout.getValue(name);\n    }\n\n    setLayoutProperty(name: string, value: any, options: StyleSetterOptions = {}) {\n        if (value !== null && value !== undefined) {\n            const key = `layers.${this.id}.layout.${name}`;\n            if (this._validate(validateLayoutProperty, key, name, value, options)) {\n                return;\n            }\n        }\n\n        if (name === 'visibility') {\n            this.visibility = value;\n            return;\n        }\n\n        this._unevaluatedLayout.setValue(name, value);\n    }\n\n    getPaintProperty(name: string) {\n        if (name.endsWith(TRANSITION_SUFFIX)) {\n            return this._transitionablePaint.getTransition(name.slice(0, -TRANSITION_SUFFIX.length));\n        } else {\n            return this._transitionablePaint.getValue(name);\n        }\n    }\n\n    setPaintProperty(name: string, value: unknown, options: StyleSetterOptions = {}) {\n        if (value !== null && value !== undefined) {\n            const key = `layers.${this.id}.paint.${name}`;\n            if (this._validate(validatePaintProperty, key, name, value, options)) {\n                return false;\n            }\n        }\n\n        if (name.endsWith(TRANSITION_SUFFIX)) {\n            this._transitionablePaint.setTransition(name.slice(0, -TRANSITION_SUFFIX.length), (value as any) || undefined);\n            return false;\n        } else {\n            const transitionable = this._transitionablePaint._values[name];\n            const isCrossFadedProperty = transitionable.property.specification['property-type'] === 'cross-faded-data-driven';\n            const wasDataDriven = transitionable.value.isDataDriven();\n            const oldValue = transitionable.value;\n\n            this._transitionablePaint.setValue(name, value);\n            this._handleSpecialPaintPropertyUpdate(name);\n\n            const newValue = this._transitionablePaint._values[name].value;\n            const isDataDriven = newValue.isDataDriven();\n\n            // if a cross-faded value is changed, we need to make sure the new icons get added to each tile's iconAtlas\n            // so a call to _updateLayer is necessary, and we return true from this function so it gets called in\n            // Style#setPaintProperty\n            return isDataDriven || wasDataDriven || isCrossFadedProperty || this._handleOverridablePaintPropertyUpdate(name, oldValue, newValue);\n        }\n    }\n\n    _handleSpecialPaintPropertyUpdate(_: string) {\n        // No-op; can be overridden by derived classes.\n    }\n\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\n    _handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean {\n        // No-op; can be overridden by derived classes.\n        return false;\n    }\n\n    isHidden(zoom: number) {\n        if (this.minzoom && zoom < this.minzoom) return true;\n        if (this.maxzoom && zoom >= this.maxzoom) return true;\n        return this.visibility === 'none';\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioningPaint = this._transitionablePaint.transitioned(parameters, this._transitioningPaint);\n    }\n\n    hasTransition() {\n        return this._transitioningPaint.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        if (parameters.getCrossfadeParameters) {\n            this._crossfadeParameters = parameters.getCrossfadeParameters();\n        }\n\n        if (this._unevaluatedLayout) {\n            (this as any).layout = this._unevaluatedLayout.possiblyEvaluate(parameters, undefined, availableImages);\n        }\n\n        (this as any).paint = this._transitioningPaint.possiblyEvaluate(parameters, undefined, availableImages);\n    }\n\n    serialize(): LayerSpecification {\n        const output: LayerSpecification = {\n            'id': this.id,\n            'type': this.type as LayerSpecification['type'],\n            'source': this.source,\n            'source-layer': this.sourceLayer,\n            'metadata': this.metadata,\n            'minzoom': this.minzoom,\n            'maxzoom': this.maxzoom,\n            'filter': this.filter as FilterSpecification,\n            'layout': this._unevaluatedLayout && this._unevaluatedLayout.serialize(),\n            'paint': this._transitionablePaint && this._transitionablePaint.serialize()\n        };\n\n        if (this.visibility) {\n            output.layout = output.layout || {};\n            output.layout.visibility = this.visibility;\n        }\n\n        return filterObject(output, (value, key) => {\n            return value !== undefined &&\n                !(key === 'layout' && !Object.keys(value).length) &&\n                !(key === 'paint' && !Object.keys(value).length);\n        });\n    }\n\n    _validate(validate: Function, key: string, name: string, value: unknown, options: StyleSetterOptions = {}) {\n        if (options && options.validate === false) {\n            return false;\n        }\n        return emitValidationErrors(this, validate.call(validateStyle, {\n            key,\n            layerType: this.type,\n            objectKey: name,\n            value,\n            styleSpec,\n            // Workaround for https://github.com/mapbox/mapbox-gl-js/issues/2407\n            style: {glyphs: true, sprite: true}\n        }));\n    }\n\n    is3D() {\n        return false;\n    }\n\n    isTileClipped() {\n        return false;\n    }\n\n    hasOffscreenPass() {\n        return false;\n    }\n\n    resize() {\n        // noop\n    }\n\n    isStateDependent() {\n        for (const property in (this as any).paint._values) {\n            const value = (this as any).paint.get(property);\n            if (!(value instanceof PossiblyEvaluatedPropertyValue) || !supportsPropertyExpression(value.property.specification)) {\n                continue;\n            }\n\n            if ((value.value.kind === 'source' || value.value.kind === 'composite') &&\n                value.value.isStateDependent) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n", "// Note: all \"sizes\" are measured in bytes\n\n/**\n * @internal\n * A view type size\n */\nconst viewTypes = {\n    'Int8': Int8Array,\n    'Uint8': Uint8Array,\n    'Int16': Int16Array,\n    'Uint16': Uint16Array,\n    'Int32': Int32Array,\n    'Uint32': Uint32Array,\n    'Float32': Float32Array\n};\n\n/**\n * @internal\n * A view type size\n */\nexport type ViewType = keyof typeof viewTypes;\n\n/** @internal */\nclass Struct {\n    _pos1: number;\n    _pos2: number;\n    _pos4: number;\n    _pos8: number;\n    readonly _structArray: StructArray;\n\n    // The following properties are defined on the prototype of sub classes.\n    size: number;\n\n    /**\n     * @param structArray - The StructArray the struct is stored in\n     * @param index - The index of the struct in the StructArray.\n     */\n    constructor(structArray: StructArray, index: number) {\n        (this as any)._structArray = structArray;\n        this._pos1 = index * this.size;\n        this._pos2 = this._pos1 / 2;\n        this._pos4 = this._pos1 / 4;\n        this._pos8 = this._pos1 / 8;\n    }\n}\n\nconst DEFAULT_CAPACITY = 128;\nconst RESIZE_MULTIPLIER = 5;\n\n/**\n * @internal\n * A struct array member\n */\nexport type StructArrayMember = {\n    name: string;\n    type: ViewType;\n    components: number;\n    offset: number;\n};\n\nexport type StructArrayLayout = {\n    members: Array<StructArrayMember>;\n    size: number;\n    alignment: number;\n};\n\n/**\n * An array that can be deserialized\n */\nexport type SerializedStructArray = {\n    length: number;\n    arrayBuffer: ArrayBuffer;\n};\n\n/**\n * @internal\n * `StructArray` provides an abstraction over `ArrayBuffer` and `TypedArray`\n * making it behave like an array of typed structs.\n *\n * Conceptually, a StructArray is comprised of elements, i.e., instances of its\n * associated struct type. Each particular struct type, together with an\n * alignment size, determines the memory layout of a StructArray whose elements\n * are of that type.  Thus, for each such layout that we need, we have\n * a corresponding StructArrayLayout class, inheriting from StructArray and\n * implementing `emplaceBack()` and `_refreshViews()`.\n *\n * In some cases, where we need to access particular elements of a StructArray,\n * we implement a more specific subclass that inherits from one of the\n * StructArrayLayouts and adds a `get(i): T` accessor that returns a structured\n * object whose properties are proxies into the underlying memory space for the\n * i-th element.  This affords the convenience of working with (seemingly) plain\n * Javascript objects without the overhead of serializing/deserializing them\n * into ArrayBuffers for efficient web worker transfer.\n */\nabstract class StructArray {\n    capacity: number;\n    length: number;\n    isTransferred: boolean;\n    arrayBuffer: ArrayBuffer;\n    uint8: Uint8Array;\n\n    // The following properties are defined on the prototype.\n    members: Array<StructArrayMember>;\n    bytesPerElement: number;\n    abstract emplaceBack(...v: number[]);\n    abstract emplace(i: number, ...v: number[]);\n\n    constructor() {\n        this.isTransferred = false;\n        this.capacity = -1;\n        this.resize(0);\n    }\n\n    /**\n     * Serialize a StructArray instance.  Serializes both the raw data and the\n     * metadata needed to reconstruct the StructArray base class during\n     * deserialization.\n     */\n    static serialize(array: StructArray, transferables?: Array<Transferable>): SerializedStructArray {\n\n        array._trim();\n\n        if (transferables) {\n            array.isTransferred = true;\n            transferables.push(array.arrayBuffer);\n        }\n\n        return {\n            length: array.length,\n            arrayBuffer: array.arrayBuffer,\n        };\n    }\n\n    static deserialize(input: SerializedStructArray) {\n        const structArray = Object.create(this.prototype);\n        structArray.arrayBuffer = input.arrayBuffer;\n        structArray.length = input.length;\n        structArray.capacity = input.arrayBuffer.byteLength / structArray.bytesPerElement;\n        structArray._refreshViews();\n        return structArray;\n    }\n\n    /**\n     * Resize the array to discard unused capacity.\n     */\n    _trim() {\n        if (this.length !== this.capacity) {\n            this.capacity = this.length;\n            this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement);\n            this._refreshViews();\n        }\n    }\n\n    /**\n     * Resets the length of the array to 0 without de-allocating capacity.\n     */\n    clear() {\n        this.length = 0;\n    }\n\n    /**\n     * Resize the array.\n     * If `n` is greater than the current length then additional elements with undefined values are added.\n     * If `n` is less than the current length then the array will be reduced to the first `n` elements.\n     * @param n - The new size of the array.\n     */\n    resize(n: number) {\n        this.reserve(n);\n        this.length = n;\n    }\n\n    /**\n     * Indicate a planned increase in size, so that any necessary allocation may\n     * be done once, ahead of time.\n     * @param n - The expected size of the array.\n     */\n    reserve(n: number) {\n        if (n > this.capacity) {\n            this.capacity = Math.max(n, Math.floor(this.capacity * RESIZE_MULTIPLIER), DEFAULT_CAPACITY);\n            this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement);\n\n            const oldUint8Array = this.uint8;\n            this._refreshViews();\n            if (oldUint8Array) this.uint8.set(oldUint8Array);\n        }\n    }\n\n    /**\n     * Create TypedArray views for the current ArrayBuffer.\n     */\n    _refreshViews() {\n        throw new Error('_refreshViews() must be implemented by each concrete StructArray layout');\n    }\n}\n\n/**\n * Given a list of member fields, create a full StructArrayLayout, in\n * particular calculating the correct byte offset for each field.  This data\n * is used at build time to generate StructArrayLayout_*#emplaceBack() and\n * other accessors, and at runtime for binding vertex buffer attributes.\n */\nfunction createLayout(\n    members: Array<{\n        name: string;\n        type: ViewType;\n        readonly components?: number;\n    }>,\n    alignment: number = 1\n): StructArrayLayout {\n\n    let offset = 0;\n    let maxSize = 0;\n    const layoutMembers = members.map((member) => {\n        const typeSize = sizeOf(member.type);\n        const memberOffset = offset = align(offset, Math.max(alignment, typeSize));\n        const components = member.components || 1;\n\n        maxSize = Math.max(maxSize, typeSize);\n        offset += typeSize * components;\n\n        return {\n            name: member.name,\n            type: member.type,\n            components,\n            offset: memberOffset,\n        };\n    });\n\n    const size = align(offset, Math.max(maxSize, alignment));\n\n    return {\n        members: layoutMembers,\n        size,\n        alignment\n    };\n}\n\nfunction sizeOf(type: ViewType): number {\n    return viewTypes[type].BYTES_PER_ELEMENT;\n}\n\nfunction align(offset: number, size: number): number {\n    return Math.ceil(offset / size) * size;\n}\n\nexport {StructArray, Struct, viewTypes, createLayout};\n", "// This file is generated. Edit build/generate-struct-arrays.ts, then run `npm run codegen`.\n\nimport {Struct, StructArray} from '../util/struct_array';\nimport {register} from '../util/web_worker_transfer';\nimport Point from '@mapbox/point-geometry';\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n *\n */\nclass StructArrayLayout2i4 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1);\n    }\n\n    public emplace(i: number, v0: number, v1: number) {\n        const o2 = i * 2;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        return i;\n    }\n}\n\nStructArrayLayout2i4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout2i4', StructArrayLayout2i4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[3]\n *\n */\nclass StructArrayLayout3i6 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o2 = i * 3;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout3i6.prototype.bytesPerElement = 6;\nregister('StructArrayLayout3i6', StructArrayLayout3i6);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[4]\n *\n */\nclass StructArrayLayout4i8 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number) {\n        const o2 = i * 4;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        return i;\n    }\n}\n\nStructArrayLayout4i8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout4i8', StructArrayLayout4i8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Int16[4]\n *\n */\nclass StructArrayLayout2i4i12 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o2 = i * 6;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2i4i12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout2i4i12', StructArrayLayout2i4i12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Uint8[4]\n *\n */\nclass StructArrayLayout2i4ub8 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o2 = i * 4;\n        const o1 = i * 8;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.uint8[o1 + 4] = v2;\n        this.uint8[o1 + 5] = v3;\n        this.uint8[o1 + 6] = v4;\n        this.uint8[o1 + 7] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2i4ub8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout2i4ub8', StructArrayLayout2i4ub8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[2]\n *\n */\nclass StructArrayLayout2f8 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1);\n    }\n\n    public emplace(i: number, v0: number, v1: number) {\n        const o4 = i * 2;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        return i;\n    }\n}\n\nStructArrayLayout2f8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout2f8', StructArrayLayout2f8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[10]\n *\n */\nclass StructArrayLayout10ui20 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number) {\n        const o2 = i * 10;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        this.uint16[o2 + 3] = v3;\n        this.uint16[o2 + 4] = v4;\n        this.uint16[o2 + 5] = v5;\n        this.uint16[o2 + 6] = v6;\n        this.uint16[o2 + 7] = v7;\n        this.uint16[o2 + 8] = v8;\n        this.uint16[o2 + 9] = v9;\n        return i;\n    }\n}\n\nStructArrayLayout10ui20.prototype.bytesPerElement = 20;\nregister('StructArrayLayout10ui20', StructArrayLayout10ui20);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[4]\n * [8] - Uint16[4]\n * [16] - Int16[4]\n *\n */\nclass StructArrayLayout4i4ui4i24 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number) {\n        const o2 = i * 12;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.uint16[o2 + 4] = v4;\n        this.uint16[o2 + 5] = v5;\n        this.uint16[o2 + 6] = v6;\n        this.uint16[o2 + 7] = v7;\n        this.int16[o2 + 8] = v8;\n        this.int16[o2 + 9] = v9;\n        this.int16[o2 + 10] = v10;\n        this.int16[o2 + 11] = v11;\n        return i;\n    }\n}\n\nStructArrayLayout4i4ui4i24.prototype.bytesPerElement = 24;\nregister('StructArrayLayout4i4ui4i24', StructArrayLayout4i4ui4i24);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[3]\n *\n */\nclass StructArrayLayout3f12 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o4 = i * 3;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout3f12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout3f12', StructArrayLayout3f12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint32[1]\n *\n */\nclass StructArrayLayout1ul4 extends StructArray {\n    uint8: Uint8Array;\n    uint32: Uint32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0);\n    }\n\n    public emplace(i: number, v0: number) {\n        const o4 = i * 1;\n        this.uint32[o4 + 0] = v0;\n        return i;\n    }\n}\n\nStructArrayLayout1ul4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout1ul4', StructArrayLayout1ul4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[6]\n * [12] - Uint32[1]\n * [16] - Uint16[2]\n *\n */\nclass StructArrayLayout6i1ul2ui20 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint32: Uint32Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number) {\n        const o2 = i * 10;\n        const o4 = i * 5;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        this.uint32[o4 + 3] = v6;\n        this.uint16[o2 + 8] = v7;\n        this.uint16[o2 + 9] = v8;\n        return i;\n    }\n}\n\nStructArrayLayout6i1ul2ui20.prototype.bytesPerElement = 20;\nregister('StructArrayLayout6i1ul2ui20', StructArrayLayout6i1ul2ui20);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Int16[2]\n * [8] - Int16[2]\n *\n */\nclass StructArrayLayout2i2i2i12 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o2 = i * 6;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2i2i2i12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout2i2i2i12', StructArrayLayout2i2i2i12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[2]\n * [8] - Float32[1]\n * [12] - Int16[2]\n *\n */\nclass StructArrayLayout2f1f2i16 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number) {\n        const o4 = i * 4;\n        const o2 = i * 8;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        this.int16[o2 + 6] = v3;\n        this.int16[o2 + 7] = v4;\n        return i;\n    }\n}\n\nStructArrayLayout2f1f2i16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout2f1f2i16', StructArrayLayout2f1f2i16);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint8[2]\n * [4] - Float32[2]\n * [12] - Int16[2]\n *\n */\nclass StructArrayLayout2ub2f2i16 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n    int16: Int16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number) {\n        const o1 = i * 16;\n        const o4 = i * 4;\n        const o2 = i * 8;\n        this.uint8[o1 + 0] = v0;\n        this.uint8[o1 + 1] = v1;\n        this.float32[o4 + 1] = v2;\n        this.float32[o4 + 2] = v3;\n        this.int16[o2 + 6] = v4;\n        this.int16[o2 + 7] = v5;\n        return i;\n    }\n}\n\nStructArrayLayout2ub2f2i16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout2ub2f2i16', StructArrayLayout2ub2f2i16);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[3]\n *\n */\nclass StructArrayLayout3ui6 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o2 = i * 3;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout3ui6.prototype.bytesPerElement = 6;\nregister('StructArrayLayout3ui6', StructArrayLayout3ui6);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[2]\n * [4] - Uint16[2]\n * [8] - Uint32[3]\n * [20] - Uint16[3]\n * [28] - Float32[2]\n * [36] - Uint8[3]\n * [40] - Uint32[1]\n * [44] - Int16[1]\n *\n */\nclass StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n    uint32: Uint32Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number) {\n        const o2 = i * 24;\n        const o4 = i * 12;\n        const o1 = i * 48;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.uint16[o2 + 2] = v2;\n        this.uint16[o2 + 3] = v3;\n        this.uint32[o4 + 2] = v4;\n        this.uint32[o4 + 3] = v5;\n        this.uint32[o4 + 4] = v6;\n        this.uint16[o2 + 10] = v7;\n        this.uint16[o2 + 11] = v8;\n        this.uint16[o2 + 12] = v9;\n        this.float32[o4 + 7] = v10;\n        this.float32[o4 + 8] = v11;\n        this.uint8[o1 + 36] = v12;\n        this.uint8[o1 + 37] = v13;\n        this.uint8[o1 + 38] = v14;\n        this.uint32[o4 + 10] = v15;\n        this.int16[o2 + 22] = v16;\n        return i;\n    }\n}\n\nStructArrayLayout2i2ui3ul3ui2f3ub1ul1i48.prototype.bytesPerElement = 48;\nregister('StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48', StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Int16[8]\n * [16] - Uint16[15]\n * [48] - Uint32[1]\n * [52] - Float32[2]\n * [60] - Uint16[2]\n *\n */\nclass StructArrayLayout8i15ui1ul2f2ui64 extends StructArray {\n    uint8: Uint8Array;\n    int16: Int16Array;\n    uint16: Uint16Array;\n    uint32: Uint32Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.int16 = new Int16Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v24, v25, v26, v27);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number, v4: number, v5: number, v6: number, v7: number, v8: number, v9: number, v10: number, v11: number, v12: number, v13: number, v14: number, v15: number, v16: number, v17: number, v18: number, v19: number, v20: number, v21: number, v22: number, v23: number, v24: number, v25: number, v26: number, v27: number) {\n        const o2 = i * 32;\n        const o4 = i * 16;\n        this.int16[o2 + 0] = v0;\n        this.int16[o2 + 1] = v1;\n        this.int16[o2 + 2] = v2;\n        this.int16[o2 + 3] = v3;\n        this.int16[o2 + 4] = v4;\n        this.int16[o2 + 5] = v5;\n        this.int16[o2 + 6] = v6;\n        this.int16[o2 + 7] = v7;\n        this.uint16[o2 + 8] = v8;\n        this.uint16[o2 + 9] = v9;\n        this.uint16[o2 + 10] = v10;\n        this.uint16[o2 + 11] = v11;\n        this.uint16[o2 + 12] = v12;\n        this.uint16[o2 + 13] = v13;\n        this.uint16[o2 + 14] = v14;\n        this.uint16[o2 + 15] = v15;\n        this.uint16[o2 + 16] = v16;\n        this.uint16[o2 + 17] = v17;\n        this.uint16[o2 + 18] = v18;\n        this.uint16[o2 + 19] = v19;\n        this.uint16[o2 + 20] = v20;\n        this.uint16[o2 + 21] = v21;\n        this.uint16[o2 + 22] = v22;\n        this.uint32[o4 + 12] = v23;\n        this.float32[o4 + 13] = v24;\n        this.float32[o4 + 14] = v25;\n        this.uint16[o2 + 30] = v26;\n        this.uint16[o2 + 31] = v27;\n        return i;\n    }\n}\n\nStructArrayLayout8i15ui1ul2f2ui64.prototype.bytesPerElement = 64;\nregister('StructArrayLayout8i15ui1ul2f2ui64', StructArrayLayout8i15ui1ul2f2ui64);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[1]\n *\n */\nclass StructArrayLayout1f4 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0);\n    }\n\n    public emplace(i: number, v0: number) {\n        const o4 = i * 1;\n        this.float32[o4 + 0] = v0;\n        return i;\n    }\n}\n\nStructArrayLayout1f4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout1f4', StructArrayLayout1f4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[1]\n * [4] - Float32[2]\n *\n */\nclass StructArrayLayout1ui2f12 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o2 = i * 6;\n        const o4 = i * 3;\n        this.uint16[o2 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout1ui2f12.prototype.bytesPerElement = 12;\nregister('StructArrayLayout1ui2f12', StructArrayLayout1ui2f12);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint32[1]\n * [4] - Uint16[2]\n *\n */\nclass StructArrayLayout1ul2ui8 extends StructArray {\n    uint8: Uint8Array;\n    uint32: Uint32Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint32 = new Uint32Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number) {\n        const o4 = i * 2;\n        const o2 = i * 4;\n        this.uint32[o4 + 0] = v0;\n        this.uint16[o2 + 2] = v1;\n        this.uint16[o2 + 3] = v2;\n        return i;\n    }\n}\n\nStructArrayLayout1ul2ui8.prototype.bytesPerElement = 8;\nregister('StructArrayLayout1ul2ui8', StructArrayLayout1ul2ui8);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[2]\n *\n */\nclass StructArrayLayout2ui4 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1);\n    }\n\n    public emplace(i: number, v0: number, v1: number) {\n        const o2 = i * 2;\n        this.uint16[o2 + 0] = v0;\n        this.uint16[o2 + 1] = v1;\n        return i;\n    }\n}\n\nStructArrayLayout2ui4.prototype.bytesPerElement = 4;\nregister('StructArrayLayout2ui4', StructArrayLayout2ui4);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Uint16[1]\n *\n */\nclass StructArrayLayout1ui2 extends StructArray {\n    uint8: Uint8Array;\n    uint16: Uint16Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.uint16 = new Uint16Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0);\n    }\n\n    public emplace(i: number, v0: number) {\n        const o2 = i * 1;\n        this.uint16[o2 + 0] = v0;\n        return i;\n    }\n}\n\nStructArrayLayout1ui2.prototype.bytesPerElement = 2;\nregister('StructArrayLayout1ui2', StructArrayLayout1ui2);\n\n/**\n * @internal\n * Implementation of the StructArray layout:\n * [0] - Float32[4]\n *\n */\nclass StructArrayLayout4f16 extends StructArray {\n    uint8: Uint8Array;\n    float32: Float32Array;\n\n    _refreshViews() {\n        this.uint8 = new Uint8Array(this.arrayBuffer);\n        this.float32 = new Float32Array(this.arrayBuffer);\n    }\n\n    public emplaceBack(v0: number, v1: number, v2: number, v3: number) {\n        const i = this.length;\n        this.resize(i + 1);\n        return this.emplace(i, v0, v1, v2, v3);\n    }\n\n    public emplace(i: number, v0: number, v1: number, v2: number, v3: number) {\n        const o4 = i * 4;\n        this.float32[o4 + 0] = v0;\n        this.float32[o4 + 1] = v1;\n        this.float32[o4 + 2] = v2;\n        this.float32[o4 + 3] = v3;\n        return i;\n    }\n}\n\nStructArrayLayout4f16.prototype.bytesPerElement = 16;\nregister('StructArrayLayout4f16', StructArrayLayout4f16);\n\n/** @internal */\nclass CollisionBoxStruct extends Struct {\n    _structArray: CollisionBoxArray;\n    get anchorPointX() { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorPointY() { return this._structArray.int16[this._pos2 + 1]; }\n    get x1() { return this._structArray.int16[this._pos2 + 2]; }\n    get y1() { return this._structArray.int16[this._pos2 + 3]; }\n    get x2() { return this._structArray.int16[this._pos2 + 4]; }\n    get y2() { return this._structArray.int16[this._pos2 + 5]; }\n    get featureIndex() { return this._structArray.uint32[this._pos4 + 3]; }\n    get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 8]; }\n    get bucketIndex() { return this._structArray.uint16[this._pos2 + 9]; }\n    get anchorPoint() { return new Point(this.anchorPointX, this.anchorPointY); }\n}\n\nCollisionBoxStruct.prototype.size = 20;\n\nexport type CollisionBox = CollisionBoxStruct;\n\n/** @internal */\nexport class CollisionBoxArray extends StructArrayLayout6i1ul2ui20 {\n    /**\n     * Return the CollisionBoxStruct at the given location in the array.\n     * @param index The index of the element.\n     */\n    get(index: number): CollisionBoxStruct {\n        return new CollisionBoxStruct(this, index);\n    }\n}\n\nregister('CollisionBoxArray', CollisionBoxArray);\n\n/** @internal */\nclass PlacedSymbolStruct extends Struct {\n    _structArray: PlacedSymbolArray;\n    get anchorX() { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorY() { return this._structArray.int16[this._pos2 + 1]; }\n    get glyphStartIndex() { return this._structArray.uint16[this._pos2 + 2]; }\n    get numGlyphs() { return this._structArray.uint16[this._pos2 + 3]; }\n    get vertexStartIndex() { return this._structArray.uint32[this._pos4 + 2]; }\n    get lineStartIndex() { return this._structArray.uint32[this._pos4 + 3]; }\n    get lineLength() { return this._structArray.uint32[this._pos4 + 4]; }\n    get segment() { return this._structArray.uint16[this._pos2 + 10]; }\n    get lowerSize() { return this._structArray.uint16[this._pos2 + 11]; }\n    get upperSize() { return this._structArray.uint16[this._pos2 + 12]; }\n    get lineOffsetX() { return this._structArray.float32[this._pos4 + 7]; }\n    get lineOffsetY() { return this._structArray.float32[this._pos4 + 8]; }\n    get writingMode() { return this._structArray.uint8[this._pos1 + 36]; }\n    get placedOrientation() { return this._structArray.uint8[this._pos1 + 37]; }\n    set placedOrientation(x: number) { this._structArray.uint8[this._pos1 + 37] = x; }\n    get hidden() { return this._structArray.uint8[this._pos1 + 38]; }\n    set hidden(x: number) { this._structArray.uint8[this._pos1 + 38] = x; }\n    get crossTileID() { return this._structArray.uint32[this._pos4 + 10]; }\n    set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 10] = x; }\n    get associatedIconIndex() { return this._structArray.int16[this._pos2 + 22]; }\n}\n\nPlacedSymbolStruct.prototype.size = 48;\n\nexport type PlacedSymbol = PlacedSymbolStruct;\n\n/** @internal */\nexport class PlacedSymbolArray extends StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48 {\n    /**\n     * Return the PlacedSymbolStruct at the given location in the array.\n     * @param index The index of the element.\n     */\n    get(index: number): PlacedSymbolStruct {\n        return new PlacedSymbolStruct(this, index);\n    }\n}\n\nregister('PlacedSymbolArray', PlacedSymbolArray);\n\n/** @internal */\nclass SymbolInstanceStruct extends Struct {\n    _structArray: SymbolInstanceArray;\n    get anchorX() { return this._structArray.int16[this._pos2 + 0]; }\n    get anchorY() { return this._structArray.int16[this._pos2 + 1]; }\n    get rightJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 2]; }\n    get centerJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 3]; }\n    get leftJustifiedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 4]; }\n    get verticalPlacedTextSymbolIndex() { return this._structArray.int16[this._pos2 + 5]; }\n    get placedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 6]; }\n    get verticalPlacedIconSymbolIndex() { return this._structArray.int16[this._pos2 + 7]; }\n    get key() { return this._structArray.uint16[this._pos2 + 8]; }\n    get textBoxStartIndex() { return this._structArray.uint16[this._pos2 + 9]; }\n    get textBoxEndIndex() { return this._structArray.uint16[this._pos2 + 10]; }\n    get verticalTextBoxStartIndex() { return this._structArray.uint16[this._pos2 + 11]; }\n    get verticalTextBoxEndIndex() { return this._structArray.uint16[this._pos2 + 12]; }\n    get iconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 13]; }\n    get iconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 14]; }\n    get verticalIconBoxStartIndex() { return this._structArray.uint16[this._pos2 + 15]; }\n    get verticalIconBoxEndIndex() { return this._structArray.uint16[this._pos2 + 16]; }\n    get featureIndex() { return this._structArray.uint16[this._pos2 + 17]; }\n    get numHorizontalGlyphVertices() { return this._structArray.uint16[this._pos2 + 18]; }\n    get numVerticalGlyphVertices() { return this._structArray.uint16[this._pos2 + 19]; }\n    get numIconVertices() { return this._structArray.uint16[this._pos2 + 20]; }\n    get numVerticalIconVertices() { return this._structArray.uint16[this._pos2 + 21]; }\n    get useRuntimeCollisionCircles() { return this._structArray.uint16[this._pos2 + 22]; }\n    get crossTileID() { return this._structArray.uint32[this._pos4 + 12]; }\n    set crossTileID(x: number) { this._structArray.uint32[this._pos4 + 12] = x; }\n    get textBoxScale() { return this._structArray.float32[this._pos4 + 13]; }\n    get collisionCircleDiameter() { return this._structArray.float32[this._pos4 + 14]; }\n    get textAnchorOffsetStartIndex() { return this._structArray.uint16[this._pos2 + 30]; }\n    get textAnchorOffsetEndIndex() { return this._structArray.uint16[this._pos2 + 31]; }\n}\n\nSymbolInstanceStruct.prototype.size = 64;\n\nexport type SymbolInstance = SymbolInstanceStruct;\n\n/** @internal */\nexport class SymbolInstanceArray extends StructArrayLayout8i15ui1ul2f2ui64 {\n    /**\n     * Return the SymbolInstanceStruct at the given location in the array.\n     * @param index The index of the element.\n     */\n    get(index: number): SymbolInstanceStruct {\n        return new SymbolInstanceStruct(this, index);\n    }\n}\n\nregister('SymbolInstanceArray', SymbolInstanceArray);\n\n/** @internal */\nexport class GlyphOffsetArray extends StructArrayLayout1f4 {\n    getoffsetX(index: number) { return this.float32[index * 1 + 0]; }\n}\n\nregister('GlyphOffsetArray', GlyphOffsetArray);\n\n/** @internal */\nexport class SymbolLineVertexArray extends StructArrayLayout3i6 {\n    getx(index: number) { return this.int16[index * 3 + 0]; }\n    gety(index: number) { return this.int16[index * 3 + 1]; }\n    gettileUnitDistanceFromAnchor(index: number) { return this.int16[index * 3 + 2]; }\n}\n\nregister('SymbolLineVertexArray', SymbolLineVertexArray);\n\n/** @internal */\nclass TextAnchorOffsetStruct extends Struct {\n    _structArray: TextAnchorOffsetArray;\n    get textAnchor() { return this._structArray.uint16[this._pos2 + 0]; }\n    get textOffset0() { return this._structArray.float32[this._pos4 + 1]; }\n    get textOffset1() { return this._structArray.float32[this._pos4 + 2]; }\n}\n\nTextAnchorOffsetStruct.prototype.size = 12;\n\nexport type TextAnchorOffset = TextAnchorOffsetStruct;\n\n/** @internal */\nexport class TextAnchorOffsetArray extends StructArrayLayout1ui2f12 {\n    /**\n     * Return the TextAnchorOffsetStruct at the given location in the array.\n     * @param index The index of the element.\n     */\n    get(index: number): TextAnchorOffsetStruct {\n        return new TextAnchorOffsetStruct(this, index);\n    }\n}\n\nregister('TextAnchorOffsetArray', TextAnchorOffsetArray);\n\n/** @internal */\nclass FeatureIndexStruct extends Struct {\n    _structArray: FeatureIndexArray;\n    get featureIndex() { return this._structArray.uint32[this._pos4 + 0]; }\n    get sourceLayerIndex() { return this._structArray.uint16[this._pos2 + 2]; }\n    get bucketIndex() { return this._structArray.uint16[this._pos2 + 3]; }\n}\n\nFeatureIndexStruct.prototype.size = 8;\n\nexport type FeatureIndex = FeatureIndexStruct;\n\n/** @internal */\nexport class FeatureIndexArray extends StructArrayLayout1ul2ui8 {\n    /**\n     * Return the FeatureIndexStruct at the given location in the array.\n     * @param index The index of the element.\n     */\n    get(index: number): FeatureIndexStruct {\n        return new FeatureIndexStruct(this, index);\n    }\n}\n\nregister('FeatureIndexArray', FeatureIndexArray);\n\nexport class PosArray extends StructArrayLayout2i4 {}\nexport class Pos3dArray extends StructArrayLayout3i6 {}\nexport class RasterBoundsArray extends StructArrayLayout4i8 {}\nexport class CircleLayoutArray extends StructArrayLayout2i4 {}\nexport class FillLayoutArray extends StructArrayLayout2i4 {}\nexport class FillExtrusionLayoutArray extends StructArrayLayout2i4i12 {}\nexport class HeatmapLayoutArray extends StructArrayLayout2i4 {}\nexport class LineLayoutArray extends StructArrayLayout2i4ub8 {}\nexport class LineExtLayoutArray extends StructArrayLayout2f8 {}\nexport class PatternLayoutArray extends StructArrayLayout10ui20 {}\nexport class SymbolLayoutArray extends StructArrayLayout4i4ui4i24 {}\nexport class SymbolDynamicLayoutArray extends StructArrayLayout3f12 {}\nexport class SymbolOpacityArray extends StructArrayLayout1ul4 {}\nexport class CollisionBoxLayoutArray extends StructArrayLayout2i2i2i12 {}\nexport class CollisionCircleLayoutArray extends StructArrayLayout2f1f2i16 {}\nexport class CollisionVertexArray extends StructArrayLayout2ub2f2i16 {}\nexport class QuadTriangleArray extends StructArrayLayout3ui6 {}\nexport class TriangleIndexArray extends StructArrayLayout3ui6 {}\nexport class LineIndexArray extends StructArrayLayout2ui4 {}\nexport class LineStripIndexArray extends StructArrayLayout1ui2 {}\nexport {\n    StructArrayLayout2i4,\n    StructArrayLayout3i6,\n    StructArrayLayout4i8,\n    StructArrayLayout2i4i12,\n    StructArrayLayout2i4ub8,\n    StructArrayLayout2f8,\n    StructArrayLayout10ui20,\n    StructArrayLayout4i4ui4i24,\n    StructArrayLayout3f12,\n    StructArrayLayout1ul4,\n    StructArrayLayout6i1ul2ui20,\n    StructArrayLayout2i2i2i12,\n    StructArrayLayout2f1f2i16,\n    StructArrayLayout2ub2f2i16,\n    StructArrayLayout3ui6,\n    StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48,\n    StructArrayLayout8i15ui1ul2f2ui64,\n    StructArrayLayout1f4,\n    StructArrayLayout1ui2f12,\n    StructArrayLayout1ul2ui8,\n    StructArrayLayout2ui4,\n    StructArrayLayout1ui2,\n    StructArrayLayout4f16\n};\n", "import {createLayout} from '../../util/struct_array';\n\nconst layout = createLayout([\n    {name: 'a_pos', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const {members, size, alignment} = layout;\n", "import {warnOnce} from '../util/util';\n\nimport {register} from '../util/web_worker_transfer';\n\nimport type {VertexArrayObject} from '../render/vertex_array_object';\nimport type {StructArray} from '../util/struct_array';\n\n/**\n * @internal\n * A single segment of a vector\n */\nexport type Segment = {\n    sortKey?: number;\n    vertexOffset: number;\n    primitiveOffset: number;\n    vertexLength: number;\n    primitiveLength: number;\n    vaos: {[_: string]: VertexArrayObject};\n};\n\n/**\n * @internal\n * Used for calculations on vector segments\n */\nexport class SegmentVector {\n    static MAX_VERTEX_ARRAY_LENGTH: number;\n    segments: Array<Segment>;\n\n    constructor(segments: Array<Segment> = []) {\n        this.segments = segments;\n    }\n\n    prepareSegment(\n        numVertices: number,\n        layoutVertexArray: StructArray,\n        indexArray: StructArray,\n        sortKey?: number\n    ): Segment {\n        let segment: Segment = this.segments[this.segments.length - 1];\n        if (numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) warnOnce(`Max vertices per segment is ${SegmentVector.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${numVertices}`);\n        if (!segment || segment.vertexLength + numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH || segment.sortKey !== sortKey) {\n            segment = ({\n                vertexOffset: layoutVertexArray.length,\n                primitiveOffset: indexArray.length,\n                vertexLength: 0,\n                primitiveLength: 0\n            } as any);\n            if (sortKey !== undefined) segment.sortKey = sortKey;\n            this.segments.push(segment);\n        }\n        return segment;\n    }\n\n    get() {\n        return this.segments;\n    }\n\n    destroy() {\n        for (const segment of this.segments) {\n            for (const k in segment.vaos) {\n                segment.vaos[k].destroy();\n            }\n        }\n    }\n\n    static simpleSegment(\n        vertexOffset: number,\n        primitiveOffset: number,\n        vertexLength: number,\n        primitiveLength: number\n    ): SegmentVector {\n        return new SegmentVector([{\n            vertexOffset,\n            primitiveOffset,\n            vertexLength,\n            primitiveLength,\n            vaos: {},\n            sortKey: 0\n        }]);\n    }\n}\n\n/**\n * The maximum size of a vertex array. This limit is imposed by WebGL's 16 bit\n * addressing of vertex buffers.\n */\nSegmentVector.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1;\n\nregister('SegmentVector', SegmentVector);\n", "import {clamp} from '../util/util';\n\n/**\n * Packs two numbers, interpreted as 8-bit unsigned integers, into a single\n * float.  Unpack them in the shader using the `unpack_float()` function,\n * defined in _prelude.vertex.glsl\n */\nexport function packUint8ToFloat(a: number, b: number) {\n    // coerce a and b to 8-bit ints\n    a = clamp(Math.floor(a), 0, 255);\n    b = clamp(Math.floor(b), 0, 255);\n    return 256 * a + b;\n}\n", "import {createLayout} from '../../util/struct_array';\n\nexport const patternAttributes = createLayout([\n    // [tl.x, tl.y, br.x, br.y]\n    {name: 'a_pattern_from', components: 4, type: 'Uint16'},\n    {name: 'a_pattern_to', components: 4, type: 'Uint16'},\n    {name: 'a_pixel_ratio_from', components: 1, type: 'Uint16'},\n    {name: 'a_pixel_ratio_to', components: 1, type: 'Uint16'},\n]);\n", "/**\n * JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)\n * \n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n * \n * @param {string} key ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash \n */\n\nfunction murmurhash3_32_gc(key, seed) {\n\tvar remainder, bytes, h1, h1b, c1, c1b, c2, c2b, k1, i;\n\t\n\tremainder = key.length & 3; // key.length % 4\n\tbytes = key.length - remainder;\n\th1 = seed;\n\tc1 = 0xcc9e2d51;\n\tc2 = 0x1b873593;\n\ti = 0;\n\t\n\twhile (i < bytes) {\n\t  \tk1 = \n\t  \t  ((key.charCodeAt(i) & 0xff)) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 8) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 16) |\n\t  \t  ((key.charCodeAt(++i) & 0xff) << 24);\n\t\t++i;\n\t\t\n\t\tk1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;\n\t\tk1 = (k1 << 15) | (k1 >>> 17);\n\t\tk1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;\n\n\t\th1 ^= k1;\n        h1 = (h1 << 13) | (h1 >>> 19);\n\t\th1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;\n\t\th1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));\n\t}\n\t\n\tk1 = 0;\n\t\n\tswitch (remainder) {\n\t\tcase 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;\n\t\tcase 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;\n\t\tcase 1: k1 ^= (key.charCodeAt(i) & 0xff);\n\t\t\n\t\tk1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;\n\t\tk1 = (k1 << 15) | (k1 >>> 17);\n\t\tk1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;\n\t\th1 ^= k1;\n\t}\n\t\n\th1 ^= key.length;\n\n\th1 ^= h1 >>> 16;\n\th1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;\n\th1 ^= h1 >>> 13;\n\th1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;\n\th1 ^= h1 >>> 16;\n\n\treturn h1 >>> 0;\n}\n\nif(typeof module !== \"undefined\") {\n  module.exports = murmurhash3_32_gc\n}", "/**\n * JS Implementation of MurmurHash2\n * \n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/murmurhash-js\n * @author <a href=\"mailto:aappleby@gmail.com\">Austin Appleby</a>\n * @see http://sites.google.com/site/murmurhash/\n * \n * @param {string} str ASCII only\n * @param {number} seed Positive integer only\n * @return {number} 32-bit positive integer hash\n */\n\nfunction murmurhash2_32_gc(str, seed) {\n  var\n    l = str.length,\n    h = seed ^ l,\n    i = 0,\n    k;\n  \n  while (l >= 4) {\n  \tk = \n  \t  ((str.charCodeAt(i) & 0xff)) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 8) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 16) |\n  \t  ((str.charCodeAt(++i) & 0xff) << 24);\n    \n    k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n    k ^= k >>> 24;\n    k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n\n\th = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k;\n\n    l -= 4;\n    ++i;\n  }\n  \n  switch (l) {\n  case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n  case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n  case 1: h ^= (str.charCodeAt(i) & 0xff);\n          h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n  }\n\n  h ^= h >>> 13;\n  h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16));\n  h ^= h >>> 15;\n\n  return h >>> 0;\n}\n\nif(typeof module !== undefined) {\n  module.exports = murmurhash2_32_gc\n}\n", "var murmur3 = require(\"./murmurhash3_gc.js\")\nvar murmur2 = require(\"./murmurhash2_gc.js\")\n\nmodule.exports = murmur3\nmodule.exports.murmur3 = murmur3\nmodule.exports.murmur2 = murmur2\n", "import murmur3 from 'murmurhash-js';\nimport {register} from '../util/web_worker_transfer';\n\ntype SerializedFeaturePositionMap = {\n    ids: Float64Array;\n    positions: Uint32Array;\n};\n\ntype FeaturePosition = {\n    index: number;\n    start: number;\n    end: number;\n};\n\n// A transferable data structure that maps feature ids to their indices and buffer offsets\nexport class FeaturePositionMap {\n    ids: Array<number>;\n    positions: Array<number>;\n    indexed: boolean;\n\n    constructor() {\n        this.ids = [];\n        this.positions = [];\n        this.indexed = false;\n    }\n\n    add(id: unknown, index: number, start: number, end: number) {\n        this.ids.push(getNumericId(id));\n        this.positions.push(index, start, end);\n    }\n\n    getPositions(id: unknown): Array<FeaturePosition> {\n        if (!this.indexed) throw new Error('Trying to get index, but feature positions are not indexed');\n\n        const intId = getNumericId(id);\n\n        // binary search for the first occurrence of id in this.ids;\n        // relies on ids/positions being sorted by id, which happens in serialization\n        let i = 0;\n        let j = this.ids.length - 1;\n        while (i < j) {\n            const m = (i + j) >> 1;\n            if (this.ids[m] >= intId) {\n                j = m;\n            } else {\n                i = m + 1;\n            }\n        }\n        const positions = [];\n        while (this.ids[i] === intId) {\n            const index = this.positions[3 * i];\n            const start = this.positions[3 * i + 1];\n            const end = this.positions[3 * i + 2];\n            positions.push({index, start, end});\n            i++;\n        }\n        return positions;\n    }\n\n    static serialize(map: FeaturePositionMap, transferables: Array<ArrayBuffer>): SerializedFeaturePositionMap {\n        const ids = new Float64Array(map.ids);\n        const positions = new Uint32Array(map.positions);\n\n        sort(ids, positions, 0, ids.length - 1);\n\n        if (transferables) {\n            transferables.push(ids.buffer, positions.buffer);\n        }\n\n        return {ids, positions};\n    }\n\n    static deserialize(obj: SerializedFeaturePositionMap): FeaturePositionMap {\n        const map = new FeaturePositionMap();\n        // after transferring, we only use these arrays statically (no pushes),\n        // so TypedArray vs Array distinction that flow points out doesn't matter\n        map.ids = (obj.ids as any);\n        map.positions = (obj.positions as any);\n        map.indexed = true;\n        return map;\n    }\n}\n\nfunction getNumericId(value: unknown) {\n    const numValue = +value;\n    if (!isNaN(numValue) && numValue <= Number.MAX_SAFE_INTEGER) {\n        return numValue;\n    }\n    return murmur3(String(value));\n}\n\n// custom quicksort that sorts ids, indices and offsets together (by ids)\n// uses Hoare partitioning & manual tail call optimization to avoid worst case scenarios\nfunction sort(ids, positions, left, right) {\n    while (left < right) {\n        const pivot = ids[(left + right) >> 1];\n        let i = left - 1;\n        let j = right + 1;\n\n        while (true) {\n            do i++; while (ids[i] < pivot);\n            do j--; while (ids[j] > pivot);\n            if (i >= j) break;\n            swap(ids, i, j);\n            swap(positions, 3 * i, 3 * j);\n            swap(positions, 3 * i + 1, 3 * j + 1);\n            swap(positions, 3 * i + 2, 3 * j + 2);\n        }\n\n        if (j - left < right - j) {\n            sort(ids, positions, left, j);\n            left = j + 1;\n        } else {\n            sort(ids, positions, j + 1, right);\n            right = j;\n        }\n    }\n}\n\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\nregister('FeaturePositionMap', FeaturePositionMap);\n", "import {Color} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {Context} from '../gl/context';\nimport {mat4, vec2, vec3, vec4} from 'gl-matrix';\n\ntype $ObjMap<T extends {}, F extends (v: any) => any> = {\n    [K in keyof T]: F extends (v: T[K]) => infer R ? R : never;\n};\n\nexport type UniformValues<Us extends {}> = $ObjMap<Us, <V>(u: Uniform<V>) => V>;\nexport type UniformLocations = {[_: string]: WebGLUniformLocation};\n\n/**\n * @internal\n * A base uniform abstract class\n */\nabstract class Uniform<T> {\n    gl: WebGLRenderingContext|WebGL2RenderingContext;\n    location: WebGLUniformLocation;\n    current: T;\n\n    constructor(context: Context, location: WebGLUniformLocation) {\n        this.gl = context.gl;\n        this.location = location;\n    }\n\n    abstract set(v: T): void;\n}\n\nclass Uniform1i extends Uniform<number> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = 0;\n    }\n\n    set(v: number): void {\n        if (this.current !== v) {\n            this.current = v;\n            this.gl.uniform1i(this.location, v);\n        }\n    }\n}\n\nclass Uniform1f extends Uniform<number> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = 0;\n    }\n\n    set(v: number): void {\n        if (this.current !== v) {\n            this.current = v;\n            this.gl.uniform1f(this.location, v);\n        }\n    }\n}\n\nclass Uniform2f extends Uniform<vec2> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = [0, 0];\n    }\n\n    set(v: vec2): void {\n        if (v[0] !== this.current[0] || v[1] !== this.current[1]) {\n            this.current = v;\n            this.gl.uniform2f(this.location, v[0], v[1]);\n        }\n    }\n}\n\nclass Uniform3f extends Uniform<vec3> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = [0, 0, 0];\n    }\n\n    set(v: vec3): void {\n        if (v[0] !== this.current[0] || v[1] !== this.current[1] || v[2] !== this.current[2]) {\n            this.current = v;\n            this.gl.uniform3f(this.location, v[0], v[1], v[2]);\n        }\n    }\n}\n\nclass Uniform4f extends Uniform<vec4> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = [0, 0, 0, 0];\n    }\n\n    set(v: vec4): void {\n        if (v[0] !== this.current[0] || v[1] !== this.current[1] ||\n            v[2] !== this.current[2] || v[3] !== this.current[3]) {\n            this.current = v;\n            this.gl.uniform4f(this.location, v[0], v[1], v[2], v[3]);\n        }\n    }\n}\n\nclass UniformColor extends Uniform<Color> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = Color.transparent;\n    }\n\n    set(v: Color): void {\n        if (v.r !== this.current.r || v.g !== this.current.g ||\n            v.b !== this.current.b || v.a !== this.current.a) {\n            this.current = v;\n            this.gl.uniform4f(this.location, v.r, v.g, v.b, v.a);\n        }\n    }\n}\n\nconst emptyMat4 = new Float32Array(16) as mat4;\nclass UniformMatrix4f extends Uniform<mat4> {\n    constructor(context: Context, location: WebGLUniformLocation) {\n        super(context, location);\n        this.current = emptyMat4;\n    }\n\n    set(v: mat4): void {\n        // The vast majority of matrix comparisons that will trip this set\n        // happen at i=12 or i=0, so we check those first to avoid lots of\n        // unnecessary iteration:\n        if (v[12] !== this.current[12] || v[0] !== this.current[0]) {\n            this.current = v;\n            this.gl.uniformMatrix4fv(this.location, false, v);\n            return;\n        }\n        for (let i = 1; i < 16; i++) {\n            if (v[i] !== this.current[i]) {\n                this.current = v;\n                this.gl.uniformMatrix4fv(this.location, false, v);\n                break;\n            }\n        }\n    }\n}\n\nexport {\n    Uniform,\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f,\n    Uniform4f,\n    UniformColor,\n    UniformMatrix4f\n};\n\n/**\n * @internal\n * A uniform bindings\n */\nexport type UniformBindings = {[_: string]: Uniform<any>};\n", "import {packUint8ToFloat} from '../shaders/encode_attribute';\nimport {Color, supportsPropertyExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {register} from '../util/web_worker_transfer';\nimport {PossiblyEvaluatedPropertyValue} from '../style/properties';\nimport {StructArrayLayout1f4, StructArrayLayout2f8, StructArrayLayout4f16, PatternLayoutArray} from './array_types.g';\nimport {clamp} from '../util/util';\nimport {patternAttributes} from './bucket/pattern_attributes';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {FeaturePositionMap} from './feature_position_map';\nimport {Uniform, Uniform1f, UniformColor, Uniform4f} from '../render/uniform_binding';\n\nimport type {UniformLocations} from '../render/uniform_binding';\n\nimport type {CanonicalTileID} from '../source/tile_id';\nimport type {Context} from '../gl/context';\nimport type {TypedStyleLayer} from '../style/style_layer/typed_style_layer';\nimport type {CrossfadeParameters} from '../style/evaluation_parameters';\nimport type {StructArray, StructArrayMember} from '../util/struct_array';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {\n    Feature,\n    FeatureState,\n    GlobalProperties,\n    SourceExpression,\n    CompositeExpression,\n    FormattedSection\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {FeatureStates} from '../source/source_state';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\n\nexport type BinderUniform = {\n    name: string;\n    property: string;\n    binding: Uniform<any>;\n};\n\nfunction packColor(color: Color): [number, number] {\n    return [\n        packUint8ToFloat(255 * color.r, 255 * color.g),\n        packUint8ToFloat(255 * color.b, 255 * color.a)\n    ];\n}\n\n/**\n *  `Binder` is the interface definition for the strategies for constructing,\n *  uploading, and binding paint property data as GLSL attributes. Most style-\n *  spec properties have a 1:1 relationship to shader attribute/uniforms, but\n *  some require multiple values per feature to be passed to the GPU, and in\n *  those cases we bind multiple attributes/uniforms.\n *\n *  It has three implementations, one for each of the three strategies we use:\n *\n *  * For _constant_ properties -- those whose value is a constant, or the constant\n *    result of evaluating a camera expression at a particular camera position -- we\n *    don't need a vertex attribute buffer, and instead use a uniform.\n *  * For data expressions, we use a vertex buffer with a single attribute value,\n *    the evaluated result of the source function for the given feature.\n *  * For composite expressions, we use a vertex buffer with two attributes: min and\n *    max values covering the range of zooms at which we expect the tile to be\n *    displayed. These values are calculated by evaluating the composite expression for\n *    the given feature at strategically chosen zoom levels. In addition to this\n *    attribute data, we also use a uniform value which the shader uses to interpolate\n *    between the min and max value at the final displayed zoom level. The use of a\n *    uniform allows us to cheaply update the value on every frame.\n *\n *  Note that the shader source varies depending on whether we're using a uniform or\n *  attribute. We dynamically compile shaders at runtime to accommodate this.\n */\ninterface AttributeBinder {\n    populatePaintArray(\n        length: number,\n        feature: Feature,\n        imagePositions: {[_: string]: ImagePosition},\n        canonical?: CanonicalTileID,\n        formattedSection?: FormattedSection\n    ): void;\n    updatePaintArray(\n        start: number,\n        length: number,\n        feature: Feature,\n        featureState: FeatureState,\n        imagePositions: {[_: string]: ImagePosition}\n    ): void;\n    upload(a: Context): void;\n    destroy(): void;\n}\n\ninterface UniformBinder {\n    uniformNames: Array<string>;\n    setUniform(\n        uniform: Uniform<any>,\n        globals: GlobalProperties,\n        currentValue: PossiblyEvaluatedPropertyValue<any>,\n        uniformName: string\n    ): void;\n    getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>>;\n}\n\nclass ConstantBinder implements UniformBinder {\n    value: unknown;\n    type: string;\n    uniformNames: Array<string>;\n\n    constructor(value: unknown, names: Array<string>, type: string) {\n        this.value = value;\n        this.uniformNames = names.map(name => `u_${name}`);\n        this.type = type;\n    }\n\n    setUniform(\n        uniform: Uniform<any>,\n        globals: GlobalProperties,\n        currentValue: PossiblyEvaluatedPropertyValue<unknown>\n    ): void {\n        uniform.set(currentValue.constantOr(this.value));\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, _: string): Partial<Uniform<any>> {\n        return (this.type === 'color') ?\n            new UniformColor(context, location) :\n            new Uniform1f(context, location);\n    }\n}\n\nclass CrossFadedConstantBinder implements UniformBinder {\n    uniformNames: Array<string>;\n    patternFrom: Array<number>;\n    patternTo: Array<number>;\n    pixelRatioFrom: number;\n    pixelRatioTo: number;\n\n    constructor(value: unknown, names: Array<string>) {\n        this.uniformNames = names.map(name => `u_${name}`);\n        this.patternFrom = null;\n        this.patternTo = null;\n        this.pixelRatioFrom = 1.0;\n        this.pixelRatioTo = 1.0;\n    }\n\n    setConstantPatternPositions(posTo: ImagePosition, posFrom: ImagePosition) {\n        this.pixelRatioFrom = posFrom.pixelRatio;\n        this.pixelRatioTo = posTo.pixelRatio;\n        this.patternFrom = posFrom.tlbr;\n        this.patternTo = posTo.tlbr;\n    }\n\n    setUniform(uniform: Uniform<any>, globals: GlobalProperties, currentValue: PossiblyEvaluatedPropertyValue<unknown>, uniformName: string) {\n        const pos =\n            uniformName === 'u_pattern_to' ? this.patternTo :\n                uniformName === 'u_pattern_from' ? this.patternFrom :\n                    uniformName === 'u_pixel_ratio_to' ? this.pixelRatioTo :\n                        uniformName === 'u_pixel_ratio_from' ? this.pixelRatioFrom : null;\n        if (pos) uniform.set(pos);\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, name: string): Partial<Uniform<any>> {\n        return name.substr(0, 9) === 'u_pattern' ?\n            new Uniform4f(context, location) :\n            new Uniform1f(context, location);\n    }\n}\n\nclass SourceExpressionBinder implements AttributeBinder {\n    expression: SourceExpression;\n    type: string;\n    maxValue: number;\n\n    paintVertexArray: StructArray;\n    paintVertexAttributes: Array<StructArrayMember>;\n    paintVertexBuffer: VertexBuffer;\n\n    constructor(expression: SourceExpression, names: Array<string>, type: string, PaintVertexArray: {\n        new (...args: any): StructArray;\n    }) {\n        this.expression = expression;\n        this.type = type;\n        this.maxValue = 0;\n        this.paintVertexAttributes = names.map((name) => ({\n            name: `a_${name}`,\n            type: 'Float32',\n            components: type === 'color' ? 2 : 1,\n            offset: 0\n        }));\n        this.paintVertexArray = new PaintVertexArray();\n    }\n\n    populatePaintArray(newLength: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection) {\n        const start = this.paintVertexArray.length;\n        const value = this.expression.evaluate(new EvaluationParameters(0), feature, {}, canonical, [], formattedSection);\n        this.paintVertexArray.resize(newLength);\n        this._setPaintValue(start, newLength, value);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState) {\n        const value = this.expression.evaluate({zoom: 0}, feature, featureState);\n        this._setPaintValue(start, end, value);\n    }\n\n    _setPaintValue(start, end, value) {\n        if (this.type === 'color') {\n            const color = packColor(value);\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, color[0], color[1]);\n            }\n        } else {\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, value);\n            }\n            this.maxValue = Math.max(this.maxValue, Math.abs(value));\n        }\n    }\n\n    upload(context: Context) {\n        if (this.paintVertexArray && this.paintVertexArray.arrayBuffer) {\n            if (this.paintVertexBuffer && this.paintVertexBuffer.buffer) {\n                this.paintVertexBuffer.updateData(this.paintVertexArray);\n            } else {\n                this.paintVertexBuffer = context.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent);\n            }\n        }\n    }\n\n    destroy() {\n        if (this.paintVertexBuffer) {\n            this.paintVertexBuffer.destroy();\n        }\n    }\n}\n\nclass CompositeExpressionBinder implements AttributeBinder, UniformBinder {\n    expression: CompositeExpression;\n    uniformNames: Array<string>;\n    type: string;\n    useIntegerZoom: boolean;\n    zoom: number;\n    maxValue: number;\n\n    paintVertexArray: StructArray;\n    paintVertexAttributes: Array<StructArrayMember>;\n    paintVertexBuffer: VertexBuffer;\n\n    constructor(expression: CompositeExpression, names: Array<string>, type: string, useIntegerZoom: boolean, zoom: number, PaintVertexArray: {\n        new (...args: any): StructArray;\n    }) {\n        this.expression = expression;\n        this.uniformNames = names.map(name => `u_${name}_t`);\n        this.type = type;\n        this.useIntegerZoom = useIntegerZoom;\n        this.zoom = zoom;\n        this.maxValue = 0;\n        this.paintVertexAttributes = names.map((name) => ({\n            name: `a_${name}`,\n            type: 'Float32',\n            components: type === 'color' ? 4 : 2,\n            offset: 0\n        }));\n        this.paintVertexArray = new PaintVertexArray();\n    }\n\n    populatePaintArray(newLength: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection) {\n        const min = this.expression.evaluate(new EvaluationParameters(this.zoom), feature, {}, canonical, [], formattedSection);\n        const max = this.expression.evaluate(new EvaluationParameters(this.zoom + 1), feature, {}, canonical, [], formattedSection);\n        const start = this.paintVertexArray.length;\n        this.paintVertexArray.resize(newLength);\n        this._setPaintValue(start, newLength, min, max);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState) {\n        const min = this.expression.evaluate({zoom: this.zoom}, feature, featureState);\n        const max = this.expression.evaluate({zoom: this.zoom + 1}, feature, featureState);\n        this._setPaintValue(start, end, min, max);\n    }\n\n    _setPaintValue(start, end, min, max) {\n        if (this.type === 'color') {\n            const minColor = packColor(min);\n            const maxColor = packColor(max);\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, minColor[0], minColor[1], maxColor[0], maxColor[1]);\n            }\n        } else {\n            for (let i = start; i < end; i++) {\n                this.paintVertexArray.emplace(i, min, max);\n            }\n            this.maxValue = Math.max(this.maxValue, Math.abs(min), Math.abs(max));\n        }\n    }\n\n    upload(context: Context) {\n        if (this.paintVertexArray && this.paintVertexArray.arrayBuffer) {\n            if (this.paintVertexBuffer && this.paintVertexBuffer.buffer) {\n                this.paintVertexBuffer.updateData(this.paintVertexArray);\n            } else {\n                this.paintVertexBuffer = context.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent);\n            }\n        }\n    }\n\n    destroy() {\n        if (this.paintVertexBuffer) {\n            this.paintVertexBuffer.destroy();\n        }\n    }\n\n    setUniform(uniform: Uniform<any>, globals: GlobalProperties): void {\n        const currentZoom = this.useIntegerZoom ? Math.floor(globals.zoom) : globals.zoom;\n        const factor = clamp(this.expression.interpolationFactor(currentZoom, this.zoom, this.zoom + 1), 0, 1);\n        uniform.set(factor);\n    }\n\n    getBinding(context: Context, location: WebGLUniformLocation, _: string): Uniform1f {\n        return new Uniform1f(context, location);\n    }\n}\n\nclass CrossFadedCompositeBinder implements AttributeBinder {\n    expression: CompositeExpression;\n    type: string;\n    useIntegerZoom: boolean;\n    zoom: number;\n    layerId: string;\n\n    zoomInPaintVertexArray: StructArray;\n    zoomOutPaintVertexArray: StructArray;\n    zoomInPaintVertexBuffer: VertexBuffer;\n    zoomOutPaintVertexBuffer: VertexBuffer;\n    paintVertexAttributes: Array<StructArrayMember>;\n\n    constructor(expression: CompositeExpression, type: string, useIntegerZoom: boolean, zoom: number, PaintVertexArray: {\n        new (...args: any): StructArray;\n    }, layerId: string) {\n        this.expression = expression;\n        this.type = type;\n        this.useIntegerZoom = useIntegerZoom;\n        this.zoom = zoom;\n        this.layerId = layerId;\n\n        this.zoomInPaintVertexArray = new PaintVertexArray();\n        this.zoomOutPaintVertexArray = new PaintVertexArray();\n    }\n\n    populatePaintArray(length: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}) {\n        const start = this.zoomInPaintVertexArray.length;\n        this.zoomInPaintVertexArray.resize(length);\n        this.zoomOutPaintVertexArray.resize(length);\n        this._setPaintValues(start, length, feature.patterns && feature.patterns[this.layerId], imagePositions);\n    }\n\n    updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, imagePositions: {[_: string]: ImagePosition}) {\n        this._setPaintValues(start, end, feature.patterns && feature.patterns[this.layerId], imagePositions);\n    }\n\n    _setPaintValues(start, end, patterns, positions) {\n        if (!positions || !patterns) return;\n\n        const {min, mid, max} = patterns;\n        const imageMin = positions[min];\n        const imageMid = positions[mid];\n        const imageMax = positions[max];\n        if (!imageMin || !imageMid || !imageMax) return;\n\n        // We populate two paint arrays because, for cross-faded properties, we don't know which direction\n        // we're cross-fading to at layout time. In order to keep vertex attributes to a minimum and not pass\n        // unnecessary vertex data to the shaders, we determine which to upload at draw time.\n        for (let i = start; i < end; i++) {\n            this.zoomInPaintVertexArray.emplace(i,\n                imageMid.tl[0], imageMid.tl[1], imageMid.br[0], imageMid.br[1],\n                imageMin.tl[0], imageMin.tl[1], imageMin.br[0], imageMin.br[1],\n                imageMid.pixelRatio,\n                imageMin.pixelRatio,\n            );\n            this.zoomOutPaintVertexArray.emplace(i,\n                imageMid.tl[0], imageMid.tl[1], imageMid.br[0], imageMid.br[1],\n                imageMax.tl[0], imageMax.tl[1], imageMax.br[0], imageMax.br[1],\n                imageMid.pixelRatio,\n                imageMax.pixelRatio,\n            );\n        }\n    }\n\n    upload(context: Context) {\n        if (this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer) {\n            this.zoomInPaintVertexBuffer = context.createVertexBuffer(this.zoomInPaintVertexArray, patternAttributes.members, this.expression.isStateDependent);\n            this.zoomOutPaintVertexBuffer = context.createVertexBuffer(this.zoomOutPaintVertexArray, patternAttributes.members, this.expression.isStateDependent);\n        }\n    }\n\n    destroy() {\n        if (this.zoomOutPaintVertexBuffer) this.zoomOutPaintVertexBuffer.destroy();\n        if (this.zoomInPaintVertexBuffer) this.zoomInPaintVertexBuffer.destroy();\n    }\n}\n\n/**\n * @internal\n * ProgramConfiguration contains the logic for binding style layer properties and tile\n * layer feature data into GL program uniforms and vertex attributes.\n *\n * Non-data-driven property values are bound to shader uniforms. Data-driven property\n * values are bound to vertex attributes. In order to support a uniform GLSL syntax over\n * both, [Mapbox GL Shaders](https://github.com/mapbox/mapbox-gl-shaders) defines a `#pragma`\n * abstraction, which ProgramConfiguration is responsible for implementing. At runtime,\n * it examines the attributes of a particular layer, combines this with fixed knowledge\n * about how layers of the particular type are implemented, and determines which uniforms\n * and vertex attributes will be required. It can then substitute the appropriate text\n * into the shader source code, create and link a program, and bind the uniforms and\n * vertex attributes in preparation for drawing.\n *\n * When a vector tile is parsed, this same configuration information is used to\n * populate the attribute buffers needed for data-driven styling using the zoom\n * level and feature property data.\n */\nexport class ProgramConfiguration {\n    binders: {[_: string]: AttributeBinder | UniformBinder};\n    cacheKey: string;\n\n    _buffers: Array<VertexBuffer>;\n\n    constructor(layer: TypedStyleLayer, zoom: number, filterProperties: (_: string) => boolean) {\n        this.binders = {};\n        this._buffers = [];\n\n        const keys = [];\n\n        for (const property in layer.paint._values) {\n            if (!filterProperties(property)) continue;\n            const value = (layer.paint as any).get(property);\n            if (!(value instanceof PossiblyEvaluatedPropertyValue) || !supportsPropertyExpression(value.property.specification)) {\n                continue;\n            }\n            const names = paintAttributeNames(property, layer.type);\n            const expression = value.value;\n            const type = value.property.specification.type;\n            const useIntegerZoom = (value.property as any).useIntegerZoom;\n            const propType = value.property.specification['property-type'];\n            const isCrossFaded = propType === 'cross-faded' || propType === 'cross-faded-data-driven';\n\n            if (expression.kind === 'constant') {\n                this.binders[property] = isCrossFaded ?\n                    new CrossFadedConstantBinder(expression.value, names) :\n                    new ConstantBinder(expression.value, names, type);\n                keys.push(`/u_${property}`);\n\n            } else if (expression.kind === 'source' || isCrossFaded) {\n                const StructArrayLayout = layoutType(property, type, 'source');\n                this.binders[property] = isCrossFaded ?\n                    new CrossFadedCompositeBinder(expression as CompositeExpression, type, useIntegerZoom, zoom, StructArrayLayout, layer.id) :\n                    new SourceExpressionBinder(expression as SourceExpression, names, type, StructArrayLayout);\n                keys.push(`/a_${property}`);\n\n            } else {\n                const StructArrayLayout = layoutType(property, type, 'composite');\n                this.binders[property] = new CompositeExpressionBinder(expression, names, type, useIntegerZoom, zoom, StructArrayLayout);\n                keys.push(`/z_${property}`);\n            }\n        }\n\n        this.cacheKey = keys.sort().join('');\n    }\n\n    getMaxValue(property: string): number {\n        const binder = this.binders[property];\n        return binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder ? binder.maxValue : 0;\n    }\n\n    populatePaintArrays(newLength: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedCompositeBinder)\n                (binder as AttributeBinder).populatePaintArray(newLength, feature, imagePositions, canonical, formattedSection);\n        }\n    }\n    setConstantPatternPositions(posTo: ImagePosition, posFrom: ImagePosition) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof CrossFadedConstantBinder)\n                binder.setConstantPatternPositions(posTo, posFrom);\n        }\n    }\n\n    updatePaintArrays(\n        featureStates: FeatureStates,\n        featureMap: FeaturePositionMap,\n        vtLayer: VectorTileLayer,\n        layer: TypedStyleLayer,\n        imagePositions: {[_: string]: ImagePosition}\n    ): boolean {\n        let dirty: boolean = false;\n        for (const id in featureStates) {\n            const positions = featureMap.getPositions(id);\n\n            for (const pos of positions) {\n                const feature = vtLayer.feature(pos.index);\n\n                for (const property in this.binders) {\n                    const binder = this.binders[property];\n                    if ((binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder ||\n                         binder instanceof CrossFadedCompositeBinder) && (binder as any).expression.isStateDependent === true) {\n                        //AHM: Remove after https://github.com/mapbox/mapbox-gl-js/issues/6255\n                        const value = (layer.paint as any).get(property);\n                        (binder as any).expression = value.value;\n                        (binder as AttributeBinder).updatePaintArray(pos.start, pos.end, feature, featureStates[id], imagePositions);\n                        dirty = true;\n                    }\n                }\n            }\n        }\n        return dirty;\n    }\n\n    defines(): Array<string> {\n        const result = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof ConstantBinder || binder instanceof CrossFadedConstantBinder) {\n                result.push(...binder.uniformNames.map(name => `#define HAS_UNIFORM_${name}`));\n            }\n        }\n        return result;\n    }\n\n    getBinderAttributes(): Array<string> {\n        const result = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder) {\n                for (let i = 0; i < binder.paintVertexAttributes.length; i++) {\n                    result.push(binder.paintVertexAttributes[i].name);\n                }\n            } else if (binder instanceof CrossFadedCompositeBinder) {\n                for (let i = 0; i < patternAttributes.members.length; i++) {\n                    result.push(patternAttributes.members[i].name);\n                }\n            }\n        }\n        return result;\n    }\n\n    getBinderUniforms(): Array<string> {\n        const uniforms = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof ConstantBinder || binder instanceof CrossFadedConstantBinder || binder instanceof CompositeExpressionBinder) {\n                for (const uniformName of binder.uniformNames) {\n                    uniforms.push(uniformName);\n                }\n            }\n        }\n        return uniforms;\n    }\n\n    getPaintVertexBuffers(): Array<VertexBuffer> {\n        return this._buffers;\n    }\n\n    getUniforms(context: Context, locations: UniformLocations): Array<BinderUniform> {\n        const uniforms = [];\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof ConstantBinder || binder instanceof CrossFadedConstantBinder || binder instanceof CompositeExpressionBinder) {\n                for (const name of binder.uniformNames) {\n                    if (locations[name]) {\n                        const binding = binder.getBinding(context, locations[name], name);\n                        uniforms.push({name, property, binding});\n                    }\n                }\n            }\n        }\n        return uniforms;\n    }\n\n    setUniforms(\n        context: Context,\n        binderUniforms: Array<BinderUniform>,\n        properties: any,\n        globals: GlobalProperties\n    ) {\n        // Uniform state bindings are owned by the Program, but we set them\n        // from within the ProgramConfiguration's binder members.\n        for (const {name, property, binding} of binderUniforms) {\n            (this.binders[property] as any).setUniform(binding, globals, properties.get(property), name);\n        }\n    }\n\n    updatePaintBuffers(crossfade?: CrossfadeParameters) {\n        this._buffers = [];\n\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (crossfade && binder instanceof CrossFadedCompositeBinder) {\n                const patternVertexBuffer = crossfade.fromScale === 2 ? binder.zoomInPaintVertexBuffer : binder.zoomOutPaintVertexBuffer;\n                if (patternVertexBuffer) this._buffers.push(patternVertexBuffer);\n\n            } else if ((binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder) && binder.paintVertexBuffer) {\n                this._buffers.push(binder.paintVertexBuffer);\n            }\n        }\n    }\n\n    upload(context: Context) {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedCompositeBinder)\n                binder.upload(context);\n        }\n        this.updatePaintBuffers();\n    }\n\n    destroy() {\n        for (const property in this.binders) {\n            const binder = this.binders[property];\n            if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedCompositeBinder)\n                binder.destroy();\n        }\n    }\n}\n\nexport class ProgramConfigurationSet<Layer extends TypedStyleLayer> {\n    programConfigurations: {[_: string]: ProgramConfiguration};\n    needsUpload: boolean;\n    _featureMap: FeaturePositionMap;\n    _bufferOffset: number;\n\n    constructor(layers: ReadonlyArray<Layer>, zoom: number, filterProperties: (_: string) => boolean = () => true) {\n        this.programConfigurations = {};\n        for (const layer of layers) {\n            this.programConfigurations[layer.id] = new ProgramConfiguration(layer, zoom, filterProperties);\n        }\n        this.needsUpload = false;\n        this._featureMap = new FeaturePositionMap();\n        this._bufferOffset = 0;\n    }\n\n    populatePaintArrays(length: number, feature: Feature, index: number, imagePositions: {[_: string]: ImagePosition}, canonical: CanonicalTileID, formattedSection?: FormattedSection) {\n        for (const key in this.programConfigurations) {\n            this.programConfigurations[key].populatePaintArrays(length, feature, imagePositions, canonical, formattedSection);\n        }\n\n        if (feature.id !== undefined) {\n            this._featureMap.add(feature.id, index, this._bufferOffset, length);\n        }\n        this._bufferOffset = length;\n\n        this.needsUpload = true;\n    }\n\n    updatePaintArrays(featureStates: FeatureStates, vtLayer: VectorTileLayer, layers: ReadonlyArray<TypedStyleLayer>, imagePositions: {[_: string]: ImagePosition}) {\n        for (const layer of layers) {\n            this.needsUpload = this.programConfigurations[layer.id].updatePaintArrays(featureStates, this._featureMap, vtLayer, layer, imagePositions) || this.needsUpload;\n        }\n    }\n\n    get(layerId: string) {\n        return this.programConfigurations[layerId];\n    }\n\n    upload(context: Context) {\n        if (!this.needsUpload) return;\n        for (const layerId in this.programConfigurations) {\n            this.programConfigurations[layerId].upload(context);\n        }\n        this.needsUpload = false;\n    }\n\n    destroy() {\n        for (const layerId in this.programConfigurations) {\n            this.programConfigurations[layerId].destroy();\n        }\n    }\n}\n\nfunction paintAttributeNames(property, type) {\n    const attributeNameExceptions = {\n        'text-opacity': ['opacity'],\n        'icon-opacity': ['opacity'],\n        'text-color': ['fill_color'],\n        'icon-color': ['fill_color'],\n        'text-halo-color': ['halo_color'],\n        'icon-halo-color': ['halo_color'],\n        'text-halo-blur': ['halo_blur'],\n        'icon-halo-blur': ['halo_blur'],\n        'text-halo-width': ['halo_width'],\n        'icon-halo-width': ['halo_width'],\n        'line-gap-width': ['gapwidth'],\n        'line-pattern': ['pattern_to', 'pattern_from', 'pixel_ratio_to', 'pixel_ratio_from'],\n        'fill-pattern': ['pattern_to', 'pattern_from', 'pixel_ratio_to', 'pixel_ratio_from'],\n        'fill-extrusion-pattern': ['pattern_to', 'pattern_from', 'pixel_ratio_to', 'pixel_ratio_from'],\n    };\n\n    return attributeNameExceptions[property] || [property.replace(`${type}-`, '').replace(/-/g, '_')];\n}\n\nfunction getLayoutException(property) {\n    const propertyExceptions = {\n        'line-pattern': {\n            'source': PatternLayoutArray,\n            'composite': PatternLayoutArray\n        },\n        'fill-pattern': {\n            'source': PatternLayoutArray,\n            'composite': PatternLayoutArray\n        },\n        'fill-extrusion-pattern': {\n            'source': PatternLayoutArray,\n            'composite': PatternLayoutArray\n        }\n    };\n\n    return propertyExceptions[property];\n}\n\nfunction layoutType(property, type, binderType) {\n    const defaultLayouts = {\n        'color': {\n            'source': StructArrayLayout2f8,\n            'composite': StructArrayLayout4f16\n        },\n        'number': {\n            'source': StructArrayLayout1f4,\n            'composite': StructArrayLayout2f8\n        }\n    };\n\n    const layoutException = getLayoutException(property);\n    return  layoutException && layoutException[binderType] || defaultLayouts[type][binderType];\n}\n\nregister('ConstantBinder', ConstantBinder);\nregister('CrossFadedConstantBinder', CrossFadedConstantBinder);\nregister('SourceExpressionBinder', SourceExpressionBinder);\nregister('CrossFadedCompositeBinder', CrossFadedCompositeBinder);\nregister('CompositeExpressionBinder', CompositeExpressionBinder);\nregister('ProgramConfiguration', ProgramConfiguration, {omit: ['_buffers']});\nregister('ProgramConfigurationSet', ProgramConfigurationSet);\n", "/**\n * The maximum value of a coordinate in the internal tile coordinate system. Coordinates of\n * all source features normalized to this extent upon load.\n *\n * The value is a consequence of the following:\n *\n * * Vertex buffer store positions as signed 16 bit integers.\n * * One bit is lost for signedness to support tile buffers.\n * * One bit is lost because the line vertex buffer used to pack 1 bit of other data into the int.\n * * One bit is lost to support features extending past the extent on the right edge of the tile.\n * * This leaves us with 2^13 = 8192\n */\nexport const EXTENT = 8192;\n", "import {warnOnce, clamp} from '../util/util';\n\nimport {EXTENT} from './extent';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\n\n// These bounds define the minimum and maximum supported coordinate values.\n// While visible coordinates are within [0, EXTENT], tiles may theoretically\n// contain coordinates within [-Infinity, Infinity]. Our range is limited by the\n// number of bits used to represent the coordinate.\nconst BITS = 15;\nconst MAX = Math.pow(2, BITS - 1) - 1;\nconst MIN = -MAX - 1;\n\n/**\n * Loads a geometry from a VectorTileFeature and scales it to the common extent\n * used internally.\n * @param feature - the vector tile feature to load\n */\nexport function loadGeometry(feature: VectorTileFeature): Array<Array<Point>> {\n    const scale = EXTENT / feature.extent;\n    const geometry = feature.loadGeometry();\n    for (let r = 0; r < geometry.length; r++) {\n        const ring = geometry[r];\n        for (let p = 0; p < ring.length; p++) {\n            const point = ring[p];\n            // round here because mapbox-gl-native uses integers to represent\n            // points and we need to do the same to avoid renering differences.\n            const x = Math.round(point.x * scale);\n            const y = Math.round(point.y * scale);\n\n            point.x = clamp(x, MIN, MAX);\n            point.y = clamp(y, MIN, MAX);\n\n            if (x < point.x || x > point.x + 1 || y < point.y || y > point.y + 1) {\n                // warn when exceeding allowed extent except for the 1-px-off case\n                // https://github.com/mapbox/mapbox-gl-js/issues/8992\n                warnOnce('Geometry exceeds allowed extent, reduce your vector tile buffer size');\n            }\n        }\n    }\n    return geometry;\n}\n", "import {loadGeometry} from './load_geometry';\nimport type Point from '@mapbox/point-geometry';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\n\ntype EvaluationFeature = Feature & { geometry: Array<Array<Point>> };\n/**\n * Construct a new feature based on a VectorTileFeature for expression evaluation, the geometry of which\n * will be loaded based on necessity.\n * @param feature - the feature to evaluate\n * @param needGeometry - if set to true this will load the geometry\n */\nexport function toEvaluationFeature(feature: VectorTileFeature, needGeometry: boolean): EvaluationFeature {\n    return {type: feature.type,\n        id: feature.id,\n        properties: feature.properties,\n        geometry: needGeometry ? loadGeometry(feature) : []};\n}\n", "import {CircleLayoutArray} from '../array_types.g';\n\nimport {members as layoutAttributes} from './circle_attributes';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EXTENT} from '../extent';\nimport {register} from '../../util/web_worker_transfer';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../source/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {CircleStyleLayer} from '../../style/style_layer/circle_style_layer';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\n\nfunction addCircleVertex(layoutVertexArray, x, y, extrudeX, extrudeY) {\n    layoutVertexArray.emplaceBack(\n        (x * 2) + ((extrudeX + 1) / 2),\n        (y * 2) + ((extrudeY + 1) / 2));\n}\n\n/**\n * @internal\n * Circles are represented by two triangles.\n *\n * Each corner has a pos that is the center of the circle and an extrusion\n * vector that is where it points.\n */\nexport class CircleBucket<Layer extends CircleStyleLayer | HeatmapStyleLayer> implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layerIds: Array<string>;\n    layers: Array<Layer>;\n    stateDependentLayers: Array<Layer>;\n    stateDependentLayerIds: Array<string>;\n\n    layoutVertexArray: CircleLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasPattern: boolean;\n    programConfigurations: ProgramConfigurationSet<Layer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n\n    constructor(options: BucketParameters<Layer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasPattern = false;\n\n        this.layoutVertexArray = new CircleLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.segments = new SegmentVector();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        const styleLayer = this.layers[0];\n        const bucketFeatures: BucketFeature[] = [];\n        let circleSortKey = null;\n        let sortFeaturesByKey = false;\n\n        // Heatmap layers are handled in this bucket and have no evaluated properties, so we check our access\n        if (styleLayer.type === 'circle') {\n            circleSortKey = (styleLayer as CircleStyleLayer).layout.get('circle-sort-key');\n            sortFeaturesByKey = !circleSortKey.isConstant();\n        }\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const sortKey = sortFeaturesByKey ?\n                circleSortKey.evaluate(evaluationFeature, {}, canonical) :\n                undefined;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                properties: feature.properties,\n                type: feature.type,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                patterns: {},\n                sortKey\n            };\n\n            bucketFeatures.push(bucketFeature);\n\n        }\n\n        if (sortFeaturesByKey) {\n            bucketFeatures.sort((a, b) => a.sortKey - b.sortKey);\n        }\n\n        for (const bucketFeature of bucketFeatures) {\n            const {geometry, index, sourceLayerIndex} = bucketFeature;\n            const feature = features[index].feature;\n\n            this.addFeature(bucketFeature, geometry, index, canonical);\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID) {\n        for (const ring of geometry) {\n            for (const point of ring) {\n                const x = point.x;\n                const y = point.y;\n\n                // Do not include points that are outside the tile boundaries.\n                if (x < 0 || x >= EXTENT || y < 0 || y >= EXTENT) continue;\n\n                // this geometry will be of the Point type, and we'll derive\n                // two triangles from it.\n                //\n                // âââââââââââ\n                // â 3     2 â\n                // â         â\n                // â 0     1 â\n                // âââââââââââ\n\n                const segment = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray, feature.sortKey);\n                const index = segment.vertexLength;\n\n                addCircleVertex(this.layoutVertexArray, x, y, -1, -1);\n                addCircleVertex(this.layoutVertexArray, x, y, 1, -1);\n                addCircleVertex(this.layoutVertexArray, x, y, 1, 1);\n                addCircleVertex(this.layoutVertexArray, x, y, -1, 1);\n\n                this.indexArray.emplaceBack(index, index + 1, index + 2);\n                this.indexArray.emplaceBack(index, index + 3, index + 2);\n\n                segment.vertexLength += 4;\n                segment.primitiveLength += 2;\n            }\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, {}, canonical);\n    }\n}\n\nregister('CircleBucket', CircleBucket, {omit: ['layers']});\n", "import {isCounterClockwise} from './util';\n\nimport Point from '@mapbox/point-geometry';\n\nexport {polygonIntersectsBufferedPoint, polygonIntersectsMultiPolygon, polygonIntersectsBufferedMultiLine, polygonIntersectsPolygon, distToSegmentSquared, polygonIntersectsBox};\n\ntype Line = Array<Point>;\ntype MultiLine = Array<Line>;\ntype Ring = Array<Point>;\ntype Polygon = Array<Point>;\ntype MultiPolygon = Array<Polygon>;\n\nfunction polygonIntersectsPolygon(polygonA: Polygon, polygonB: Polygon) {\n    for (let i = 0; i < polygonA.length; i++) {\n        if (polygonContainsPoint(polygonB, polygonA[i])) return true;\n    }\n\n    for (let i = 0; i < polygonB.length; i++) {\n        if (polygonContainsPoint(polygonA, polygonB[i])) return true;\n    }\n\n    if (lineIntersectsLine(polygonA, polygonB)) return true;\n\n    return false;\n}\n\nfunction polygonIntersectsBufferedPoint(polygon: Polygon, point: Point, radius: number) {\n    if (polygonContainsPoint(polygon, point)) return true;\n    if (pointIntersectsBufferedLine(point, polygon, radius)) return true;\n    return false;\n}\n\nfunction polygonIntersectsMultiPolygon(polygon: Polygon, multiPolygon: MultiPolygon) {\n\n    if (polygon.length === 1) {\n        return multiPolygonContainsPoint(multiPolygon, polygon[0]);\n    }\n\n    for (let m = 0; m < multiPolygon.length; m++) {\n        const ring = multiPolygon[m];\n        for (let n = 0; n < ring.length; n++) {\n            if (polygonContainsPoint(polygon, ring[n])) return true;\n        }\n    }\n\n    for (let i = 0; i < polygon.length; i++) {\n        if (multiPolygonContainsPoint(multiPolygon, polygon[i])) return true;\n    }\n\n    for (let k = 0; k < multiPolygon.length; k++) {\n        if (lineIntersectsLine(polygon, multiPolygon[k])) return true;\n    }\n\n    return false;\n}\n\nfunction polygonIntersectsBufferedMultiLine(polygon: Polygon, multiLine: MultiLine, radius: number) {\n    for (let i = 0; i < multiLine.length; i++) {\n        const line = multiLine[i];\n\n        if (polygon.length >= 3) {\n            for (let k = 0; k < line.length; k++) {\n                if (polygonContainsPoint(polygon, line[k])) return true;\n            }\n        }\n\n        if (lineIntersectsBufferedLine(polygon, line, radius)) return true;\n    }\n    return false;\n}\n\nfunction lineIntersectsBufferedLine(lineA: Line, lineB: Line, radius: number) {\n\n    if (lineA.length > 1) {\n        if (lineIntersectsLine(lineA, lineB)) return true;\n\n        // Check whether any point in either line is within radius of the other line\n        for (let j = 0; j < lineB.length; j++) {\n            if (pointIntersectsBufferedLine(lineB[j], lineA, radius)) return true;\n        }\n    }\n\n    for (let k = 0; k < lineA.length; k++) {\n        if (pointIntersectsBufferedLine(lineA[k], lineB, radius)) return true;\n    }\n\n    return false;\n}\n\nfunction lineIntersectsLine(lineA: Line, lineB: Line) {\n    if (lineA.length === 0 || lineB.length === 0) return false;\n    for (let i = 0; i < lineA.length - 1; i++) {\n        const a0 = lineA[i];\n        const a1 = lineA[i + 1];\n        for (let j = 0; j < lineB.length - 1; j++) {\n            const b0 = lineB[j];\n            const b1 = lineB[j + 1];\n            if (lineSegmentIntersectsLineSegment(a0, a1, b0, b1)) return true;\n        }\n    }\n    return false;\n}\n\nfunction lineSegmentIntersectsLineSegment(a0: Point, a1: Point, b0: Point, b1: Point) {\n    return isCounterClockwise(a0, b0, b1) !== isCounterClockwise(a1, b0, b1) &&\n        isCounterClockwise(a0, a1, b0) !== isCounterClockwise(a0, a1, b1);\n}\n\nfunction pointIntersectsBufferedLine(p: Point, line: Line, radius: number) {\n    const radiusSquared = radius * radius;\n\n    if (line.length === 1) return p.distSqr(line[0]) < radiusSquared;\n\n    for (let i = 1; i < line.length; i++) {\n        // Find line segments that have a distance <= radius^2 to p\n        // In that case, we treat the line as \"containing point p\".\n        const v = line[i - 1], w = line[i];\n        if (distToSegmentSquared(p, v, w) < radiusSquared) return true;\n    }\n    return false;\n}\n\n// Code from https://stackoverflow.com/a/1501725/331379.\nfunction distToSegmentSquared(p: Point, v: Point, w: Point) {\n    const l2 = v.distSqr(w);\n    if (l2 === 0) return p.distSqr(v);\n    const t = ((p.x - v.x) * (w.x - v.x) + (p.y - v.y) * (w.y - v.y)) / l2;\n    if (t < 0) return p.distSqr(v);\n    if (t > 1) return p.distSqr(w);\n    return p.distSqr(w.sub(v)._mult(t)._add(v));\n}\n\n// point in polygon ray casting algorithm\nfunction multiPolygonContainsPoint(rings: Array<Ring>, p: Point) {\n    let c = false,\n        ring, p1, p2;\n\n    for (let k = 0; k < rings.length; k++) {\n        ring = rings[k];\n        for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n            p1 = ring[i];\n            p2 = ring[j];\n            if (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n                c = !c;\n            }\n        }\n    }\n    return c;\n}\n\nfunction polygonContainsPoint(ring: Ring, p: Point) {\n    let c = false;\n    for (let i = 0, j = ring.length - 1; i < ring.length; j = i++) {\n        const p1 = ring[i];\n        const p2 = ring[j];\n        if (((p1.y > p.y) !== (p2.y > p.y)) && (p.x < (p2.x - p1.x) * (p.y - p1.y) / (p2.y - p1.y) + p1.x)) {\n            c = !c;\n        }\n    }\n    return c;\n}\n\nfunction polygonIntersectsBox(ring: Ring, boxX1: number, boxY1: number, boxX2: number, boxY2: number) {\n    for (const p of ring) {\n        if (boxX1 <= p.x &&\n            boxY1 <= p.y &&\n            boxX2 >= p.x &&\n            boxY2 >= p.y) return true;\n    }\n\n    const corners = [\n        new Point(boxX1, boxY1),\n        new Point(boxX1, boxY2),\n        new Point(boxX2, boxY2),\n        new Point(boxX2, boxY1)];\n\n    if (ring.length > 2) {\n        for (const corner of corners) {\n            if (polygonContainsPoint(ring, corner)) return true;\n        }\n    }\n\n    for (let i = 0; i < ring.length - 1; i++) {\n        const p1 = ring[i];\n        const p2 = ring[i + 1];\n        if (edgeIntersectsBox(p1, p2, corners)) return true;\n    }\n\n    return false;\n}\n\nfunction edgeIntersectsBox(e1: Point, e2: Point, corners: Array<Point>) {\n    const tl = corners[0];\n    const br = corners[2];\n    // the edge and box do not intersect in either the x or y dimensions\n    if (((e1.x < tl.x) && (e2.x < tl.x)) ||\n        ((e1.x > br.x) && (e2.x > br.x)) ||\n        ((e1.y < tl.y) && (e2.y < tl.y)) ||\n        ((e1.y > br.y) && (e2.y > br.y))) return false;\n\n    // check if all corners of the box are on the same side of the edge\n    const dir = isCounterClockwise(e1, e2, corners[0]);\n    return dir !== isCounterClockwise(e1, e2, corners[1]) ||\n        dir !== isCounterClockwise(e1, e2, corners[2]) ||\n        dir !== isCounterClockwise(e1, e2, corners[3]);\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport type {PossiblyEvaluatedPropertyValue} from './properties';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CircleBucket} from '../data/bucket/circle_bucket';\nimport type {LineBucket} from '../data/bucket/line_bucket';\n\nexport function getMaximumPaintValue(\n    property: string,\n    layer: StyleLayer,\n    bucket: CircleBucket<any> | LineBucket\n): number {\n    const value = ((layer.paint as any).get(property) as PossiblyEvaluatedPropertyValue<any>).value;\n    if (value.kind === 'constant') {\n        return value.value;\n    } else {\n        return bucket.programConfigurations.get(layer.id).getMaxValue(property);\n    }\n}\n\nexport function translateDistance(translate: [number, number]) {\n    return Math.sqrt(translate[0] * translate[0] + translate[1] * translate[1]);\n}\n\nexport function translate(queryGeometry: Array<Point>,\n    translate: [number, number],\n    translateAnchor: 'viewport' | 'map',\n    bearing: number,\n    pixelsToTileUnits: number) {\n    if (!translate[0] && !translate[1]) {\n        return queryGeometry;\n    }\n    const pt = Point.convert(translate)._mult(pixelsToTileUnits);\n\n    if (translateAnchor === 'viewport') {\n        pt._rotate(-bearing);\n    }\n\n    const translated = [];\n    for (let i = 0; i < queryGeometry.length; i++) {\n        const point = queryGeometry[i];\n        translated.push(point.sub(pt));\n    }\n    return translated;\n}\n\nexport function offsetLine(rings: Array<Array<Point>>, offset: number) {\n    const newRings: Array<Array<Point>> = [];\n    for (let ringIndex = 0; ringIndex < rings.length; ringIndex++) {\n        const ring = rings[ringIndex];\n        const newRing: Array<Point> = [];\n        for (let index = 0; index < ring.length; index++) {\n            const a = ring[index - 1];\n            const b = ring[index];\n            const c = ring[index + 1];\n            const aToB = index === 0 ? new Point(0, 0) : b.sub(a)._unit()._perp();\n            const bToC = index === ring.length - 1 ? new Point(0, 0) : c.sub(b)._unit()._perp();\n            const extrude = aToB._add(bToC)._unit();\n\n            const cosHalfAngle = extrude.x * bToC.x + extrude.y * bToC.y;\n            if (cosHalfAngle !== 0) {\n                extrude._mult(1 / cosHalfAngle);\n            }\n\n            newRing.push(extrude._mult(offset)._add(b));\n        }\n        newRings.push(newRing);\n    }\n    return newRings;\n}\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type CircleLayoutProps = {\n    \"circle-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type CircleLayoutPropsPossiblyEvaluated = {\n    \"circle-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<CircleLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"circle-sort-key\": new DataDrivenProperty(styleSpec[\"layout_circle\"][\"circle-sort-key\"] as any as StylePropertySpecification),\n});\n\nexport type CirclePaintProps = {\n    \"circle-radius\": DataDrivenProperty<number>,\n    \"circle-color\": DataDrivenProperty<Color>,\n    \"circle-blur\": DataDrivenProperty<number>,\n    \"circle-opacity\": DataDrivenProperty<number>,\n    \"circle-translate\": DataConstantProperty<[number, number]>,\n    \"circle-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"circle-pitch-scale\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"circle-pitch-alignment\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"circle-stroke-width\": DataDrivenProperty<number>,\n    \"circle-stroke-color\": DataDrivenProperty<Color>,\n    \"circle-stroke-opacity\": DataDrivenProperty<number>,\n};\n\nexport type CirclePaintPropsPossiblyEvaluated = {\n    \"circle-radius\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"circle-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-translate\": [number, number],\n    \"circle-translate-anchor\": \"map\" | \"viewport\",\n    \"circle-pitch-scale\": \"map\" | \"viewport\",\n    \"circle-pitch-alignment\": \"map\" | \"viewport\",\n    \"circle-stroke-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"circle-stroke-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"circle-stroke-opacity\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet paint: Properties<CirclePaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"circle-radius\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-radius\"] as any as StylePropertySpecification),\n    \"circle-color\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-color\"] as any as StylePropertySpecification),\n    \"circle-blur\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-blur\"] as any as StylePropertySpecification),\n    \"circle-opacity\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-opacity\"] as any as StylePropertySpecification),\n    \"circle-translate\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-translate\"] as any as StylePropertySpecification),\n    \"circle-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-translate-anchor\"] as any as StylePropertySpecification),\n    \"circle-pitch-scale\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-pitch-scale\"] as any as StylePropertySpecification),\n    \"circle-pitch-alignment\": new DataConstantProperty(styleSpec[\"paint_circle\"][\"circle-pitch-alignment\"] as any as StylePropertySpecification),\n    \"circle-stroke-width\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-width\"] as any as StylePropertySpecification),\n    \"circle-stroke-color\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-color\"] as any as StylePropertySpecification),\n    \"circle-stroke-opacity\": new DataDrivenProperty(styleSpec[\"paint_circle\"][\"circle-stroke-opacity\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });", "/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nexport var EPSILON = 0.000001;\nexport var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nexport var RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nexport function setMatrixArrayType(type) {\n  ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nexport function toRadian(a) {\n  return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n  var y = 0,\n      i = arguments.length;\n\n  while (i--) {\n    y += arguments[i] * arguments[i];\n  }\n\n  return Math.sqrt(y);\n};", "import * as glMatrix from \"./common.js\";\n/**\n * 4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(16);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[4] = 0;\n    out[6] = 0;\n    out[7] = 0;\n    out[8] = 0;\n    out[9] = 0;\n    out[11] = 0;\n    out[12] = 0;\n    out[13] = 0;\n    out[14] = 0;\n  }\n\n  out[0] = 1;\n  out[5] = 1;\n  out[10] = 1;\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  out[9] = a[9];\n  out[10] = a[10];\n  out[11] = a[11];\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  out[9] = a[9];\n  out[10] = a[10];\n  out[11] = a[11];\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\nexport function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n  var out = new glMatrix.ARRAY_TYPE(16);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m03;\n  out[4] = m10;\n  out[5] = m11;\n  out[6] = m12;\n  out[7] = m13;\n  out[8] = m20;\n  out[9] = m21;\n  out[10] = m22;\n  out[11] = m23;\n  out[12] = m30;\n  out[13] = m31;\n  out[14] = m32;\n  out[15] = m33;\n  return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\nexport function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m03;\n  out[4] = m10;\n  out[5] = m11;\n  out[6] = m12;\n  out[7] = m13;\n  out[8] = m20;\n  out[9] = m21;\n  out[10] = m22;\n  out[11] = m23;\n  out[12] = m30;\n  out[13] = m31;\n  out[14] = m32;\n  out[15] = m33;\n  return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache some values\n  if (out === a) {\n    var a01 = a[1],\n        a02 = a[2],\n        a03 = a[3];\n    var a12 = a[6],\n        a13 = a[7];\n    var a23 = a[11];\n    out[1] = a[4];\n    out[2] = a[8];\n    out[3] = a[12];\n    out[4] = a01;\n    out[6] = a[9];\n    out[7] = a[13];\n    out[8] = a02;\n    out[9] = a12;\n    out[11] = a[14];\n    out[12] = a03;\n    out[13] = a13;\n    out[14] = a23;\n  } else {\n    out[0] = a[0];\n    out[1] = a[4];\n    out[2] = a[8];\n    out[3] = a[12];\n    out[4] = a[1];\n    out[5] = a[5];\n    out[6] = a[9];\n    out[7] = a[13];\n    out[8] = a[2];\n    out[9] = a[6];\n    out[10] = a[10];\n    out[11] = a[14];\n    out[12] = a[3];\n    out[13] = a[7];\n    out[14] = a[11];\n    out[15] = a[15];\n  }\n\n  return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function invert(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n  if (!det) {\n    return null;\n  }\n\n  det = 1.0 / det;\n  out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n  out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n  out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n  out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n  out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n  out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n  out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n  out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n  out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n  out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n  out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n  out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n  out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n  out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n  out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n  out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n  return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nexport function adjoint(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n  out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n  out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n  out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n  out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n  out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n  out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n  out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n  out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n  out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n  out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n  out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n  out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n  out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n  out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n  out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n  return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n  return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function multiply(out, a, b) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15]; // Cache only the current line of the second matrix\n\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[4];\n  b1 = b[5];\n  b2 = b[6];\n  b3 = b[7];\n  out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[8];\n  b1 = b[9];\n  b2 = b[10];\n  b3 = b[11];\n  out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  b0 = b[12];\n  b1 = b[13];\n  b2 = b[14];\n  b3 = b[15];\n  out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n  out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n  out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n  out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n  return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\nexport function translate(out, a, v) {\n  var x = v[0],\n      y = v[1],\n      z = v[2];\n  var a00, a01, a02, a03;\n  var a10, a11, a12, a13;\n  var a20, a21, a22, a23;\n\n  if (a === out) {\n    out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n    out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n    out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n    out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n  } else {\n    a00 = a[0];\n    a01 = a[1];\n    a02 = a[2];\n    a03 = a[3];\n    a10 = a[4];\n    a11 = a[5];\n    a12 = a[6];\n    a13 = a[7];\n    a20 = a[8];\n    a21 = a[9];\n    a22 = a[10];\n    a23 = a[11];\n    out[0] = a00;\n    out[1] = a01;\n    out[2] = a02;\n    out[3] = a03;\n    out[4] = a10;\n    out[5] = a11;\n    out[6] = a12;\n    out[7] = a13;\n    out[8] = a20;\n    out[9] = a21;\n    out[10] = a22;\n    out[11] = a23;\n    out[12] = a00 * x + a10 * y + a20 * z + a[12];\n    out[13] = a01 * x + a11 * y + a21 * z + a[13];\n    out[14] = a02 * x + a12 * y + a22 * z + a[14];\n    out[15] = a03 * x + a13 * y + a23 * z + a[15];\n  }\n\n  return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\nexport function scale(out, a, v) {\n  var x = v[0],\n      y = v[1],\n      z = v[2];\n  out[0] = a[0] * x;\n  out[1] = a[1] * x;\n  out[2] = a[2] * x;\n  out[3] = a[3] * x;\n  out[4] = a[4] * y;\n  out[5] = a[5] * y;\n  out[6] = a[6] * y;\n  out[7] = a[7] * y;\n  out[8] = a[8] * z;\n  out[9] = a[9] * z;\n  out[10] = a[10] * z;\n  out[11] = a[11] * z;\n  out[12] = a[12];\n  out[13] = a[13];\n  out[14] = a[14];\n  out[15] = a[15];\n  return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nexport function rotate(out, a, rad, axis) {\n  var x = axis[0],\n      y = axis[1],\n      z = axis[2];\n  var len = Math.hypot(x, y, z);\n  var s, c, t;\n  var a00, a01, a02, a03;\n  var a10, a11, a12, a13;\n  var a20, a21, a22, a23;\n  var b00, b01, b02;\n  var b10, b11, b12;\n  var b20, b21, b22;\n\n  if (len < glMatrix.EPSILON) {\n    return null;\n  }\n\n  len = 1 / len;\n  x *= len;\n  y *= len;\n  z *= len;\n  s = Math.sin(rad);\n  c = Math.cos(rad);\n  t = 1 - c;\n  a00 = a[0];\n  a01 = a[1];\n  a02 = a[2];\n  a03 = a[3];\n  a10 = a[4];\n  a11 = a[5];\n  a12 = a[6];\n  a13 = a[7];\n  a20 = a[8];\n  a21 = a[9];\n  a22 = a[10];\n  a23 = a[11]; // Construct the elements of the rotation matrix\n\n  b00 = x * x * t + c;\n  b01 = y * x * t + z * s;\n  b02 = z * x * t - y * s;\n  b10 = x * y * t - z * s;\n  b11 = y * y * t + c;\n  b12 = z * y * t + x * s;\n  b20 = x * z * t + y * s;\n  b21 = y * z * t - x * s;\n  b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n  out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n  out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n  out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n  out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n  out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n  out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n  out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n  out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n  out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n  out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n  out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n  out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged last row\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  }\n\n  return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateX(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a10 = a[4];\n  var a11 = a[5];\n  var a12 = a[6];\n  var a13 = a[7];\n  var a20 = a[8];\n  var a21 = a[9];\n  var a22 = a[10];\n  var a23 = a[11];\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged rows\n    out[0] = a[0];\n    out[1] = a[1];\n    out[2] = a[2];\n    out[3] = a[3];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  } // Perform axis-specific matrix multiplication\n\n\n  out[4] = a10 * c + a20 * s;\n  out[5] = a11 * c + a21 * s;\n  out[6] = a12 * c + a22 * s;\n  out[7] = a13 * c + a23 * s;\n  out[8] = a20 * c - a10 * s;\n  out[9] = a21 * c - a11 * s;\n  out[10] = a22 * c - a12 * s;\n  out[11] = a23 * c - a13 * s;\n  return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateY(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a00 = a[0];\n  var a01 = a[1];\n  var a02 = a[2];\n  var a03 = a[3];\n  var a20 = a[8];\n  var a21 = a[9];\n  var a22 = a[10];\n  var a23 = a[11];\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged rows\n    out[4] = a[4];\n    out[5] = a[5];\n    out[6] = a[6];\n    out[7] = a[7];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  } // Perform axis-specific matrix multiplication\n\n\n  out[0] = a00 * c - a20 * s;\n  out[1] = a01 * c - a21 * s;\n  out[2] = a02 * c - a22 * s;\n  out[3] = a03 * c - a23 * s;\n  out[8] = a00 * s + a20 * c;\n  out[9] = a01 * s + a21 * c;\n  out[10] = a02 * s + a22 * c;\n  out[11] = a03 * s + a23 * c;\n  return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function rotateZ(out, a, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  var a00 = a[0];\n  var a01 = a[1];\n  var a02 = a[2];\n  var a03 = a[3];\n  var a10 = a[4];\n  var a11 = a[5];\n  var a12 = a[6];\n  var a13 = a[7];\n\n  if (a !== out) {\n    // If the source and destination differ, copy the unchanged last row\n    out[8] = a[8];\n    out[9] = a[9];\n    out[10] = a[10];\n    out[11] = a[11];\n    out[12] = a[12];\n    out[13] = a[13];\n    out[14] = a[14];\n    out[15] = a[15];\n  } // Perform axis-specific matrix multiplication\n\n\n  out[0] = a00 * c + a10 * s;\n  out[1] = a01 * c + a11 * s;\n  out[2] = a02 * c + a12 * s;\n  out[3] = a03 * c + a13 * s;\n  out[4] = a10 * c - a00 * s;\n  out[5] = a11 * c - a01 * s;\n  out[6] = a12 * c - a02 * s;\n  out[7] = a13 * c - a03 * s;\n  return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nexport function fromTranslation(out, v) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = v[1];\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = v[2];\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nexport function fromRotation(out, rad, axis) {\n  var x = axis[0],\n      y = axis[1],\n      z = axis[2];\n  var len = Math.hypot(x, y, z);\n  var s, c, t;\n\n  if (len < glMatrix.EPSILON) {\n    return null;\n  }\n\n  len = 1 / len;\n  x *= len;\n  y *= len;\n  z *= len;\n  s = Math.sin(rad);\n  c = Math.cos(rad);\n  t = 1 - c; // Perform rotation-specific matrix multiplication\n\n  out[0] = x * x * t + c;\n  out[1] = y * x * t + z * s;\n  out[2] = z * x * t - y * s;\n  out[3] = 0;\n  out[4] = x * y * t - z * s;\n  out[5] = y * y * t + c;\n  out[6] = z * y * t + x * s;\n  out[7] = 0;\n  out[8] = x * z * t + y * s;\n  out[9] = y * z * t - x * s;\n  out[10] = z * z * t + c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromXRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = c;\n  out[6] = s;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = -s;\n  out[10] = c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromYRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n  out[0] = c;\n  out[1] = 0;\n  out[2] = -s;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = 1;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = s;\n  out[9] = 0;\n  out[10] = c;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nexport function fromZRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n  out[0] = c;\n  out[1] = s;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = -s;\n  out[5] = c;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 1;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, vec);\n *     let quatMat = mat4.create();\n *     quat4.toMat4(quat, quatMat);\n *     mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslation(out, q, v) {\n  // Quaternion math\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - (yy + zz);\n  out[1] = xy + wz;\n  out[2] = xz - wy;\n  out[3] = 0;\n  out[4] = xy - wz;\n  out[5] = 1 - (xx + zz);\n  out[6] = yz + wx;\n  out[7] = 0;\n  out[8] = xz + wy;\n  out[9] = yz - wx;\n  out[10] = 1 - (xx + yy);\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\nexport function fromQuat2(out, a) {\n  var translation = new glMatrix.ARRAY_TYPE(3);\n  var bx = -a[0],\n      by = -a[1],\n      bz = -a[2],\n      bw = a[3],\n      ax = a[4],\n      ay = a[5],\n      az = a[6],\n      aw = a[7];\n  var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n  if (magnitude > 0) {\n    translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n    translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n    translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n  } else {\n    translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n    translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n    translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n  }\n\n  fromRotationTranslation(out, a, translation);\n  return out;\n}\n/**\n * Returns the translation vector component of a transformation\n *  matrix. If a matrix is built with fromRotationTranslation,\n *  the returned vector will be the same as the translation vector\n *  originally supplied.\n * @param  {vec3} out Vector to receive translation component\n * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nexport function getTranslation(out, mat) {\n  out[0] = mat[12];\n  out[1] = mat[13];\n  out[2] = mat[14];\n  return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n *  matrix. If a matrix is built with fromRotationTranslationScale\n *  with a normalized Quaternion paramter, the returned vector will be\n *  the same as the scaling vector\n *  originally supplied.\n * @param  {vec3} out Vector to receive scaling factor component\n * @param  {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nexport function getScaling(out, mat) {\n  var m11 = mat[0];\n  var m12 = mat[1];\n  var m13 = mat[2];\n  var m21 = mat[4];\n  var m22 = mat[5];\n  var m23 = mat[6];\n  var m31 = mat[8];\n  var m32 = mat[9];\n  var m33 = mat[10];\n  out[0] = Math.hypot(m11, m12, m13);\n  out[1] = Math.hypot(m21, m22, m23);\n  out[2] = Math.hypot(m31, m32, m33);\n  return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n *  of a transformation matrix. If a matrix is built with\n *  fromRotationTranslation, the returned quaternion will be the\n *  same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\nexport function getRotation(out, mat) {\n  var scaling = new glMatrix.ARRAY_TYPE(3);\n  getScaling(scaling, mat);\n  var is1 = 1 / scaling[0];\n  var is2 = 1 / scaling[1];\n  var is3 = 1 / scaling[2];\n  var sm11 = mat[0] * is1;\n  var sm12 = mat[1] * is2;\n  var sm13 = mat[2] * is3;\n  var sm21 = mat[4] * is1;\n  var sm22 = mat[5] * is2;\n  var sm23 = mat[6] * is3;\n  var sm31 = mat[8] * is1;\n  var sm32 = mat[9] * is2;\n  var sm33 = mat[10] * is3;\n  var trace = sm11 + sm22 + sm33;\n  var S = 0;\n\n  if (trace > 0) {\n    S = Math.sqrt(trace + 1.0) * 2;\n    out[3] = 0.25 * S;\n    out[0] = (sm23 - sm32) / S;\n    out[1] = (sm31 - sm13) / S;\n    out[2] = (sm12 - sm21) / S;\n  } else if (sm11 > sm22 && sm11 > sm33) {\n    S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n    out[3] = (sm23 - sm32) / S;\n    out[0] = 0.25 * S;\n    out[1] = (sm12 + sm21) / S;\n    out[2] = (sm31 + sm13) / S;\n  } else if (sm22 > sm33) {\n    S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n    out[3] = (sm31 - sm13) / S;\n    out[0] = (sm12 + sm21) / S;\n    out[1] = 0.25 * S;\n    out[2] = (sm23 + sm32) / S;\n  } else {\n    S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n    out[3] = (sm12 - sm21) / S;\n    out[0] = (sm31 + sm13) / S;\n    out[1] = (sm23 + sm32) / S;\n    out[2] = 0.25 * S;\n  }\n\n  return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, vec);\n *     let quatMat = mat4.create();\n *     quat4.toMat4(quat, quatMat);\n *     mat4.multiply(dest, quatMat);\n *     mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslationScale(out, q, v, s) {\n  // Quaternion math\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  var sx = s[0];\n  var sy = s[1];\n  var sz = s[2];\n  out[0] = (1 - (yy + zz)) * sx;\n  out[1] = (xy + wz) * sx;\n  out[2] = (xz - wy) * sx;\n  out[3] = 0;\n  out[4] = (xy - wz) * sy;\n  out[5] = (1 - (xx + zz)) * sy;\n  out[6] = (yz + wx) * sy;\n  out[7] = 0;\n  out[8] = (xz + wy) * sz;\n  out[9] = (yz - wx) * sz;\n  out[10] = (1 - (xx + yy)) * sz;\n  out[11] = 0;\n  out[12] = v[0];\n  out[13] = v[1];\n  out[14] = v[2];\n  out[15] = 1;\n  return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n *     mat4.identity(dest);\n *     mat4.translate(dest, vec);\n *     mat4.translate(dest, origin);\n *     let quatMat = mat4.create();\n *     quat4.toMat4(quat, quatMat);\n *     mat4.multiply(dest, quatMat);\n *     mat4.scale(dest, scale)\n *     mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\nexport function fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n  // Quaternion math\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var xy = x * y2;\n  var xz = x * z2;\n  var yy = y * y2;\n  var yz = y * z2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  var sx = s[0];\n  var sy = s[1];\n  var sz = s[2];\n  var ox = o[0];\n  var oy = o[1];\n  var oz = o[2];\n  var out0 = (1 - (yy + zz)) * sx;\n  var out1 = (xy + wz) * sx;\n  var out2 = (xz - wy) * sx;\n  var out4 = (xy - wz) * sy;\n  var out5 = (1 - (xx + zz)) * sy;\n  var out6 = (yz + wx) * sy;\n  var out8 = (xz + wy) * sz;\n  var out9 = (yz - wx) * sz;\n  var out10 = (1 - (xx + yy)) * sz;\n  out[0] = out0;\n  out[1] = out1;\n  out[2] = out2;\n  out[3] = 0;\n  out[4] = out4;\n  out[5] = out5;\n  out[6] = out6;\n  out[7] = 0;\n  out[8] = out8;\n  out[9] = out9;\n  out[10] = out10;\n  out[11] = 0;\n  out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n  out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n  out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n  out[15] = 1;\n  return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\nexport function fromQuat(out, q) {\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var yx = y * x2;\n  var yy = y * y2;\n  var zx = z * x2;\n  var zy = z * y2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - yy - zz;\n  out[1] = yx + wz;\n  out[2] = zx - wy;\n  out[3] = 0;\n  out[4] = yx - wz;\n  out[5] = 1 - xx - zz;\n  out[6] = zy + wx;\n  out[7] = 0;\n  out[8] = zx + wy;\n  out[9] = zy - wx;\n  out[10] = 1 - xx - yy;\n  out[11] = 0;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = 0;\n  out[15] = 1;\n  return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function frustum(out, left, right, bottom, top, near, far) {\n  var rl = 1 / (right - left);\n  var tb = 1 / (top - bottom);\n  var nf = 1 / (near - far);\n  out[0] = near * 2 * rl;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = near * 2 * tb;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = (right + left) * rl;\n  out[9] = (top + bottom) * tb;\n  out[10] = (far + near) * nf;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[14] = far * near * 2 * nf;\n  out[15] = 0;\n  return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexport function perspectiveNO(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2),\n      nf;\n  out[0] = f / aspect;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = f;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[15] = 0;\n\n  if (far != null && far !== Infinity) {\n    nf = 1 / (near - far);\n    out[10] = (far + near) * nf;\n    out[14] = 2 * far * near * nf;\n  } else {\n    out[10] = -1;\n    out[14] = -2 * near;\n  }\n\n  return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\nexport var perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nexport function perspectiveZO(out, fovy, aspect, near, far) {\n  var f = 1.0 / Math.tan(fovy / 2),\n      nf;\n  out[0] = f / aspect;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = f;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[11] = -1;\n  out[12] = 0;\n  out[13] = 0;\n  out[15] = 0;\n\n  if (far != null && far !== Infinity) {\n    nf = 1 / (near - far);\n    out[10] = far * nf;\n    out[14] = far * near * nf;\n  } else {\n    out[10] = -1;\n    out[14] = -near;\n  }\n\n  return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function perspectiveFromFieldOfView(out, fov, near, far) {\n  var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n  var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n  var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n  var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n  var xScale = 2.0 / (leftTan + rightTan);\n  var yScale = 2.0 / (upTan + downTan);\n  out[0] = xScale;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  out[3] = 0.0;\n  out[4] = 0.0;\n  out[5] = yScale;\n  out[6] = 0.0;\n  out[7] = 0.0;\n  out[8] = -((leftTan - rightTan) * xScale * 0.5);\n  out[9] = (upTan - downTan) * yScale * 0.5;\n  out[10] = far / (near - far);\n  out[11] = -1.0;\n  out[12] = 0.0;\n  out[13] = 0.0;\n  out[14] = far * near / (near - far);\n  out[15] = 0.0;\n  return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function orthoNO(out, left, right, bottom, top, near, far) {\n  var lr = 1 / (left - right);\n  var bt = 1 / (bottom - top);\n  var nf = 1 / (near - far);\n  out[0] = -2 * lr;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = -2 * bt;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = 2 * nf;\n  out[11] = 0;\n  out[12] = (left + right) * lr;\n  out[13] = (top + bottom) * bt;\n  out[14] = (far + near) * nf;\n  out[15] = 1;\n  return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\nexport var ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nexport function orthoZO(out, left, right, bottom, top, near, far) {\n  var lr = 1 / (left - right);\n  var bt = 1 / (bottom - top);\n  var nf = 1 / (near - far);\n  out[0] = -2 * lr;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 0;\n  out[5] = -2 * bt;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 0;\n  out[9] = 0;\n  out[10] = nf;\n  out[11] = 0;\n  out[12] = (left + right) * lr;\n  out[13] = (top + bottom) * bt;\n  out[14] = near * nf;\n  out[15] = 1;\n  return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nexport function lookAt(out, eye, center, up) {\n  var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n  var eyex = eye[0];\n  var eyey = eye[1];\n  var eyez = eye[2];\n  var upx = up[0];\n  var upy = up[1];\n  var upz = up[2];\n  var centerx = center[0];\n  var centery = center[1];\n  var centerz = center[2];\n\n  if (Math.abs(eyex - centerx) < glMatrix.EPSILON && Math.abs(eyey - centery) < glMatrix.EPSILON && Math.abs(eyez - centerz) < glMatrix.EPSILON) {\n    return identity(out);\n  }\n\n  z0 = eyex - centerx;\n  z1 = eyey - centery;\n  z2 = eyez - centerz;\n  len = 1 / Math.hypot(z0, z1, z2);\n  z0 *= len;\n  z1 *= len;\n  z2 *= len;\n  x0 = upy * z2 - upz * z1;\n  x1 = upz * z0 - upx * z2;\n  x2 = upx * z1 - upy * z0;\n  len = Math.hypot(x0, x1, x2);\n\n  if (!len) {\n    x0 = 0;\n    x1 = 0;\n    x2 = 0;\n  } else {\n    len = 1 / len;\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\n  }\n\n  y0 = z1 * x2 - z2 * x1;\n  y1 = z2 * x0 - z0 * x2;\n  y2 = z0 * x1 - z1 * x0;\n  len = Math.hypot(y0, y1, y2);\n\n  if (!len) {\n    y0 = 0;\n    y1 = 0;\n    y2 = 0;\n  } else {\n    len = 1 / len;\n    y0 *= len;\n    y1 *= len;\n    y2 *= len;\n  }\n\n  out[0] = x0;\n  out[1] = y0;\n  out[2] = z0;\n  out[3] = 0;\n  out[4] = x1;\n  out[5] = y1;\n  out[6] = z1;\n  out[7] = 0;\n  out[8] = x2;\n  out[9] = y2;\n  out[10] = z2;\n  out[11] = 0;\n  out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n  out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n  out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n  out[15] = 1;\n  return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nexport function targetTo(out, eye, target, up) {\n  var eyex = eye[0],\n      eyey = eye[1],\n      eyez = eye[2],\n      upx = up[0],\n      upy = up[1],\n      upz = up[2];\n  var z0 = eyex - target[0],\n      z1 = eyey - target[1],\n      z2 = eyez - target[2];\n  var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    z0 *= len;\n    z1 *= len;\n    z2 *= len;\n  }\n\n  var x0 = upy * z2 - upz * z1,\n      x1 = upz * z0 - upx * z2,\n      x2 = upx * z1 - upy * z0;\n  len = x0 * x0 + x1 * x1 + x2 * x2;\n\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n    x0 *= len;\n    x1 *= len;\n    x2 *= len;\n  }\n\n  out[0] = x0;\n  out[1] = x1;\n  out[2] = x2;\n  out[3] = 0;\n  out[4] = z1 * x2 - z2 * x1;\n  out[5] = z2 * x0 - z0 * x2;\n  out[6] = z0 * x1 - z1 * x0;\n  out[7] = 0;\n  out[8] = z0;\n  out[9] = z1;\n  out[10] = z2;\n  out[11] = 0;\n  out[12] = eyex;\n  out[13] = eyey;\n  out[14] = eyez;\n  out[15] = 1;\n  return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n  return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n  return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  out[4] = a[4] + b[4];\n  out[5] = a[5] + b[5];\n  out[6] = a[6] + b[6];\n  out[7] = a[7] + b[7];\n  out[8] = a[8] + b[8];\n  out[9] = a[9] + b[9];\n  out[10] = a[10] + b[10];\n  out[11] = a[11] + b[11];\n  out[12] = a[12] + b[12];\n  out[13] = a[13] + b[13];\n  out[14] = a[14] + b[14];\n  out[15] = a[15] + b[15];\n  return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  out[4] = a[4] - b[4];\n  out[5] = a[5] - b[5];\n  out[6] = a[6] - b[6];\n  out[7] = a[7] - b[7];\n  out[8] = a[8] - b[8];\n  out[9] = a[9] - b[9];\n  out[10] = a[10] - b[10];\n  out[11] = a[11] - b[11];\n  out[12] = a[12] - b[12];\n  out[13] = a[13] - b[13];\n  out[14] = a[14] - b[14];\n  out[15] = a[15] - b[15];\n  return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  out[4] = a[4] * b;\n  out[5] = a[5] * b;\n  out[6] = a[6] * b;\n  out[7] = a[7] * b;\n  out[8] = a[8] * b;\n  out[9] = a[9] * b;\n  out[10] = a[10] * b;\n  out[11] = a[11] * b;\n  out[12] = a[12] * b;\n  out[13] = a[13] * b;\n  out[14] = a[14] * b;\n  out[15] = a[15] * b;\n  return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  out[4] = a[4] + b[4] * scale;\n  out[5] = a[5] + b[5] * scale;\n  out[6] = a[6] + b[6] * scale;\n  out[7] = a[7] + b[7] * scale;\n  out[8] = a[8] + b[8] * scale;\n  out[9] = a[9] + b[9] * scale;\n  out[10] = a[10] + b[10] * scale;\n  out[11] = a[11] + b[11] * scale;\n  out[12] = a[12] + b[12] * scale;\n  out[13] = a[13] + b[13] * scale;\n  out[14] = a[14] + b[14] * scale;\n  out[15] = a[15] + b[15] * scale;\n  return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var a4 = a[4],\n      a5 = a[5],\n      a6 = a[6],\n      a7 = a[7];\n  var a8 = a[8],\n      a9 = a[9],\n      a10 = a[10],\n      a11 = a[11];\n  var a12 = a[12],\n      a13 = a[13],\n      a14 = a[14],\n      a15 = a[15];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  var b4 = b[4],\n      b5 = b[5],\n      b6 = b[6],\n      b7 = b[7];\n  var b8 = b[8],\n      b9 = b[9],\n      b10 = b[10],\n      b11 = b[11];\n  var b12 = b[12],\n      b13 = b[13],\n      b14 = b[14],\n      b15 = b[15];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nexport var sub = subtract;", "import * as glMatrix from \"./common.js\";\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n  }\n\n  return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\nexport function fromValues(x, y, z, w) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = w;\n  return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\nexport function set(out, x, y, z, w) {\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  out[3] = w;\n  return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  out[2] = a[2] * b[2];\n  out[3] = a[3] * b[3];\n  return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  out[2] = a[2] / b[2];\n  out[3] = a[3] / b[3];\n  return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  out[2] = Math.ceil(a[2]);\n  out[3] = Math.ceil(a[3]);\n  return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  out[2] = Math.floor(a[2]);\n  out[3] = Math.floor(a[3]);\n  return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  out[2] = Math.min(a[2], b[2]);\n  out[3] = Math.min(a[3], b[3]);\n  return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  out[2] = Math.max(a[2], b[2]);\n  out[3] = Math.max(a[3], b[3]);\n  return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\nexport function round(out, a) {\n  out[0] = Math.round(a[0]);\n  out[1] = Math.round(a[1]);\n  out[2] = Math.round(a[2]);\n  out[3] = Math.round(a[3]);\n  return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  var w = b[3] - a[3];\n  return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  var w = b[3] - a[3];\n  return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  out[3] = -a[3];\n  return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  out[2] = 1.0 / a[2];\n  out[3] = 1.0 / a[3];\n  return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\nexport function normalize(out, a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var w = a[3];\n  var len = x * x + y * y + z * z + w * w;\n\n  if (len > 0) {\n    len = 1 / Math.sqrt(len);\n  }\n\n  out[0] = x * len;\n  out[1] = y * len;\n  out[2] = z * len;\n  out[3] = w * len;\n  return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\nexport function cross(out, u, v, w) {\n  var A = v[0] * w[1] - v[1] * w[0],\n      B = v[0] * w[2] - v[2] * w[0],\n      C = v[0] * w[3] - v[3] * w[0],\n      D = v[1] * w[2] - v[2] * w[1],\n      E = v[1] * w[3] - v[3] * w[1],\n      F = v[2] * w[3] - v[3] * w[2];\n  var G = u[0];\n  var H = u[1];\n  var I = u[2];\n  var J = u[3];\n  out[0] = H * F - I * E + J * D;\n  out[1] = -(G * F) + I * C - J * B;\n  out[2] = G * E - H * C + J * A;\n  out[3] = -(G * D) + H * B - I * A;\n  return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\nexport function lerp(out, a, b, t) {\n  var ax = a[0];\n  var ay = a[1];\n  var az = a[2];\n  var aw = a[3];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  out[2] = az + t * (b[2] - az);\n  out[3] = aw + t * (b[3] - aw);\n  return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\nexport function random(out, scale) {\n  scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n  // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n  // http://projecteuclid.org/euclid.aoms/1177692644;\n\n  var v1, v2, v3, v4;\n  var s1, s2;\n\n  do {\n    v1 = glMatrix.RANDOM() * 2 - 1;\n    v2 = glMatrix.RANDOM() * 2 - 1;\n    s1 = v1 * v1 + v2 * v2;\n  } while (s1 >= 1);\n\n  do {\n    v3 = glMatrix.RANDOM() * 2 - 1;\n    v4 = glMatrix.RANDOM() * 2 - 1;\n    s2 = v3 * v3 + v4 * v4;\n  } while (s2 >= 1);\n\n  var d = Math.sqrt((1 - s1) / s2);\n  out[0] = scale * v1;\n  out[1] = scale * v2;\n  out[2] = scale * v3 * d;\n  out[3] = scale * v4 * d;\n  return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\nexport function transformMat4(out, a, m) {\n  var x = a[0],\n      y = a[1],\n      z = a[2],\n      w = a[3];\n  out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n  out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n  out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n  out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n  return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\nexport function transformQuat(out, a, q) {\n  var x = a[0],\n      y = a[1],\n      z = a[2];\n  var qx = q[0],\n      qy = q[1],\n      qz = q[2],\n      qw = q[3]; // calculate quat * vec\n\n  var ix = qw * x + qy * z - qz * y;\n  var iy = qw * y + qz * x - qx * z;\n  var iz = qw * z + qx * y - qy * x;\n  var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n  out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n  out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n  out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n  out[3] = a[3];\n  return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  out[3] = 0.0;\n  return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n  return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n\n    if (!stride) {\n      stride = 4;\n    }\n\n    if (!offset) {\n      offset = 0;\n    }\n\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      vec[2] = a[i + 2];\n      vec[3] = a[i + 3];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n      a[i + 2] = vec[2];\n      a[i + 3] = vec[3];\n    }\n\n    return a;\n  };\n}();", "import {StyleLayer} from '../style_layer';\n\nimport {CircleBucket} from '../../data/bucket/circle_bucket';\nimport {polygonIntersectsBufferedPoint} from '../../util/intersection_tests';\nimport {getMaximumPaintValue, translateDistance, translate} from '../query_utils';\nimport properties, {CircleLayoutPropsPossiblyEvaluated, CirclePaintPropsPossiblyEvaluated} from './circle_style_layer_properties.g';\nimport {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties';\nimport {mat4, vec4} from 'gl-matrix';\nimport Point from '@mapbox/point-geometry';\nimport type {FeatureState, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Transform} from '../../geo/transform';\nimport type {Bucket, BucketParameters} from '../../data/bucket';\nimport type {CircleLayoutProps, CirclePaintProps} from './circle_style_layer_properties.g';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\n\n/**\n * A style layer that defines a circle\n */\nexport class CircleStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<CircleLayoutProps>;\n    layout: PossiblyEvaluated<CircleLayoutProps, CircleLayoutPropsPossiblyEvaluated>;\n\n    _transitionablePaint: Transitionable<CirclePaintProps>;\n    _transitioningPaint: Transitioning<CirclePaintProps>;\n    paint: PossiblyEvaluated<CirclePaintProps, CirclePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new CircleBucket(parameters);\n    }\n\n    queryRadius(bucket: Bucket): number {\n        const circleBucket: CircleBucket<CircleStyleLayer> = (bucket as any);\n        return getMaximumPaintValue('circle-radius', this, circleBucket) +\n            getMaximumPaintValue('circle-stroke-width', this, circleBucket) +\n            translateDistance(this.paint.get('circle-translate'));\n    }\n\n    queryIntersectsFeature(\n        queryGeometry: Array<Point>,\n        feature: VectorTileFeature,\n        featureState: FeatureState,\n        geometry: Array<Array<Point>>,\n        zoom: number,\n        transform: Transform,\n        pixelsToTileUnits: number,\n        pixelPosMatrix: mat4\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('circle-translate'),\n            this.paint.get('circle-translate-anchor'),\n            transform.angle, pixelsToTileUnits);\n        const radius = this.paint.get('circle-radius').evaluate(feature, featureState);\n        const stroke = this.paint.get('circle-stroke-width').evaluate(feature, featureState);\n        const size  = radius + stroke;\n\n        // For pitch-alignment: map, compare feature geometry to query geometry in the plane of the tile\n        // // Otherwise, compare geometry in the plane of the viewport\n        // // A circle with fixed scaling relative to the viewport gets larger in tile space as it moves into the distance\n        // // A circle with fixed scaling relative to the map gets smaller in viewport space as it moves into the distance\n        const alignWithMap = this.paint.get('circle-pitch-alignment') === 'map';\n        const transformedPolygon = alignWithMap ? translatedPolygon : projectQueryGeometry(translatedPolygon, pixelPosMatrix);\n        const transformedSize = alignWithMap ? size * pixelsToTileUnits : size;\n\n        for (const ring of geometry) {\n            for (const point of ring) {\n\n                const transformedPoint = alignWithMap ? point : projectPoint(point, pixelPosMatrix);\n\n                let adjustedSize = transformedSize;\n                const projectedCenter = vec4.transformMat4([] as any, [point.x, point.y, 0, 1], pixelPosMatrix);\n                if (this.paint.get('circle-pitch-scale') === 'viewport' && this.paint.get('circle-pitch-alignment') === 'map') {\n                    adjustedSize *= projectedCenter[3] / transform.cameraToCenterDistance;\n                } else if (this.paint.get('circle-pitch-scale') === 'map' && this.paint.get('circle-pitch-alignment') === 'viewport') {\n                    adjustedSize *= transform.cameraToCenterDistance / projectedCenter[3];\n                }\n\n                if (polygonIntersectsBufferedPoint(transformedPolygon, transformedPoint, adjustedSize)) return true;\n            }\n        }\n\n        return false;\n    }\n}\n\nfunction projectPoint(p: Point, pixelPosMatrix: mat4) {\n    const point = vec4.transformMat4([] as any, [p.x, p.y, 0, 1], pixelPosMatrix);\n    return new Point(point[0] / point[3], point[1] / point[3]);\n}\n\nfunction projectQueryGeometry(queryGeometry: Array<Point>, pixelPosMatrix: mat4) {\n    return queryGeometry.map((p) => {\n        return projectPoint(p, pixelPosMatrix);\n    });\n}\n", "import {CircleBucket} from './circle_bucket';\nimport {register} from '../../util/web_worker_transfer';\n\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\n\nexport class HeatmapBucket extends CircleBucket<HeatmapStyleLayer> {\n    // Needed for flow to accept omit: ['layers'] below, due to\n    // https://github.com/facebook/flow/issues/4262\n    layers: Array<HeatmapStyleLayer>;\n}\n\nregister('HeatmapBucket', HeatmapBucket, {omit: ['layers']});\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type HeatmapPaintProps = {\n    \"heatmap-radius\": DataDrivenProperty<number>,\n    \"heatmap-weight\": DataDrivenProperty<number>,\n    \"heatmap-intensity\": DataConstantProperty<number>,\n    \"heatmap-color\": ColorRampProperty,\n    \"heatmap-opacity\": DataConstantProperty<number>,\n};\n\nexport type HeatmapPaintPropsPossiblyEvaluated = {\n    \"heatmap-radius\": PossiblyEvaluatedPropertyValue<number>,\n    \"heatmap-weight\": PossiblyEvaluatedPropertyValue<number>,\n    \"heatmap-intensity\": number,\n    \"heatmap-color\": ColorRampProperty,\n    \"heatmap-opacity\": number,\n};\n\nlet paint: Properties<HeatmapPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"heatmap-radius\": new DataDrivenProperty(styleSpec[\"paint_heatmap\"][\"heatmap-radius\"] as any as StylePropertySpecification),\n    \"heatmap-weight\": new DataDrivenProperty(styleSpec[\"paint_heatmap\"][\"heatmap-weight\"] as any as StylePropertySpecification),\n    \"heatmap-intensity\": new DataConstantProperty(styleSpec[\"paint_heatmap\"][\"heatmap-intensity\"] as any as StylePropertySpecification),\n    \"heatmap-color\": new ColorRampProperty(styleSpec[\"paint_heatmap\"][\"heatmap-color\"] as any as StylePropertySpecification),\n    \"heatmap-opacity\": new DataConstantProperty(styleSpec[\"paint_heatmap\"][\"heatmap-opacity\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import {register} from './web_worker_transfer';\n\nexport type Size = {\n    width: number;\n    height: number;\n};\n\ntype Point2D = {\n    x: number;\n    y: number;\n};\n\nfunction createImage(image: any, {\n    width,\n    height\n}: Size, channels: number, data?: Uint8Array | Uint8ClampedArray) {\n    if (!data) {\n        data = new Uint8Array(width * height * channels);\n    } else if (data instanceof Uint8ClampedArray) {\n        data = new Uint8Array(data.buffer);\n    } else if (data.length !== width * height * channels) {\n        throw new RangeError(`mismatched image size. expected: ${data.length} but got: ${width * height * channels}`);\n    }\n    image.width = width;\n    image.height = height;\n    image.data = data;\n    return image;\n}\n\nfunction resizeImage(image: any, {\n    width,\n    height\n}: Size, channels: number) {\n    if (width === image.width && height === image.height) {\n        return;\n    }\n\n    const newImage = createImage({}, {width, height}, channels);\n\n    copyImage(image, newImage, {x: 0, y: 0}, {x: 0, y: 0}, {\n        width: Math.min(image.width, width),\n        height: Math.min(image.height, height)\n    }, channels);\n\n    image.width = width;\n    image.height = height;\n    image.data = newImage.data;\n}\n\nfunction copyImage(srcImg: any, dstImg: any, srcPt: Point2D, dstPt: Point2D, size: Size, channels: number) {\n    if (size.width === 0 || size.height === 0) {\n        return dstImg;\n    }\n\n    if (size.width > srcImg.width ||\n        size.height > srcImg.height ||\n        srcPt.x > srcImg.width - size.width ||\n        srcPt.y > srcImg.height - size.height) {\n        throw new RangeError('out of range source coordinates for image copy');\n    }\n\n    if (size.width > dstImg.width ||\n        size.height > dstImg.height ||\n        dstPt.x > dstImg.width - size.width ||\n        dstPt.y > dstImg.height - size.height) {\n        throw new RangeError('out of range destination coordinates for image copy');\n    }\n\n    const srcData = srcImg.data;\n    const dstData = dstImg.data;\n\n    if (srcData === dstData) throw new Error('srcData equals dstData, so image is already copied');\n\n    for (let y = 0; y < size.height; y++) {\n        const srcOffset = ((srcPt.y + y) * srcImg.width + srcPt.x) * channels;\n        const dstOffset = ((dstPt.y + y) * dstImg.width + dstPt.x) * channels;\n        for (let i = 0; i < size.width * channels; i++) {\n            dstData[dstOffset + i] = srcData[srcOffset + i];\n        }\n    }\n    return dstImg;\n}\n\n/**\n * An image with alpha color value\n */\nexport class AlphaImage {\n    width: number;\n    height: number;\n    data: Uint8Array;\n\n    constructor(size: Size, data?: Uint8Array | Uint8ClampedArray) {\n        createImage(this, size, 1, data);\n    }\n\n    resize(size: Size) {\n        resizeImage(this, size, 1);\n    }\n\n    clone() {\n        return new AlphaImage({width: this.width, height: this.height}, new Uint8Array(this.data));\n    }\n\n    static copy(srcImg: AlphaImage, dstImg: AlphaImage, srcPt: Point2D, dstPt: Point2D, size: Size) {\n        copyImage(srcImg, dstImg, srcPt, dstPt, size, 1);\n    }\n}\n\n/**\n * An object to store image data not premultiplied, because ImageData is not premultiplied.\n * UNPACK_PREMULTIPLY_ALPHA_WEBGL must be used when uploading to a texture.\n */\nexport class RGBAImage {\n    width: number;\n    height: number;\n\n    /**\n     * data must be a Uint8Array instead of Uint8ClampedArray because texImage2D does not support Uint8ClampedArray in all browsers.\n     */\n    data: Uint8Array;\n\n    constructor(size: Size, data?: Uint8Array | Uint8ClampedArray) {\n        createImage(this, size, 4, data);\n    }\n\n    resize(size: Size) {\n        resizeImage(this, size, 4);\n    }\n\n    replace(data: Uint8Array | Uint8ClampedArray, copy?: boolean) {\n        if (copy) {\n            this.data.set(data);\n        } else if (data instanceof Uint8ClampedArray) {\n            this.data = new Uint8Array(data.buffer);\n        } else {\n            this.data = data;\n        }\n    }\n\n    clone() {\n        return new RGBAImage({width: this.width, height: this.height}, new Uint8Array(this.data));\n    }\n\n    static copy(srcImg: RGBAImage | ImageData, dstImg: RGBAImage, srcPt: Point2D, dstPt: Point2D, size: Size) {\n        copyImage(srcImg, dstImg, srcPt, dstPt, size, 4);\n    }\n}\n\nregister('AlphaImage', AlphaImage);\nregister('RGBAImage', RGBAImage);\n", "import {RGBAImage} from './image';\nimport {isPowerOfTwo} from './util';\n\nimport type {StylePropertyExpression} from '@maplibre/maplibre-gl-style-spec';\n\nexport type ColorRampParams = {\n    expression: StylePropertyExpression;\n    evaluationKey: string;\n    resolution?: number;\n    image?: RGBAImage;\n    clips?: Array<any>;\n};\n\n/**\n * Given an expression that should evaluate to a color ramp,\n * return a RGBA image representing that ramp expression.\n */\nexport function renderColorRamp(params: ColorRampParams): RGBAImage {\n    const evaluationGlobals = {};\n    const width = params.resolution || 256;\n    const height = params.clips ? params.clips.length : 1;\n    const image = params.image || new RGBAImage({width, height});\n\n    if (!isPowerOfTwo(width)) throw new Error(`width is not a power of 2 - ${width}`);\n\n    const renderPixel = (stride, index, progress) => {\n        evaluationGlobals[params.evaluationKey] = progress;\n        const pxColor = params.expression.evaluate(evaluationGlobals as any);\n        // the colors are being unpremultiplied because Color uses\n        // premultiplied values, and the Texture class expects unpremultiplied ones\n        image.data[stride + index + 0] = Math.floor(pxColor.r * 255 / pxColor.a);\n        image.data[stride + index + 1] = Math.floor(pxColor.g * 255 / pxColor.a);\n        image.data[stride + index + 2] = Math.floor(pxColor.b * 255 / pxColor.a);\n        image.data[stride + index + 3] = Math.floor(pxColor.a * 255);\n    };\n\n    if (!params.clips) {\n        for (let i = 0, j = 0; i < width; i++, j += 4) {\n            const progress = i / (width - 1);\n\n            renderPixel(0, j, progress);\n        }\n    } else {\n        for (let clip = 0, stride = 0; clip < height; ++clip, stride += width * 4) {\n            for (let i = 0, j = 0; i < width; i++, j += 4) {\n                // Remap progress between clips\n                const progress = i / (width - 1);\n                const {start, end} = params.clips[clip];\n                const evaluationProgress = start * (1 - progress) + end * progress;\n                renderPixel(stride, j, evaluationProgress);\n            }\n        }\n    }\n\n    return image;\n}\n", "import {StyleLayer} from '../style_layer';\n\nimport {HeatmapBucket} from '../../data/bucket/heatmap_bucket';\nimport {RGBAImage} from '../../util/image';\nimport properties, {HeatmapPaintPropsPossiblyEvaluated} from './heatmap_style_layer_properties.g';\nimport {renderColorRamp} from '../../util/color_ramp';\nimport {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';\n\nimport type {Texture} from '../../render/texture';\nimport type {Framebuffer} from '../../gl/framebuffer';\nimport type {HeatmapPaintProps} from './heatmap_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport const HEATMAP_FULL_RENDER_FBO_KEY = 'big-fb';\n\n/**\n * A style layer that defines a heatmap\n */\nexport class HeatmapStyleLayer extends StyleLayer {\n\n    heatmapFbos: Map<string, Framebuffer>;\n    colorRamp: RGBAImage;\n    colorRampTexture: Texture;\n\n    _transitionablePaint: Transitionable<HeatmapPaintProps>;\n    _transitioningPaint: Transitioning<HeatmapPaintProps>;\n    paint: PossiblyEvaluated<HeatmapPaintProps, HeatmapPaintPropsPossiblyEvaluated>;\n\n    createBucket(options: any) {\n        return new HeatmapBucket(options);\n    }\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n\n        this.heatmapFbos = new Map();\n        // make sure color ramp texture is generated for default heatmap color too\n        this._updateColorRamp();\n    }\n\n    _handleSpecialPaintPropertyUpdate(name: string) {\n        if (name === 'heatmap-color') {\n            this._updateColorRamp();\n        }\n    }\n\n    _updateColorRamp() {\n        const expression = this._transitionablePaint._values['heatmap-color'].value.expression;\n        this.colorRamp = renderColorRamp({\n            expression,\n            evaluationKey: 'heatmapDensity',\n            image: this.colorRamp\n        });\n        this.colorRampTexture = null;\n    }\n\n    resize() {\n        if (this.heatmapFbos.has(HEATMAP_FULL_RENDER_FBO_KEY)) {\n            this.heatmapFbos.delete(HEATMAP_FULL_RENDER_FBO_KEY);\n        }\n    }\n\n    queryRadius(): number {\n        return 0;\n    }\n\n    queryIntersectsFeature(): boolean {\n        return false;\n    }\n\n    hasOffscreenPass() {\n        return this.paint.get('heatmap-opacity') !== 0 && this.visibility !== 'none';\n    }\n}\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type HillshadePaintProps = {\n    \"hillshade-illumination-direction\": DataConstantProperty<number>,\n    \"hillshade-illumination-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"hillshade-exaggeration\": DataConstantProperty<number>,\n    \"hillshade-shadow-color\": DataConstantProperty<Color>,\n    \"hillshade-highlight-color\": DataConstantProperty<Color>,\n    \"hillshade-accent-color\": DataConstantProperty<Color>,\n};\n\nexport type HillshadePaintPropsPossiblyEvaluated = {\n    \"hillshade-illumination-direction\": number,\n    \"hillshade-illumination-anchor\": \"map\" | \"viewport\",\n    \"hillshade-exaggeration\": number,\n    \"hillshade-shadow-color\": Color,\n    \"hillshade-highlight-color\": Color,\n    \"hillshade-accent-color\": Color,\n};\n\nlet paint: Properties<HillshadePaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"hillshade-illumination-direction\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-direction\"] as any as StylePropertySpecification),\n    \"hillshade-illumination-anchor\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-illumination-anchor\"] as any as StylePropertySpecification),\n    \"hillshade-exaggeration\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-exaggeration\"] as any as StylePropertySpecification),\n    \"hillshade-shadow-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-shadow-color\"] as any as StylePropertySpecification),\n    \"hillshade-highlight-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-highlight-color\"] as any as StylePropertySpecification),\n    \"hillshade-accent-color\": new DataConstantProperty(styleSpec[\"paint_hillshade\"][\"hillshade-accent-color\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import {StyleLayer} from '../style_layer';\n\nimport properties, {HillshadePaintPropsPossiblyEvaluated} from './hillshade_style_layer_properties.g';\nimport {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';\n\nimport type {HillshadePaintProps} from './hillshade_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport class HillshadeStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<HillshadePaintProps>;\n    _transitioningPaint: Transitioning<HillshadePaintProps>;\n    paint: PossiblyEvaluated<HillshadePaintProps, HillshadePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n\n    hasOffscreenPass() {\n        return this.paint.get('hillshade-exaggeration') !== 0 && this.visibility !== 'none';\n    }\n}\n", "import {createLayout} from '../../util/struct_array';\n\nconst layout = createLayout([\n    {name: 'a_pos', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const {members, size, alignment} = layout;\n", "\nexport default function earcut(data, holeIndices, dim = 2) {\n\n    const hasHoles = holeIndices && holeIndices.length;\n    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n    let outerNode = linkedList(data, 0, outerLen, dim, true);\n    const triangles = [];\n\n    if (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\n    let minX, minY, invSize;\n\n    if (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim);\n\n    // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n    if (data.length > 80 * dim) {\n        minX = Infinity;\n        minY = Infinity;\n        let maxX = -Infinity;\n        let maxY = -Infinity;\n\n        for (let i = dim; i < outerLen; i += dim) {\n            const x = data[i];\n            const y = data[i + 1];\n            if (x < minX) minX = x;\n            if (y < minY) minY = y;\n            if (x > maxX) maxX = x;\n            if (y > maxY) maxY = y;\n        }\n\n        // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n        invSize = Math.max(maxX - minX, maxY - minY);\n        invSize = invSize !== 0 ? 32767 / invSize : 0;\n    }\n\n    earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);\n\n    return triangles;\n}\n\n// create a circular doubly linked list from polygon points in the specified winding order\nfunction linkedList(data, start, end, dim, clockwise) {\n    let last;\n\n    if (clockwise === (signedArea(data, start, end, dim) > 0)) {\n        for (let i = start; i < end; i += dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    } else {\n        for (let i = end - dim; i >= start; i -= dim) last = insertNode(i / dim | 0, data[i], data[i + 1], last);\n    }\n\n    if (last && equals(last, last.next)) {\n        removeNode(last);\n        last = last.next;\n    }\n\n    return last;\n}\n\n// eliminate colinear or duplicate points\nfunction filterPoints(start, end) {\n    if (!start) return start;\n    if (!end) end = start;\n\n    let p = start,\n        again;\n    do {\n        again = false;\n\n        if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n            removeNode(p);\n            p = end = p.prev;\n            if (p === p.next) break;\n            again = true;\n\n        } else {\n            p = p.next;\n        }\n    } while (again || p !== end);\n\n    return end;\n}\n\n// main ear slicing loop which triangulates a polygon (given as a linked list)\nfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n    if (!ear) return;\n\n    // interlink polygon nodes in z-order\n    if (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\n    let stop = ear;\n\n    // iterate through ears, slicing them one by one\n    while (ear.prev !== ear.next) {\n        const prev = ear.prev;\n        const next = ear.next;\n\n        if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n            triangles.push(prev.i, ear.i, next.i); // cut off the triangle\n\n            removeNode(ear);\n\n            // skipping the next vertex leads to less sliver triangles\n            ear = next.next;\n            stop = next.next;\n\n            continue;\n        }\n\n        ear = next;\n\n        // if we looped through the whole remaining polygon and can't find any more ears\n        if (ear === stop) {\n            // try filtering points and slicing again\n            if (!pass) {\n                earcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1);\n\n            // if this didn't work, try curing all small self-intersections locally\n            } else if (pass === 1) {\n                ear = cureLocalIntersections(filterPoints(ear), triangles);\n                earcutLinked(ear, triangles, dim, minX, minY, invSize, 2);\n\n            // as a last resort, try splitting the remaining polygon into two\n            } else if (pass === 2) {\n                splitEarcut(ear, triangles, dim, minX, minY, invSize);\n            }\n\n            break;\n        }\n    }\n}\n\n// check whether a polygon node forms a valid ear with adjacent nodes\nfunction isEar(ear) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    // now make sure we don't have other points inside the potential ear\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox; min & max are calculated like this for speed\n    const x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n        y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n        x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n        y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n    let p = c.next;\n    while (p !== a) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&\n            area(p.prev, p, p.next) >= 0) return false;\n        p = p.next;\n    }\n\n    return true;\n}\n\nfunction isEarHashed(ear, minX, minY, invSize) {\n    const a = ear.prev,\n        b = ear,\n        c = ear.next;\n\n    if (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\n    const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;\n\n    // triangle bbox; min & max are calculated like this for speed\n    const x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),\n        y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),\n        x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),\n        y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);\n\n    // z-order range for the current triangle bbox;\n    const minZ = zOrder(x0, y0, minX, minY, invSize),\n        maxZ = zOrder(x1, y1, minX, minY, invSize);\n\n    let p = ear.prevZ,\n        n = ear.nextZ;\n\n    // look for points inside the triangle in both directions\n    while (p && p.z >= minZ && n && n.z <= maxZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    // look for remaining points in decreasing z-order\n    while (p && p.z >= minZ) {\n        if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n        p = p.prevZ;\n    }\n\n    // look for remaining points in increasing z-order\n    while (n && n.z <= maxZ) {\n        if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&\n            pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n        n = n.nextZ;\n    }\n\n    return true;\n}\n\n// go through all polygon nodes and cure small local self-intersections\nfunction cureLocalIntersections(start, triangles) {\n    let p = start;\n    do {\n        const a = p.prev,\n            b = p.next.next;\n\n        if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\n            triangles.push(a.i, p.i, b.i);\n\n            // remove two nodes involved\n            removeNode(p);\n            removeNode(p.next);\n\n            p = start = b;\n        }\n        p = p.next;\n    } while (p !== start);\n\n    return filterPoints(p);\n}\n\n// try splitting polygon into two and triangulate them independently\nfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n    // look for a valid diagonal that divides the polygon into two\n    let a = start;\n    do {\n        let b = a.next.next;\n        while (b !== a.prev) {\n            if (a.i !== b.i && isValidDiagonal(a, b)) {\n                // split the polygon in two by the diagonal\n                let c = splitPolygon(a, b);\n\n                // filter colinear points around the cuts\n                a = filterPoints(a, a.next);\n                c = filterPoints(c, c.next);\n\n                // run earcut on each half\n                earcutLinked(a, triangles, dim, minX, minY, invSize, 0);\n                earcutLinked(c, triangles, dim, minX, minY, invSize, 0);\n                return;\n            }\n            b = b.next;\n        }\n        a = a.next;\n    } while (a !== start);\n}\n\n// link every hole into the outer loop, producing a single-ring polygon without holes\nfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n    const queue = [];\n\n    for (let i = 0, len = holeIndices.length; i < len; i++) {\n        const start = holeIndices[i] * dim;\n        const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n        const list = linkedList(data, start, end, dim, false);\n        if (list === list.next) list.steiner = true;\n        queue.push(getLeftmost(list));\n    }\n\n    queue.sort(compareX);\n\n    // process holes from left to right\n    for (let i = 0; i < queue.length; i++) {\n        outerNode = eliminateHole(queue[i], outerNode);\n    }\n\n    return outerNode;\n}\n\nfunction compareX(a, b) {\n    return a.x - b.x;\n}\n\n// find a bridge between vertices that connects hole with an outer ring and and link it\nfunction eliminateHole(hole, outerNode) {\n    const bridge = findHoleBridge(hole, outerNode);\n    if (!bridge) {\n        return outerNode;\n    }\n\n    const bridgeReverse = splitPolygon(bridge, hole);\n\n    // filter collinear points around the cuts\n    filterPoints(bridgeReverse, bridgeReverse.next);\n    return filterPoints(bridge, bridge.next);\n}\n\n// David Eberly's algorithm for finding a bridge between hole and outer polygon\nfunction findHoleBridge(hole, outerNode) {\n    let p = outerNode;\n    const hx = hole.x;\n    const hy = hole.y;\n    let qx = -Infinity;\n    let m;\n\n    // find a segment intersected by a ray from the hole's leftmost point to the left;\n    // segment's endpoint with lesser x will be potential connection point\n    do {\n        if (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n            const x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n            if (x <= hx && x > qx) {\n                qx = x;\n                m = p.x < p.next.x ? p : p.next;\n                if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint\n            }\n        }\n        p = p.next;\n    } while (p !== outerNode);\n\n    if (!m) return null;\n\n    // look for points inside the triangle of hole point, segment intersection and endpoint;\n    // if there are no points found, we have a valid connection;\n    // otherwise choose the point of the minimum angle with the ray as connection point\n\n    const stop = m;\n    const mx = m.x;\n    const my = m.y;\n    let tanMin = Infinity;\n\n    p = m;\n\n    do {\n        if (hx >= p.x && p.x >= mx && hx !== p.x &&\n                pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\n            const tan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n            if (locallyInside(p, hole) &&\n                (tan < tanMin || (tan === tanMin && (p.x > m.x || (p.x === m.x && sectorContainsSector(m, p)))))) {\n                m = p;\n                tanMin = tan;\n            }\n        }\n\n        p = p.next;\n    } while (p !== stop);\n\n    return m;\n}\n\n// whether sector in vertex m contains sector in vertex p in the same coordinates\nfunction sectorContainsSector(m, p) {\n    return area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n}\n\n// interlink polygon nodes in z-order\nfunction indexCurve(start, minX, minY, invSize) {\n    let p = start;\n    do {\n        if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n        p.prevZ = p.prev;\n        p.nextZ = p.next;\n        p = p.next;\n    } while (p !== start);\n\n    p.prevZ.nextZ = null;\n    p.prevZ = null;\n\n    sortLinked(p);\n}\n\n// Simon Tatham's linked list merge sort algorithm\n// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\nfunction sortLinked(list) {\n    let numMerges;\n    let inSize = 1;\n\n    do {\n        let p = list;\n        let e;\n        list = null;\n        let tail = null;\n        numMerges = 0;\n\n        while (p) {\n            numMerges++;\n            let q = p;\n            let pSize = 0;\n            for (let i = 0; i < inSize; i++) {\n                pSize++;\n                q = q.nextZ;\n                if (!q) break;\n            }\n            let qSize = inSize;\n\n            while (pSize > 0 || (qSize > 0 && q)) {\n\n                if (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n                    e = p;\n                    p = p.nextZ;\n                    pSize--;\n                } else {\n                    e = q;\n                    q = q.nextZ;\n                    qSize--;\n                }\n\n                if (tail) tail.nextZ = e;\n                else list = e;\n\n                e.prevZ = tail;\n                tail = e;\n            }\n\n            p = q;\n        }\n\n        tail.nextZ = null;\n        inSize *= 2;\n\n    } while (numMerges > 1);\n\n    return list;\n}\n\n// z-order of a point given coords and inverse of the longer side of data bbox\nfunction zOrder(x, y, minX, minY, invSize) {\n    // coords are transformed into non-negative 15-bit integer range\n    x = (x - minX) * invSize | 0;\n    y = (y - minY) * invSize | 0;\n\n    x = (x | (x << 8)) & 0x00FF00FF;\n    x = (x | (x << 4)) & 0x0F0F0F0F;\n    x = (x | (x << 2)) & 0x33333333;\n    x = (x | (x << 1)) & 0x55555555;\n\n    y = (y | (y << 8)) & 0x00FF00FF;\n    y = (y | (y << 4)) & 0x0F0F0F0F;\n    y = (y | (y << 2)) & 0x33333333;\n    y = (y | (y << 1)) & 0x55555555;\n\n    return x | (y << 1);\n}\n\n// find the leftmost node of a polygon ring\nfunction getLeftmost(start) {\n    let p = start,\n        leftmost = start;\n    do {\n        if (p.x < leftmost.x || (p.x === leftmost.x && p.y < leftmost.y)) leftmost = p;\n        p = p.next;\n    } while (p !== start);\n\n    return leftmost;\n}\n\n// check if a point lies within a convex triangle\nfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n    return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&\n           (ax - px) * (by - py) >= (bx - px) * (ay - py) &&\n           (bx - px) * (cy - py) >= (cx - px) * (by - py);\n}\n\n// check if a diagonal between two polygon nodes is valid (lies in polygon interior)\nfunction isValidDiagonal(a, b) {\n    return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && // dones't intersect other edges\n           (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && // locally visible\n            (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n            equals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n}\n\n// signed area of a triangle\nfunction area(p, q, r) {\n    return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n}\n\n// check if two points are equal\nfunction equals(p1, p2) {\n    return p1.x === p2.x && p1.y === p2.y;\n}\n\n// check if two segments intersect\nfunction intersects(p1, q1, p2, q2) {\n    const o1 = sign(area(p1, q1, p2));\n    const o2 = sign(area(p1, q1, q2));\n    const o3 = sign(area(p2, q2, p1));\n    const o4 = sign(area(p2, q2, q1));\n\n    if (o1 !== o2 && o3 !== o4) return true; // general case\n\n    if (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n    if (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n    if (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n    if (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n    return false;\n}\n\n// for collinear points p, q, r, check if point q lies on segment pr\nfunction onSegment(p, q, r) {\n    return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}\n\nfunction sign(num) {\n    return num > 0 ? 1 : num < 0 ? -1 : 0;\n}\n\n// check if a polygon diagonal intersects any polygon segments\nfunction intersectsPolygon(a, b) {\n    let p = a;\n    do {\n        if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&\n                intersects(p, p.next, a, b)) return true;\n        p = p.next;\n    } while (p !== a);\n\n    return false;\n}\n\n// check if a polygon diagonal is locally inside the polygon\nfunction locallyInside(a, b) {\n    return area(a.prev, a, a.next) < 0 ?\n        area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 :\n        area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n}\n\n// check if the middle point of a polygon diagonal is inside the polygon\nfunction middleInside(a, b) {\n    let p = a;\n    let inside = false;\n    const px = (a.x + b.x) / 2;\n    const py = (a.y + b.y) / 2;\n    do {\n        if (((p.y > py) !== (p.next.y > py)) && p.next.y !== p.y &&\n                (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x))\n            inside = !inside;\n        p = p.next;\n    } while (p !== a);\n\n    return inside;\n}\n\n// link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n// if one belongs to the outer ring and another to a hole, it merges it into a single ring\nfunction splitPolygon(a, b) {\n    const a2 = createNode(a.i, a.x, a.y),\n        b2 = createNode(b.i, b.x, b.y),\n        an = a.next,\n        bp = b.prev;\n\n    a.next = b;\n    b.prev = a;\n\n    a2.next = an;\n    an.prev = a2;\n\n    b2.next = a2;\n    a2.prev = b2;\n\n    bp.next = b2;\n    b2.prev = bp;\n\n    return b2;\n}\n\n// create a node and optionally link it with previous one (in a circular doubly linked list)\nfunction insertNode(i, x, y, last) {\n    const p = createNode(i, x, y);\n\n    if (!last) {\n        p.prev = p;\n        p.next = p;\n\n    } else {\n        p.next = last.next;\n        p.prev = last;\n        last.next.prev = p;\n        last.next = p;\n    }\n    return p;\n}\n\nfunction removeNode(p) {\n    p.next.prev = p.prev;\n    p.prev.next = p.next;\n\n    if (p.prevZ) p.prevZ.nextZ = p.nextZ;\n    if (p.nextZ) p.nextZ.prevZ = p.prevZ;\n}\n\nfunction createNode(i, x, y) {\n    return {\n        i, // vertex index in coordinates array\n        x, y, // vertex coordinates\n        prev: null, // previous and next vertex nodes in a polygon ring\n        next: null,\n        z: 0, // z-order curve value\n        prevZ: null, // previous and next nodes in z-order\n        nextZ: null,\n        steiner: false // indicates whether this is a steiner point\n    };\n}\n\n// return a percentage difference between the polygon area and its triangulation area;\n// used to verify correctness of triangulation\nexport function deviation(data, holeIndices, dim, triangles) {\n    const hasHoles = holeIndices && holeIndices.length;\n    const outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\n    let polygonArea = Math.abs(signedArea(data, 0, outerLen, dim));\n    if (hasHoles) {\n        for (let i = 0, len = holeIndices.length; i < len; i++) {\n            const start = holeIndices[i] * dim;\n            const end = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n            polygonArea -= Math.abs(signedArea(data, start, end, dim));\n        }\n    }\n\n    let trianglesArea = 0;\n    for (let i = 0; i < triangles.length; i += 3) {\n        const a = triangles[i] * dim;\n        const b = triangles[i + 1] * dim;\n        const c = triangles[i + 2] * dim;\n        trianglesArea += Math.abs(\n            (data[a] - data[c]) * (data[b + 1] - data[a + 1]) -\n            (data[a] - data[b]) * (data[c + 1] - data[a + 1]));\n    }\n\n    return polygonArea === 0 && trianglesArea === 0 ? 0 :\n        Math.abs((trianglesArea - polygonArea) / polygonArea);\n}\n\nfunction signedArea(data, start, end, dim) {\n    let sum = 0;\n    for (let i = start, j = end - dim; i < end; i += dim) {\n        sum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n        j = i;\n    }\n    return sum;\n}\n\n// turn a polygon in a multi-dimensional array form (e.g. as in GeoJSON) into a form Earcut accepts\nexport function flatten(data) {\n    const vertices = [];\n    const holes = [];\n    const dimensions = data[0][0].length;\n    let holeIndex = 0;\n    let prevLen = 0;\n\n    for (const ring of data) {\n        for (const p of ring) {\n            for (let d = 0; d < dimensions; d++) vertices.push(p[d]);\n        }\n        if (prevLen) {\n            holeIndex += prevLen;\n            holes.push(holeIndex);\n        }\n        prevLen = ring.length;\n    }\n    return {vertices, holes, dimensions};\n}\n", "import type {FillStyleLayer} from '../../style/style_layer/fill_style_layer';\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\n\nimport type {\n    BucketFeature,\n    PopulateParameters\n} from '../bucket';\nimport {PossiblyEvaluated} from '../../style/properties';\n\ntype PatternStyleLayers = Array<LineStyleLayer> | Array<FillStyleLayer> | Array<FillExtrusionStyleLayer>;\n\nexport function hasPattern(type: string, layers: PatternStyleLayers, options: PopulateParameters) {\n    const patterns = options.patternDependencies;\n    let hasPattern = false;\n\n    for (const layer of layers) {\n        const patternProperty = (layer.paint as PossiblyEvaluated<any, any>).get(`${type}-pattern`);\n        if (!patternProperty.isConstant()) {\n            hasPattern = true;\n        }\n\n        const constantPattern = patternProperty.constantOr(null);\n        if (constantPattern) {\n            hasPattern = true;\n            patterns[constantPattern.to] =  true;\n            patterns[constantPattern.from] =  true;\n        }\n    }\n\n    return hasPattern;\n}\n\nexport function addPatternDependencies(type: string, layers: PatternStyleLayers, patternFeature: BucketFeature, zoom: number, options: PopulateParameters) {\n    const patterns = options.patternDependencies;\n    for (const layer of layers) {\n        const patternProperty = (layer.paint  as PossiblyEvaluated<any, any>).get(`${type}-pattern`);\n\n        const patternPropertyValue = patternProperty.value;\n        if (patternPropertyValue.kind !== 'constant') {\n            let min = patternPropertyValue.evaluate({zoom: zoom - 1}, patternFeature, {}, options.availableImages);\n            let mid = patternPropertyValue.evaluate({zoom}, patternFeature, {}, options.availableImages);\n            let max = patternPropertyValue.evaluate({zoom: zoom + 1}, patternFeature, {}, options.availableImages);\n            min = min && min.name ? min.name : min;\n            mid = mid && mid.name ? mid.name : mid;\n            max = max && max.name ? max.name : max;\n            // add to patternDependencies\n            patterns[min] = true;\n            patterns[mid] = true;\n            patterns[max] = true;\n\n            // save for layout\n            patternFeature.patterns[layer.id] = {min, mid, max};\n        }\n    }\n    return patternFeature;\n}\n", "import {FillLayoutArray} from '../array_types.g';\n\nimport {members as layoutAttributes} from './fill_attributes';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {LineIndexArray, TriangleIndexArray} from '../index_array_type';\nimport earcut from 'earcut';\nimport {classifyRings} from '@maplibre/maplibre-gl-style-spec';\nconst EARCUT_MAX_RINGS = 500;\nimport {register} from '../../util/web_worker_transfer';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../source/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {FillStyleLayer} from '../../style/style_layer/fill_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\n\nexport class FillBucket implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: Array<FillStyleLayer>;\n    layerIds: Array<string>;\n    stateDependentLayers: Array<FillStyleLayer>;\n    stateDependentLayerIds: Array<string>;\n    patternFeatures: Array<BucketFeature>;\n\n    layoutVertexArray: FillLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    indexArray2: LineIndexArray;\n    indexBuffer2: IndexBuffer;\n\n    hasPattern: boolean;\n    programConfigurations: ProgramConfigurationSet<FillStyleLayer>;\n    segments: SegmentVector;\n    segments2: SegmentVector;\n    uploaded: boolean;\n\n    constructor(options: BucketParameters<FillStyleLayer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasPattern = false;\n        this.patternFeatures = [];\n\n        this.layoutVertexArray = new FillLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.indexArray2 = new LineIndexArray();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.segments = new SegmentVector();\n        this.segments2 = new SegmentVector();\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        this.hasPattern = hasPattern('fill', this.layers, options);\n        const fillSortKey = this.layers[0].layout.get('fill-sort-key');\n        const sortFeaturesByKey = !fillSortKey.isConstant();\n        const bucketFeatures: BucketFeature[] = [];\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const sortKey = sortFeaturesByKey ?\n                fillSortKey.evaluate(evaluationFeature, {}, canonical, options.availableImages) :\n                undefined;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                properties: feature.properties,\n                type: feature.type,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                patterns: {},\n                sortKey\n            };\n\n            bucketFeatures.push(bucketFeature);\n        }\n\n        if (sortFeaturesByKey) {\n            bucketFeatures.sort((a, b) => a.sortKey - b.sortKey);\n        }\n\n        for (const bucketFeature of bucketFeatures) {\n            const {geometry, index, sourceLayerIndex} = bucketFeature;\n\n            if (this.hasPattern) {\n                const patternFeature = addPatternDependencies('fill', this.layers, bucketFeature, this.zoom, options);\n                // pattern features are added only once the pattern is loaded into the image atlas\n                // so are stored during populate until later updated with positions by tile worker in addFeatures\n                this.patternFeatures.push(patternFeature);\n            } else {\n                this.addFeature(bucketFeature, geometry, index, canonical, {});\n            }\n\n            const feature = features[index].feature;\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {\n        [_: string]: ImagePosition;\n    }) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {\n        [_: string]: ImagePosition;\n    }) {\n        for (const feature of this.patternFeatures) {\n            this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions);\n        }\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending(): boolean {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n    upload(context: Context) {\n        if (!this.uploaded) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n            this.indexBuffer2 = context.createIndexBuffer(this.indexArray2);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.indexBuffer2.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n        this.segments2.destroy();\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {\n        [_: string]: ImagePosition;\n    }) {\n        for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {\n            let numVertices = 0;\n            for (const ring of polygon) {\n                numVertices += ring.length;\n            }\n\n            const triangleSegment = this.segments.prepareSegment(numVertices, this.layoutVertexArray, this.indexArray);\n            const triangleIndex = triangleSegment.vertexLength;\n\n            const flattened = [];\n            const holeIndices = [];\n\n            for (const ring of polygon) {\n                if (ring.length === 0) {\n                    continue;\n                }\n\n                if (ring !== polygon[0]) {\n                    holeIndices.push(flattened.length / 2);\n                }\n\n                const lineSegment = this.segments2.prepareSegment(ring.length, this.layoutVertexArray, this.indexArray2);\n                const lineIndex = lineSegment.vertexLength;\n\n                this.layoutVertexArray.emplaceBack(ring[0].x, ring[0].y);\n                this.indexArray2.emplaceBack(lineIndex + ring.length - 1, lineIndex);\n                flattened.push(ring[0].x);\n                flattened.push(ring[0].y);\n\n                for (let i = 1; i < ring.length; i++) {\n                    this.layoutVertexArray.emplaceBack(ring[i].x, ring[i].y);\n                    this.indexArray2.emplaceBack(lineIndex + i - 1, lineIndex + i);\n                    flattened.push(ring[i].x);\n                    flattened.push(ring[i].y);\n                }\n\n                lineSegment.vertexLength += ring.length;\n                lineSegment.primitiveLength += ring.length;\n            }\n\n            const indices = earcut(flattened, holeIndices);\n\n            for (let i = 0; i < indices.length; i += 3) {\n                this.indexArray.emplaceBack(\n                    triangleIndex + indices[i],\n                    triangleIndex + indices[i + 1],\n                    triangleIndex + indices[i + 2]);\n            }\n\n            triangleSegment.vertexLength += numVertices;\n            triangleSegment.primitiveLength += indices.length / 3;\n        }\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, imagePositions, canonical);\n    }\n}\n\nregister('FillBucket', FillBucket, {omit: ['layers', 'patternFeatures']});\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type FillLayoutProps = {\n    \"fill-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type FillLayoutPropsPossiblyEvaluated = {\n    \"fill-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<FillLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"fill-sort-key\": new DataDrivenProperty(styleSpec[\"layout_fill\"][\"fill-sort-key\"] as any as StylePropertySpecification),\n});\n\nexport type FillPaintProps = {\n    \"fill-antialias\": DataConstantProperty<boolean>,\n    \"fill-opacity\": DataDrivenProperty<number>,\n    \"fill-color\": DataDrivenProperty<Color>,\n    \"fill-outline-color\": DataDrivenProperty<Color>,\n    \"fill-translate\": DataConstantProperty<[number, number]>,\n    \"fill-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"fill-pattern\": CrossFadedDataDrivenProperty<ResolvedImage>,\n};\n\nexport type FillPaintPropsPossiblyEvaluated = {\n    \"fill-antialias\": boolean,\n    \"fill-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"fill-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"fill-outline-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"fill-translate\": [number, number],\n    \"fill-translate-anchor\": \"map\" | \"viewport\",\n    \"fill-pattern\": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,\n};\n\nlet paint: Properties<FillPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"fill-antialias\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-antialias\"] as any as StylePropertySpecification),\n    \"fill-opacity\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-opacity\"] as any as StylePropertySpecification),\n    \"fill-color\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-color\"] as any as StylePropertySpecification),\n    \"fill-outline-color\": new DataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-outline-color\"] as any as StylePropertySpecification),\n    \"fill-translate\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-translate\"] as any as StylePropertySpecification),\n    \"fill-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_fill\"][\"fill-translate-anchor\"] as any as StylePropertySpecification),\n    \"fill-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_fill\"][\"fill-pattern\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });", "import {StyleLayer} from '../style_layer';\n\nimport {FillBucket} from '../../data/bucket/fill_bucket';\nimport {polygonIntersectsMultiPolygon} from '../../util/intersection_tests';\nimport {translateDistance, translate} from '../query_utils';\nimport properties, {FillLayoutPropsPossiblyEvaluated, FillPaintPropsPossiblyEvaluated} from './fill_style_layer_properties.g';\nimport {Transitionable, Transitioning, Layout, PossiblyEvaluated} from '../properties';\n\nimport type {FeatureState, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket';\nimport type Point from '@mapbox/point-geometry';\nimport type {FillLayoutProps, FillPaintProps} from './fill_style_layer_properties.g';\nimport type {EvaluationParameters} from '../evaluation_parameters';\nimport type {Transform} from '../../geo/transform';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\n\nexport class FillStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<FillLayoutProps>;\n    layout: PossiblyEvaluated<FillLayoutProps, FillLayoutPropsPossiblyEvaluated>;\n\n    _transitionablePaint: Transitionable<FillPaintProps>;\n    _transitioningPaint: Transitioning<FillPaintProps>;\n    paint: PossiblyEvaluated<FillPaintProps, FillPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        super.recalculate(parameters, availableImages);\n\n        const outlineColor = this.paint._values['fill-outline-color'];\n        if (outlineColor.value.kind === 'constant' && outlineColor.value.value === undefined) {\n            this.paint._values['fill-outline-color'] = this.paint._values['fill-color'];\n        }\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new FillBucket(parameters);\n    }\n\n    queryRadius(): number {\n        return translateDistance(this.paint.get('fill-translate'));\n    }\n\n    queryIntersectsFeature(\n        queryGeometry: Array<Point>,\n        feature: VectorTileFeature,\n        featureState: FeatureState,\n        geometry: Array<Array<Point>>,\n        zoom: number,\n        transform: Transform,\n        pixelsToTileUnits: number\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('fill-translate'),\n            this.paint.get('fill-translate-anchor'),\n            transform.angle, pixelsToTileUnits);\n        return polygonIntersectsMultiPolygon(translatedPolygon, geometry);\n    }\n\n    isTileClipped() {\n        return true;\n    }\n}\n", "import {createLayout} from '../../util/struct_array';\n\nconst layout = createLayout([\n    {name: 'a_pos',          components: 2, type: 'Int16'},\n    {name: 'a_normal_ed',    components: 4, type: 'Int16'},\n], 4);\n\nexport const centroidAttributes = createLayout([\n    {name: 'a_centroid', components: 2, type: 'Int16'}\n], 4);\n\nexport default layout;\nexport const {members, size, alignment} = layout;\n", "'use strict';\n\nvar Point = require('@mapbox/point-geometry');\n\nmodule.exports = VectorTileFeature;\n\nfunction VectorTileFeature(pbf, end, extent, keys, values) {\n    // Public\n    this.properties = {};\n    this.extent = extent;\n    this.type = 0;\n\n    // Private\n    this._pbf = pbf;\n    this._geometry = -1;\n    this._keys = keys;\n    this._values = values;\n\n    pbf.readFields(readFeature, this, end);\n}\n\nfunction readFeature(tag, feature, pbf) {\n    if (tag == 1) feature.id = pbf.readVarint();\n    else if (tag == 2) readTag(pbf, feature);\n    else if (tag == 3) feature.type = pbf.readVarint();\n    else if (tag == 4) feature._geometry = pbf.pos;\n}\n\nfunction readTag(pbf, feature) {\n    var end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        var key = feature._keys[pbf.readVarint()],\n            value = feature._values[pbf.readVarint()];\n        feature.properties[key] = value;\n    }\n}\n\nVectorTileFeature.types = ['Unknown', 'Point', 'LineString', 'Polygon'];\n\nVectorTileFeature.prototype.loadGeometry = function() {\n    var pbf = this._pbf;\n    pbf.pos = this._geometry;\n\n    var end = pbf.readVarint() + pbf.pos,\n        cmd = 1,\n        length = 0,\n        x = 0,\n        y = 0,\n        lines = [],\n        line;\n\n    while (pbf.pos < end) {\n        if (length <= 0) {\n            var cmdLen = pbf.readVarint();\n            cmd = cmdLen & 0x7;\n            length = cmdLen >> 3;\n        }\n\n        length--;\n\n        if (cmd === 1 || cmd === 2) {\n            x += pbf.readSVarint();\n            y += pbf.readSVarint();\n\n            if (cmd === 1) { // moveTo\n                if (line) lines.push(line);\n                line = [];\n            }\n\n            line.push(new Point(x, y));\n\n        } else if (cmd === 7) {\n\n            // Workaround for https://github.com/mapbox/mapnik-vector-tile/issues/90\n            if (line) {\n                line.push(line[0].clone()); // closePolygon\n            }\n\n        } else {\n            throw new Error('unknown command ' + cmd);\n        }\n    }\n\n    if (line) lines.push(line);\n\n    return lines;\n};\n\nVectorTileFeature.prototype.bbox = function() {\n    var pbf = this._pbf;\n    pbf.pos = this._geometry;\n\n    var end = pbf.readVarint() + pbf.pos,\n        cmd = 1,\n        length = 0,\n        x = 0,\n        y = 0,\n        x1 = Infinity,\n        x2 = -Infinity,\n        y1 = Infinity,\n        y2 = -Infinity;\n\n    while (pbf.pos < end) {\n        if (length <= 0) {\n            var cmdLen = pbf.readVarint();\n            cmd = cmdLen & 0x7;\n            length = cmdLen >> 3;\n        }\n\n        length--;\n\n        if (cmd === 1 || cmd === 2) {\n            x += pbf.readSVarint();\n            y += pbf.readSVarint();\n            if (x < x1) x1 = x;\n            if (x > x2) x2 = x;\n            if (y < y1) y1 = y;\n            if (y > y2) y2 = y;\n\n        } else if (cmd !== 7) {\n            throw new Error('unknown command ' + cmd);\n        }\n    }\n\n    return [x1, y1, x2, y2];\n};\n\nVectorTileFeature.prototype.toGeoJSON = function(x, y, z) {\n    var size = this.extent * Math.pow(2, z),\n        x0 = this.extent * x,\n        y0 = this.extent * y,\n        coords = this.loadGeometry(),\n        type = VectorTileFeature.types[this.type],\n        i, j;\n\n    function project(line) {\n        for (var j = 0; j < line.length; j++) {\n            var p = line[j], y2 = 180 - (p.y + y0) * 360 / size;\n            line[j] = [\n                (p.x + x0) * 360 / size - 180,\n                360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90\n            ];\n        }\n    }\n\n    switch (this.type) {\n    case 1:\n        var points = [];\n        for (i = 0; i < coords.length; i++) {\n            points[i] = coords[i][0];\n        }\n        coords = points;\n        project(coords);\n        break;\n\n    case 2:\n        for (i = 0; i < coords.length; i++) {\n            project(coords[i]);\n        }\n        break;\n\n    case 3:\n        coords = classifyRings(coords);\n        for (i = 0; i < coords.length; i++) {\n            for (j = 0; j < coords[i].length; j++) {\n                project(coords[i][j]);\n            }\n        }\n        break;\n    }\n\n    if (coords.length === 1) {\n        coords = coords[0];\n    } else {\n        type = 'Multi' + type;\n    }\n\n    var result = {\n        type: \"Feature\",\n        geometry: {\n            type: type,\n            coordinates: coords\n        },\n        properties: this.properties\n    };\n\n    if ('id' in this) {\n        result.id = this.id;\n    }\n\n    return result;\n};\n\n// classifies an array of rings into polygons with outer rings and holes\n\nfunction classifyRings(rings) {\n    var len = rings.length;\n\n    if (len <= 1) return [rings];\n\n    var polygons = [],\n        polygon,\n        ccw;\n\n    for (var i = 0; i < len; i++) {\n        var area = signedArea(rings[i]);\n        if (area === 0) continue;\n\n        if (ccw === undefined) ccw = area < 0;\n\n        if (ccw === area < 0) {\n            if (polygon) polygons.push(polygon);\n            polygon = [rings[i]];\n\n        } else {\n            polygon.push(rings[i]);\n        }\n    }\n    if (polygon) polygons.push(polygon);\n\n    return polygons;\n}\n\nfunction signedArea(ring) {\n    var sum = 0;\n    for (var i = 0, len = ring.length, j = len - 1, p1, p2; i < len; j = i++) {\n        p1 = ring[i];\n        p2 = ring[j];\n        sum += (p2.x - p1.x) * (p1.y + p2.y);\n    }\n    return sum;\n}\n", "'use strict';\n\nvar VectorTileFeature = require('./vectortilefeature.js');\n\nmodule.exports = VectorTileLayer;\n\nfunction VectorTileLayer(pbf, end) {\n    // Public\n    this.version = 1;\n    this.name = null;\n    this.extent = 4096;\n    this.length = 0;\n\n    // Private\n    this._pbf = pbf;\n    this._keys = [];\n    this._values = [];\n    this._features = [];\n\n    pbf.readFields(readLayer, this, end);\n\n    this.length = this._features.length;\n}\n\nfunction readLayer(tag, layer, pbf) {\n    if (tag === 15) layer.version = pbf.readVarint();\n    else if (tag === 1) layer.name = pbf.readString();\n    else if (tag === 5) layer.extent = pbf.readVarint();\n    else if (tag === 2) layer._features.push(pbf.pos);\n    else if (tag === 3) layer._keys.push(pbf.readString());\n    else if (tag === 4) layer._values.push(readValueMessage(pbf));\n}\n\nfunction readValueMessage(pbf) {\n    var value = null,\n        end = pbf.readVarint() + pbf.pos;\n\n    while (pbf.pos < end) {\n        var tag = pbf.readVarint() >> 3;\n\n        value = tag === 1 ? pbf.readString() :\n            tag === 2 ? pbf.readFloat() :\n            tag === 3 ? pbf.readDouble() :\n            tag === 4 ? pbf.readVarint64() :\n            tag === 5 ? pbf.readVarint() :\n            tag === 6 ? pbf.readSVarint() :\n            tag === 7 ? pbf.readBoolean() : null;\n    }\n\n    return value;\n}\n\n// return feature `i` from this layer as a `VectorTileFeature`\nVectorTileLayer.prototype.feature = function(i) {\n    if (i < 0 || i >= this._features.length) throw new Error('feature index out of bounds');\n\n    this._pbf.pos = this._features[i];\n\n    var end = this._pbf.readVarint() + this._pbf.pos;\n    return new VectorTileFeature(this._pbf, end, this.extent, this._keys, this._values);\n};\n", "'use strict';\n\nvar VectorTileLayer = require('./vectortilelayer');\n\nmodule.exports = VectorTile;\n\nfunction VectorTile(pbf, end) {\n    this.layers = pbf.readFields(readTile, {}, end);\n}\n\nfunction readTile(tag, layers, pbf) {\n    if (tag === 3) {\n        var layer = new VectorTileLayer(pbf, pbf.readVarint() + pbf.pos);\n        if (layer.length) layers[layer.name] = layer;\n    }\n}\n\n", "module.exports.VectorTile = require('./lib/vectortile.js');\nmodule.exports.VectorTileFeature = require('./lib/vectortilefeature.js');\nmodule.exports.VectorTileLayer = require('./lib/vectortilelayer.js');\n", "import {FillExtrusionLayoutArray, PosArray} from '../array_types.g';\n\nimport {members as layoutAttributes, centroidAttributes} from './fill_extrusion_attributes';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {EXTENT} from '../extent';\nimport earcut from 'earcut';\nimport mvt from '@mapbox/vector-tile';\nconst vectorTileFeatureTypes = mvt.VectorTileFeature.types;\nimport {classifyRings} from '@maplibre/maplibre-gl-style-spec';\nconst EARCUT_MAX_RINGS = 500;\nimport {register} from '../../util/web_worker_transfer';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../source/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\n\nimport type {FillExtrusionStyleLayer} from '../../style/style_layer/fill_extrusion_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type Point from '@mapbox/point-geometry';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\n\nconst FACTOR = Math.pow(2, 13);\n\nfunction addVertex(vertexArray, x, y, nx, ny, nz, t, e) {\n    vertexArray.emplaceBack(\n        // a_pos\n        x,\n        y,\n        // a_normal_ed: 3-component normal and 1-component edgedistance\n        Math.floor(nx * FACTOR) * 2 + t,\n        ny * FACTOR * 2,\n        nz * FACTOR * 2,\n        // edgedistance (used for wrapping patterns around extrusion sides)\n        Math.round(e)\n    );\n}\n\nexport class FillExtrusionBucket implements Bucket {\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: Array<FillExtrusionStyleLayer>;\n    layerIds: Array<string>;\n    stateDependentLayers: Array<FillExtrusionStyleLayer>;\n    stateDependentLayerIds: Array<string>;\n\n    layoutVertexArray: FillExtrusionLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    centroidVertexArray: PosArray;\n    centroidVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasPattern: boolean;\n    programConfigurations: ProgramConfigurationSet<FillExtrusionStyleLayer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n    features: Array<BucketFeature>;\n\n    constructor(options: BucketParameters<FillExtrusionStyleLayer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasPattern = false;\n\n        this.layoutVertexArray = new FillExtrusionLayoutArray();\n        this.centroidVertexArray = new PosArray();\n        this.indexArray = new TriangleIndexArray();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.segments = new SegmentVector();\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        this.features = [];\n        this.hasPattern = hasPattern('fill-extrusion', this.layers, options);\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                properties: feature.properties,\n                type: feature.type,\n                patterns: {}\n            };\n\n            if (this.hasPattern) {\n                this.features.push(addPatternDependencies('fill-extrusion', this.layers, bucketFeature, this.zoom, options));\n            } else {\n                this.addFeature(bucketFeature, bucketFeature.geometry, index, canonical, {});\n            }\n\n            options.featureIndex.insert(feature, bucketFeature.geometry, index, sourceLayerIndex, this.index, true);\n        }\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {\n        for (const feature of this.features) {\n            const {geometry} = feature;\n            this.addFeature(feature, geometry, feature.index, canonical, imagePositions);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0 && this.centroidVertexArray.length === 0;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.centroidVertexBuffer = context.createVertexBuffer(this.centroidVertexArray, centroidAttributes.members, true);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n        this.centroidVertexBuffer.destroy();\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {\n        for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) {\n\n            const centroid = {x: 0, y: 0, vertexCount: 0};\n\n            let numVertices = 0;\n            for (const ring of polygon) {\n                numVertices += ring.length;\n            }\n            let segment = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray);\n\n            for (const ring of polygon) {\n                if (ring.length === 0) {\n                    continue;\n                }\n\n                if (isEntirelyOutside(ring)) {\n                    continue;\n                }\n\n                let edgeDistance = 0;\n\n                for (let p = 0; p < ring.length; p++) {\n                    const p1 = ring[p];\n\n                    if (p >= 1) {\n                        const p2 = ring[p - 1];\n\n                        if (!isBoundaryEdge(p1, p2)) {\n                            if (segment.vertexLength + 4 > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n                                segment = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray);\n                            }\n\n                            const perp = p1.sub(p2)._perp()._unit();\n                            const dist = p2.dist(p1);\n                            if (edgeDistance + dist > 32768) edgeDistance = 0;\n\n                            addVertex(this.layoutVertexArray, p1.x, p1.y, perp.x, perp.y, 0, 0, edgeDistance);\n                            addVertex(this.layoutVertexArray, p1.x, p1.y, perp.x, perp.y, 0, 1, edgeDistance);\n                            centroid.x += 2 * p1.x;\n                            centroid.y += 2 * p1.y;\n                            centroid.vertexCount += 2;\n\n                            edgeDistance += dist;\n\n                            addVertex(this.layoutVertexArray, p2.x, p2.y, perp.x, perp.y, 0, 0, edgeDistance);\n                            addVertex(this.layoutVertexArray, p2.x, p2.y, perp.x, perp.y, 0, 1, edgeDistance);\n                            centroid.x += 2 * p2.x;\n                            centroid.y += 2 * p2.y;\n                            centroid.vertexCount += 2;\n\n                            const bottomRight = segment.vertexLength;\n\n                            // ââââââââ\n                            // â 0  1 â Counter-clockwise winding order.\n                            // â      â Triangle 1: 0 => 2 => 1\n                            // â 2  3 â Triangle 2: 1 => 2 => 3\n                            // ââââââââ\n                            this.indexArray.emplaceBack(bottomRight, bottomRight + 2, bottomRight + 1);\n                            this.indexArray.emplaceBack(bottomRight + 1, bottomRight + 2, bottomRight + 3);\n\n                            segment.vertexLength += 4;\n                            segment.primitiveLength += 2;\n                        }\n                    }\n                }\n\n            }\n\n            if (segment.vertexLength + numVertices > SegmentVector.MAX_VERTEX_ARRAY_LENGTH) {\n                segment = this.segments.prepareSegment(numVertices, this.layoutVertexArray, this.indexArray);\n            }\n\n            //Only triangulate and draw the area of the feature if it is a polygon\n            //Other feature types (e.g. LineString) do not have area, so triangulation is pointless / undefined\n            if (vectorTileFeatureTypes[feature.type] !== 'Polygon')\n                continue;\n\n            const flattened = [];\n            const holeIndices = [];\n            const triangleIndex = segment.vertexLength;\n\n            for (const ring of polygon) {\n                if (ring.length === 0) {\n                    continue;\n                }\n\n                if (ring !== polygon[0]) {\n                    holeIndices.push(flattened.length / 2);\n                }\n\n                for (let i = 0; i < ring.length; i++) {\n                    const p = ring[i];\n\n                    addVertex(this.layoutVertexArray, p.x, p.y, 0, 0, 1, 1, 0);\n                    centroid.x += p.x;\n                    centroid.y += p.y;\n                    centroid.vertexCount += 1;\n\n                    flattened.push(p.x);\n                    flattened.push(p.y);\n                }\n\n            }\n\n            const indices = earcut(flattened, holeIndices);\n\n            for (let j = 0; j < indices.length; j += 3) {\n                // Counter-clockwise winding order.\n                this.indexArray.emplaceBack(\n                    triangleIndex + indices[j],\n                    triangleIndex + indices[j + 2],\n                    triangleIndex + indices[j + 1]);\n            }\n\n            segment.primitiveLength += indices.length / 3;\n            segment.vertexLength += numVertices;\n\n            // remember polygon centroid to calculate elevation in GPU\n            for (let i = 0; i < centroid.vertexCount; i++) {\n                const averageX =  Math.floor(centroid.x / centroid.vertexCount);\n                const averageY = Math.floor(centroid.y / centroid.vertexCount);\n                this.centroidVertexArray.emplaceBack(averageX, averageY);\n            }\n\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, imagePositions, canonical);\n    }\n}\n\nregister('FillExtrusionBucket', FillExtrusionBucket, {omit: ['layers', 'features']});\n\nfunction isBoundaryEdge(p1, p2) {\n    return (p1.x === p2.x && (p1.x < 0 || p1.x > EXTENT)) ||\n        (p1.y === p2.y && (p1.y < 0 || p1.y > EXTENT));\n}\n\nfunction isEntirelyOutside(ring) {\n    return ring.every(p => p.x < 0) ||\n        ring.every(p => p.x > EXTENT) ||\n        ring.every(p => p.y < 0) ||\n        ring.every(p => p.y > EXTENT);\n}\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type FillExtrusionPaintProps = {\n    \"fill-extrusion-opacity\": DataConstantProperty<number>,\n    \"fill-extrusion-color\": DataDrivenProperty<Color>,\n    \"fill-extrusion-translate\": DataConstantProperty<[number, number]>,\n    \"fill-extrusion-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"fill-extrusion-pattern\": CrossFadedDataDrivenProperty<ResolvedImage>,\n    \"fill-extrusion-height\": DataDrivenProperty<number>,\n    \"fill-extrusion-base\": DataDrivenProperty<number>,\n    \"fill-extrusion-vertical-gradient\": DataConstantProperty<boolean>,\n};\n\nexport type FillExtrusionPaintPropsPossiblyEvaluated = {\n    \"fill-extrusion-opacity\": number,\n    \"fill-extrusion-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"fill-extrusion-translate\": [number, number],\n    \"fill-extrusion-translate-anchor\": \"map\" | \"viewport\",\n    \"fill-extrusion-pattern\": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,\n    \"fill-extrusion-height\": PossiblyEvaluatedPropertyValue<number>,\n    \"fill-extrusion-base\": PossiblyEvaluatedPropertyValue<number>,\n    \"fill-extrusion-vertical-gradient\": boolean,\n};\n\nlet paint: Properties<FillExtrusionPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"fill-extrusion-opacity\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-opacity\"] as any as StylePropertySpecification),\n    \"fill-extrusion-color\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-color\"] as any as StylePropertySpecification),\n    \"fill-extrusion-translate\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-translate\"] as any as StylePropertySpecification),\n    \"fill-extrusion-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-translate-anchor\"] as any as StylePropertySpecification),\n    \"fill-extrusion-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-pattern\"] as any as StylePropertySpecification),\n    \"fill-extrusion-height\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-height\"] as any as StylePropertySpecification),\n    \"fill-extrusion-base\": new DataDrivenProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-base\"] as any as StylePropertySpecification),\n    \"fill-extrusion-vertical-gradient\": new DataConstantProperty(styleSpec[\"paint_fill-extrusion\"][\"fill-extrusion-vertical-gradient\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import {StyleLayer} from '../style_layer';\n\nimport {FillExtrusionBucket} from '../../data/bucket/fill_extrusion_bucket';\nimport {polygonIntersectsPolygon, polygonIntersectsMultiPolygon} from '../../util/intersection_tests';\nimport {translateDistance, translate} from '../query_utils';\nimport properties, {FillExtrusionPaintPropsPossiblyEvaluated} from './fill_extrusion_style_layer_properties.g';\nimport {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';\nimport {mat4, vec4} from 'gl-matrix';\nimport Point from '@mapbox/point-geometry';\nimport type {FeatureState, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {BucketParameters} from '../../data/bucket';\nimport type {FillExtrusionPaintProps} from './fill_extrusion_style_layer_properties.g';\nimport type {Transform} from '../../geo/transform';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\n\nexport class Point3D extends Point {\n    z: number;\n}\n\nexport class FillExtrusionStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<FillExtrusionPaintProps>;\n    _transitioningPaint: Transitioning<FillExtrusionPaintProps>;\n    paint: PossiblyEvaluated<FillExtrusionPaintProps, FillExtrusionPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n\n    createBucket(parameters: BucketParameters<FillExtrusionStyleLayer>) {\n        return new FillExtrusionBucket(parameters);\n    }\n\n    queryRadius(): number {\n        return translateDistance(this.paint.get('fill-extrusion-translate'));\n    }\n\n    is3D(): boolean {\n        return true;\n    }\n\n    queryIntersectsFeature(\n        queryGeometry: Array<Point>,\n        feature: VectorTileFeature,\n        featureState: FeatureState,\n        geometry: Array<Array<Point>>,\n        zoom: number,\n        transform: Transform,\n        pixelsToTileUnits: number,\n        pixelPosMatrix: mat4\n    ): boolean | number {\n\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('fill-extrusion-translate'),\n            this.paint.get('fill-extrusion-translate-anchor'),\n            transform.angle, pixelsToTileUnits);\n\n        const height = this.paint.get('fill-extrusion-height').evaluate(feature, featureState);\n        const base = this.paint.get('fill-extrusion-base').evaluate(feature, featureState);\n\n        const projectedQueryGeometry = projectQueryGeometry(translatedPolygon, pixelPosMatrix, transform, 0);\n\n        const projected = projectExtrusion(geometry, base, height, pixelPosMatrix);\n        const projectedBase = projected[0];\n        const projectedTop = projected[1];\n        return checkIntersection(projectedBase, projectedTop, projectedQueryGeometry);\n    }\n}\n\nfunction dot(a, b) {\n    return a.x * b.x + a.y * b.y;\n}\n\nexport function getIntersectionDistance(projectedQueryGeometry: Array<Point3D>, projectedFace: Array<Point3D>) {\n\n    if (projectedQueryGeometry.length === 1) {\n        // For point queries calculate the z at which the point intersects the face\n        // using barycentric coordinates.\n\n        // Find the barycentric coordinates of the projected point within the first\n        // triangle of the face, using only the xy plane. It doesn't matter if the\n        // point is outside the first triangle because all the triangles in the face\n        // are in the same plane.\n        //\n        // Check whether points are coincident and use other points if they are.\n        let i = 0;\n        const a = projectedFace[i++];\n        let b;\n        while (!b || a.equals(b)) {\n            b = projectedFace[i++];\n            if (!b) return Infinity;\n        }\n\n        // Loop until point `c` is not colinear with points `a` and `b`.\n        for (; i < projectedFace.length; i++) {\n            const c = projectedFace[i];\n\n            const p = projectedQueryGeometry[0];\n\n            const ab = b.sub(a);\n            const ac = c.sub(a);\n            const ap = p.sub(a);\n\n            const dotABAB = dot(ab, ab);\n            const dotABAC = dot(ab, ac);\n            const dotACAC = dot(ac, ac);\n            const dotAPAB = dot(ap, ab);\n            const dotAPAC = dot(ap, ac);\n            const denom = dotABAB * dotACAC - dotABAC * dotABAC;\n\n            const v = (dotACAC * dotAPAB - dotABAC * dotAPAC) / denom;\n            const w = (dotABAB * dotAPAC - dotABAC * dotAPAB) / denom;\n            const u = 1 - v - w;\n\n            // Use the barycentric weighting along with the original triangle z coordinates to get the point of intersection.\n            const distance = a.z * u + b.z * v + c.z * w;\n\n            if (isFinite(distance)) return distance;\n        }\n\n        return Infinity;\n\n    } else {\n        // The counts as closest is less clear when the query is a box. This\n        // returns the distance to the nearest point on the face, whether it is\n        // within the query or not. It could be more correct to return the\n        // distance to the closest point within the query box but this would be\n        // more complicated and expensive to calculate with little benefit.\n        let closestDistance = Infinity;\n        for (const p of projectedFace) {\n            closestDistance = Math.min(closestDistance, p.z);\n        }\n        return closestDistance;\n    }\n}\n\nfunction checkIntersection(projectedBase: Array<Array<Point3D>>, projectedTop: Array<Array<Point3D>>, projectedQueryGeometry: Array<Point3D>) {\n    let closestDistance = Infinity;\n\n    if (polygonIntersectsMultiPolygon(projectedQueryGeometry, projectedTop)) {\n        closestDistance = getIntersectionDistance(projectedQueryGeometry, projectedTop[0]);\n    }\n\n    for (let r = 0; r < projectedTop.length; r++) {\n        const ringTop = projectedTop[r];\n        const ringBase = projectedBase[r];\n        for (let p = 0; p < ringTop.length - 1; p++) {\n            const topA = ringTop[p];\n            const topB = ringTop[p + 1];\n            const baseA = ringBase[p];\n            const baseB = ringBase[p + 1];\n            const face = [topA, topB, baseB, baseA, topA];\n            if (polygonIntersectsPolygon(projectedQueryGeometry, face)) {\n                closestDistance = Math.min(closestDistance, getIntersectionDistance(projectedQueryGeometry, face));\n            }\n        }\n    }\n\n    return closestDistance === Infinity ? false : closestDistance;\n}\n\n/*\n * Project the geometry using matrix `m`. This is essentially doing\n * `vec4.transformMat4([], [p.x, p.y, z, 1], m)` but the multiplication\n * is inlined so that parts of the projection that are the same across\n * different points can only be done once. This produced a measurable\n * performance improvement.\n */\nfunction projectExtrusion(geometry: Array<Array<Point>>, zBase: number, zTop: number, m: mat4): [Array<Array<Point3D>>, Array<Array<Point3D>>] {\n    const projectedBase = [] as Array<Array<Point3D>>;\n    const projectedTop = [] as Array<Array<Point3D>>;\n    const baseXZ = m[8] * zBase;\n    const baseYZ = m[9] * zBase;\n    const baseZZ = m[10] * zBase;\n    const baseWZ = m[11] * zBase;\n    const topXZ = m[8] * zTop;\n    const topYZ = m[9] * zTop;\n    const topZZ = m[10] * zTop;\n    const topWZ = m[11] * zTop;\n\n    for (const r of geometry) {\n        const ringBase = [] as Array<Point3D>;\n        const ringTop = [] as Array<Point3D>;\n        for (const p of r) {\n            const x = p.x;\n            const y = p.y;\n\n            const sX = m[0] * x + m[4] * y + m[12];\n            const sY = m[1] * x + m[5] * y + m[13];\n            const sZ = m[2] * x + m[6] * y + m[14];\n            const sW = m[3] * x + m[7] * y + m[15];\n\n            const baseX = sX + baseXZ;\n            const baseY = sY + baseYZ;\n            const baseZ = sZ + baseZZ;\n            const baseW = sW + baseWZ;\n\n            const topX = sX + topXZ;\n            const topY = sY + topYZ;\n            const topZ = sZ + topZZ;\n            const topW = sW + topWZ;\n\n            const b = new Point(baseX / baseW, baseY / baseW) as Point3D;\n            b.z = baseZ / baseW;\n            ringBase.push(b);\n\n            const t = new Point(topX / topW, topY / topW) as Point3D;\n            t.z = topZ / topW;\n            ringTop.push(t);\n        }\n        projectedBase.push(ringBase);\n        projectedTop.push(ringTop);\n    }\n    return [projectedBase, projectedTop];\n}\n\nfunction projectQueryGeometry(queryGeometry: Array<Point>, pixelPosMatrix: mat4, transform: Transform, z: number) {\n    const projectedQueryGeometry = [];\n    for (const p of queryGeometry) {\n        const v = [p.x, p.y, z, 1] as vec4;\n        vec4.transformMat4(v, v, pixelPosMatrix);\n        projectedQueryGeometry.push(new Point(v[0] / v[3], v[1] / v[3]));\n    }\n    return projectedQueryGeometry;\n}\n", "import {createLayout} from '../../util/struct_array';\n\nexport const lineLayoutAttributes = createLayout([\n    {name: 'a_pos_normal', components: 2, type: 'Int16'},\n    {name: 'a_data', components: 4, type: 'Uint8'}\n], 4);\n\nexport const {members, size, alignment} = lineLayoutAttributes;\n", "import {createLayout} from '../../util/struct_array';\n\nexport const lineLayoutAttributesExt = createLayout([\n    {name: 'a_uv_x', components: 1, type: 'Float32'},\n    {name: 'a_split_index', components: 1, type: 'Float32'},\n]);\n\nexport const {members, size, alignment} = lineLayoutAttributesExt;\n", "import {LineLayoutArray, LineExtLayoutArray} from '../array_types.g';\n\nimport {members as layoutAttributes} from './line_attributes';\nimport {members as layoutAttributesExt} from './line_attributes_ext';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray} from '../index_array_type';\nimport {EXTENT} from '../extent';\nimport mvt from '@mapbox/vector-tile';\nconst vectorTileFeatureTypes = mvt.VectorTileFeature.types;\nimport {register} from '../../util/web_worker_transfer';\nimport {hasPattern, addPatternDependencies} from './pattern_bucket_features';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\n\nimport type {CanonicalTileID} from '../../source/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    BucketFeature,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\nimport type Point from '@mapbox/point-geometry';\nimport type {Segment} from '../segment';\nimport {RGBAImage} from '../../util/image';\nimport type {Context} from '../../gl/context';\nimport type {Texture} from '../../render/texture';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\n\n// NOTE ON EXTRUDE SCALE:\n// scale the extrusion vector so that the normal length is this value.\n// contains the \"texture\" normals (-1..1). this is distinct from the extrude\n// normals for line joins, because the x-value remains 0 for the texture\n// normal array, while the extrude normal actually moves the vertex to create\n// the acute/bevelled line join.\nconst EXTRUDE_SCALE = 63;\n\n/*\n * Sharp corners cause dashed lines to tilt because the distance along the line\n * is the same at both the inner and outer corners. To improve the appearance of\n * dashed lines we add extra points near sharp corners so that a smaller part\n * of the line is tilted.\n *\n * COS_HALF_SHARP_CORNER controls how sharp a corner has to be for us to add an\n * extra vertex. The default is 75 degrees.\n *\n * The newly created vertices are placed SHARP_CORNER_OFFSET pixels from the corner.\n */\nconst COS_HALF_SHARP_CORNER = Math.cos(75 / 2 * (Math.PI / 180));\nconst SHARP_CORNER_OFFSET = 15;\n\n// Angle per triangle for approximating round line joins.\nconst DEG_PER_TRIANGLE = 20;\n\n// The number of bits that is used to store the line distance in the buffer.\nconst LINE_DISTANCE_BUFFER_BITS = 15;\n\n// We don't have enough bits for the line distance as we'd like to have, so\n// use this value to scale the line distance (in tile units) down to a smaller\n// value. This lets us store longer distances while sacrificing precision.\nconst LINE_DISTANCE_SCALE = 1 / 2;\n\n// The maximum line distance, in tile units, that fits in the buffer.\nconst MAX_LINE_DISTANCE = Math.pow(2, LINE_DISTANCE_BUFFER_BITS - 1) / LINE_DISTANCE_SCALE;\n\ntype LineClips = {\n    start: number;\n    end: number;\n};\n\ntype GradientTexture = {\n    texture?: Texture;\n    gradient?: RGBAImage;\n    version?: number;\n};\n\n/**\n * @internal\n * Line bucket class\n */\nexport class LineBucket implements Bucket {\n    distance: number;\n    totalDistance: number;\n    maxLineLength: number;\n    scaledDistance: number;\n    lineClips?: LineClips;\n\n    e1: number;\n    e2: number;\n\n    index: number;\n    zoom: number;\n    overscaling: number;\n    layers: Array<LineStyleLayer>;\n    layerIds: Array<string>;\n    gradients: {[x: string]: GradientTexture};\n    stateDependentLayers: Array<any>;\n    stateDependentLayerIds: Array<string>;\n    patternFeatures: Array<BucketFeature>;\n    lineClipsArray: Array<LineClips>;\n\n    layoutVertexArray: LineLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n    layoutVertexArray2: LineExtLayoutArray;\n    layoutVertexBuffer2: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    hasPattern: boolean;\n    programConfigurations: ProgramConfigurationSet<LineStyleLayer>;\n    segments: SegmentVector;\n    uploaded: boolean;\n\n    constructor(options: BucketParameters<LineStyleLayer>) {\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.hasPattern = false;\n        this.patternFeatures = [];\n        this.lineClipsArray = [];\n        this.gradients = {};\n        this.layers.forEach(layer => {\n            this.gradients[layer.id] = {};\n        });\n\n        this.layoutVertexArray = new LineLayoutArray();\n        this.layoutVertexArray2 = new LineExtLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.programConfigurations = new ProgramConfigurationSet(options.layers, options.zoom);\n        this.segments = new SegmentVector();\n        this.maxLineLength = 0;\n\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        this.hasPattern = hasPattern('line', this.layers, options);\n        const lineSortKey = this.layers[0].layout.get('line-sort-key');\n        const sortFeaturesByKey = !lineSortKey.isConstant();\n        const bucketFeatures: BucketFeature[] = [];\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n            const needGeometry = this.layers[0]._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n\n            if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue;\n\n            const sortKey = sortFeaturesByKey ?\n                lineSortKey.evaluate(evaluationFeature, {}, canonical) :\n                undefined;\n\n            const bucketFeature: BucketFeature = {\n                id,\n                properties: feature.properties,\n                type: feature.type,\n                sourceLayerIndex,\n                index,\n                geometry: needGeometry ? evaluationFeature.geometry : loadGeometry(feature),\n                patterns: {},\n                sortKey\n            };\n\n            bucketFeatures.push(bucketFeature);\n        }\n\n        if (sortFeaturesByKey) {\n            bucketFeatures.sort((a, b) => {\n                return (a.sortKey) - (b.sortKey);\n            });\n        }\n\n        for (const bucketFeature of bucketFeatures) {\n            const {geometry, index, sourceLayerIndex} = bucketFeature;\n\n            if (this.hasPattern) {\n                const patternBucketFeature = addPatternDependencies('line', this.layers, bucketFeature, this.zoom, options);\n                // pattern features are added only once the pattern is loaded into the image atlas\n                // so are stored during populate until later updated with positions by tile worker in addFeatures\n                this.patternFeatures.push(patternBucketFeature);\n            } else {\n                this.addFeature(bucketFeature, geometry, index, canonical, {});\n            }\n\n            const feature = features[index].feature;\n            options.featureIndex.insert(feature, geometry, index, sourceLayerIndex, this.index);\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions);\n    }\n\n    addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {\n        for (const feature of this.patternFeatures) {\n            this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions);\n        }\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded) {\n            if (this.layoutVertexArray2.length !== 0) {\n                this.layoutVertexBuffer2 = context.createVertexBuffer(this.layoutVertexArray2, layoutAttributesExt);\n            }\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, layoutAttributes);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        }\n        this.programConfigurations.upload(context);\n        this.uploaded = true;\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n    }\n\n    lineFeatureClips(feature: BucketFeature): LineClips | undefined {\n        if (!!feature.properties && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_start') && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_end')) {\n            const start = +feature.properties['mapbox_clip_start'];\n            const end = +feature.properties['mapbox_clip_end'];\n            return {start, end};\n        }\n    }\n\n    addFeature(feature: BucketFeature, geometry: Array<Array<Point>>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) {\n        const layout = this.layers[0].layout;\n        const join = layout.get('line-join').evaluate(feature, {});\n        const cap = layout.get('line-cap');\n        const miterLimit = layout.get('line-miter-limit');\n        const roundLimit = layout.get('line-round-limit');\n        this.lineClips = this.lineFeatureClips(feature);\n\n        for (const line of geometry) {\n            this.addLine(line, feature, join, cap, miterLimit, roundLimit);\n        }\n\n        this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, feature, index, imagePositions, canonical);\n    }\n\n    addLine(vertices: Array<Point>, feature: BucketFeature, join: string, cap: string, miterLimit: number, roundLimit: number) {\n        this.distance = 0;\n        this.scaledDistance = 0;\n        this.totalDistance = 0;\n\n        if (this.lineClips) {\n            this.lineClipsArray.push(this.lineClips);\n            // Calculate the total distance, in tile units, of this tiled line feature\n            for (let i = 0; i < vertices.length - 1; i++) {\n                this.totalDistance += vertices[i].dist(vertices[i + 1]);\n            }\n            this.updateScaledDistance();\n            this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance);\n        }\n\n        const isPolygon = vectorTileFeatureTypes[feature.type] === 'Polygon';\n\n        // If the line has duplicate vertices at the ends, adjust start/length to remove them.\n        let len = vertices.length;\n        while (len >= 2 && vertices[len - 1].equals(vertices[len - 2])) {\n            len--;\n        }\n        let first = 0;\n        while (first < len - 1 && vertices[first].equals(vertices[first + 1])) {\n            first++;\n        }\n\n        // Ignore invalid geometry.\n        if (len < (isPolygon ? 3 : 2)) return;\n\n        if (join === 'bevel') miterLimit = 1.05;\n\n        const sharpCornerOffset = this.overscaling <= 16 ?\n            SHARP_CORNER_OFFSET * EXTENT / (512 * this.overscaling) :\n            0;\n\n        // we could be more precise, but it would only save a negligible amount of space\n        const segment = this.segments.prepareSegment(len * 10, this.layoutVertexArray, this.indexArray);\n\n        let currentVertex: Point;\n        let prevVertex: Point;\n        let nextVertex: Point;\n        let prevNormal: Point;\n        let nextNormal: Point;\n\n        // the last two vertices added\n        this.e1 = this.e2 = -1;\n\n        if (isPolygon) {\n            currentVertex = vertices[len - 2];\n            nextNormal = vertices[first].sub(currentVertex)._unit()._perp();\n        }\n\n        for (let i = first; i < len; i++) {\n\n            nextVertex = i === len - 1 ?\n                (isPolygon ? vertices[first + 1] : undefined) : // if it's a polygon, treat the last vertex like the first\n                vertices[i + 1]; // just the next vertex\n\n            // if two consecutive vertices exist, skip the current one\n            if (nextVertex && vertices[i].equals(nextVertex)) continue;\n\n            if (nextNormal) prevNormal = nextNormal;\n            if (currentVertex) prevVertex = currentVertex;\n\n            currentVertex = vertices[i];\n\n            // Calculate the normal towards the next vertex in this line. In case\n            // there is no next vertex, pretend that the line is continuing straight,\n            // meaning that we are just using the previous normal.\n            nextNormal = nextVertex ? nextVertex.sub(currentVertex)._unit()._perp() : prevNormal;\n\n            // If we still don't have a previous normal, this is the beginning of a\n            // non-closed line, so we're doing a straight \"join\".\n            prevNormal = prevNormal || nextNormal;\n\n            // Determine the normal of the join extrusion. It is the angle bisector\n            // of the segments between the previous line and the next line.\n            // In the case of 180Â° angles, the prev and next normals cancel each other out:\n            // prevNormal + nextNormal = (0, 0), its magnitude is 0, so the unit vector would be\n            // undefined. In that case, we're keeping the joinNormal at (0, 0), so that the cosHalfAngle\n            // below will also become 0 and miterLength will become Infinity.\n            let joinNormal = prevNormal.add(nextNormal);\n            if (joinNormal.x !== 0 || joinNormal.y !== 0) {\n                joinNormal._unit();\n            }\n            /*  joinNormal     prevNormal\n             *             â      â\n             *                .________. prevVertex\n             *                |\n             * nextNormal  â  |  currentVertex\n             *                |\n             *     nextVertex !\n             *\n             */\n\n            // calculate cosines of the angle (and its half) using dot product\n            const cosAngle = prevNormal.x * nextNormal.x + prevNormal.y * nextNormal.y;\n            const cosHalfAngle = joinNormal.x * nextNormal.x + joinNormal.y * nextNormal.y;\n\n            // Calculate the length of the miter (the ratio of the miter to the width)\n            // as the inverse of cosine of the angle between next and join normals\n            const miterLength = cosHalfAngle !== 0 ? 1 / cosHalfAngle : Infinity;\n\n            // approximate angle from cosine\n            const approxAngle = 2 * Math.sqrt(2 - 2 * cosHalfAngle);\n\n            const isSharpCorner = cosHalfAngle < COS_HALF_SHARP_CORNER && prevVertex && nextVertex;\n            const lineTurnsLeft = prevNormal.x * nextNormal.y - prevNormal.y * nextNormal.x > 0;\n\n            if (isSharpCorner && i > first) {\n                const prevSegmentLength = currentVertex.dist(prevVertex);\n                if (prevSegmentLength > 2 * sharpCornerOffset) {\n                    const newPrevVertex = currentVertex.sub(currentVertex.sub(prevVertex)._mult(sharpCornerOffset / prevSegmentLength)._round());\n                    this.updateDistance(prevVertex, newPrevVertex);\n                    this.addCurrentVertex(newPrevVertex, prevNormal, 0, 0, segment);\n                    prevVertex = newPrevVertex;\n                }\n            }\n\n            // The join if a middle vertex, otherwise the cap.\n            const middleVertex = prevVertex && nextVertex;\n            let currentJoin = middleVertex ? join : isPolygon ? 'butt' : cap;\n\n            if (middleVertex && currentJoin === 'round') {\n                if (miterLength < roundLimit) {\n                    currentJoin = 'miter';\n                } else if (miterLength <= 2) {\n                    currentJoin = 'fakeround';\n                }\n            }\n\n            if (currentJoin === 'miter' && miterLength > miterLimit) {\n                currentJoin = 'bevel';\n            }\n\n            if (currentJoin === 'bevel') {\n                // The maximum extrude length is 128 / 63 = 2 times the width of the line\n                // so if miterLength >= 2 we need to draw a different type of bevel here.\n                if (miterLength > 2) currentJoin = 'flipbevel';\n\n                // If the miterLength is really small and the line bevel wouldn't be visible,\n                // just draw a miter join to save a triangle.\n                if (miterLength < miterLimit) currentJoin = 'miter';\n            }\n\n            // Calculate how far along the line the currentVertex is\n            if (prevVertex) this.updateDistance(prevVertex, currentVertex);\n\n            if (currentJoin === 'miter') {\n\n                joinNormal._mult(miterLength);\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment);\n\n            } else if (currentJoin === 'flipbevel') {\n                // miter is too big, flip the direction to make a beveled join\n\n                if (miterLength > 100) {\n                    // Almost parallel lines\n                    joinNormal = nextNormal.mult(-1);\n\n                } else {\n                    const bevelLength = miterLength * prevNormal.add(nextNormal).mag() / prevNormal.sub(nextNormal).mag();\n                    joinNormal._perp()._mult(bevelLength * (lineTurnsLeft ? -1 : 1));\n                }\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment);\n                this.addCurrentVertex(currentVertex, joinNormal.mult(-1), 0, 0, segment);\n\n            } else if (currentJoin === 'bevel' || currentJoin === 'fakeround') {\n                const offset = -Math.sqrt(miterLength * miterLength - 1);\n                const offsetA = lineTurnsLeft ? offset : 0;\n                const offsetB = lineTurnsLeft ? 0 : offset;\n\n                // Close previous segment with a bevel\n                if (prevVertex) {\n                    this.addCurrentVertex(currentVertex, prevNormal, offsetA, offsetB, segment);\n                }\n\n                if (currentJoin === 'fakeround') {\n                    // The join angle is sharp enough that a round join would be visible.\n                    // Bevel joins fill the gap between segments with a single pie slice triangle.\n                    // Create a round join by adding multiple pie slices. The join isn't actually round, but\n                    // it looks like it is at the sizes we render lines at.\n\n                    // pick the number of triangles for approximating round join by based on the angle between normals\n                    const n = Math.round((approxAngle * 180 / Math.PI) / DEG_PER_TRIANGLE);\n\n                    for (let m = 1; m < n; m++) {\n                        let t = m / n;\n                        if (t !== 0.5) {\n                            // approximate spherical interpolation https://observablehq.com/@mourner/approximating-geometric-slerp\n                            const t2 = t - 0.5;\n                            const A = 1.0904 + cosAngle * (-3.2452 + cosAngle * (3.55645 - cosAngle * 1.43519));\n                            const B = 0.848013 + cosAngle * (-1.06021 + cosAngle * 0.215638);\n                            t = t + t * t2 * (t - 1) * (A * t2 * t2 + B);\n                        }\n                        const extrude = nextNormal.sub(prevNormal)._mult(t)._add(prevNormal)._unit()._mult(lineTurnsLeft ? -1 : 1);\n                        this.addHalfVertex(currentVertex, extrude.x, extrude.y, false, lineTurnsLeft, 0, segment);\n                    }\n                }\n\n                if (nextVertex) {\n                    // Start next segment\n                    this.addCurrentVertex(currentVertex, nextNormal, -offsetA, -offsetB, segment);\n                }\n\n            } else if (currentJoin === 'butt') {\n                this.addCurrentVertex(currentVertex, joinNormal, 0, 0, segment); // butt cap\n\n            } else if (currentJoin === 'square') {\n                const offset = prevVertex ? 1 : -1; // closing or starting square cap\n                this.addCurrentVertex(currentVertex, joinNormal, offset, offset, segment);\n\n            } else if (currentJoin === 'round') {\n\n                if (prevVertex) {\n                    // Close previous segment with butt\n                    this.addCurrentVertex(currentVertex, prevNormal, 0, 0, segment);\n\n                    // Add round cap or linejoin at end of segment\n                    this.addCurrentVertex(currentVertex, prevNormal, 1, 1, segment, true);\n                }\n                if (nextVertex) {\n                    // Add round cap before first segment\n                    this.addCurrentVertex(currentVertex, nextNormal, -1, -1, segment, true);\n\n                    // Start next segment with a butt\n                    this.addCurrentVertex(currentVertex, nextNormal, 0, 0, segment);\n                }\n            }\n\n            if (isSharpCorner && i < len - 1) {\n                const nextSegmentLength = currentVertex.dist(nextVertex);\n                if (nextSegmentLength > 2 * sharpCornerOffset) {\n                    const newCurrentVertex = currentVertex.add(nextVertex.sub(currentVertex)._mult(sharpCornerOffset / nextSegmentLength)._round());\n                    this.updateDistance(currentVertex, newCurrentVertex);\n                    this.addCurrentVertex(newCurrentVertex, nextNormal, 0, 0, segment);\n                    currentVertex = newCurrentVertex;\n                }\n            }\n        }\n    }\n\n    /**\n     * Add two vertices to the buffers.\n     *\n     * @param p - the line vertex to add buffer vertices for\n     * @param normal - vertex normal\n     * @param endLeft - extrude to shift the left vertex along the line\n     * @param endRight - extrude to shift the left vertex along the line\n     * @param segment - the segment object to add the vertex to\n     * @param round - whether this is a round cap\n     */\n    addCurrentVertex(p: Point, normal: Point, endLeft: number, endRight: number, segment: Segment, round: boolean = false) {\n        // left and right extrude vectors, perpendicularly shifted by endLeft/endRight\n        const leftX = normal.x + normal.y * endLeft;\n        const leftY = normal.y - normal.x * endLeft;\n        const rightX = -normal.x + normal.y * endRight;\n        const rightY = -normal.y - normal.x * endRight;\n\n        this.addHalfVertex(p, leftX, leftY, round, false, endLeft, segment);\n        this.addHalfVertex(p, rightX, rightY, round, true, -endRight, segment);\n\n        // There is a maximum \"distance along the line\" that we can store in the buffers.\n        // When we get close to the distance, reset it to zero and add the vertex again with\n        // a distance of zero. The max distance is determined by the number of bits we allocate\n        // to `linesofar`.\n        if (this.distance > MAX_LINE_DISTANCE / 2 && this.totalDistance === 0) {\n            this.distance = 0;\n            this.updateScaledDistance();\n            this.addCurrentVertex(p, normal, endLeft, endRight, segment, round);\n        }\n    }\n\n    addHalfVertex({x, y}: Point, extrudeX: number, extrudeY: number, round: boolean, up: boolean, dir: number, segment: Segment) {\n        const totalDistance = this.lineClips ? this.scaledDistance * (MAX_LINE_DISTANCE - 1) : this.scaledDistance;\n        // scale down so that we can store longer distances while sacrificing precision.\n        const linesofarScaled = totalDistance * LINE_DISTANCE_SCALE;\n\n        this.layoutVertexArray.emplaceBack(\n            // a_pos_normal\n            // Encode round/up the least significant bits\n            (x << 1) + (round ? 1 : 0),\n            (y << 1) + (up ? 1 : 0),\n            // a_data\n            // add 128 to store a byte in an unsigned byte\n            Math.round(EXTRUDE_SCALE * extrudeX) + 128,\n            Math.round(EXTRUDE_SCALE * extrudeY) + 128,\n            // Encode the -1/0/1 direction value into the first two bits of .z of a_data.\n            // Combine it with the lower 6 bits of `linesofarScaled` (shifted by 2 bits to make\n            // room for the direction value). The upper 8 bits of `linesofarScaled` are placed in\n            // the `w` component.\n            ((dir === 0 ? 0 : (dir < 0 ? -1 : 1)) + 1) | ((linesofarScaled & 0x3F) << 2),\n            linesofarScaled >> 6);\n\n        // Constructs a second vertex buffer with higher precision line progress\n        if (this.lineClips) {\n            const progressRealigned = this.scaledDistance - this.lineClips.start;\n            const endClipRealigned = this.lineClips.end - this.lineClips.start;\n            const uvX = progressRealigned / endClipRealigned;\n            this.layoutVertexArray2.emplaceBack(uvX, this.lineClipsArray.length);\n        }\n\n        const e = segment.vertexLength++;\n        if (this.e1 >= 0 && this.e2 >= 0) {\n            this.indexArray.emplaceBack(this.e1, this.e2, e);\n            segment.primitiveLength++;\n        }\n        if (up) {\n            this.e2 = e;\n        } else {\n            this.e1 = e;\n        }\n    }\n\n    updateScaledDistance() {\n        // Knowing the ratio of the full linestring covered by this tiled feature, as well\n        // as the total distance (in tile units) of this tiled feature, and the distance\n        // (in tile units) of the current vertex, we can determine the relative distance\n        // of this vertex along the full linestring feature and scale it to [0, 2^15)\n        this.scaledDistance = this.lineClips ?\n            this.lineClips.start + (this.lineClips.end - this.lineClips.start) * this.distance / this.totalDistance :\n            this.distance;\n    }\n\n    updateDistance(prev: Point, next: Point) {\n        this.distance += prev.dist(next);\n        this.updateScaledDistance();\n    }\n}\n\nregister('LineBucket', LineBucket, {omit: ['layers', 'patternFeatures']});\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LineLayoutProps = {\n    \"line-cap\": DataConstantProperty<\"butt\" | \"round\" | \"square\">,\n    \"line-join\": DataDrivenProperty<\"bevel\" | \"round\" | \"miter\">,\n    \"line-miter-limit\": DataConstantProperty<number>,\n    \"line-round-limit\": DataConstantProperty<number>,\n    \"line-sort-key\": DataDrivenProperty<number>,\n};\n\nexport type LineLayoutPropsPossiblyEvaluated = {\n    \"line-cap\": \"butt\" | \"round\" | \"square\",\n    \"line-join\": PossiblyEvaluatedPropertyValue<\"bevel\" | \"round\" | \"miter\">,\n    \"line-miter-limit\": number,\n    \"line-round-limit\": number,\n    \"line-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n};\n\nlet layout: Properties<LineLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"line-cap\": new DataConstantProperty(styleSpec[\"layout_line\"][\"line-cap\"] as any as StylePropertySpecification),\n    \"line-join\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-join\"] as any as StylePropertySpecification),\n    \"line-miter-limit\": new DataConstantProperty(styleSpec[\"layout_line\"][\"line-miter-limit\"] as any as StylePropertySpecification),\n    \"line-round-limit\": new DataConstantProperty(styleSpec[\"layout_line\"][\"line-round-limit\"] as any as StylePropertySpecification),\n    \"line-sort-key\": new DataDrivenProperty(styleSpec[\"layout_line\"][\"line-sort-key\"] as any as StylePropertySpecification),\n});\n\nexport type LinePaintProps = {\n    \"line-opacity\": DataDrivenProperty<number>,\n    \"line-color\": DataDrivenProperty<Color>,\n    \"line-translate\": DataConstantProperty<[number, number]>,\n    \"line-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"line-width\": DataDrivenProperty<number>,\n    \"line-gap-width\": DataDrivenProperty<number>,\n    \"line-offset\": DataDrivenProperty<number>,\n    \"line-blur\": DataDrivenProperty<number>,\n    \"line-dasharray\": CrossFadedProperty<Array<number>>,\n    \"line-pattern\": CrossFadedDataDrivenProperty<ResolvedImage>,\n    \"line-gradient\": ColorRampProperty,\n};\n\nexport type LinePaintPropsPossiblyEvaluated = {\n    \"line-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"line-translate\": [number, number],\n    \"line-translate-anchor\": \"map\" | \"viewport\",\n    \"line-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-gap-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-offset\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"line-dasharray\": CrossFaded<Array<number>>,\n    \"line-pattern\": PossiblyEvaluatedPropertyValue<CrossFaded<ResolvedImage>>,\n    \"line-gradient\": ColorRampProperty,\n};\n\nlet paint: Properties<LinePaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"line-opacity\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-opacity\"] as any as StylePropertySpecification),\n    \"line-color\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-color\"] as any as StylePropertySpecification),\n    \"line-translate\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-translate\"] as any as StylePropertySpecification),\n    \"line-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_line\"][\"line-translate-anchor\"] as any as StylePropertySpecification),\n    \"line-width\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-width\"] as any as StylePropertySpecification),\n    \"line-gap-width\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-gap-width\"] as any as StylePropertySpecification),\n    \"line-offset\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-offset\"] as any as StylePropertySpecification),\n    \"line-blur\": new DataDrivenProperty(styleSpec[\"paint_line\"][\"line-blur\"] as any as StylePropertySpecification),\n    \"line-dasharray\": new CrossFadedProperty(styleSpec[\"paint_line\"][\"line-dasharray\"] as any as StylePropertySpecification),\n    \"line-pattern\": new CrossFadedDataDrivenProperty(styleSpec[\"paint_line\"][\"line-pattern\"] as any as StylePropertySpecification),\n    \"line-gradient\": new ColorRampProperty(styleSpec[\"paint_line\"][\"line-gradient\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });", "import Point from '@mapbox/point-geometry';\n\nimport {StyleLayer} from '../style_layer';\nimport {LineBucket} from '../../data/bucket/line_bucket';\nimport {polygonIntersectsBufferedMultiLine} from '../../util/intersection_tests';\nimport {getMaximumPaintValue, translateDistance, translate, offsetLine} from '../query_utils';\nimport properties, {LineLayoutPropsPossiblyEvaluated, LinePaintPropsPossiblyEvaluated} from './line_style_layer_properties.g';\nimport {extend} from '../../util/util';\nimport {EvaluationParameters} from '../evaluation_parameters';\nimport {Transitionable, Transitioning, Layout, PossiblyEvaluated, DataDrivenProperty} from '../properties';\n\nimport {isZoomExpression, Step} from '@maplibre/maplibre-gl-style-spec';\nimport type {FeatureState, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Bucket, BucketParameters} from '../../data/bucket';\nimport type {LineLayoutProps, LinePaintProps} from './line_style_layer_properties.g';\nimport type {Transform} from '../../geo/transform';\nimport type {VectorTileFeature} from '@mapbox/vector-tile';\n\nexport class LineFloorwidthProperty extends DataDrivenProperty<number> {\n    useIntegerZoom: true;\n\n    possiblyEvaluate(value, parameters) {\n        parameters = new EvaluationParameters(Math.floor(parameters.zoom), {\n            now: parameters.now,\n            fadeDuration: parameters.fadeDuration,\n            zoomHistory: parameters.zoomHistory,\n            transition: parameters.transition\n        });\n        return super.possiblyEvaluate(value, parameters);\n    }\n\n    evaluate(value, globals, feature, featureState) {\n        globals = extend({}, globals, {zoom: Math.floor(globals.zoom)});\n        return super.evaluate(value, globals, feature, featureState);\n    }\n}\n\nlet lineFloorwidthProperty: LineFloorwidthProperty;\n\nexport class LineStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<LineLayoutProps>;\n    layout: PossiblyEvaluated<LineLayoutProps, LineLayoutPropsPossiblyEvaluated>;\n\n    gradientVersion: number;\n    stepInterpolant: boolean;\n\n    _transitionablePaint: Transitionable<LinePaintProps>;\n    _transitioningPaint: Transitioning<LinePaintProps>;\n    paint: PossiblyEvaluated<LinePaintProps, LinePaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n        this.gradientVersion = 0;\n        if (!lineFloorwidthProperty) {\n            lineFloorwidthProperty =\n                new LineFloorwidthProperty(properties.paint.properties['line-width'].specification);\n            lineFloorwidthProperty.useIntegerZoom = true;\n        }\n    }\n\n    _handleSpecialPaintPropertyUpdate(name: string) {\n        if (name === 'line-gradient') {\n            const expression = this.gradientExpression();\n            if (isZoomExpression(expression)) {\n                this.stepInterpolant = expression._styleExpression.expression instanceof Step;\n            } else {\n                this.stepInterpolant = false;\n            }\n            this.gradientVersion = (this.gradientVersion + 1) % Number.MAX_SAFE_INTEGER;\n        }\n    }\n\n    gradientExpression() {\n        return this._transitionablePaint._values['line-gradient'].value.expression;\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        super.recalculate(parameters, availableImages);\n        (this.paint._values as any)['line-floorwidth'] =\n            lineFloorwidthProperty.possiblyEvaluate(this._transitioningPaint._values['line-width'].value, parameters);\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new LineBucket(parameters);\n    }\n\n    queryRadius(bucket: Bucket): number {\n        const lineBucket: LineBucket = (bucket as any);\n        const width = getLineWidth(\n            getMaximumPaintValue('line-width', this, lineBucket),\n            getMaximumPaintValue('line-gap-width', this, lineBucket));\n        const offset = getMaximumPaintValue('line-offset', this, lineBucket);\n        return width / 2 + Math.abs(offset) + translateDistance(this.paint.get('line-translate'));\n    }\n\n    queryIntersectsFeature(\n        queryGeometry: Array<Point>,\n        feature: VectorTileFeature,\n        featureState: FeatureState,\n        geometry: Array<Array<Point>>,\n        zoom: number,\n        transform: Transform,\n        pixelsToTileUnits: number\n    ): boolean {\n        const translatedPolygon = translate(queryGeometry,\n            this.paint.get('line-translate'),\n            this.paint.get('line-translate-anchor'),\n            transform.angle, pixelsToTileUnits);\n        const halfWidth = pixelsToTileUnits / 2 * getLineWidth(\n            this.paint.get('line-width').evaluate(feature, featureState),\n            this.paint.get('line-gap-width').evaluate(feature, featureState));\n        const lineOffset = this.paint.get('line-offset').evaluate(feature, featureState);\n        if (lineOffset) {\n            geometry = offsetLine(geometry, lineOffset * pixelsToTileUnits);\n        }\n\n        return polygonIntersectsBufferedMultiLine(translatedPolygon, geometry, halfWidth);\n    }\n\n    isTileClipped() {\n        return true;\n    }\n}\n\nfunction getLineWidth(lineWidth, lineGapWidth) {\n    if (lineGapWidth > 0) {\n        return lineGapWidth + 2 * lineWidth;\n    } else {\n        return lineWidth;\n    }\n}\n", "import {createLayout} from '../../util/struct_array';\n\nexport const symbolLayoutAttributes = createLayout([\n    {name: 'a_pos_offset',  components: 4, type: 'Int16'},\n    {name: 'a_data',        components: 4, type: 'Uint16'},\n    {name: 'a_pixeloffset',        components: 4, type: 'Int16'}\n], 4);\n\nexport const dynamicLayoutAttributes = createLayout([\n    {name: 'a_projected_pos', components: 3, type: 'Float32'}\n], 4);\n\nexport const placementOpacityAttributes = createLayout([\n    {name: 'a_fade_opacity', components: 1, type: 'Uint32'}\n], 4);\n\nexport const collisionVertexAttributes = createLayout([\n    {name: 'a_placed', components: 2, type: 'Uint8'},\n    {name: 'a_shift', components: 2, type: 'Float32'},\n    {name: 'a_box_real', components: 2, type: 'Int16'},\n]);\n\nexport const collisionBox = createLayout([\n    // the box is centered around the anchor point\n    {type: 'Int16', name: 'anchorPointX'},\n    {type: 'Int16', name: 'anchorPointY'},\n\n    // distances to the edges from the anchor\n    {type: 'Int16', name: 'x1'},\n    {type: 'Int16', name: 'y1'},\n    {type: 'Int16', name: 'x2'},\n    {type: 'Int16', name: 'y2'},\n\n    // the index of the feature in the original vectortile\n    {type: 'Uint32', name: 'featureIndex'},\n    // the source layer the feature appears in\n    {type: 'Uint16', name: 'sourceLayerIndex'},\n    // the bucket the feature appears in\n    {type: 'Uint16', name: 'bucketIndex'},\n]);\n\nexport const collisionBoxLayout = createLayout([ // used to render collision boxes for debugging purposes\n    {name: 'a_pos',        components: 2, type: 'Int16'},\n    {name: 'a_anchor_pos', components: 2, type: 'Int16'},\n    {name: 'a_extrude',    components: 2, type: 'Int16'}\n], 4);\n\nexport const collisionCircleLayout = createLayout([ // used to render collision circles for debugging purposes\n    {name: 'a_pos',        components: 2, type: 'Float32'},\n    {name: 'a_radius',     components: 1, type: 'Float32'},\n    {name: 'a_flags',      components: 2, type: 'Int16'}\n], 4);\n\nexport const quadTriangle = createLayout([\n    {name: 'triangle', components: 3, type: 'Uint16'},\n]);\n\nexport const placement = createLayout([\n    {type: 'Int16', name: 'anchorX'},\n    {type: 'Int16', name: 'anchorY'},\n    {type: 'Uint16', name: 'glyphStartIndex'},\n    {type: 'Uint16', name: 'numGlyphs'},\n    {type: 'Uint32', name: 'vertexStartIndex'},\n    {type: 'Uint32', name: 'lineStartIndex'},\n    {type: 'Uint32', name: 'lineLength'},\n    {type: 'Uint16', name: 'segment'},\n    {type: 'Uint16', name: 'lowerSize'},\n    {type: 'Uint16', name: 'upperSize'},\n    {type: 'Float32', name: 'lineOffsetX'},\n    {type: 'Float32', name: 'lineOffsetY'},\n    {type: 'Uint8', name: 'writingMode'},\n    {type: 'Uint8', name: 'placedOrientation'},\n    {type: 'Uint8', name: 'hidden'},\n    {type: 'Uint32', name: 'crossTileID'},\n    {type: 'Int16', name: 'associatedIconIndex'}\n]);\n\nexport const symbolInstance = createLayout([\n    {type: 'Int16', name: 'anchorX'},\n    {type: 'Int16', name: 'anchorY'},\n    {type: 'Int16', name: 'rightJustifiedTextSymbolIndex'},\n    {type: 'Int16', name: 'centerJustifiedTextSymbolIndex'},\n    {type: 'Int16', name: 'leftJustifiedTextSymbolIndex'},\n    {type: 'Int16', name: 'verticalPlacedTextSymbolIndex'},\n    {type: 'Int16', name: 'placedIconSymbolIndex'},\n    {type: 'Int16', name: 'verticalPlacedIconSymbolIndex'},\n    {type: 'Uint16', name: 'key'},\n    {type: 'Uint16', name: 'textBoxStartIndex'},\n    {type: 'Uint16', name: 'textBoxEndIndex'},\n    {type: 'Uint16', name: 'verticalTextBoxStartIndex'},\n    {type: 'Uint16', name: 'verticalTextBoxEndIndex'},\n    {type: 'Uint16', name: 'iconBoxStartIndex'},\n    {type: 'Uint16', name: 'iconBoxEndIndex'},\n    {type: 'Uint16', name: 'verticalIconBoxStartIndex'},\n    {type: 'Uint16', name: 'verticalIconBoxEndIndex'},\n    {type: 'Uint16', name: 'featureIndex'},\n    {type: 'Uint16', name: 'numHorizontalGlyphVertices'},\n    {type: 'Uint16', name: 'numVerticalGlyphVertices'},\n    {type: 'Uint16', name: 'numIconVertices'},\n    {type: 'Uint16', name: 'numVerticalIconVertices'},\n    {type: 'Uint16', name: 'useRuntimeCollisionCircles'},\n    {type: 'Uint32', name: 'crossTileID'},\n    {type: 'Float32', name: 'textBoxScale'},\n    {type: 'Float32', name: 'collisionCircleDiameter'},\n    {type: 'Uint16', name: 'textAnchorOffsetStartIndex'},\n    {type: 'Uint16', name: 'textAnchorOffsetEndIndex'}\n]);\n\nexport const glyphOffset = createLayout([\n    {type: 'Float32', name: 'offsetX'}\n]);\n\nexport const lineVertex = createLayout([\n    {type: 'Int16', name: 'x'},\n    {type: 'Int16', name: 'y'},\n    {type: 'Int16', name: 'tileUnitDistanceFromAnchor'}\n]);\n\nexport const textAnchorOffset = createLayout([\n    {type: 'Uint16', name: 'textAnchor'},\n    {type: 'Float32', components: 2, name: 'textOffset'}\n]);\n", "import {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\n\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport {Formatted} from '@maplibre/maplibre-gl-style-spec';\n\nfunction transformTextInternal(text: string, layer: SymbolStyleLayer, feature: Feature) {\n    const transform = layer.layout.get('text-transform').evaluate(feature, {});\n    if (transform === 'uppercase') {\n        text = text.toLocaleUpperCase();\n    } else if (transform === 'lowercase') {\n        text = text.toLocaleLowerCase();\n    }\n\n    if (rtlWorkerPlugin.applyArabicShaping) {\n        text = rtlWorkerPlugin.applyArabicShaping(text);\n    }\n\n    return text;\n}\n\nexport function transformText(text: Formatted, layer: SymbolStyleLayer, feature: Feature): Formatted {\n    text.sections.forEach(section => {\n        section.text = transformTextInternal(section.text, layer, feature);\n    });\n    return text;\n}\n", "import {charHasRotatedVerticalOrientation} from './script_detection';\n\nexport const verticalizedCharacterMap = {\n    '!': 'ï¸',\n    '#': 'ï¼',\n    '$': 'ï¼',\n    '%': 'ï¼',\n    '&': 'ï¼',\n    '(': 'ï¸µ',\n    ')': 'ï¸¶',\n    '*': 'ï¼',\n    '+': 'ï¼',\n    ',': 'ï¸',\n    '-': 'ï¸²',\n    '.': 'ã»',\n    '/': 'ï¼',\n    ':': 'ï¸',\n    ';': 'ï¸',\n    '<': 'ï¸¿',\n    '=': 'ï¼',\n    '>': 'ï¹',\n    '?': 'ï¸',\n    '@': 'ï¼ ',\n    '[': 'ï¹',\n    '\\\\': 'ï¼¼',\n    ']': 'ï¹',\n    '^': 'ï¼¾',\n    '_': 'ï¸³',\n    '`': 'ï½',\n    '{': 'ï¸·',\n    '|': 'â',\n    '}': 'ï¸¸',\n    '~': 'ï½',\n    'Â¢': 'ï¿ ',\n    'Â£': 'ï¿¡',\n    'Â¥': 'ï¿¥',\n    'Â¦': 'ï¿¤',\n    'Â¬': 'ï¿¢',\n    'Â¯': 'ï¿£',\n    'â': 'ï¸²',\n    'â': 'ï¸±',\n    'â': 'ï¹',\n    'â': 'ï¹',\n    'â': 'ï¹',\n    'â': 'ï¹',\n    'â¦': 'ï¸',\n    'â§': 'ã»',\n    'â©': 'ï¿¦',\n    'ã': 'ï¸',\n    'ã': 'ï¸',\n    'ã': 'ï¸¿',\n    'ã': 'ï¹',\n    'ã': 'ï¸½',\n    'ã': 'ï¸¾',\n    'ã': 'ï¹',\n    'ã': 'ï¹',\n    'ã': 'ï¹',\n    'ã': 'ï¹',\n    'ã': 'ï¸»',\n    'ã': 'ï¸¼',\n    'ã': 'ï¸¹',\n    'ã': 'ï¸º',\n    'ã': 'ï¸',\n    'ã': 'ï¸',\n    'ï¼': 'ï¸',\n    'ï¼': 'ï¸µ',\n    'ï¼': 'ï¸¶',\n    'ï¼': 'ï¸',\n    'ï¼': 'ï¸²',\n    'ï¼': 'ã»',\n    'ï¼': 'ï¸',\n    'ï¼': 'ï¸',\n    'ï¼': 'ï¸¿',\n    'ï¼': 'ï¹',\n    'ï¼': 'ï¸',\n    'ï¼»': 'ï¹',\n    'ï¼½': 'ï¹',\n    'ï¼¿': 'ï¸³',\n    'ï½': 'ï¸·',\n    'ï½': 'â',\n    'ï½': 'ï¸¸',\n    'ï½': 'ï¸µ',\n    'ï½ ': 'ï¸¶',\n    'ï½¡': 'ï¸',\n    'ï½¢': 'ï¹',\n    'ï½£': 'ï¹'\n};\n\nexport function verticalizePunctuation(input: string) {\n    let output = '';\n\n    for (let i = 0; i < input.length; i++) {\n        const nextCharCode = input.charCodeAt(i + 1) || null;\n        const prevCharCode = input.charCodeAt(i - 1) || null;\n\n        const canReplacePunctuation = (\n            (!nextCharCode || !charHasRotatedVerticalOrientation(nextCharCode) || verticalizedCharacterMap[input[i + 1]]) &&\n            (!prevCharCode || !charHasRotatedVerticalOrientation(prevCharCode) || verticalizedCharacterMap[input[i - 1]])\n        );\n\n        if (canReplacePunctuation && verticalizedCharacterMap[input[i]]) {\n            output += verticalizedCharacterMap[input[i]];\n        } else {\n            output += input[i];\n        }\n    }\n\n    return output;\n}\n\n", "// ONE_EM constant used to go between \"em\" units used in style spec and \"points\" used internally for layout\n\nexport default 24;\n", "'use strict';\n\nmodule.exports = Pbf;\n\nvar ieee754 = require('ieee754');\n\nfunction Pbf(buf) {\n    this.buf = ArrayBuffer.isView && ArrayBuffer.isView(buf) ? buf : new Uint8Array(buf || 0);\n    this.pos = 0;\n    this.type = 0;\n    this.length = this.buf.length;\n}\n\nPbf.Varint  = 0; // varint: int32, int64, uint32, uint64, sint32, sint64, bool, enum\nPbf.Fixed64 = 1; // 64-bit: double, fixed64, sfixed64\nPbf.Bytes   = 2; // length-delimited: string, bytes, embedded messages, packed repeated fields\nPbf.Fixed32 = 5; // 32-bit: float, fixed32, sfixed32\n\nvar SHIFT_LEFT_32 = (1 << 16) * (1 << 16),\n    SHIFT_RIGHT_32 = 1 / SHIFT_LEFT_32;\n\n// Threshold chosen based on both benchmarking and knowledge about browser string\n// data structures (which currently switch structure types at 12 bytes or more)\nvar TEXT_DECODER_MIN_LENGTH = 12;\nvar utf8TextDecoder = typeof TextDecoder === 'undefined' ? null : new TextDecoder('utf-8');\n\nPbf.prototype = {\n\n    destroy: function() {\n        this.buf = null;\n    },\n\n    // === READING =================================================================\n\n    readFields: function(readField, result, end) {\n        end = end || this.length;\n\n        while (this.pos < end) {\n            var val = this.readVarint(),\n                tag = val >> 3,\n                startPos = this.pos;\n\n            this.type = val & 0x7;\n            readField(tag, result, this);\n\n            if (this.pos === startPos) this.skip(val);\n        }\n        return result;\n    },\n\n    readMessage: function(readField, result) {\n        return this.readFields(readField, result, this.readVarint() + this.pos);\n    },\n\n    readFixed32: function() {\n        var val = readUInt32(this.buf, this.pos);\n        this.pos += 4;\n        return val;\n    },\n\n    readSFixed32: function() {\n        var val = readInt32(this.buf, this.pos);\n        this.pos += 4;\n        return val;\n    },\n\n    // 64-bit int handling is based on github.com/dpw/node-buffer-more-ints (MIT-licensed)\n\n    readFixed64: function() {\n        var val = readUInt32(this.buf, this.pos) + readUInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    },\n\n    readSFixed64: function() {\n        var val = readUInt32(this.buf, this.pos) + readInt32(this.buf, this.pos + 4) * SHIFT_LEFT_32;\n        this.pos += 8;\n        return val;\n    },\n\n    readFloat: function() {\n        var val = ieee754.read(this.buf, this.pos, true, 23, 4);\n        this.pos += 4;\n        return val;\n    },\n\n    readDouble: function() {\n        var val = ieee754.read(this.buf, this.pos, true, 52, 8);\n        this.pos += 8;\n        return val;\n    },\n\n    readVarint: function(isSigned) {\n        var buf = this.buf,\n            val, b;\n\n        b = buf[this.pos++]; val  =  b & 0x7f;        if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 7;  if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 14; if (b < 0x80) return val;\n        b = buf[this.pos++]; val |= (b & 0x7f) << 21; if (b < 0x80) return val;\n        b = buf[this.pos];   val |= (b & 0x0f) << 28;\n\n        return readVarintRemainder(val, isSigned, this);\n    },\n\n    readVarint64: function() { // for compatibility with v2.0.1\n        return this.readVarint(true);\n    },\n\n    readSVarint: function() {\n        var num = this.readVarint();\n        return num % 2 === 1 ? (num + 1) / -2 : num / 2; // zigzag encoding\n    },\n\n    readBoolean: function() {\n        return Boolean(this.readVarint());\n    },\n\n    readString: function() {\n        var end = this.readVarint() + this.pos;\n        var pos = this.pos;\n        this.pos = end;\n\n        if (end - pos >= TEXT_DECODER_MIN_LENGTH && utf8TextDecoder) {\n            // longer strings are fast with the built-in browser TextDecoder API\n            return readUtf8TextDecoder(this.buf, pos, end);\n        }\n        // short strings are fast with our custom implementation\n        return readUtf8(this.buf, pos, end);\n    },\n\n    readBytes: function() {\n        var end = this.readVarint() + this.pos,\n            buffer = this.buf.subarray(this.pos, end);\n        this.pos = end;\n        return buffer;\n    },\n\n    // verbose for performance reasons; doesn't affect gzipped size\n\n    readPackedVarint: function(arr, isSigned) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readVarint(isSigned));\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readVarint(isSigned));\n        return arr;\n    },\n    readPackedSVarint: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readSVarint());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readSVarint());\n        return arr;\n    },\n    readPackedBoolean: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readBoolean());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readBoolean());\n        return arr;\n    },\n    readPackedFloat: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readFloat());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readFloat());\n        return arr;\n    },\n    readPackedDouble: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readDouble());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readDouble());\n        return arr;\n    },\n    readPackedFixed32: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readFixed32());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readFixed32());\n        return arr;\n    },\n    readPackedSFixed32: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed32());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readSFixed32());\n        return arr;\n    },\n    readPackedFixed64: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readFixed64());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readFixed64());\n        return arr;\n    },\n    readPackedSFixed64: function(arr) {\n        if (this.type !== Pbf.Bytes) return arr.push(this.readSFixed64());\n        var end = readPackedEnd(this);\n        arr = arr || [];\n        while (this.pos < end) arr.push(this.readSFixed64());\n        return arr;\n    },\n\n    skip: function(val) {\n        var type = val & 0x7;\n        if (type === Pbf.Varint) while (this.buf[this.pos++] > 0x7f) {}\n        else if (type === Pbf.Bytes) this.pos = this.readVarint() + this.pos;\n        else if (type === Pbf.Fixed32) this.pos += 4;\n        else if (type === Pbf.Fixed64) this.pos += 8;\n        else throw new Error('Unimplemented type: ' + type);\n    },\n\n    // === WRITING =================================================================\n\n    writeTag: function(tag, type) {\n        this.writeVarint((tag << 3) | type);\n    },\n\n    realloc: function(min) {\n        var length = this.length || 16;\n\n        while (length < this.pos + min) length *= 2;\n\n        if (length !== this.length) {\n            var buf = new Uint8Array(length);\n            buf.set(this.buf);\n            this.buf = buf;\n            this.length = length;\n        }\n    },\n\n    finish: function() {\n        this.length = this.pos;\n        this.pos = 0;\n        return this.buf.subarray(0, this.length);\n    },\n\n    writeFixed32: function(val) {\n        this.realloc(4);\n        writeInt32(this.buf, val, this.pos);\n        this.pos += 4;\n    },\n\n    writeSFixed32: function(val) {\n        this.realloc(4);\n        writeInt32(this.buf, val, this.pos);\n        this.pos += 4;\n    },\n\n    writeFixed64: function(val) {\n        this.realloc(8);\n        writeInt32(this.buf, val & -1, this.pos);\n        writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);\n        this.pos += 8;\n    },\n\n    writeSFixed64: function(val) {\n        this.realloc(8);\n        writeInt32(this.buf, val & -1, this.pos);\n        writeInt32(this.buf, Math.floor(val * SHIFT_RIGHT_32), this.pos + 4);\n        this.pos += 8;\n    },\n\n    writeVarint: function(val) {\n        val = +val || 0;\n\n        if (val > 0xfffffff || val < 0) {\n            writeBigVarint(val, this);\n            return;\n        }\n\n        this.realloc(4);\n\n        this.buf[this.pos++] =           val & 0x7f  | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] = ((val >>>= 7) & 0x7f) | (val > 0x7f ? 0x80 : 0); if (val <= 0x7f) return;\n        this.buf[this.pos++] =   (val >>> 7) & 0x7f;\n    },\n\n    writeSVarint: function(val) {\n        this.writeVarint(val < 0 ? -val * 2 - 1 : val * 2);\n    },\n\n    writeBoolean: function(val) {\n        this.writeVarint(Boolean(val));\n    },\n\n    writeString: function(str) {\n        str = String(str);\n        this.realloc(str.length * 4);\n\n        this.pos++; // reserve 1 byte for short string length\n\n        var startPos = this.pos;\n        // write the string directly to the buffer and see how much was written\n        this.pos = writeUtf8(this.buf, str, this.pos);\n        var len = this.pos - startPos;\n\n        if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n        // finally, write the message length in the reserved place and restore the position\n        this.pos = startPos - 1;\n        this.writeVarint(len);\n        this.pos += len;\n    },\n\n    writeFloat: function(val) {\n        this.realloc(4);\n        ieee754.write(this.buf, val, this.pos, true, 23, 4);\n        this.pos += 4;\n    },\n\n    writeDouble: function(val) {\n        this.realloc(8);\n        ieee754.write(this.buf, val, this.pos, true, 52, 8);\n        this.pos += 8;\n    },\n\n    writeBytes: function(buffer) {\n        var len = buffer.length;\n        this.writeVarint(len);\n        this.realloc(len);\n        for (var i = 0; i < len; i++) this.buf[this.pos++] = buffer[i];\n    },\n\n    writeRawMessage: function(fn, obj) {\n        this.pos++; // reserve 1 byte for short message length\n\n        // write the message directly to the buffer and see how much was written\n        var startPos = this.pos;\n        fn(obj, this);\n        var len = this.pos - startPos;\n\n        if (len >= 0x80) makeRoomForExtraLength(startPos, len, this);\n\n        // finally, write the message length in the reserved place and restore the position\n        this.pos = startPos - 1;\n        this.writeVarint(len);\n        this.pos += len;\n    },\n\n    writeMessage: function(tag, fn, obj) {\n        this.writeTag(tag, Pbf.Bytes);\n        this.writeRawMessage(fn, obj);\n    },\n\n    writePackedVarint:   function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedVarint, arr);   },\n    writePackedSVarint:  function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSVarint, arr);  },\n    writePackedBoolean:  function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedBoolean, arr);  },\n    writePackedFloat:    function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFloat, arr);    },\n    writePackedDouble:   function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedDouble, arr);   },\n    writePackedFixed32:  function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed32, arr);  },\n    writePackedSFixed32: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed32, arr); },\n    writePackedFixed64:  function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedFixed64, arr);  },\n    writePackedSFixed64: function(tag, arr) { if (arr.length) this.writeMessage(tag, writePackedSFixed64, arr); },\n\n    writeBytesField: function(tag, buffer) {\n        this.writeTag(tag, Pbf.Bytes);\n        this.writeBytes(buffer);\n    },\n    writeFixed32Field: function(tag, val) {\n        this.writeTag(tag, Pbf.Fixed32);\n        this.writeFixed32(val);\n    },\n    writeSFixed32Field: function(tag, val) {\n        this.writeTag(tag, Pbf.Fixed32);\n        this.writeSFixed32(val);\n    },\n    writeFixed64Field: function(tag, val) {\n        this.writeTag(tag, Pbf.Fixed64);\n        this.writeFixed64(val);\n    },\n    writeSFixed64Field: function(tag, val) {\n        this.writeTag(tag, Pbf.Fixed64);\n        this.writeSFixed64(val);\n    },\n    writeVarintField: function(tag, val) {\n        this.writeTag(tag, Pbf.Varint);\n        this.writeVarint(val);\n    },\n    writeSVarintField: function(tag, val) {\n        this.writeTag(tag, Pbf.Varint);\n        this.writeSVarint(val);\n    },\n    writeStringField: function(tag, str) {\n        this.writeTag(tag, Pbf.Bytes);\n        this.writeString(str);\n    },\n    writeFloatField: function(tag, val) {\n        this.writeTag(tag, Pbf.Fixed32);\n        this.writeFloat(val);\n    },\n    writeDoubleField: function(tag, val) {\n        this.writeTag(tag, Pbf.Fixed64);\n        this.writeDouble(val);\n    },\n    writeBooleanField: function(tag, val) {\n        this.writeVarintField(tag, Boolean(val));\n    }\n};\n\nfunction readVarintRemainder(l, s, p) {\n    var buf = p.buf,\n        h, b;\n\n    b = buf[p.pos++]; h  = (b & 0x70) >> 4;  if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 3;  if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 10; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 17; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x7f) << 24; if (b < 0x80) return toNum(l, h, s);\n    b = buf[p.pos++]; h |= (b & 0x01) << 31; if (b < 0x80) return toNum(l, h, s);\n\n    throw new Error('Expected varint not more than 10 bytes');\n}\n\nfunction readPackedEnd(pbf) {\n    return pbf.type === Pbf.Bytes ?\n        pbf.readVarint() + pbf.pos : pbf.pos + 1;\n}\n\nfunction toNum(low, high, isSigned) {\n    if (isSigned) {\n        return high * 0x100000000 + (low >>> 0);\n    }\n\n    return ((high >>> 0) * 0x100000000) + (low >>> 0);\n}\n\nfunction writeBigVarint(val, pbf) {\n    var low, high;\n\n    if (val >= 0) {\n        low  = (val % 0x100000000) | 0;\n        high = (val / 0x100000000) | 0;\n    } else {\n        low  = ~(-val % 0x100000000);\n        high = ~(-val / 0x100000000);\n\n        if (low ^ 0xffffffff) {\n            low = (low + 1) | 0;\n        } else {\n            low = 0;\n            high = (high + 1) | 0;\n        }\n    }\n\n    if (val >= 0x10000000000000000 || val < -0x10000000000000000) {\n        throw new Error('Given varint doesn\\'t fit into 10 bytes');\n    }\n\n    pbf.realloc(10);\n\n    writeBigVarintLow(low, high, pbf);\n    writeBigVarintHigh(high, pbf);\n}\n\nfunction writeBigVarintLow(low, high, pbf) {\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos++] = low & 0x7f | 0x80; low >>>= 7;\n    pbf.buf[pbf.pos]   = low & 0x7f;\n}\n\nfunction writeBigVarintHigh(high, pbf) {\n    var lsb = (high & 0x07) << 4;\n\n    pbf.buf[pbf.pos++] |= lsb         | ((high >>>= 3) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f | ((high >>>= 7) ? 0x80 : 0); if (!high) return;\n    pbf.buf[pbf.pos++]  = high & 0x7f;\n}\n\nfunction makeRoomForExtraLength(startPos, len, pbf) {\n    var extraLen =\n        len <= 0x3fff ? 1 :\n        len <= 0x1fffff ? 2 :\n        len <= 0xfffffff ? 3 : Math.floor(Math.log(len) / (Math.LN2 * 7));\n\n    // if 1 byte isn't enough for encoding message length, shift the data to the right\n    pbf.realloc(extraLen);\n    for (var i = pbf.pos - 1; i >= startPos; i--) pbf.buf[i + extraLen] = pbf.buf[i];\n}\n\nfunction writePackedVarint(arr, pbf)   { for (var i = 0; i < arr.length; i++) pbf.writeVarint(arr[i]);   }\nfunction writePackedSVarint(arr, pbf)  { for (var i = 0; i < arr.length; i++) pbf.writeSVarint(arr[i]);  }\nfunction writePackedFloat(arr, pbf)    { for (var i = 0; i < arr.length; i++) pbf.writeFloat(arr[i]);    }\nfunction writePackedDouble(arr, pbf)   { for (var i = 0; i < arr.length; i++) pbf.writeDouble(arr[i]);   }\nfunction writePackedBoolean(arr, pbf)  { for (var i = 0; i < arr.length; i++) pbf.writeBoolean(arr[i]);  }\nfunction writePackedFixed32(arr, pbf)  { for (var i = 0; i < arr.length; i++) pbf.writeFixed32(arr[i]);  }\nfunction writePackedSFixed32(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed32(arr[i]); }\nfunction writePackedFixed64(arr, pbf)  { for (var i = 0; i < arr.length; i++) pbf.writeFixed64(arr[i]);  }\nfunction writePackedSFixed64(arr, pbf) { for (var i = 0; i < arr.length; i++) pbf.writeSFixed64(arr[i]); }\n\n// Buffer code below from https://github.com/feross/buffer, MIT-licensed\n\nfunction readUInt32(buf, pos) {\n    return ((buf[pos]) |\n        (buf[pos + 1] << 8) |\n        (buf[pos + 2] << 16)) +\n        (buf[pos + 3] * 0x1000000);\n}\n\nfunction writeInt32(buf, val, pos) {\n    buf[pos] = val;\n    buf[pos + 1] = (val >>> 8);\n    buf[pos + 2] = (val >>> 16);\n    buf[pos + 3] = (val >>> 24);\n}\n\nfunction readInt32(buf, pos) {\n    return ((buf[pos]) |\n        (buf[pos + 1] << 8) |\n        (buf[pos + 2] << 16)) +\n        (buf[pos + 3] << 24);\n}\n\nfunction readUtf8(buf, pos, end) {\n    var str = '';\n    var i = pos;\n\n    while (i < end) {\n        var b0 = buf[i];\n        var c = null; // codepoint\n        var bytesPerSequence =\n            b0 > 0xEF ? 4 :\n            b0 > 0xDF ? 3 :\n            b0 > 0xBF ? 2 : 1;\n\n        if (i + bytesPerSequence > end) break;\n\n        var b1, b2, b3;\n\n        if (bytesPerSequence === 1) {\n            if (b0 < 0x80) {\n                c = b0;\n            }\n        } else if (bytesPerSequence === 2) {\n            b1 = buf[i + 1];\n            if ((b1 & 0xC0) === 0x80) {\n                c = (b0 & 0x1F) << 0x6 | (b1 & 0x3F);\n                if (c <= 0x7F) {\n                    c = null;\n                }\n            }\n        } else if (bytesPerSequence === 3) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80) {\n                c = (b0 & 0xF) << 0xC | (b1 & 0x3F) << 0x6 | (b2 & 0x3F);\n                if (c <= 0x7FF || (c >= 0xD800 && c <= 0xDFFF)) {\n                    c = null;\n                }\n            }\n        } else if (bytesPerSequence === 4) {\n            b1 = buf[i + 1];\n            b2 = buf[i + 2];\n            b3 = buf[i + 3];\n            if ((b1 & 0xC0) === 0x80 && (b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) {\n                c = (b0 & 0xF) << 0x12 | (b1 & 0x3F) << 0xC | (b2 & 0x3F) << 0x6 | (b3 & 0x3F);\n                if (c <= 0xFFFF || c >= 0x110000) {\n                    c = null;\n                }\n            }\n        }\n\n        if (c === null) {\n            c = 0xFFFD;\n            bytesPerSequence = 1;\n\n        } else if (c > 0xFFFF) {\n            c -= 0x10000;\n            str += String.fromCharCode(c >>> 10 & 0x3FF | 0xD800);\n            c = 0xDC00 | c & 0x3FF;\n        }\n\n        str += String.fromCharCode(c);\n        i += bytesPerSequence;\n    }\n\n    return str;\n}\n\nfunction readUtf8TextDecoder(buf, pos, end) {\n    return utf8TextDecoder.decode(buf.subarray(pos, end));\n}\n\nfunction writeUtf8(buf, str, pos) {\n    for (var i = 0, c, lead; i < str.length; i++) {\n        c = str.charCodeAt(i); // code point\n\n        if (c > 0xD7FF && c < 0xE000) {\n            if (lead) {\n                if (c < 0xDC00) {\n                    buf[pos++] = 0xEF;\n                    buf[pos++] = 0xBF;\n                    buf[pos++] = 0xBD;\n                    lead = c;\n                    continue;\n                } else {\n                    c = lead - 0xD800 << 10 | c - 0xDC00 | 0x10000;\n                    lead = null;\n                }\n            } else {\n                if (c > 0xDBFF || (i + 1 === str.length)) {\n                    buf[pos++] = 0xEF;\n                    buf[pos++] = 0xBF;\n                    buf[pos++] = 0xBD;\n                } else {\n                    lead = c;\n                }\n                continue;\n            }\n        } else if (lead) {\n            buf[pos++] = 0xEF;\n            buf[pos++] = 0xBF;\n            buf[pos++] = 0xBD;\n            lead = null;\n        }\n\n        if (c < 0x80) {\n            buf[pos++] = c;\n        } else {\n            if (c < 0x800) {\n                buf[pos++] = c >> 0x6 | 0xC0;\n            } else {\n                if (c < 0x10000) {\n                    buf[pos++] = c >> 0xC | 0xE0;\n                } else {\n                    buf[pos++] = c >> 0x12 | 0xF0;\n                    buf[pos++] = c >> 0xC & 0x3F | 0x80;\n                }\n                buf[pos++] = c >> 0x6 & 0x3F | 0x80;\n            }\n            buf[pos++] = c & 0x3F | 0x80;\n        }\n    }\n    return pos;\n}\n", "/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n  var e, m\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var nBits = -7\n  var i = isLE ? (nBytes - 1) : 0\n  var d = isLE ? -1 : 1\n  var s = buffer[offset + i]\n\n  i += d\n\n  e = s & ((1 << (-nBits)) - 1)\n  s >>= (-nBits)\n  nBits += eLen\n  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  m = e & ((1 << (-nBits)) - 1)\n  e >>= (-nBits)\n  nBits += mLen\n  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n  if (e === 0) {\n    e = 1 - eBias\n  } else if (e === eMax) {\n    return m ? NaN : ((s ? -1 : 1) * Infinity)\n  } else {\n    m = m + Math.pow(2, mLen)\n    e = e - eBias\n  }\n  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n  var e, m, c\n  var eLen = (nBytes * 8) - mLen - 1\n  var eMax = (1 << eLen) - 1\n  var eBias = eMax >> 1\n  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n  var i = isLE ? 0 : (nBytes - 1)\n  var d = isLE ? 1 : -1\n  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n  value = Math.abs(value)\n\n  if (isNaN(value) || value === Infinity) {\n    m = isNaN(value) ? 1 : 0\n    e = eMax\n  } else {\n    e = Math.floor(Math.log(value) / Math.LN2)\n    if (value * (c = Math.pow(2, -e)) < 1) {\n      e--\n      c *= 2\n    }\n    if (e + eBias >= 1) {\n      value += rt / c\n    } else {\n      value += rt * Math.pow(2, 1 - eBias)\n    }\n    if (value * c >= 2) {\n      e++\n      c /= 2\n    }\n\n    if (e + eBias >= eMax) {\n      m = 0\n      e = eMax\n    } else if (e + eBias >= 1) {\n      m = ((value * c) - 1) * Math.pow(2, mLen)\n      e = e + eBias\n    } else {\n      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n      e = 0\n    }\n  }\n\n  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n  e = (e << mLen) | m\n  eLen += mLen\n  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n  buffer[offset + i - d] |= s * 128\n}\n", "import {AlphaImage} from '../util/image';\n\nimport Protobuf from 'pbf';\nconst border = 3;\n\nimport type {StyleGlyph} from './style_glyph';\n\nfunction readFontstacks(tag: number, glyphs: Array<StyleGlyph>, pbf: Protobuf) {\n    if (tag === 1) {\n        pbf.readMessage(readFontstack, glyphs);\n    }\n}\n\nfunction readFontstack(tag: number, glyphs: Array<StyleGlyph>, pbf: Protobuf) {\n    if (tag === 3) {\n        const {id, bitmap, width, height, left, top, advance} = pbf.readMessage(readGlyph, {});\n        glyphs.push({\n            id,\n            bitmap: new AlphaImage({\n                width: width + 2 * border,\n                height: height + 2 * border\n            }, bitmap),\n            metrics: {width, height, left, top, advance}\n        });\n    }\n}\n\nfunction readGlyph(tag: number, glyph: any, pbf: Protobuf) {\n    if (tag === 1) glyph.id = pbf.readVarint();\n    else if (tag === 2) glyph.bitmap = pbf.readBytes();\n    else if (tag === 3) glyph.width = pbf.readVarint();\n    else if (tag === 4) glyph.height = pbf.readVarint();\n    else if (tag === 5) glyph.left = pbf.readSVarint();\n    else if (tag === 6) glyph.top = pbf.readSVarint();\n    else if (tag === 7) glyph.advance = pbf.readVarint();\n}\n\nexport function parseGlyphPbf(data: ArrayBuffer | Uint8Array): Array<StyleGlyph> {\n    return new Protobuf(data).readFields(readFontstacks, []);\n}\n\nexport const GLYPH_PBF_BORDER = border;\n", "\nexport default function potpack(boxes) {\n\n    // calculate total box area and maximum box width\n    let area = 0;\n    let maxWidth = 0;\n\n    for (const box of boxes) {\n        area += box.w * box.h;\n        maxWidth = Math.max(maxWidth, box.w);\n    }\n\n    // sort the boxes for insertion by height, descending\n    boxes.sort((a, b) => b.h - a.h);\n\n    // aim for a squarish resulting container,\n    // slightly adjusted for sub-100% space utilization\n    const startWidth = Math.max(Math.ceil(Math.sqrt(area / 0.95)), maxWidth);\n\n    // start with a single empty space, unbounded at the bottom\n    const spaces = [{x: 0, y: 0, w: startWidth, h: Infinity}];\n\n    let width = 0;\n    let height = 0;\n\n    for (const box of boxes) {\n        // look through spaces backwards so that we check smaller spaces first\n        for (let i = spaces.length - 1; i >= 0; i--) {\n            const space = spaces[i];\n\n            // look for empty spaces that can accommodate the current box\n            if (box.w > space.w || box.h > space.h) continue;\n\n            // found the space; add the box to its top-left corner\n            // |-------|-------|\n            // |  box  |       |\n            // |_______|       |\n            // |         space |\n            // |_______________|\n            box.x = space.x;\n            box.y = space.y;\n\n            height = Math.max(height, box.y + box.h);\n            width = Math.max(width, box.x + box.w);\n\n            if (box.w === space.w && box.h === space.h) {\n                // space matches the box exactly; remove it\n                const last = spaces.pop();\n                if (i < spaces.length) spaces[i] = last;\n\n            } else if (box.h === space.h) {\n                // space matches the box height; update it accordingly\n                // |-------|---------------|\n                // |  box  | updated space |\n                // |_______|_______________|\n                space.x += box.w;\n                space.w -= box.w;\n\n            } else if (box.w === space.w) {\n                // space matches the box width; update it accordingly\n                // |---------------|\n                // |      box      |\n                // |_______________|\n                // | updated space |\n                // |_______________|\n                space.y += box.h;\n                space.h -= box.h;\n\n            } else {\n                // otherwise the box splits the space into two spaces\n                // |-------|-----------|\n                // |  box  | new space |\n                // |_______|___________|\n                // | updated space     |\n                // |___________________|\n                spaces.push({\n                    x: space.x + box.w,\n                    y: space.y,\n                    w: space.w - box.w,\n                    h: box.h\n                });\n                space.y += box.h;\n                space.h -= box.h;\n            }\n            break;\n        }\n    }\n\n    return {\n        w: width, // container width\n        h: height, // container height\n        fill: (area / (width * height)) || 0 // space utilization\n    };\n}\n", "/* eslint-disable key-spacing */\nimport {RGBAImage} from '../util/image';\nimport {register} from '../util/web_worker_transfer';\nimport potpack from 'potpack';\n\nimport type {StyleImage} from '../style/style_image';\nimport {TextFit} from '../style/style_image';\nimport type {ImageManager} from './image_manager';\nimport type {Texture} from './texture';\nimport type {Rect} from './glyph_atlas';\nimport type {GetImagesResponse} from '../util/actor_messages';\n\nconst IMAGE_PADDING: number = 1;\nexport {IMAGE_PADDING};\n\nexport class ImagePosition {\n    paddedRect: Rect;\n    pixelRatio: number;\n    version: number;\n    stretchY: Array<[number, number]>;\n    stretchX: Array<[number, number]>;\n    content: [number, number, number, number];\n    textFitWidth: TextFit;\n    textFitHeight: TextFit;\n\n    constructor(paddedRect: Rect, {\n        pixelRatio,\n        version,\n        stretchX,\n        stretchY,\n        content,\n        textFitWidth,\n        textFitHeight\n    }: StyleImage) {\n        this.paddedRect = paddedRect;\n        this.pixelRatio = pixelRatio;\n        this.stretchX = stretchX;\n        this.stretchY = stretchY;\n        this.content = content;\n        this.version = version;\n        this.textFitWidth = textFitWidth;\n        this.textFitHeight = textFitHeight;\n    }\n\n    get tl(): [number, number] {\n        return [\n            this.paddedRect.x + IMAGE_PADDING,\n            this.paddedRect.y + IMAGE_PADDING\n        ];\n    }\n\n    get br(): [number, number] {\n        return [\n            this.paddedRect.x + this.paddedRect.w - IMAGE_PADDING,\n            this.paddedRect.y + this.paddedRect.h - IMAGE_PADDING\n        ];\n    }\n\n    get tlbr(): Array<number> {\n        return this.tl.concat(this.br);\n    }\n\n    get displaySize(): [number, number] {\n        return [\n            (this.paddedRect.w - IMAGE_PADDING * 2) / this.pixelRatio,\n            (this.paddedRect.h - IMAGE_PADDING * 2) / this.pixelRatio\n        ];\n    }\n}\n\n/**\n * A class holding all the images\n */\nexport class ImageAtlas {\n    image: RGBAImage;\n    iconPositions: {[_: string]: ImagePosition};\n    patternPositions: {[_: string]: ImagePosition};\n    haveRenderCallbacks: Array<string>;\n    uploaded: boolean;\n\n    constructor(icons: GetImagesResponse, patterns: GetImagesResponse) {\n        const iconPositions = {}, patternPositions = {};\n        this.haveRenderCallbacks = [];\n\n        const bins = [];\n\n        this.addImages(icons, iconPositions, bins);\n        this.addImages(patterns, patternPositions, bins);\n\n        const {w, h} = potpack(bins);\n        const image = new RGBAImage({width: w || 1, height: h || 1});\n\n        for (const id in icons) {\n            const src = icons[id];\n            const bin = iconPositions[id].paddedRect;\n            RGBAImage.copy(src.data, image, {x: 0, y: 0}, {x: bin.x + IMAGE_PADDING, y: bin.y + IMAGE_PADDING}, src.data);\n        }\n\n        for (const id in patterns) {\n            const src = patterns[id];\n            const bin = patternPositions[id].paddedRect;\n            const x = bin.x + IMAGE_PADDING,\n                y = bin.y + IMAGE_PADDING,\n                w = src.data.width,\n                h = src.data.height;\n\n            RGBAImage.copy(src.data, image, {x: 0, y: 0}, {x, y}, src.data);\n            // Add 1 pixel wrapped padding on each side of the image.\n            RGBAImage.copy(src.data, image, {x: 0, y: h - 1}, {x, y: y - 1}, {width: w, height: 1}); // T\n            RGBAImage.copy(src.data, image, {x: 0, y:     0}, {x, y: y + h}, {width: w, height: 1}); // B\n            RGBAImage.copy(src.data, image, {x: w - 1, y: 0}, {x: x - 1, y}, {width: 1, height: h}); // L\n            RGBAImage.copy(src.data, image, {x: 0,     y: 0}, {x: x + w, y}, {width: 1, height: h}); // R\n        }\n\n        this.image = image;\n        this.iconPositions = iconPositions;\n        this.patternPositions = patternPositions;\n    }\n\n    addImages(images: {[_: string]: StyleImage}, positions: {[_: string]: ImagePosition}, bins: Array<Rect>) {\n        for (const id in images) {\n            const src = images[id];\n            const bin = {\n                x: 0,\n                y: 0,\n                w: src.data.width + 2 * IMAGE_PADDING,\n                h: src.data.height + 2 * IMAGE_PADDING,\n            };\n            bins.push(bin);\n            positions[id] = new ImagePosition(bin, src);\n\n            if (src.hasRenderCallback) {\n                this.haveRenderCallbacks.push(id);\n            }\n        }\n    }\n\n    patchUpdatedImages(imageManager: ImageManager, texture: Texture) {\n        imageManager.dispatchRenderCallbacks(this.haveRenderCallbacks);\n        for (const name in imageManager.updatedImages) {\n            this.patchUpdatedImage(this.iconPositions[name], imageManager.getImage(name), texture);\n            this.patchUpdatedImage(this.patternPositions[name], imageManager.getImage(name), texture);\n        }\n    }\n\n    patchUpdatedImage(position: ImagePosition, image: StyleImage, texture: Texture) {\n        if (!position || !image) return;\n\n        if (position.version === image.version) return;\n\n        position.version = image.version;\n        const [x, y] = position.tl;\n        texture.update(image.data, undefined, {x, y});\n    }\n\n}\n\nregister('ImagePosition', ImagePosition);\nregister('ImageAtlas', ImageAtlas);\n", "import {\n    charHasUprightVerticalOrientation,\n    charAllowsIdeographicBreaking,\n    charInComplexShapingScript\n} from '../util/script_detection';\nimport {verticalizePunctuation} from '../util/verticalize_punctuation';\nimport {rtlWorkerPlugin} from '../source/rtl_text_plugin_worker';\nimport ONE_EM from './one_em';\nimport {warnOnce} from '../util/util';\n\nimport type {StyleGlyph, GlyphMetrics} from '../style/style_glyph';\nimport {GLYPH_PBF_BORDER} from '../style/parse_glyph_pbf';\nimport {TextFit} from '../style/style_image';\nimport type {ImagePosition} from '../render/image_atlas';\nimport {IMAGE_PADDING} from '../render/image_atlas';\nimport type {Rect, GlyphPosition} from '../render/glyph_atlas';\nimport {Formatted, FormattedSection} from '@maplibre/maplibre-gl-style-spec';\n\nenum WritingMode {\n    none = 0,\n    horizontal = 1,\n    vertical = 2,\n    horizontalOnly = 3\n}\n\nconst SHAPING_DEFAULT_OFFSET = -17;\nexport {shapeText, shapeIcon, applyTextFit, fitIconToText, getAnchorAlignment, WritingMode, SHAPING_DEFAULT_OFFSET};\n\n// The position of a glyph relative to the text's anchor point.\nexport type PositionedGlyph = {\n    glyph: number;\n    imageName: string | null;\n    x: number;\n    y: number;\n    vertical: boolean;\n    scale: number;\n    fontStack: string;\n    sectionIndex: number;\n    metrics: GlyphMetrics;\n    rect: Rect | null;\n};\n\nexport type PositionedLine = {\n    positionedGlyphs: Array<PositionedGlyph>;\n    lineOffset: number;\n};\n\n// A collection of positioned glyphs and some metadata\nexport type Shaping = {\n    positionedLines: Array<PositionedLine>;\n    top: number;\n    bottom: number;\n    left: number;\n    right: number;\n    writingMode: WritingMode.horizontal | WritingMode.vertical;\n    text: string;\n    iconsInText: boolean;\n    verticalizable: boolean;\n};\n\nfunction isEmpty(positionedLines: Array<PositionedLine>) {\n    for (const line of positionedLines) {\n        if (line.positionedGlyphs.length !== 0) {\n            return false;\n        }\n    }\n    return true;\n}\n\nexport type SymbolAnchor = 'center' | 'left' | 'right' | 'top' | 'bottom' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\nexport type TextJustify = 'left' | 'center' | 'right';\n\n// Max number of images in label is 6401 U+E000âU+F8FF that covers\n// Basic Multilingual Plane Unicode Private Use Area (PUA).\nconst PUAbegin = 0xE000;\nconst PUAend = 0xF8FF;\n\nclass SectionOptions {\n    // Text options\n    scale: number;\n    fontStack: string;\n    // Image options\n    imageName: string | null;\n\n    constructor() {\n        this.scale = 1.0;\n        this.fontStack = '';\n        this.imageName = null;\n    }\n\n    static forText(scale: number | null, fontStack: string) {\n        const textOptions = new SectionOptions();\n        textOptions.scale = scale || 1;\n        textOptions.fontStack = fontStack;\n        return textOptions;\n    }\n\n    static forImage(imageName: string) {\n        const imageOptions = new SectionOptions();\n        imageOptions.imageName = imageName;\n        return imageOptions;\n    }\n\n}\n\nclass TaggedString {\n    text: string;\n    sectionIndex: Array<number>; // maps each character in 'text' to its corresponding entry in 'sections'\n    sections: Array<SectionOptions>;\n    imageSectionID: number | null;\n\n    constructor() {\n        this.text = '';\n        this.sectionIndex = [];\n        this.sections = [];\n        this.imageSectionID = null;\n    }\n\n    static fromFeature(text: Formatted, defaultFontStack: string) {\n        const result = new TaggedString();\n        for (let i = 0; i < text.sections.length; i++) {\n            const section = text.sections[i];\n            if (!section.image) {\n                result.addTextSection(section, defaultFontStack);\n            } else {\n                result.addImageSection(section);\n            }\n        }\n        return result;\n    }\n\n    length(): number {\n        return this.text.length;\n    }\n\n    getSection(index: number): SectionOptions {\n        return this.sections[this.sectionIndex[index]];\n    }\n\n    getSectionIndex(index: number): number {\n        return this.sectionIndex[index];\n    }\n\n    getCharCode(index: number): number {\n        return this.text.charCodeAt(index);\n    }\n\n    verticalizePunctuation() {\n        this.text = verticalizePunctuation(this.text);\n    }\n\n    trim() {\n        let beginningWhitespace = 0;\n        for (let i = 0;\n            i < this.text.length && whitespace[this.text.charCodeAt(i)];\n            i++) {\n            beginningWhitespace++;\n        }\n        let trailingWhitespace = this.text.length;\n        for (let i = this.text.length - 1;\n            i >= 0 && i >= beginningWhitespace && whitespace[this.text.charCodeAt(i)];\n            i--) {\n            trailingWhitespace--;\n        }\n        this.text = this.text.substring(beginningWhitespace, trailingWhitespace);\n        this.sectionIndex = this.sectionIndex.slice(beginningWhitespace, trailingWhitespace);\n    }\n\n    substring(start: number, end: number): TaggedString {\n        const substring = new TaggedString();\n        substring.text = this.text.substring(start, end);\n        substring.sectionIndex = this.sectionIndex.slice(start, end);\n        substring.sections = this.sections;\n        return substring;\n    }\n\n    toString(): string {\n        return this.text;\n    }\n\n    getMaxScale() {\n        return this.sectionIndex.reduce((max, index) => Math.max(max, this.sections[index].scale), 0);\n    }\n\n    addTextSection(section: FormattedSection, defaultFontStack: string) {\n        this.text += section.text;\n        this.sections.push(SectionOptions.forText(section.scale, section.fontStack || defaultFontStack));\n        const index = this.sections.length - 1;\n        for (let i = 0; i < section.text.length; ++i) {\n            this.sectionIndex.push(index);\n        }\n    }\n\n    addImageSection(section: FormattedSection) {\n        const imageName = section.image ? section.image.name : '';\n        if (imageName.length === 0) {\n            warnOnce('Can\\'t add FormattedSection with an empty image.');\n            return;\n        }\n\n        const nextImageSectionCharCode = this.getNextImageSectionCharCode();\n        if (!nextImageSectionCharCode) {\n            warnOnce(`Reached maximum number of images ${PUAend - PUAbegin + 2}`);\n            return;\n        }\n\n        this.text += String.fromCharCode(nextImageSectionCharCode);\n        this.sections.push(SectionOptions.forImage(imageName));\n        this.sectionIndex.push(this.sections.length - 1);\n    }\n\n    getNextImageSectionCharCode(): number | null {\n        if (!this.imageSectionID) {\n            this.imageSectionID = PUAbegin;\n            return this.imageSectionID;\n        }\n\n        if (this.imageSectionID >= PUAend) return null;\n        return ++this.imageSectionID;\n    }\n}\n\nfunction breakLines(input: TaggedString, lineBreakPoints: Array<number>): Array<TaggedString> {\n    const lines = [];\n    const text = input.text;\n    let start = 0;\n    for (const lineBreak of lineBreakPoints) {\n        lines.push(input.substring(start, lineBreak));\n        start = lineBreak;\n    }\n\n    if (start < text.length) {\n        lines.push(input.substring(start, text.length));\n    }\n    return lines;\n}\n\nfunction shapeText(\n    text: Formatted,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    glyphPositions: {\n        [_: string]: {\n            [_: number]: GlyphPosition;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    defaultFontStack: string,\n    maxWidth: number,\n    lineHeight: number,\n    textAnchor: SymbolAnchor,\n    textJustify: TextJustify,\n    spacing: number,\n    translate: [number, number],\n    writingMode: WritingMode.horizontal | WritingMode.vertical,\n    allowVerticalPlacement: boolean,\n    layoutTextSize: number,\n    layoutTextSizeThisZoom: number\n): Shaping | false {\n    const logicalInput = TaggedString.fromFeature(text, defaultFontStack);\n\n    if (writingMode === WritingMode.vertical) {\n        logicalInput.verticalizePunctuation();\n    }\n\n    let lines: Array<TaggedString>;\n\n    const {processBidirectionalText, processStyledBidirectionalText} = rtlWorkerPlugin;\n    if (processBidirectionalText && logicalInput.sections.length === 1) {\n        // Bidi doesn't have to be style-aware\n        lines = [];\n        const untaggedLines =\n            processBidirectionalText(logicalInput.toString(),\n                determineLineBreaks(logicalInput, spacing, maxWidth, glyphMap, imagePositions, layoutTextSize));\n        for (const line of untaggedLines) {\n            const taggedLine = new TaggedString();\n            taggedLine.text = line;\n            taggedLine.sections = logicalInput.sections;\n            for (let i = 0; i < line.length; i++) {\n                taggedLine.sectionIndex.push(0);\n            }\n            lines.push(taggedLine);\n        }\n    } else if (processStyledBidirectionalText) {\n        // Need version of mapbox-gl-rtl-text with style support for combining RTL text\n        // with formatting\n        lines = [];\n        const processedLines =\n            processStyledBidirectionalText(logicalInput.text,\n                logicalInput.sectionIndex,\n                determineLineBreaks(logicalInput, spacing, maxWidth, glyphMap, imagePositions, layoutTextSize));\n        for (const line of processedLines) {\n            const taggedLine = new TaggedString();\n            taggedLine.text = line[0];\n            taggedLine.sectionIndex = line[1];\n            taggedLine.sections = logicalInput.sections;\n            lines.push(taggedLine);\n        }\n    } else {\n        lines = breakLines(logicalInput, determineLineBreaks(logicalInput, spacing, maxWidth, glyphMap, imagePositions, layoutTextSize));\n    }\n\n    const positionedLines = [];\n    const shaping = {\n        positionedLines,\n        text: logicalInput.toString(),\n        top: translate[1],\n        bottom: translate[1],\n        left: translate[0],\n        right: translate[0],\n        writingMode,\n        iconsInText: false,\n        verticalizable: false\n    };\n\n    shapeLines(shaping, glyphMap, glyphPositions, imagePositions, lines, lineHeight, textAnchor, textJustify, writingMode, spacing, allowVerticalPlacement, layoutTextSizeThisZoom);\n    if (isEmpty(positionedLines)) return false;\n\n    return shaping;\n}\n\n// using computed properties due to https://github.com/facebook/flow/issues/380\n/* eslint no-useless-computed-key: 0 */\n\nconst whitespace: {\n    [_: number]: boolean;\n} = {\n    [0x09]: true, // tab\n    [0x0a]: true, // newline\n    [0x0b]: true, // vertical tab\n    [0x0c]: true, // form feed\n    [0x0d]: true, // carriage return\n    [0x20]: true, // space\n};\n\nconst breakable: {\n    [_: number]: boolean;\n} = {\n    [0x0a]: true, // newline\n    [0x20]: true, // space\n    [0x26]: true, // ampersand\n    [0x29]: true, // right parenthesis\n    [0x2b]: true, // plus sign\n    [0x2d]: true, // hyphen-minus\n    [0x2f]: true, // solidus\n    [0xad]: true, // soft hyphen\n    [0xb7]: true, // middle dot\n    [0x200b]: true, // zero-width space\n    [0x2010]: true, // hyphen\n    [0x2013]: true, // en dash\n    [0x2027]: true  // interpunct\n    // Many other characters may be reasonable breakpoints\n    // Consider \"neutral orientation\" characters at scriptDetection.charHasNeutralVerticalOrientation\n    // See https://github.com/mapbox/mapbox-gl-js/issues/3658\n};\n\n// Allow breaks depending on the following character\nconst breakableBefore: {\n    [_: number]: boolean;\n} = {\n    [0x28]: true, // left parenthesis\n};\n\nfunction getGlyphAdvance(\n    codePoint: number,\n    section: SectionOptions,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    spacing: number,\n    layoutTextSize: number\n): number {\n    if (!section.imageName) {\n        const positions = glyphMap[section.fontStack];\n        const glyph = positions && positions[codePoint];\n        if (!glyph) return 0;\n        return glyph.metrics.advance * section.scale + spacing;\n    } else {\n        const imagePosition = imagePositions[section.imageName];\n        if (!imagePosition) return 0;\n        return imagePosition.displaySize[0] * section.scale * ONE_EM / layoutTextSize + spacing;\n    }\n}\n\nfunction determineAverageLineWidth(logicalInput: TaggedString,\n    spacing: number,\n    maxWidth: number,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    layoutTextSize: number) {\n    let totalWidth = 0;\n\n    for (let index = 0; index < logicalInput.length(); index++) {\n        const section = logicalInput.getSection(index);\n        totalWidth += getGlyphAdvance(logicalInput.getCharCode(index), section, glyphMap, imagePositions, spacing, layoutTextSize);\n    }\n\n    const lineCount = Math.max(1, Math.ceil(totalWidth / maxWidth));\n    return totalWidth / lineCount;\n}\n\nfunction calculateBadness(lineWidth: number,\n    targetWidth: number,\n    penalty: number,\n    isLastBreak: boolean) {\n    const raggedness = Math.pow(lineWidth - targetWidth, 2);\n    if (isLastBreak) {\n        // Favor finals lines shorter than average over longer than average\n        if (lineWidth < targetWidth) {\n            return raggedness / 2;\n        } else {\n            return raggedness * 2;\n        }\n    }\n\n    return raggedness + Math.abs(penalty) * penalty;\n}\n\nfunction calculatePenalty(codePoint: number, nextCodePoint: number, penalizableIdeographicBreak: boolean) {\n    let penalty = 0;\n    // Force break on newline\n    if (codePoint === 0x0a) {\n        penalty -= 10000;\n    }\n    // Penalize breaks between characters that allow ideographic breaking because\n    // they are less preferable than breaks at spaces (or zero width spaces).\n    if (penalizableIdeographicBreak) {\n        penalty += 150;\n    }\n\n    // Penalize open parenthesis at end of line\n    if (codePoint === 0x28 || codePoint === 0xff08) {\n        penalty += 50;\n    }\n\n    // Penalize close parenthesis at beginning of line\n    if (nextCodePoint === 0x29 || nextCodePoint === 0xff09) {\n        penalty += 50;\n    }\n    return penalty;\n}\n\ntype Break = {\n    index: number;\n    x: number;\n    priorBreak: Break;\n    badness: number;\n};\n\nfunction evaluateBreak(\n    breakIndex: number,\n    breakX: number,\n    targetWidth: number,\n    potentialBreaks: Array<Break>,\n    penalty: number,\n    isLastBreak: boolean\n): Break {\n    // We could skip evaluating breaks where the line length (breakX - priorBreak.x) > maxWidth\n    //  ...but in fact we allow lines longer than maxWidth (if there's no break points)\n    //  ...and when targetWidth and maxWidth are close, strictly enforcing maxWidth can give\n    //     more lopsided results.\n\n    let bestPriorBreak: Break = null;\n    let bestBreakBadness = calculateBadness(breakX, targetWidth, penalty, isLastBreak);\n\n    for (const potentialBreak of potentialBreaks) {\n        const lineWidth = breakX - potentialBreak.x;\n        const breakBadness =\n            calculateBadness(lineWidth, targetWidth, penalty, isLastBreak) + potentialBreak.badness;\n        if (breakBadness <= bestBreakBadness) {\n            bestPriorBreak = potentialBreak;\n            bestBreakBadness = breakBadness;\n        }\n    }\n\n    return {\n        index: breakIndex,\n        x: breakX,\n        priorBreak: bestPriorBreak,\n        badness: bestBreakBadness\n    };\n}\n\nfunction leastBadBreaks(lastLineBreak?: Break | null): Array<number> {\n    if (!lastLineBreak) {\n        return [];\n    }\n    return leastBadBreaks(lastLineBreak.priorBreak).concat(lastLineBreak.index);\n}\n\nfunction determineLineBreaks(\n    logicalInput: TaggedString,\n    spacing: number,\n    maxWidth: number,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    layoutTextSize: number\n): Array<number> {\n    if (!logicalInput)\n        return [];\n\n    const potentialLineBreaks = [];\n    const targetWidth = determineAverageLineWidth(logicalInput, spacing, maxWidth, glyphMap, imagePositions, layoutTextSize);\n\n    const hasServerSuggestedBreakpoints = logicalInput.text.indexOf('\\u200b') >= 0;\n\n    let currentX = 0;\n\n    for (let i = 0; i < logicalInput.length(); i++) {\n        const section = logicalInput.getSection(i);\n        const codePoint = logicalInput.getCharCode(i);\n        if (!whitespace[codePoint]) currentX += getGlyphAdvance(codePoint, section, glyphMap, imagePositions, spacing, layoutTextSize);\n\n        // Ideographic characters, spaces, and word-breaking punctuation that often appear without\n        // surrounding spaces.\n        if ((i < logicalInput.length() - 1)) {\n            const ideographicBreak = charAllowsIdeographicBreaking(codePoint);\n            if (breakable[codePoint] || ideographicBreak || section.imageName || (i !== logicalInput.length() - 2 && breakableBefore[logicalInput.getCharCode(i + 1)])) {\n\n                potentialLineBreaks.push(\n                    evaluateBreak(\n                        i + 1,\n                        currentX,\n                        targetWidth,\n                        potentialLineBreaks,\n                        calculatePenalty(codePoint, logicalInput.getCharCode(i + 1), ideographicBreak && hasServerSuggestedBreakpoints),\n                        false));\n            }\n        }\n    }\n\n    return leastBadBreaks(\n        evaluateBreak(\n            logicalInput.length(),\n            currentX,\n            targetWidth,\n            potentialLineBreaks,\n            0,\n            true));\n}\n\nfunction getAnchorAlignment(anchor: SymbolAnchor) {\n    let horizontalAlign = 0.5, verticalAlign = 0.5;\n\n    switch (anchor) {\n        case 'right':\n        case 'top-right':\n        case 'bottom-right':\n            horizontalAlign = 1;\n            break;\n        case 'left':\n        case 'top-left':\n        case 'bottom-left':\n            horizontalAlign = 0;\n            break;\n    }\n\n    switch (anchor) {\n        case 'bottom':\n        case 'bottom-right':\n        case 'bottom-left':\n            verticalAlign = 1;\n            break;\n        case 'top':\n        case 'top-right':\n        case 'top-left':\n            verticalAlign = 0;\n            break;\n    }\n\n    return {horizontalAlign, verticalAlign};\n}\n\nfunction shapeLines(shaping: Shaping,\n    glyphMap: {\n        [_: string]: {\n            [_: number]: StyleGlyph;\n        };\n    },\n    glyphPositions: {\n        [_: string]: {\n            [_: number]: GlyphPosition;\n        };\n    },\n    imagePositions: {[_: string]: ImagePosition},\n    lines: Array<TaggedString>,\n    lineHeight: number,\n    textAnchor: SymbolAnchor,\n    textJustify: TextJustify,\n    writingMode: WritingMode.horizontal | WritingMode.vertical,\n    spacing: number,\n    allowVerticalPlacement: boolean,\n    layoutTextSizeThisZoom: number) {\n\n    let x = 0;\n    let y = SHAPING_DEFAULT_OFFSET;\n\n    let maxLineLength = 0;\n    let maxLineHeight = 0;\n\n    const justify =\n        textJustify === 'right' ? 1 :\n            textJustify === 'left' ? 0 : 0.5;\n\n    let lineIndex = 0;\n    for (const line of lines) {\n        line.trim();\n\n        const lineMaxScale = line.getMaxScale();\n        const maxLineOffset = (lineMaxScale - 1) * ONE_EM;\n        const positionedLine = {positionedGlyphs: [], lineOffset: 0};\n        shaping.positionedLines[lineIndex] = positionedLine;\n        const positionedGlyphs = positionedLine.positionedGlyphs;\n        let lineOffset = 0.0;\n\n        if (!line.length()) {\n            y += lineHeight; // Still need a line feed after empty line\n            ++lineIndex;\n            continue;\n        }\n\n        for (let i = 0; i < line.length(); i++) {\n            const section = line.getSection(i);\n            const sectionIndex = line.getSectionIndex(i);\n            const codePoint = line.getCharCode(i);\n            let baselineOffset = 0.0;\n            let metrics = null;\n            let rect = null;\n            let imageName = null;\n            let verticalAdvance = ONE_EM;\n            const vertical = !(writingMode === WritingMode.horizontal ||\n                // Don't verticalize glyphs that have no upright orientation if vertical placement is disabled.\n                (!allowVerticalPlacement && !charHasUprightVerticalOrientation(codePoint)) ||\n                // If vertical placement is enabled, don't verticalize glyphs that\n                // are from complex text layout script, or whitespaces.\n                (allowVerticalPlacement && (whitespace[codePoint] || charInComplexShapingScript(codePoint))));\n\n            if (!section.imageName) {\n                const positions = glyphPositions[section.fontStack];\n                const glyphPosition = positions && positions[codePoint];\n                if (glyphPosition && glyphPosition.rect) {\n                    rect = glyphPosition.rect;\n                    metrics = glyphPosition.metrics;\n                } else {\n                    const glyphs = glyphMap[section.fontStack];\n                    const glyph = glyphs && glyphs[codePoint];\n                    if (!glyph) continue;\n                    metrics = glyph.metrics;\n                }\n\n                // We don't know the baseline, but since we're laying out\n                // at 24 points, we can calculate how much it will move when\n                // we scale up or down.\n                baselineOffset = (lineMaxScale - section.scale) * ONE_EM;\n            } else {\n                const imagePosition = imagePositions[section.imageName];\n                if (!imagePosition) continue;\n                imageName = section.imageName;\n                shaping.iconsInText = shaping.iconsInText || true;\n                rect = imagePosition.paddedRect;\n                const size = imagePosition.displaySize;\n                // If needed, allow to set scale factor for an image using\n                // alias \"image-scale\" that could be alias for \"font-scale\"\n                // when FormattedSection is an image section.\n                section.scale = section.scale * ONE_EM / layoutTextSizeThisZoom;\n\n                metrics = {width: size[0],\n                    height: size[1],\n                    left: IMAGE_PADDING,\n                    top: -GLYPH_PBF_BORDER,\n                    advance: vertical ? size[1] : size[0]};\n\n                // Difference between one EM and an image size.\n                // Aligns bottom of an image to a baseline level.\n                const imageOffset = ONE_EM - size[1] * section.scale;\n                baselineOffset = maxLineOffset + imageOffset;\n                verticalAdvance = metrics.advance;\n\n                // Difference between height of an image and one EM at max line scale.\n                // Pushes current line down if an image size is over 1 EM at max line scale.\n                const offset = vertical ? size[0] * section.scale - ONE_EM * lineMaxScale :\n                    size[1] * section.scale - ONE_EM * lineMaxScale;\n                if (offset > 0 && offset > lineOffset) {\n                    lineOffset = offset;\n                }\n            }\n\n            if (!vertical) {\n                positionedGlyphs.push({glyph: codePoint, imageName, x, y: y + baselineOffset, vertical, scale: section.scale, fontStack: section.fontStack, sectionIndex, metrics, rect});\n                x += metrics.advance * section.scale + spacing;\n            } else {\n                shaping.verticalizable = true;\n                positionedGlyphs.push({glyph: codePoint, imageName, x, y: y + baselineOffset, vertical, scale: section.scale, fontStack: section.fontStack, sectionIndex, metrics, rect});\n                x += verticalAdvance * section.scale + spacing;\n            }\n        }\n\n        // Only justify if we placed at least one glyph\n        if (positionedGlyphs.length !== 0) {\n            const lineLength = x - spacing;\n            maxLineLength = Math.max(lineLength, maxLineLength);\n            justifyLine(positionedGlyphs, 0, positionedGlyphs.length - 1, justify, lineOffset);\n        }\n\n        x = 0;\n        const currentLineHeight = lineHeight * lineMaxScale + lineOffset;\n        positionedLine.lineOffset = Math.max(lineOffset, maxLineOffset);\n        y += currentLineHeight;\n        maxLineHeight = Math.max(currentLineHeight, maxLineHeight);\n        ++lineIndex;\n    }\n\n    // Calculate the bounding box and justify / align text block.\n    const height = y - SHAPING_DEFAULT_OFFSET;\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(textAnchor);\n    align(shaping.positionedLines, justify, horizontalAlign, verticalAlign, maxLineLength, maxLineHeight, lineHeight, height, lines.length);\n\n    shaping.top += -verticalAlign * height;\n    shaping.bottom = shaping.top + height;\n    shaping.left += -horizontalAlign * maxLineLength;\n    shaping.right = shaping.left + maxLineLength;\n}\n\n// justify right = 1, left = 0, center = 0.5\nfunction justifyLine(positionedGlyphs: Array<PositionedGlyph>,\n    start: number,\n    end: number,\n    justify: 1 | 0 | 0.5,\n    lineOffset: number) {\n    if (!justify && !lineOffset)\n        return;\n\n    const lastPositionedGlyph = positionedGlyphs[end];\n    const lastAdvance = lastPositionedGlyph.metrics.advance * lastPositionedGlyph.scale;\n    const lineIndent = (positionedGlyphs[end].x + lastAdvance) * justify;\n\n    for (let j = start; j <= end; j++) {\n        positionedGlyphs[j].x -= lineIndent;\n        positionedGlyphs[j].y += lineOffset;\n    }\n}\n\nfunction align(positionedLines: Array<PositionedLine>,\n    justify: number,\n    horizontalAlign: number,\n    verticalAlign: number,\n    maxLineLength: number,\n    maxLineHeight: number,\n    lineHeight: number,\n    blockHeight: number,\n    lineCount: number) {\n    const shiftX = (justify - horizontalAlign) * maxLineLength;\n    let shiftY = 0;\n\n    if (maxLineHeight !== lineHeight) {\n        shiftY = -blockHeight * verticalAlign - SHAPING_DEFAULT_OFFSET;\n    } else {\n        shiftY = (-verticalAlign * lineCount + 0.5) * lineHeight;\n    }\n\n    for (const line of positionedLines) {\n        for (const positionedGlyph of line.positionedGlyphs) {\n            positionedGlyph.x += shiftX;\n            positionedGlyph.y += shiftY;\n        }\n    }\n}\n\nexport type PositionedIcon = {\n    image: ImagePosition;\n    top: number;\n    bottom: number;\n    left: number;\n    right: number;\n    collisionPadding?: [number, number, number, number];\n};\n\nfunction shapeIcon(\n    image: ImagePosition,\n    iconOffset: [number, number],\n    iconAnchor: SymbolAnchor\n): PositionedIcon {\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(iconAnchor);\n    const dx = iconOffset[0];\n    const dy = iconOffset[1];\n    const x1 = dx - image.displaySize[0] * horizontalAlign;\n    const x2 = x1 + image.displaySize[0];\n    const y1 = dy - image.displaySize[1] * verticalAlign;\n    const y2 = y1 + image.displaySize[1];\n    return {image, top: y1, bottom: y2, left: x1, right: x2};\n}\n\nexport interface Box {\n    x1: number;\n    y1: number;\n    x2: number;\n    y2: number;\n}\n\n/**\n * Called after a PositionedIcon has already been run through fitIconToText,\n * but needs further adjustment to apply textFitWidth and textFitHeight.\n * @param shapedIcon - The icon that will be adjusted.\n * @returns Extents of the shapedIcon with text fit adjustments if necessary.\n */\nfunction applyTextFit(shapedIcon: PositionedIcon): Box {\n    // Assume shapedIcon.image is set or this wouldn't be called.\n    // Size of the icon after it was adjusted using stretchX and Y\n    let iconLeft = shapedIcon.left;\n    let iconTop = shapedIcon.top;\n    let iconWidth = shapedIcon.right - iconLeft;\n    let iconHeight = shapedIcon.bottom - iconTop;\n    // Size of the original content area\n    const contentWidth = shapedIcon.image.content[2] - shapedIcon.image.content[0];\n    const contentHeight = shapedIcon.image.content[3] - shapedIcon.image.content[1];\n    const textFitWidth = shapedIcon.image.textFitWidth ?? TextFit.stretchOrShrink;\n    const textFitHeight = shapedIcon.image.textFitHeight ?? TextFit.stretchOrShrink;\n    const contentAspectRatio = contentWidth / contentHeight;\n    // Scale to the proportional axis first note that height takes precedence if\n    // both axes are set to proportional.\n    if (textFitHeight === TextFit.proportional) {\n        if ((textFitWidth === TextFit.stretchOnly && iconWidth / iconHeight < contentAspectRatio) || textFitWidth === TextFit.proportional) {\n            // Push the width of the icon back out to match the content aspect ratio\n            const newIconWidth = Math.ceil(iconHeight * contentAspectRatio);\n            iconLeft *= newIconWidth / iconWidth;\n            iconWidth = newIconWidth;\n        }\n    } else if (textFitWidth === TextFit.proportional) {\n        if (textFitHeight === TextFit.stretchOnly && contentAspectRatio !== 0 && iconWidth / iconHeight > contentAspectRatio) {\n            // Push the height of the icon back out to match the content aspect ratio\n            const newIconHeight = Math.ceil(iconWidth / contentAspectRatio);\n            iconTop *= newIconHeight / iconHeight;\n            iconHeight = newIconHeight;\n        }\n    } else {\n        // If neither textFitHeight nor textFitWidth are proportional then\n        // there is no effect since the content rectangle should be precisely\n        // matched to the content\n    }\n    return {x1: iconLeft, y1: iconTop, x2: iconLeft + iconWidth, y2: iconTop + iconHeight};\n}\n\nfunction fitIconToText(\n    shapedIcon: PositionedIcon,\n    shapedText: Shaping,\n    textFit: string,\n    padding: [number, number, number, number],\n    iconOffset: [number, number],\n    fontScale: number\n): PositionedIcon {\n\n    const image = shapedIcon.image;\n\n    let collisionPadding;\n    if (image.content) {\n        const content = image.content;\n        const pixelRatio = image.pixelRatio || 1;\n        collisionPadding = [\n            content[0] / pixelRatio,\n            content[1] / pixelRatio,\n            image.displaySize[0] - content[2] / pixelRatio,\n            image.displaySize[1] - content[3] / pixelRatio\n        ];\n    }\n\n    // We don't respect the icon-anchor, because icon-text-fit is set. Instead,\n    // the icon will be centered on the text, then stretched in the given\n    // dimensions.\n\n    const textLeft = shapedText.left * fontScale;\n    const textRight = shapedText.right * fontScale;\n\n    let top, right, bottom, left;\n    if (textFit === 'width' || textFit === 'both') {\n        // Stretched horizontally to the text width\n        left = iconOffset[0] + textLeft - padding[3];\n        right = iconOffset[0] + textRight + padding[1];\n    } else {\n        // Centered on the text\n        left = iconOffset[0] + (textLeft + textRight - image.displaySize[0]) / 2;\n        right = left + image.displaySize[0];\n    }\n\n    const textTop = shapedText.top * fontScale;\n    const textBottom = shapedText.bottom * fontScale;\n    if (textFit === 'height' || textFit === 'both') {\n        // Stretched vertically to the text height\n        top = iconOffset[1] + textTop - padding[0];\n        bottom = iconOffset[1] + textBottom + padding[2];\n    } else {\n        // Centered on the text\n        top = iconOffset[1] + (textTop + textBottom - image.displaySize[1]) / 2;\n        bottom = top + image.displaySize[1];\n    }\n\n    return {image, top, right, bottom, left, collisionPadding};\n}\n", "import {Interpolate, interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {clamp} from '../util/util';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\n\nimport type {PropertyValue, PossiblyEvaluatedPropertyValue} from '../style/properties';\nimport type {InterpolationType} from '@maplibre/maplibre-gl-style-spec';\n\nconst MAX_GLYPH_ICON_SIZE = 255;\nconst SIZE_PACK_FACTOR = 128;\nconst MAX_PACKED_SIZE = MAX_GLYPH_ICON_SIZE * SIZE_PACK_FACTOR;\n\nexport {getSizeData, evaluateSizeForFeature, evaluateSizeForZoom, SIZE_PACK_FACTOR, MAX_GLYPH_ICON_SIZE, MAX_PACKED_SIZE};\n\nexport type SizeData = {\n    kind: 'constant';\n    layoutSize: number;\n} | {\n    kind: 'source';\n} | {\n    kind: 'camera';\n    minZoom: number;\n    maxZoom: number;\n    minSize: number;\n    maxSize: number;\n    interpolationType: InterpolationType;\n} | {\n    kind: 'composite';\n    minZoom: number;\n    maxZoom: number;\n    interpolationType: InterpolationType;\n};\n\nexport type EvaluatedZoomSize = {uSizeT: number; uSize: number};\n\n// For {text,icon}-size, get the bucket-level data that will be needed by\n// the painter to set symbol-size-related uniforms\nfunction getSizeData(\n    tileZoom: number,\n    value: PropertyValue<number, PossiblyEvaluatedPropertyValue<number>>\n): SizeData {\n    const {expression} = value;\n\n    if (expression.kind === 'constant') {\n        const layoutSize = expression.evaluate(new EvaluationParameters(tileZoom + 1));\n        return {kind: 'constant', layoutSize};\n\n    } else if (expression.kind === 'source') {\n        return {kind: 'source'};\n\n    } else {\n        const {zoomStops, interpolationType} = expression;\n\n        // calculate covering zoom stops for zoom-dependent values\n        let lower = 0;\n        while (lower < zoomStops.length && zoomStops[lower] <= tileZoom) lower++;\n        lower = Math.max(0, lower - 1);\n        let upper = lower;\n        while (upper < zoomStops.length && zoomStops[upper] < tileZoom + 1) upper++;\n        upper = Math.min(zoomStops.length - 1, upper);\n\n        const minZoom = zoomStops[lower];\n        const maxZoom = zoomStops[upper];\n\n        // We'd like to be able to use CameraExpression or CompositeExpression in these\n        // return types rather than ExpressionSpecification, but the former are not\n        // transferrable across Web Worker boundaries.\n        if (expression.kind === 'composite') {\n            return {kind: 'composite', minZoom, maxZoom, interpolationType};\n        }\n\n        // for camera functions, also save off the function values\n        // evaluated at the covering zoom levels\n        const minSize = expression.evaluate(new EvaluationParameters(minZoom));\n        const maxSize = expression.evaluate(new EvaluationParameters(maxZoom));\n\n        return {kind: 'camera', minZoom, maxZoom, minSize, maxSize, interpolationType};\n    }\n}\n\nfunction evaluateSizeForFeature(sizeData: SizeData,\n    {\n        uSize,\n        uSizeT\n    }: {\n        uSize: number;\n        uSizeT: number;\n    },\n    {\n        lowerSize,\n        upperSize\n    }: {\n        lowerSize: number;\n        upperSize: number;\n    }): number {\n    if (sizeData.kind === 'source') {\n        return lowerSize / SIZE_PACK_FACTOR;\n    } else if (sizeData.kind === 'composite') {\n        return interpolates.number(lowerSize / SIZE_PACK_FACTOR, upperSize / SIZE_PACK_FACTOR, uSizeT);\n    }\n    return uSize;\n}\n\nfunction evaluateSizeForZoom(sizeData: SizeData, zoom: number): EvaluatedZoomSize {\n    let uSizeT = 0;\n    let uSize = 0;\n\n    if (sizeData.kind === 'constant') {\n        uSize = sizeData.layoutSize;\n\n    } else if (sizeData.kind !== 'source') {\n        const {interpolationType, minZoom, maxZoom} = sizeData;\n\n        // Even though we could get the exact value of the camera function\n        // at z = tr.zoom, we intentionally do not: instead, we interpolate\n        // between the camera function values at a pair of zoom stops covering\n        // [tileZoom, tileZoom + 1] in order to be consistent with this\n        // restriction on composite functions\n        const t = !interpolationType ? 0 : clamp(\n            Interpolate.interpolationFactor(interpolationType, zoom, minZoom, maxZoom), 0, 1);\n\n        if (sizeData.kind === 'camera') {\n            uSize = interpolates.number(sizeData.minSize, sizeData.maxSize, t);\n        } else {\n            uSizeT = t;\n        }\n    }\n\n    return {uSizeT, uSize};\n}\n", "import {SymbolLayoutPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';\nimport type {SymbolLayoutProps} from './symbol_style_layer_properties.g';\nimport {PossiblyEvaluated} from '../properties';\n\n/**\n * The overlap mode for properties like `icon-overlap`and `text-overlap`\n */\nexport type OverlapMode = 'never' | 'always' | 'cooperative';\n\nexport function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'icon-overlap', allowOverlapProp: 'icon-allow-overlap'): OverlapMode;\nexport function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'text-overlap', allowOverlapProp: 'text-allow-overlap'): OverlapMode;\nexport function getOverlapMode(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, overlapProp: 'icon-overlap' | 'text-overlap', allowOverlapProp: 'icon-allow-overlap' | 'text-allow-overlap'): OverlapMode {\n    let result: OverlapMode = 'never';\n    const overlap = layout.get(overlapProp);\n\n    if (overlap) {\n        // if -overlap is set, use it\n        result = overlap;\n    } else if (layout.get(allowOverlapProp)) {\n        // fall back to -allow-overlap, with false='never', true='always'\n        result = 'always';\n    }\n\n    return result;\n}\n", "import {\n    symbolLayoutAttributes,\n    collisionVertexAttributes,\n    collisionBoxLayout,\n    dynamicLayoutAttributes,\n} from './symbol_attributes';\n\nimport {SymbolLayoutArray,\n    SymbolDynamicLayoutArray,\n    SymbolOpacityArray,\n    CollisionBoxLayoutArray,\n    CollisionVertexArray,\n    PlacedSymbolArray,\n    SymbolInstanceArray,\n    GlyphOffsetArray,\n    SymbolLineVertexArray,\n    TextAnchorOffsetArray\n} from '../array_types.g';\n\nimport Point from '@mapbox/point-geometry';\nimport {SegmentVector} from '../segment';\nimport {ProgramConfigurationSet} from '../program_configuration';\nimport {TriangleIndexArray, LineIndexArray} from '../index_array_type';\nimport {transformText} from '../../symbol/transform_text';\nimport {mergeLines} from '../../symbol/merge_lines';\nimport {allowsVerticalWritingMode, stringContainsRTLText} from '../../util/script_detection';\nimport {WritingMode} from '../../symbol/shaping';\nimport {loadGeometry} from '../load_geometry';\nimport {toEvaluationFeature} from '../evaluation_feature';\nimport mvt from '@mapbox/vector-tile';\nconst vectorTileFeatureTypes = mvt.VectorTileFeature.types;\nimport {verticalizedCharacterMap} from '../../util/verticalize_punctuation';\nimport {Anchor} from '../../symbol/anchor';\nimport {getSizeData, MAX_PACKED_SIZE} from '../../symbol/symbol_size';\n\nimport {register} from '../../util/web_worker_transfer';\nimport {EvaluationParameters} from '../../style/evaluation_parameters';\nimport {Formatted, ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport {rtlWorkerPlugin} from '../../source/rtl_text_plugin_worker';\nimport {mat4} from 'gl-matrix';\nimport {getOverlapMode} from '../../style/style_layer/overlap_mode';\nimport type {CanonicalTileID} from '../../source/tile_id';\nimport type {\n    Bucket,\n    BucketParameters,\n    IndexedFeature,\n    PopulateParameters\n} from '../bucket';\nimport type {CollisionBoxArray, CollisionBox, SymbolInstance} from '../array_types.g';\nimport type {StructArray, StructArrayMember, ViewType} from '../../util/struct_array';\nimport type {SymbolStyleLayer} from '../../style/style_layer/symbol_style_layer';\nimport type {Context} from '../../gl/context';\nimport type {IndexBuffer} from '../../gl/index_buffer';\nimport type {VertexBuffer} from '../../gl/vertex_buffer';\nimport type {SymbolQuad} from '../../symbol/quads';\nimport type {SizeData} from '../../symbol/symbol_size';\nimport type {FeatureStates} from '../../source/source_state';\nimport type {ImagePosition} from '../../render/image_atlas';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\n\nexport type SingleCollisionBox = {\n    x1: number;\n    y1: number;\n    x2: number;\n    y2: number;\n    anchorPointX: number;\n    anchorPointY: number;\n};\n\nexport type CollisionArrays = {\n    textBox?: SingleCollisionBox;\n    verticalTextBox?: SingleCollisionBox;\n    iconBox?: SingleCollisionBox;\n    verticalIconBox?: SingleCollisionBox;\n    textFeatureIndex?: number;\n    verticalTextFeatureIndex?: number;\n    iconFeatureIndex?: number;\n    verticalIconFeatureIndex?: number;\n};\n\nexport type SymbolFeature = {\n    sortKey: number | void;\n    text: Formatted | void;\n    icon: ResolvedImage;\n    index: number;\n    sourceLayerIndex: number;\n    geometry: Array<Array<Point>>;\n    properties: any;\n    type: 'Unknown' | 'Point' | 'LineString' | 'Polygon';\n    id?: any;\n};\n\nexport type SortKeyRange = {\n    sortKey: number;\n    symbolInstanceStart: number;\n    symbolInstanceEnd: number;\n};\n\n// Opacity arrays are frequently updated but don't contain a lot of information, so we pack them\n// tight. Each Uint32 is actually four duplicate Uint8s for the four corners of a glyph\n// 7 bits are for the current opacity, and the lowest bit is the target opacity\n\n// actually defined in symbol_attributes.js\n// const placementOpacityAttributes = [\n//     { name: 'a_fade_opacity', components: 1, type: 'Uint32' }\n// ];\nconst shaderOpacityAttributes = [\n    {name: 'a_fade_opacity', components: 1, type: 'Uint8' as ViewType, offset: 0}\n];\n\nfunction addVertex(\n    array: StructArray,\n    anchorX: number,\n    anchorY: number,\n    ox: number,\n    oy: number,\n    tx: number,\n    ty: number,\n    sizeVertex: number,\n    isSDF: boolean,\n    pixelOffsetX: number,\n    pixelOffsetY: number,\n    minFontScaleX: number,\n    minFontScaleY: number\n) {\n    const aSizeX = sizeVertex ? Math.min(MAX_PACKED_SIZE, Math.round(sizeVertex[0])) : 0;\n    const aSizeY = sizeVertex ? Math.min(MAX_PACKED_SIZE, Math.round(sizeVertex[1])) : 0;\n    array.emplaceBack(\n        // a_pos_offset\n        anchorX,\n        anchorY,\n        Math.round(ox * 32),\n        Math.round(oy * 32),\n\n        // a_data\n        tx, // x coordinate of symbol on glyph atlas texture\n        ty, // y coordinate of symbol on glyph atlas texture\n        (aSizeX << 1) + (isSDF ? 1 : 0),\n        aSizeY,\n        pixelOffsetX * 16,\n        pixelOffsetY * 16,\n        minFontScaleX * 256,\n        minFontScaleY * 256\n    );\n}\n\nfunction addDynamicAttributes(dynamicLayoutVertexArray: StructArray, p: Point, angle: number) {\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n    dynamicLayoutVertexArray.emplaceBack(p.x, p.y, angle);\n}\n\nfunction containsRTLText(formattedText: Formatted): boolean {\n    for (const section of formattedText.sections) {\n        if (stringContainsRTLText(section.text)) {\n            return true;\n        }\n    }\n    return false;\n}\n\nexport class SymbolBuffers {\n    layoutVertexArray: SymbolLayoutArray;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray;\n    indexBuffer: IndexBuffer;\n\n    programConfigurations: ProgramConfigurationSet<SymbolStyleLayer>;\n    segments: SegmentVector;\n\n    dynamicLayoutVertexArray: SymbolDynamicLayoutArray;\n    dynamicLayoutVertexBuffer: VertexBuffer;\n\n    opacityVertexArray: SymbolOpacityArray;\n    opacityVertexBuffer: VertexBuffer;\n    hasVisibleVertices: boolean;\n\n    collisionVertexArray: CollisionVertexArray;\n    collisionVertexBuffer: VertexBuffer;\n\n    placedSymbolArray: PlacedSymbolArray;\n\n    constructor(programConfigurations: ProgramConfigurationSet<SymbolStyleLayer>) {\n        this.layoutVertexArray = new SymbolLayoutArray();\n        this.indexArray = new TriangleIndexArray();\n        this.programConfigurations = programConfigurations;\n        this.segments = new SegmentVector();\n        this.dynamicLayoutVertexArray = new SymbolDynamicLayoutArray();\n        this.opacityVertexArray = new SymbolOpacityArray();\n        this.hasVisibleVertices = false;\n        this.placedSymbolArray = new PlacedSymbolArray();\n    }\n\n    isEmpty() {\n        return this.layoutVertexArray.length === 0 &&\n            this.indexArray.length === 0 &&\n            this.dynamicLayoutVertexArray.length === 0 &&\n            this.opacityVertexArray.length === 0;\n    }\n\n    upload(context: Context, dynamicIndexBuffer: boolean, upload?: boolean, update?: boolean) {\n        if (this.isEmpty()) {\n            return;\n        }\n\n        if (upload) {\n            this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, symbolLayoutAttributes.members);\n            this.indexBuffer = context.createIndexBuffer(this.indexArray, dynamicIndexBuffer);\n            this.dynamicLayoutVertexBuffer = context.createVertexBuffer(this.dynamicLayoutVertexArray, dynamicLayoutAttributes.members, true);\n            this.opacityVertexBuffer = context.createVertexBuffer(this.opacityVertexArray, shaderOpacityAttributes, true);\n            // This is a performance hack so that we can write to opacityVertexArray with uint32s\n            // even though the shaders read uint8s\n            this.opacityVertexBuffer.itemSize = 1;\n        }\n        if (upload || update) {\n            this.programConfigurations.upload(context);\n        }\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.programConfigurations.destroy();\n        this.segments.destroy();\n        this.dynamicLayoutVertexBuffer.destroy();\n        this.opacityVertexBuffer.destroy();\n    }\n}\n\nregister('SymbolBuffers', SymbolBuffers);\n\nclass CollisionBuffers {\n    layoutVertexArray: StructArray;\n    layoutAttributes: Array<StructArrayMember>;\n    layoutVertexBuffer: VertexBuffer;\n\n    indexArray: TriangleIndexArray | LineIndexArray;\n    indexBuffer: IndexBuffer;\n\n    segments: SegmentVector;\n\n    collisionVertexArray: CollisionVertexArray;\n    collisionVertexBuffer: VertexBuffer;\n\n    constructor(LayoutArray: {\n        new (...args: any): StructArray;\n    },\n    layoutAttributes: Array<StructArrayMember>,\n    IndexArray: {\n        new (...args: any): TriangleIndexArray | LineIndexArray;\n    }) {\n        this.layoutVertexArray = new LayoutArray();\n        this.layoutAttributes = layoutAttributes;\n        this.indexArray = new IndexArray();\n        this.segments = new SegmentVector();\n        this.collisionVertexArray = new CollisionVertexArray();\n    }\n\n    upload(context: Context) {\n        this.layoutVertexBuffer = context.createVertexBuffer(this.layoutVertexArray, this.layoutAttributes);\n        this.indexBuffer = context.createIndexBuffer(this.indexArray);\n        this.collisionVertexBuffer = context.createVertexBuffer(this.collisionVertexArray, collisionVertexAttributes.members, true);\n    }\n\n    destroy() {\n        if (!this.layoutVertexBuffer) return;\n        this.layoutVertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.segments.destroy();\n        this.collisionVertexBuffer.destroy();\n    }\n}\n\nregister('CollisionBuffers', CollisionBuffers);\n\n/**\n * @internal\n * Unlike other buckets, which simply implement #addFeature with type-specific\n * logic for (essentially) triangulating feature geometries, SymbolBucket\n * requires specialized behavior:\n *\n * 1. WorkerTile#parse(), the logical owner of the bucket creation process,\n *    calls SymbolBucket#populate(), which resolves text and icon tokens on\n *    each feature, adds each glyphs and symbols needed to the passed-in\n *    collections options.glyphDependencies and options.iconDependencies, and\n *    stores the feature data for use in subsequent step (this.features).\n *\n * 2. WorkerTile asynchronously requests from the main thread all of the glyphs\n *    and icons needed (by this bucket and any others). When glyphs and icons\n *    have been received, the WorkerTile creates a CollisionIndex and invokes:\n *\n * 3. performSymbolLayout(bucket, stacks, icons) perform texts shaping and\n *    layout on a Symbol Bucket. This step populates:\n *      `this.symbolInstances`: metadata on generated symbols\n *      `this.collisionBoxArray`: collision data for use by foreground\n *      `this.text`: SymbolBuffers for text symbols\n *      `this.icons`: SymbolBuffers for icons\n *      `this.iconCollisionBox`: Debug SymbolBuffers for icon collision boxes\n *      `this.textCollisionBox`: Debug SymbolBuffers for text collision boxes\n *    The results are sent to the foreground for rendering\n *\n * 4. placement.ts is run on the foreground,\n *    and uses the CollisionIndex along with current camera settings to determine\n *    which symbols can actually show on the map. Collided symbols are hidden\n *    using a dynamic \"OpacityVertexArray\".\n */\nexport class SymbolBucket implements Bucket {\n    static MAX_GLYPHS: number;\n    static addDynamicAttributes: typeof addDynamicAttributes;\n\n    collisionBoxArray: CollisionBoxArray;\n    zoom: number;\n    overscaling: number;\n    layers: Array<SymbolStyleLayer>;\n    layerIds: Array<string>;\n    stateDependentLayers: Array<SymbolStyleLayer>;\n    stateDependentLayerIds: Array<string>;\n\n    index: number;\n    sdfIcons: boolean;\n    iconsInText: boolean;\n    iconsNeedLinear: boolean;\n    bucketInstanceId: number;\n    justReloaded: boolean;\n    hasPattern: boolean;\n\n    textSizeData: SizeData;\n    iconSizeData: SizeData;\n\n    glyphOffsetArray: GlyphOffsetArray;\n    lineVertexArray: SymbolLineVertexArray;\n    features: Array<SymbolFeature>;\n    symbolInstances: SymbolInstanceArray;\n    textAnchorOffsets: TextAnchorOffsetArray;\n    collisionArrays: Array<CollisionArrays>;\n    sortKeyRanges: Array<SortKeyRange>;\n    pixelRatio: number;\n    tilePixelRatio: number;\n    compareText: {[_: string]: Array<Point>};\n    fadeStartTime: number;\n    sortFeaturesByKey: boolean;\n    sortFeaturesByY: boolean;\n    canOverlap: boolean;\n    sortedAngle: number;\n    featureSortOrder: Array<number>;\n\n    collisionCircleArray: Array<number>;\n    placementInvProjMatrix: mat4;\n    placementViewportMatrix: mat4;\n\n    text: SymbolBuffers;\n    icon: SymbolBuffers;\n    textCollisionBox: CollisionBuffers;\n    iconCollisionBox: CollisionBuffers;\n    uploaded: boolean;\n    sourceLayerIndex: number;\n    sourceID: string;\n    symbolInstanceIndexes: Array<number>;\n    writingModes: WritingMode[];\n    allowVerticalPlacement: boolean;\n    hasRTLText: boolean;\n\n    constructor(options: BucketParameters<SymbolStyleLayer>) {\n        this.collisionBoxArray = options.collisionBoxArray;\n        this.zoom = options.zoom;\n        this.overscaling = options.overscaling;\n        this.layers = options.layers;\n        this.layerIds = this.layers.map(layer => layer.id);\n        this.index = options.index;\n        this.pixelRatio = options.pixelRatio;\n        this.sourceLayerIndex = options.sourceLayerIndex;\n        this.hasPattern = false;\n        this.hasRTLText = false;\n        this.sortKeyRanges = [];\n\n        this.collisionCircleArray = [];\n        this.placementInvProjMatrix = mat4.identity([] as any);\n        this.placementViewportMatrix = mat4.identity([] as any);\n\n        const layer = this.layers[0];\n        const unevaluatedLayoutValues = layer._unevaluatedLayout._values;\n\n        this.textSizeData = getSizeData(this.zoom, unevaluatedLayoutValues['text-size']);\n        this.iconSizeData = getSizeData(this.zoom, unevaluatedLayoutValues['icon-size']);\n\n        const layout = this.layers[0].layout;\n        const sortKey = layout.get('symbol-sort-key');\n        const zOrder = layout.get('symbol-z-order');\n        this.canOverlap =\n            getOverlapMode(layout, 'text-overlap', 'text-allow-overlap') !== 'never' ||\n            getOverlapMode(layout, 'icon-overlap', 'icon-allow-overlap') !== 'never' ||\n            layout.get('text-ignore-placement') ||\n            layout.get('icon-ignore-placement');\n        this.sortFeaturesByKey = zOrder !== 'viewport-y' && !sortKey.isConstant();\n        const zOrderByViewportY = zOrder === 'viewport-y' || (zOrder === 'auto' && !this.sortFeaturesByKey);\n        this.sortFeaturesByY = zOrderByViewportY && this.canOverlap;\n\n        if (layout.get('symbol-placement') === 'point') {\n            this.writingModes = layout.get('text-writing-mode').map(wm => WritingMode[wm]);\n        }\n\n        this.stateDependentLayerIds = this.layers.filter((l) => l.isStateDependent()).map((l) => l.id);\n\n        this.sourceID = options.sourceID;\n    }\n\n    createArrays() {\n        this.text = new SymbolBuffers(new ProgramConfigurationSet(this.layers, this.zoom, property => /^text/.test(property)));\n        this.icon = new SymbolBuffers(new ProgramConfigurationSet(this.layers, this.zoom, property => /^icon/.test(property)));\n\n        this.glyphOffsetArray = new GlyphOffsetArray();\n        this.lineVertexArray = new SymbolLineVertexArray();\n        this.symbolInstances = new SymbolInstanceArray();\n        this.textAnchorOffsets = new TextAnchorOffsetArray();\n    }\n\n    private calculateGlyphDependencies(\n        text: string,\n        stack: {[_: number]: boolean},\n        textAlongLine: boolean,\n        allowVerticalPlacement: boolean,\n        doesAllowVerticalWritingMode: boolean) {\n\n        for (let i = 0; i < text.length; i++) {\n            stack[text.charCodeAt(i)] = true;\n            if ((textAlongLine || allowVerticalPlacement) && doesAllowVerticalWritingMode) {\n                const verticalChar = verticalizedCharacterMap[text.charAt(i)];\n                if (verticalChar) {\n                    stack[verticalChar.charCodeAt(0)] = true;\n                }\n            }\n        }\n    }\n\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID) {\n        const layer = this.layers[0];\n        const layout = layer.layout;\n\n        const textFont = layout.get('text-font');\n        const textField = layout.get('text-field');\n        const iconImage = layout.get('icon-image');\n        const hasText =\n            (textField.value.kind !== 'constant' ||\n                (textField.value.value instanceof Formatted && !textField.value.value.isEmpty()) ||\n                textField.value.value.toString().length > 0) &&\n            (textFont.value.kind !== 'constant' || textFont.value.value.length > 0);\n        // we should always resolve the icon-image value if the property was defined in the style\n        // this allows us to fire the styleimagemissing event if image evaluation returns null\n        // the only way to distinguish between null returned from a coalesce statement with no valid images\n        // and null returned because icon-image wasn't defined is to check whether or not iconImage.parameters is an empty object\n        const hasIcon = iconImage.value.kind !== 'constant' || !!iconImage.value.value || Object.keys(iconImage.parameters).length > 0;\n        const symbolSortKey = layout.get('symbol-sort-key');\n\n        this.features = [];\n\n        if (!hasText && !hasIcon) {\n            return;\n        }\n\n        const icons = options.iconDependencies;\n        const stacks = options.glyphDependencies;\n        const availableImages = options.availableImages;\n        const globalProperties = new EvaluationParameters(this.zoom);\n\n        for (const {feature, id, index, sourceLayerIndex} of features) {\n\n            const needGeometry = layer._featureFilter.needGeometry;\n            const evaluationFeature = toEvaluationFeature(feature, needGeometry);\n            if (!layer._featureFilter.filter(globalProperties, evaluationFeature, canonical)) {\n                continue;\n            }\n\n            if (!needGeometry)  evaluationFeature.geometry = loadGeometry(feature);\n\n            let text: Formatted | void;\n            if (hasText) {\n                // Expression evaluation will automatically coerce to Formatted\n                // but plain string token evaluation skips that pathway so do the\n                // conversion here.\n                const resolvedTokens = layer.getValueAndResolveTokens('text-field', evaluationFeature, canonical, availableImages);\n                const formattedText = Formatted.factory(resolvedTokens);\n\n                // on this instance: if hasRTLText is already true, all future calls to containsRTLText can be skipped.\n                const bucketHasRTLText = this.hasRTLText = (this.hasRTLText || containsRTLText(formattedText));\n                if (\n                    !bucketHasRTLText || // non-rtl text so can proceed safely\n                    rtlWorkerPlugin.getRTLTextPluginStatus() === 'unavailable' || // We don't intend to lazy-load the rtl text plugin, so proceed with incorrect shaping\n                    bucketHasRTLText && rtlWorkerPlugin.isParsed() // Use the rtlText plugin to shape text\n                ) {\n                    text = transformText(formattedText, layer, evaluationFeature);\n                }\n            }\n\n            let icon: ResolvedImage;\n            if (hasIcon) {\n                // Expression evaluation will automatically coerce to Image\n                // but plain string token evaluation skips that pathway so do the\n                // conversion here.\n                const resolvedTokens = layer.getValueAndResolveTokens('icon-image', evaluationFeature, canonical, availableImages);\n                if (resolvedTokens instanceof ResolvedImage) {\n                    icon = resolvedTokens;\n                } else {\n                    icon = ResolvedImage.fromString(resolvedTokens);\n                }\n            }\n\n            if (!text && !icon) {\n                continue;\n            }\n            const sortKey = this.sortFeaturesByKey ?\n                symbolSortKey.evaluate(evaluationFeature, {}, canonical) :\n                undefined;\n\n            const symbolFeature: SymbolFeature = {\n                id,\n                text,\n                icon,\n                index,\n                sourceLayerIndex,\n                geometry: evaluationFeature.geometry,\n                properties: feature.properties,\n                type: vectorTileFeatureTypes[feature.type],\n                sortKey\n            };\n            this.features.push(symbolFeature);\n\n            if (icon) {\n                icons[icon.name] = true;\n            }\n\n            if (text) {\n                const fontStack = textFont.evaluate(evaluationFeature, {}, canonical).join(',');\n                const textAlongLine = layout.get('text-rotation-alignment') !== 'viewport' && layout.get('symbol-placement') !== 'point';\n                this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(WritingMode.vertical) >= 0;\n                for (const section of text.sections) {\n                    if (!section.image) {\n                        const doesAllowVerticalWritingMode = allowsVerticalWritingMode(text.toString());\n                        const sectionFont = section.fontStack || fontStack;\n                        const sectionStack = stacks[sectionFont] = stacks[sectionFont] || {};\n                        this.calculateGlyphDependencies(section.text, sectionStack, textAlongLine, this.allowVerticalPlacement, doesAllowVerticalWritingMode);\n                    } else {\n                        // Add section image to the list of dependencies.\n                        icons[section.image.name] = true;\n                    }\n                }\n            }\n        }\n\n        if (layout.get('symbol-placement') === 'line') {\n            // Merge adjacent lines with the same text to improve labelling.\n            // It's better to place labels on one long line than on many short segments.\n            this.features = mergeLines(this.features);\n        }\n\n        if (this.sortFeaturesByKey) {\n            this.features.sort((a, b) => {\n                // a.sortKey is always a number when sortFeaturesByKey is true\n                return (a.sortKey as number) - (b.sortKey as number);\n            });\n        }\n    }\n\n    update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) {\n        if (!this.stateDependentLayers.length) return;\n        this.text.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, imagePositions);\n        this.icon.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, imagePositions);\n    }\n\n    isEmpty() {\n        // When the bucket encounters only rtl-text but the plugin isn't loaded, no symbol instances will be created.\n        // In order for the bucket to be serialized, and not discarded as an empty bucket both checks are necessary.\n        return this.symbolInstances.length === 0 && !this.hasRTLText;\n    }\n\n    uploadPending() {\n        return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload;\n    }\n\n    upload(context: Context) {\n        if (!this.uploaded && this.hasDebugData()) {\n            this.textCollisionBox.upload(context);\n            this.iconCollisionBox.upload(context);\n        }\n        this.text.upload(context, this.sortFeaturesByY, !this.uploaded, this.text.programConfigurations.needsUpload);\n        this.icon.upload(context, this.sortFeaturesByY, !this.uploaded, this.icon.programConfigurations.needsUpload);\n        this.uploaded = true;\n    }\n\n    destroyDebugData() {\n        this.textCollisionBox.destroy();\n        this.iconCollisionBox.destroy();\n    }\n\n    destroy() {\n        this.text.destroy();\n        this.icon.destroy();\n\n        if (this.hasDebugData()) {\n            this.destroyDebugData();\n        }\n    }\n\n    addToLineVertexArray(anchor: Anchor, line: any) {\n        const lineStartIndex = this.lineVertexArray.length;\n        if (anchor.segment !== undefined) {\n            let sumForwardLength = anchor.dist(line[anchor.segment + 1]);\n            let sumBackwardLength = anchor.dist(line[anchor.segment]);\n            const vertices = {};\n            for (let i = anchor.segment + 1; i < line.length; i++) {\n                vertices[i] = {x: line[i].x, y: line[i].y, tileUnitDistanceFromAnchor: sumForwardLength};\n                if (i < line.length - 1) {\n                    sumForwardLength += line[i + 1].dist(line[i]);\n                }\n            }\n            for (let i = anchor.segment || 0; i >= 0; i--) {\n                vertices[i] = {x: line[i].x, y: line[i].y, tileUnitDistanceFromAnchor: sumBackwardLength};\n                if (i > 0) {\n                    sumBackwardLength += line[i - 1].dist(line[i]);\n                }\n            }\n            for (let i = 0; i < line.length; i++) {\n                const vertex = vertices[i];\n                this.lineVertexArray.emplaceBack(vertex.x, vertex.y, vertex.tileUnitDistanceFromAnchor);\n            }\n        }\n        return {\n            lineStartIndex,\n            lineLength: this.lineVertexArray.length - lineStartIndex\n        };\n    }\n\n    addSymbols(arrays: SymbolBuffers,\n        quads: Array<SymbolQuad>,\n        sizeVertex: any,\n        lineOffset: [number, number],\n        alongLine: boolean,\n        feature: SymbolFeature,\n        writingMode: WritingMode,\n        labelAnchor: Anchor,\n        lineStartIndex: number,\n        lineLength: number,\n        associatedIconIndex: number,\n        canonical: CanonicalTileID) {\n        const indexArray = arrays.indexArray;\n        const layoutVertexArray = arrays.layoutVertexArray;\n\n        const segment = arrays.segments.prepareSegment(4 * quads.length, layoutVertexArray, indexArray, this.canOverlap ? feature.sortKey as number : undefined);\n        const glyphOffsetArrayStart = this.glyphOffsetArray.length;\n        const vertexStartIndex = segment.vertexLength;\n\n        const angle = (this.allowVerticalPlacement && writingMode === WritingMode.vertical) ? Math.PI / 2 : 0;\n\n        const sections = feature.text && feature.text.sections;\n\n        for (let i = 0; i < quads.length; i++) {\n            const {tl, tr, bl, br, tex, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY, glyphOffset, isSDF, sectionIndex} = quads[i];\n            const index = segment.vertexLength;\n\n            const y = glyphOffset[1];\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, tl.x, y + tl.y, tex.x, tex.y, sizeVertex, isSDF, pixelOffsetTL.x, pixelOffsetTL.y, minFontScaleX, minFontScaleY);\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, tr.x, y + tr.y, tex.x + tex.w, tex.y, sizeVertex, isSDF, pixelOffsetBR.x, pixelOffsetTL.y, minFontScaleX, minFontScaleY);\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, bl.x, y + bl.y, tex.x, tex.y + tex.h, sizeVertex, isSDF, pixelOffsetTL.x, pixelOffsetBR.y, minFontScaleX, minFontScaleY);\n            addVertex(layoutVertexArray, labelAnchor.x, labelAnchor.y, br.x, y + br.y, tex.x + tex.w, tex.y + tex.h, sizeVertex, isSDF, pixelOffsetBR.x, pixelOffsetBR.y, minFontScaleX, minFontScaleY);\n\n            addDynamicAttributes(arrays.dynamicLayoutVertexArray, labelAnchor, angle);\n\n            indexArray.emplaceBack(index, index + 1, index + 2);\n            indexArray.emplaceBack(index + 1, index + 2, index + 3);\n\n            segment.vertexLength += 4;\n            segment.primitiveLength += 2;\n\n            this.glyphOffsetArray.emplaceBack(glyphOffset[0]);\n\n            if (i === quads.length - 1 || sectionIndex !== quads[i + 1].sectionIndex) {\n                arrays.programConfigurations.populatePaintArrays(layoutVertexArray.length, feature, feature.index, {}, canonical, sections && sections[sectionIndex]);\n            }\n        }\n\n        arrays.placedSymbolArray.emplaceBack(\n            labelAnchor.x, labelAnchor.y,\n            glyphOffsetArrayStart,\n            this.glyphOffsetArray.length - glyphOffsetArrayStart,\n            vertexStartIndex,\n            lineStartIndex,\n            lineLength,\n            labelAnchor.segment,\n            sizeVertex ? sizeVertex[0] : 0,\n            sizeVertex ? sizeVertex[1] : 0,\n            lineOffset[0], lineOffset[1],\n            writingMode,\n            // placedOrientation is null initially; will be updated to horizontal(1)/vertical(2) if placed\n            0,\n            false as unknown as number,\n            // The crossTileID is only filled/used on the foreground for dynamic text anchors\n            0,\n            associatedIconIndex\n        );\n    }\n\n    _addCollisionDebugVertex(layoutVertexArray: StructArray, collisionVertexArray: StructArray, point: Point, anchorX: number, anchorY: number, extrude: Point) {\n        collisionVertexArray.emplaceBack(0, 0);\n        return layoutVertexArray.emplaceBack(\n            // pos\n            point.x,\n            point.y,\n            // a_anchor_pos\n            anchorX,\n            anchorY,\n            // extrude\n            Math.round(extrude.x),\n            Math.round(extrude.y));\n    }\n\n    addCollisionDebugVertices(x1: number, y1: number, x2: number, y2: number, arrays: CollisionBuffers, boxAnchorPoint: Point, symbolInstance: SymbolInstance) {\n        const segment = arrays.segments.prepareSegment(4, arrays.layoutVertexArray, arrays.indexArray);\n        const index = segment.vertexLength;\n\n        const layoutVertexArray = arrays.layoutVertexArray;\n        const collisionVertexArray = arrays.collisionVertexArray;\n\n        const anchorX = symbolInstance.anchorX;\n        const anchorY = symbolInstance.anchorY;\n\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x1, y1));\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x2, y1));\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x2, y2));\n        this._addCollisionDebugVertex(layoutVertexArray, collisionVertexArray, boxAnchorPoint, anchorX, anchorY, new Point(x1, y2));\n\n        segment.vertexLength += 4;\n\n        const indexArray = arrays.indexArray as LineIndexArray;\n        indexArray.emplaceBack(index, index + 1);\n        indexArray.emplaceBack(index + 1, index + 2);\n        indexArray.emplaceBack(index + 2, index + 3);\n        indexArray.emplaceBack(index + 3, index);\n\n        segment.primitiveLength += 4;\n    }\n\n    addDebugCollisionBoxes(startIndex: number, endIndex: number, symbolInstance: SymbolInstance, isText: boolean) {\n        for (let b = startIndex; b < endIndex; b++) {\n            const box: CollisionBox = this.collisionBoxArray.get(b);\n            const x1 = box.x1;\n            const y1 = box.y1;\n            const x2 = box.x2;\n            const y2 = box.y2;\n\n            this.addCollisionDebugVertices(x1, y1, x2, y2,\n                isText ? this.textCollisionBox : this.iconCollisionBox,\n                box.anchorPoint, symbolInstance);\n        }\n    }\n\n    generateCollisionDebugBuffers() {\n        if (this.hasDebugData()) {\n            this.destroyDebugData();\n        }\n\n        this.textCollisionBox = new CollisionBuffers(CollisionBoxLayoutArray, collisionBoxLayout.members, LineIndexArray);\n        this.iconCollisionBox = new CollisionBuffers(CollisionBoxLayoutArray, collisionBoxLayout.members, LineIndexArray);\n\n        for (let i = 0; i < this.symbolInstances.length; i++) {\n            const symbolInstance = this.symbolInstances.get(i);\n            this.addDebugCollisionBoxes(symbolInstance.textBoxStartIndex, symbolInstance.textBoxEndIndex, symbolInstance, true);\n            this.addDebugCollisionBoxes(symbolInstance.verticalTextBoxStartIndex, symbolInstance.verticalTextBoxEndIndex, symbolInstance, true);\n            this.addDebugCollisionBoxes(symbolInstance.iconBoxStartIndex, symbolInstance.iconBoxEndIndex, symbolInstance, false);\n            this.addDebugCollisionBoxes(symbolInstance.verticalIconBoxStartIndex, symbolInstance.verticalIconBoxEndIndex, symbolInstance, false);\n        }\n    }\n\n    // These flat arrays are meant to be quicker to iterate over than the source\n    // CollisionBoxArray\n    _deserializeCollisionBoxesForSymbol(\n        collisionBoxArray: CollisionBoxArray,\n        textStartIndex: number,\n        textEndIndex: number,\n        verticalTextStartIndex: number,\n        verticalTextEndIndex: number,\n        iconStartIndex: number,\n        iconEndIndex: number,\n        verticalIconStartIndex: number,\n        verticalIconEndIndex: number\n    ): CollisionArrays {\n\n        const collisionArrays = {} as CollisionArrays;\n        for (let k = textStartIndex; k < textEndIndex; k++) {\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.textBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.textFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        for (let k = verticalTextStartIndex; k < verticalTextEndIndex; k++) {\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.verticalTextBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.verticalTextFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        for (let k = iconStartIndex; k < iconEndIndex; k++) {\n            // An icon can only have one box now, so this indexing is a bit vestigial...\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.iconBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.iconFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        for (let k = verticalIconStartIndex; k < verticalIconEndIndex; k++) {\n            // An icon can only have one box now, so this indexing is a bit vestigial...\n            const box: CollisionBox = collisionBoxArray.get(k);\n            collisionArrays.verticalIconBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY};\n            collisionArrays.verticalIconFeatureIndex = box.featureIndex;\n            break; // Only one box allowed per instance\n        }\n        return collisionArrays;\n    }\n\n    deserializeCollisionBoxes(collisionBoxArray: CollisionBoxArray) {\n        this.collisionArrays = [];\n        for (let i = 0; i < this.symbolInstances.length; i++) {\n            const symbolInstance = this.symbolInstances.get(i);\n            this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(\n                collisionBoxArray,\n                symbolInstance.textBoxStartIndex,\n                symbolInstance.textBoxEndIndex,\n                symbolInstance.verticalTextBoxStartIndex,\n                symbolInstance.verticalTextBoxEndIndex,\n                symbolInstance.iconBoxStartIndex,\n                symbolInstance.iconBoxEndIndex,\n                symbolInstance.verticalIconBoxStartIndex,\n                symbolInstance.verticalIconBoxEndIndex\n            ));\n        }\n    }\n\n    hasTextData() {\n        return this.text.segments.get().length > 0;\n    }\n\n    hasIconData() {\n        return this.icon.segments.get().length > 0;\n    }\n\n    hasDebugData() {\n        return this.textCollisionBox && this.iconCollisionBox;\n    }\n\n    hasTextCollisionBoxData() {\n        return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0;\n    }\n\n    hasIconCollisionBoxData() {\n        return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0;\n    }\n\n    addIndicesForPlacedSymbol(iconOrText: SymbolBuffers, placedSymbolIndex: number) {\n        const placedSymbol = iconOrText.placedSymbolArray.get(placedSymbolIndex);\n\n        const endIndex = placedSymbol.vertexStartIndex + placedSymbol.numGlyphs * 4;\n        for (let vertexIndex = placedSymbol.vertexStartIndex; vertexIndex < endIndex; vertexIndex += 4) {\n            iconOrText.indexArray.emplaceBack(vertexIndex, vertexIndex + 1, vertexIndex + 2);\n            iconOrText.indexArray.emplaceBack(vertexIndex + 1, vertexIndex + 2, vertexIndex + 3);\n        }\n    }\n\n    getSortedSymbolIndexes(angle: number) {\n        if (this.sortedAngle === angle && this.symbolInstanceIndexes !== undefined) {\n            return this.symbolInstanceIndexes;\n        }\n        const sin = Math.sin(angle);\n        const cos = Math.cos(angle);\n        const rotatedYs = [];\n        const featureIndexes = [];\n        const result = [];\n\n        for (let i = 0; i < this.symbolInstances.length; ++i) {\n            result.push(i);\n            const symbolInstance = this.symbolInstances.get(i);\n            rotatedYs.push(Math.round(sin * symbolInstance.anchorX + cos * symbolInstance.anchorY) | 0);\n            featureIndexes.push(symbolInstance.featureIndex);\n        }\n\n        result.sort((aIndex, bIndex) => {\n            return (rotatedYs[aIndex] - rotatedYs[bIndex]) ||\n                   (featureIndexes[bIndex] - featureIndexes[aIndex]);\n        });\n\n        return result;\n    }\n\n    addToSortKeyRanges(symbolInstanceIndex: number, sortKey: number) {\n        const last = this.sortKeyRanges[this.sortKeyRanges.length - 1];\n        if (last && last.sortKey === sortKey) {\n            last.symbolInstanceEnd = symbolInstanceIndex + 1;\n        } else {\n            this.sortKeyRanges.push({\n                sortKey,\n                symbolInstanceStart: symbolInstanceIndex,\n                symbolInstanceEnd: symbolInstanceIndex + 1\n            });\n        }\n    }\n\n    sortFeatures(angle: number) {\n        if (!this.sortFeaturesByY) return;\n        if (this.sortedAngle === angle) return;\n\n        // The current approach to sorting doesn't sort across segments so don't try.\n        // Sorting within segments separately seemed not to be worth the complexity.\n        if (this.text.segments.get().length > 1 || this.icon.segments.get().length > 1) return;\n\n        // If the symbols are allowed to overlap sort them by their vertical screen position.\n        // The index array buffer is rewritten to reference the (unchanged) vertices in the\n        // sorted order.\n\n        // To avoid sorting the actual symbolInstance array we sort an array of indexes.\n        this.symbolInstanceIndexes = this.getSortedSymbolIndexes(angle);\n        this.sortedAngle = angle;\n\n        this.text.indexArray.clear();\n        this.icon.indexArray.clear();\n\n        this.featureSortOrder = [];\n\n        for (const i of this.symbolInstanceIndexes) {\n            const symbolInstance = this.symbolInstances.get(i);\n            this.featureSortOrder.push(symbolInstance.featureIndex);\n\n            [\n                symbolInstance.rightJustifiedTextSymbolIndex,\n                symbolInstance.centerJustifiedTextSymbolIndex,\n                symbolInstance.leftJustifiedTextSymbolIndex\n            ].forEach((index, i, array) => {\n                // Only add a given index the first time it shows up,\n                // to avoid duplicate opacity entries when multiple justifications\n                // share the same glyphs.\n                if (index >= 0 && array.indexOf(index) === i) {\n                    this.addIndicesForPlacedSymbol(this.text, index);\n                }\n            });\n\n            if (symbolInstance.verticalPlacedTextSymbolIndex >= 0) {\n                this.addIndicesForPlacedSymbol(this.text, symbolInstance.verticalPlacedTextSymbolIndex);\n            }\n\n            if (symbolInstance.placedIconSymbolIndex >= 0) {\n                this.addIndicesForPlacedSymbol(this.icon, symbolInstance.placedIconSymbolIndex);\n            }\n\n            if (symbolInstance.verticalPlacedIconSymbolIndex >= 0) {\n                this.addIndicesForPlacedSymbol(this.icon, symbolInstance.verticalPlacedIconSymbolIndex);\n            }\n        }\n\n        if (this.text.indexBuffer) this.text.indexBuffer.updateData(this.text.indexArray);\n        if (this.icon.indexBuffer) this.icon.indexBuffer.updateData(this.icon.indexArray);\n    }\n}\n\nregister('SymbolBucket', SymbolBucket, {\n    omit: ['layers', 'collisionBoxArray', 'features', 'compareText']\n});\n\n// this constant is based on the size of StructArray indexes used in a symbol\n// bucket--namely, glyphOffsetArrayStart\n// eg the max valid UInt16 is 65,535\n// See https://github.com/mapbox/mapbox-gl-js/issues/2907 for motivation\n// lineStartIndex and textBoxStartIndex could potentially be concerns\n// but we expect there to be many fewer boxes/lines than glyphs\nSymbolBucket.MAX_GLYPHS = 65535;\n\nSymbolBucket.addDynamicAttributes = addDynamicAttributes;\n\nexport {addDynamicAttributes};\n", "import type {SymbolFeature} from '../data/bucket/symbol_bucket';\n\nexport function mergeLines(features: Array<SymbolFeature>): Array<SymbolFeature> {\n    const leftIndex: {[_: string]: number} = {};\n    const rightIndex: {[_: string]: number} = {};\n    const mergedFeatures = [];\n    let mergedIndex = 0;\n\n    function add(k) {\n        mergedFeatures.push(features[k]);\n        mergedIndex++;\n    }\n\n    function mergeFromRight(leftKey: string, rightKey: string, geom) {\n        const i = rightIndex[leftKey];\n        delete rightIndex[leftKey];\n        rightIndex[rightKey] = i;\n\n        mergedFeatures[i].geometry[0].pop();\n        mergedFeatures[i].geometry[0] = mergedFeatures[i].geometry[0].concat(geom[0]);\n        return i;\n    }\n\n    function mergeFromLeft(leftKey: string, rightKey: string, geom) {\n        const i = leftIndex[rightKey];\n        delete leftIndex[rightKey];\n        leftIndex[leftKey] = i;\n\n        mergedFeatures[i].geometry[0].shift();\n        mergedFeatures[i].geometry[0] = geom[0].concat(mergedFeatures[i].geometry[0]);\n        return i;\n    }\n\n    function getKey(text, geom, onRight?) {\n        const point = onRight ? geom[0][geom[0].length - 1] : geom[0][0];\n        return `${text}:${point.x}:${point.y}`;\n    }\n\n    for (let k = 0; k < features.length; k++) {\n        const feature = features[k];\n        const geom = feature.geometry;\n        const text = feature.text ? feature.text.toString() : null;\n\n        if (!text) {\n            add(k);\n            continue;\n        }\n\n        const leftKey = getKey(text, geom),\n            rightKey = getKey(text, geom, true);\n\n        if ((leftKey in rightIndex) && (rightKey in leftIndex) && (rightIndex[leftKey] !== leftIndex[rightKey])) {\n            // found lines with the same text adjacent to both ends of the current line, merge all three\n            const j = mergeFromLeft(leftKey, rightKey, geom);\n            const i = mergeFromRight(leftKey, rightKey, mergedFeatures[j].geometry);\n\n            delete leftIndex[leftKey];\n            delete rightIndex[rightKey];\n\n            rightIndex[getKey(text, mergedFeatures[i].geometry, true)] = i;\n            mergedFeatures[j].geometry = null;\n\n        } else if (leftKey in rightIndex) {\n            // found mergeable line adjacent to the start of the current line, merge\n            mergeFromRight(leftKey, rightKey, geom);\n\n        } else if (rightKey in leftIndex) {\n            // found mergeable line adjacent to the end of the current line, merge\n            mergeFromLeft(leftKey, rightKey, geom);\n\n        } else {\n            // no adjacent lines, add as a new item\n            add(k);\n            leftIndex[leftKey] = mergedIndex - 1;\n            rightIndex[rightKey] = mergedIndex - 1;\n        }\n    }\n\n    return mergedFeatures.filter((f) => f.geometry);\n}\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n            ColorType\n        } from '@maplibre/maplibre-gl-style-spec';\n        \nexport type SymbolLayoutProps = {\n    \"symbol-placement\": DataConstantProperty<\"point\" | \"line\" | \"line-center\">,\n    \"symbol-spacing\": DataConstantProperty<number>,\n    \"symbol-avoid-edges\": DataConstantProperty<boolean>,\n    \"symbol-sort-key\": DataDrivenProperty<number>,\n    \"symbol-z-order\": DataConstantProperty<\"auto\" | \"viewport-y\" | \"source\">,\n    \"icon-allow-overlap\": DataConstantProperty<boolean>,\n    \"icon-overlap\": DataConstantProperty<\"never\" | \"always\" | \"cooperative\">,\n    \"icon-ignore-placement\": DataConstantProperty<boolean>,\n    \"icon-optional\": DataConstantProperty<boolean>,\n    \"icon-rotation-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"auto\">,\n    \"icon-size\": DataDrivenProperty<number>,\n    \"icon-text-fit\": DataConstantProperty<\"none\" | \"width\" | \"height\" | \"both\">,\n    \"icon-text-fit-padding\": DataConstantProperty<[number, number, number, number]>,\n    \"icon-image\": DataDrivenProperty<ResolvedImage>,\n    \"icon-rotate\": DataDrivenProperty<number>,\n    \"icon-padding\": DataDrivenProperty<Padding>,\n    \"icon-keep-upright\": DataConstantProperty<boolean>,\n    \"icon-offset\": DataDrivenProperty<[number, number]>,\n    \"icon-anchor\": DataDrivenProperty<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"icon-pitch-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"auto\">,\n    \"text-pitch-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"auto\">,\n    \"text-rotation-alignment\": DataConstantProperty<\"map\" | \"viewport\" | \"viewport-glyph\" | \"auto\">,\n    \"text-field\": DataDrivenProperty<Formatted>,\n    \"text-font\": DataDrivenProperty<Array<string>>,\n    \"text-size\": DataDrivenProperty<number>,\n    \"text-max-width\": DataDrivenProperty<number>,\n    \"text-line-height\": DataConstantProperty<number>,\n    \"text-letter-spacing\": DataDrivenProperty<number>,\n    \"text-justify\": DataDrivenProperty<\"auto\" | \"left\" | \"center\" | \"right\">,\n    \"text-radial-offset\": DataDrivenProperty<number>,\n    \"text-variable-anchor\": DataConstantProperty<Array<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">>,\n    \"text-variable-anchor-offset\": DataDrivenProperty<VariableAnchorOffsetCollection>,\n    \"text-anchor\": DataDrivenProperty<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"text-max-angle\": DataConstantProperty<number>,\n    \"text-writing-mode\": DataConstantProperty<Array<\"horizontal\" | \"vertical\">>,\n    \"text-rotate\": DataDrivenProperty<number>,\n    \"text-padding\": DataConstantProperty<number>,\n    \"text-keep-upright\": DataConstantProperty<boolean>,\n    \"text-transform\": DataDrivenProperty<\"none\" | \"uppercase\" | \"lowercase\">,\n    \"text-offset\": DataDrivenProperty<[number, number]>,\n    \"text-allow-overlap\": DataConstantProperty<boolean>,\n    \"text-overlap\": DataConstantProperty<\"never\" | \"always\" | \"cooperative\">,\n    \"text-ignore-placement\": DataConstantProperty<boolean>,\n    \"text-optional\": DataConstantProperty<boolean>,\n};\n\nexport type SymbolLayoutPropsPossiblyEvaluated = {\n    \"symbol-placement\": \"point\" | \"line\" | \"line-center\",\n    \"symbol-spacing\": number,\n    \"symbol-avoid-edges\": boolean,\n    \"symbol-sort-key\": PossiblyEvaluatedPropertyValue<number>,\n    \"symbol-z-order\": \"auto\" | \"viewport-y\" | \"source\",\n    \"icon-allow-overlap\": boolean,\n    \"icon-overlap\": \"never\" | \"always\" | \"cooperative\",\n    \"icon-ignore-placement\": boolean,\n    \"icon-optional\": boolean,\n    \"icon-rotation-alignment\": \"map\" | \"viewport\" | \"auto\",\n    \"icon-size\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-text-fit\": \"none\" | \"width\" | \"height\" | \"both\",\n    \"icon-text-fit-padding\": [number, number, number, number],\n    \"icon-image\": PossiblyEvaluatedPropertyValue<ResolvedImage>,\n    \"icon-rotate\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-padding\": PossiblyEvaluatedPropertyValue<Padding>,\n    \"icon-keep-upright\": boolean,\n    \"icon-offset\": PossiblyEvaluatedPropertyValue<[number, number]>,\n    \"icon-anchor\": PossiblyEvaluatedPropertyValue<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"icon-pitch-alignment\": \"map\" | \"viewport\" | \"auto\",\n    \"text-pitch-alignment\": \"map\" | \"viewport\" | \"auto\",\n    \"text-rotation-alignment\": \"map\" | \"viewport\" | \"viewport-glyph\" | \"auto\",\n    \"text-field\": PossiblyEvaluatedPropertyValue<Formatted>,\n    \"text-font\": PossiblyEvaluatedPropertyValue<Array<string>>,\n    \"text-size\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-max-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-line-height\": number,\n    \"text-letter-spacing\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-justify\": PossiblyEvaluatedPropertyValue<\"auto\" | \"left\" | \"center\" | \"right\">,\n    \"text-radial-offset\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-variable-anchor\": Array<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"text-variable-anchor-offset\": PossiblyEvaluatedPropertyValue<VariableAnchorOffsetCollection>,\n    \"text-anchor\": PossiblyEvaluatedPropertyValue<\"center\" | \"left\" | \"right\" | \"top\" | \"bottom\" | \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\">,\n    \"text-max-angle\": number,\n    \"text-writing-mode\": Array<\"horizontal\" | \"vertical\">,\n    \"text-rotate\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-padding\": number,\n    \"text-keep-upright\": boolean,\n    \"text-transform\": PossiblyEvaluatedPropertyValue<\"none\" | \"uppercase\" | \"lowercase\">,\n    \"text-offset\": PossiblyEvaluatedPropertyValue<[number, number]>,\n    \"text-allow-overlap\": boolean,\n    \"text-overlap\": \"never\" | \"always\" | \"cooperative\",\n    \"text-ignore-placement\": boolean,\n    \"text-optional\": boolean,\n};\n\nlet layout: Properties<SymbolLayoutProps>;\nconst getLayout = () => layout = layout || new Properties({\n    \"symbol-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-placement\"] as any as StylePropertySpecification),\n    \"symbol-spacing\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-spacing\"] as any as StylePropertySpecification),\n    \"symbol-avoid-edges\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-avoid-edges\"] as any as StylePropertySpecification),\n    \"symbol-sort-key\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"symbol-sort-key\"] as any as StylePropertySpecification),\n    \"symbol-z-order\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"symbol-z-order\"] as any as StylePropertySpecification),\n    \"icon-allow-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-allow-overlap\"] as any as StylePropertySpecification),\n    \"icon-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-overlap\"] as any as StylePropertySpecification),\n    \"icon-ignore-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-ignore-placement\"] as any as StylePropertySpecification),\n    \"icon-optional\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-optional\"] as any as StylePropertySpecification),\n    \"icon-rotation-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-rotation-alignment\"] as any as StylePropertySpecification),\n    \"icon-size\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-size\"] as any as StylePropertySpecification),\n    \"icon-text-fit\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-text-fit\"] as any as StylePropertySpecification),\n    \"icon-text-fit-padding\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-text-fit-padding\"] as any as StylePropertySpecification),\n    \"icon-image\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-image\"] as any as StylePropertySpecification),\n    \"icon-rotate\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-rotate\"] as any as StylePropertySpecification),\n    \"icon-padding\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-padding\"] as any as StylePropertySpecification),\n    \"icon-keep-upright\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-keep-upright\"] as any as StylePropertySpecification),\n    \"icon-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-offset\"] as any as StylePropertySpecification),\n    \"icon-anchor\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"icon-anchor\"] as any as StylePropertySpecification),\n    \"icon-pitch-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"icon-pitch-alignment\"] as any as StylePropertySpecification),\n    \"text-pitch-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-pitch-alignment\"] as any as StylePropertySpecification),\n    \"text-rotation-alignment\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-rotation-alignment\"] as any as StylePropertySpecification),\n    \"text-field\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-field\"] as any as StylePropertySpecification),\n    \"text-font\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-font\"] as any as StylePropertySpecification),\n    \"text-size\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-size\"] as any as StylePropertySpecification),\n    \"text-max-width\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-max-width\"] as any as StylePropertySpecification),\n    \"text-line-height\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-line-height\"] as any as StylePropertySpecification),\n    \"text-letter-spacing\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-letter-spacing\"] as any as StylePropertySpecification),\n    \"text-justify\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-justify\"] as any as StylePropertySpecification),\n    \"text-radial-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-radial-offset\"] as any as StylePropertySpecification),\n    \"text-variable-anchor\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-variable-anchor\"] as any as StylePropertySpecification),\n    \"text-variable-anchor-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-variable-anchor-offset\"] as any as StylePropertySpecification),\n    \"text-anchor\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-anchor\"] as any as StylePropertySpecification),\n    \"text-max-angle\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-max-angle\"] as any as StylePropertySpecification),\n    \"text-writing-mode\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-writing-mode\"] as any as StylePropertySpecification),\n    \"text-rotate\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-rotate\"] as any as StylePropertySpecification),\n    \"text-padding\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-padding\"] as any as StylePropertySpecification),\n    \"text-keep-upright\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-keep-upright\"] as any as StylePropertySpecification),\n    \"text-transform\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-transform\"] as any as StylePropertySpecification),\n    \"text-offset\": new DataDrivenProperty(styleSpec[\"layout_symbol\"][\"text-offset\"] as any as StylePropertySpecification),\n    \"text-allow-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-allow-overlap\"] as any as StylePropertySpecification),\n    \"text-overlap\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-overlap\"] as any as StylePropertySpecification),\n    \"text-ignore-placement\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-ignore-placement\"] as any as StylePropertySpecification),\n    \"text-optional\": new DataConstantProperty(styleSpec[\"layout_symbol\"][\"text-optional\"] as any as StylePropertySpecification),\n});\n\nexport type SymbolPaintProps = {\n    \"icon-opacity\": DataDrivenProperty<number>,\n    \"icon-color\": DataDrivenProperty<Color>,\n    \"icon-halo-color\": DataDrivenProperty<Color>,\n    \"icon-halo-width\": DataDrivenProperty<number>,\n    \"icon-halo-blur\": DataDrivenProperty<number>,\n    \"icon-translate\": DataConstantProperty<[number, number]>,\n    \"icon-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n    \"text-opacity\": DataDrivenProperty<number>,\n    \"text-color\": DataDrivenProperty<Color>,\n    \"text-halo-color\": DataDrivenProperty<Color>,\n    \"text-halo-width\": DataDrivenProperty<number>,\n    \"text-halo-blur\": DataDrivenProperty<number>,\n    \"text-translate\": DataConstantProperty<[number, number]>,\n    \"text-translate-anchor\": DataConstantProperty<\"map\" | \"viewport\">,\n};\n\nexport type SymbolPaintPropsPossiblyEvaluated = {\n    \"icon-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"icon-halo-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"icon-halo-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-halo-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"icon-translate\": [number, number],\n    \"icon-translate-anchor\": \"map\" | \"viewport\",\n    \"text-opacity\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"text-halo-color\": PossiblyEvaluatedPropertyValue<Color>,\n    \"text-halo-width\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-halo-blur\": PossiblyEvaluatedPropertyValue<number>,\n    \"text-translate\": [number, number],\n    \"text-translate-anchor\": \"map\" | \"viewport\",\n};\n\nlet paint: Properties<SymbolPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"icon-opacity\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-opacity\"] as any as StylePropertySpecification),\n    \"icon-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-color\"] as any as StylePropertySpecification),\n    \"icon-halo-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-color\"] as any as StylePropertySpecification),\n    \"icon-halo-width\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-width\"] as any as StylePropertySpecification),\n    \"icon-halo-blur\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"icon-halo-blur\"] as any as StylePropertySpecification),\n    \"icon-translate\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"icon-translate\"] as any as StylePropertySpecification),\n    \"icon-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"icon-translate-anchor\"] as any as StylePropertySpecification),\n    \"text-opacity\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-opacity\"] as any as StylePropertySpecification),\n    \"text-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-color\"] as any as StylePropertySpecification, { runtimeType: ColorType, getOverride: (o) => o.textColor, hasOverride: (o) => !!o.textColor }),\n    \"text-halo-color\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-color\"] as any as StylePropertySpecification),\n    \"text-halo-width\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-width\"] as any as StylePropertySpecification),\n    \"text-halo-blur\": new DataDrivenProperty(styleSpec[\"paint_symbol\"][\"text-halo-blur\"] as any as StylePropertySpecification),\n    \"text-translate\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"text-translate\"] as any as StylePropertySpecification),\n    \"text-translate-anchor\": new DataConstantProperty(styleSpec[\"paint_symbol\"][\"text-translate-anchor\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() }, get layout() { return getLayout() } });", "import type {Expression, EvaluationContext, Type, ZoomConstantExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {NullType} from '@maplibre/maplibre-gl-style-spec';\nimport {PossiblyEvaluatedPropertyValue} from './properties';\nimport {register} from '../util/web_worker_transfer';\n\n// This is an internal expression class. It is only used in GL JS and\n// has GL JS dependencies which can break the standalone style-spec module\nexport class FormatSectionOverride<T> implements Expression {\n    type: Type;\n    defaultValue: PossiblyEvaluatedPropertyValue<T>;\n\n    constructor(defaultValue: PossiblyEvaluatedPropertyValue<T>) {\n        if (defaultValue.property.overrides === undefined) throw new Error('overrides must be provided to instantiate FormatSectionOverride class');\n        this.type = defaultValue.property.overrides ? defaultValue.property.overrides.runtimeType : NullType;\n        this.defaultValue = defaultValue;\n    }\n\n    evaluate(ctx: EvaluationContext) {\n        if (ctx.formattedSection) {\n            const overrides = this.defaultValue.property.overrides;\n            if (overrides && overrides.hasOverride(ctx.formattedSection)) {\n                return overrides.getOverride(ctx.formattedSection);\n            }\n        }\n\n        if (ctx.feature && ctx.featureState) {\n            return this.defaultValue.evaluate(ctx.feature, ctx.featureState);\n        }\n\n        return this.defaultValue.property.specification.default;\n    }\n\n    eachChild(fn: (_: Expression) => void) {\n        if (!this.defaultValue.isConstant()) {\n            const expr: ZoomConstantExpression<'source'> = (this.defaultValue.value as any);\n            fn(expr._styleExpression.expression);\n        }\n    }\n\n    // Cannot be statically evaluated, as the output depends on the evaluation context.\n    outputDefined() {\n        return false;\n    }\n\n    serialize() {\n        return null;\n    }\n}\n\nregister('FormatSectionOverride', FormatSectionOverride, {omit: ['defaultValue']});\n", "import {StyleLayer} from '../style_layer';\n\nimport {SymbolBucket, SymbolFeature} from '../../data/bucket/symbol_bucket';\nimport {resolveTokens} from '../../util/resolve_tokens';\nimport properties, {SymbolLayoutPropsPossiblyEvaluated, SymbolPaintPropsPossiblyEvaluated} from './symbol_style_layer_properties.g';\n\nimport {\n    Transitionable,\n    Transitioning,\n    Layout,\n    PossiblyEvaluated,\n    PossiblyEvaluatedPropertyValue,\n    PropertyValue\n} from '../properties';\n\nimport {\n    isExpression,\n    StyleExpression,\n    ZoomConstantExpression,\n    ZoomDependentExpression,\n    FormattedType,\n    typeOf,\n    Formatted,\n    FormatExpression,\n    Literal} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {BucketParameters} from '../../data/bucket';\nimport type {SymbolLayoutProps, SymbolPaintProps} from './symbol_style_layer_properties.g';\nimport type {EvaluationParameters} from '../evaluation_parameters';\nimport type {Expression, Feature, SourceExpression, LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanonicalTileID} from '../../source/tile_id';\nimport {FormatSectionOverride} from '../format_section_override';\n\nexport class SymbolStyleLayer extends StyleLayer {\n    _unevaluatedLayout: Layout<SymbolLayoutProps>;\n    layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>;\n\n    _transitionablePaint: Transitionable<SymbolPaintProps>;\n    _transitioningPaint: Transitioning<SymbolPaintProps>;\n    paint: PossiblyEvaluated<SymbolPaintProps, SymbolPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n\n    recalculate(parameters: EvaluationParameters, availableImages: Array<string>) {\n        super.recalculate(parameters, availableImages);\n\n        if (this.layout.get('icon-rotation-alignment') === 'auto') {\n            if (this.layout.get('symbol-placement') !== 'point') {\n                this.layout._values['icon-rotation-alignment'] = 'map';\n            } else {\n                this.layout._values['icon-rotation-alignment'] = 'viewport';\n            }\n        }\n\n        if (this.layout.get('text-rotation-alignment') === 'auto') {\n            if (this.layout.get('symbol-placement') !== 'point') {\n                this.layout._values['text-rotation-alignment'] = 'map';\n            } else {\n                this.layout._values['text-rotation-alignment'] = 'viewport';\n            }\n        }\n\n        // If unspecified, `*-pitch-alignment` inherits `*-rotation-alignment`\n        if (this.layout.get('text-pitch-alignment') === 'auto') {\n            this.layout._values['text-pitch-alignment'] = this.layout.get('text-rotation-alignment') === 'map' ? 'map' : 'viewport';\n        }\n        if (this.layout.get('icon-pitch-alignment') === 'auto') {\n            this.layout._values['icon-pitch-alignment'] = this.layout.get('icon-rotation-alignment');\n        }\n\n        if (this.layout.get('symbol-placement') === 'point') {\n            const writingModes = this.layout.get('text-writing-mode');\n            if (writingModes) {\n                // remove duplicates, preserving order\n                const deduped = [];\n                for (const m of writingModes) {\n                    if (deduped.indexOf(m) < 0) deduped.push(m);\n                }\n                this.layout._values['text-writing-mode'] = deduped;\n            } else {\n                this.layout._values['text-writing-mode'] = ['horizontal'];\n            }\n        }\n\n        this._setPaintOverrides();\n    }\n\n    getValueAndResolveTokens(name: any, feature: Feature, canonical: CanonicalTileID, availableImages: Array<string>) {\n        const value = this.layout.get(name).evaluate(feature, {}, canonical, availableImages);\n        const unevaluated = this._unevaluatedLayout._values[name];\n        if (!unevaluated.isDataDriven() && !isExpression(unevaluated.value) && value) {\n            return resolveTokens(feature.properties, value);\n        }\n\n        return value;\n    }\n\n    createBucket(parameters: BucketParameters<any>) {\n        return new SymbolBucket(parameters);\n    }\n\n    queryRadius(): number {\n        return 0;\n    }\n\n    queryIntersectsFeature(): boolean {\n        throw new Error('Should take a different path in FeatureIndex');\n    }\n\n    _setPaintOverrides() {\n        for (const overridable of properties.paint.overridableProperties) {\n            if (!SymbolStyleLayer.hasPaintOverride(this.layout, overridable)) {\n                continue;\n            }\n            const overridden = this.paint.get(overridable as keyof SymbolPaintPropsPossiblyEvaluated) as PossiblyEvaluatedPropertyValue<number>;\n            const override = new FormatSectionOverride(overridden);\n            const styleExpression = new StyleExpression(override, overridden.property.specification);\n            let expression = null;\n            if (overridden.value.kind === 'constant' || overridden.value.kind === 'source') {\n                expression = new ZoomConstantExpression('source', styleExpression) as SourceExpression;\n            } else {\n                expression = new ZoomDependentExpression('composite',\n                    styleExpression,\n                    overridden.value.zoomStops);\n            }\n            this.paint._values[overridable] = new PossiblyEvaluatedPropertyValue(overridden.property,\n                expression,\n                overridden.parameters);\n        }\n    }\n\n    _handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean {\n        if (!this.layout || oldValue.isDataDriven() || newValue.isDataDriven()) {\n            return false;\n        }\n        return SymbolStyleLayer.hasPaintOverride(this.layout, name);\n    }\n\n    static hasPaintOverride(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, propertyName: string): boolean {\n        const textField = layout.get('text-field');\n        const property = properties.paint.properties[propertyName];\n        let hasOverrides = false;\n\n        const checkSections = (sections) => {\n            for (const section of sections) {\n                if (property.overrides && property.overrides.hasOverride(section)) {\n                    hasOverrides = true;\n                    return;\n                }\n            }\n        };\n\n        if (textField.value.kind === 'constant' && textField.value.value instanceof Formatted) {\n            checkSections(textField.value.value.sections);\n        } else if (textField.value.kind === 'source') {\n\n            const checkExpression = (expression: Expression) => {\n                if (hasOverrides) return;\n\n                if (expression instanceof Literal && typeOf(expression.value) === FormattedType) {\n                    const formatted: Formatted = (expression.value as any);\n                    checkSections(formatted.sections);\n                } else if (expression instanceof FormatExpression) {\n                    checkSections(expression.sections);\n                } else {\n                    expression.eachChild(checkExpression);\n                }\n            };\n\n            const expr: ZoomConstantExpression<'source'> = (textField.value as any);\n            if (expr._styleExpression) {\n                checkExpression(expr._styleExpression.expression);\n            }\n        }\n\n        return hasOverrides;\n    }\n}\n\nexport type SymbolPadding = [number, number, number, number];\n\nexport function getIconPadding(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, feature: SymbolFeature, canonical: CanonicalTileID, pixelRatio = 1): SymbolPadding {\n    // Support text-padding in addition to icon-padding? Unclear how to apply asymmetric text-padding to the radius for collision circles.\n    const result = layout.get('icon-padding').evaluate(feature, {}, canonical);\n    const values = result && result.values;\n\n    return [\n        values[0] * pixelRatio,\n        values[1] * pixelRatio,\n        values[2] * pixelRatio,\n        values[3] * pixelRatio,\n    ];\n}\n", "/**\n * Replace tokens in a string template with values in an object\n *\n * @param properties - a key/value relationship between tokens and replacements\n * @param text - the template string\n * @returns the template with tokens replaced\n */\nexport function resolveTokens(\n    properties: {\n        readonly [x: string]: unknown;\n    } | null,\n    text: string\n): string {\n    return text.replace(/{([^{}]+)}/g, (match, key: string) => {\n        return properties && key in properties ? String(properties[key]) : '';\n    });\n}\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type BackgroundPaintProps = {\n    \"background-color\": DataConstantProperty<Color>,\n    \"background-pattern\": CrossFadedProperty<ResolvedImage>,\n    \"background-opacity\": DataConstantProperty<number>,\n};\n\nexport type BackgroundPaintPropsPossiblyEvaluated = {\n    \"background-color\": Color,\n    \"background-pattern\": CrossFaded<ResolvedImage>,\n    \"background-opacity\": number,\n};\n\nlet paint: Properties<BackgroundPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"background-color\": new DataConstantProperty(styleSpec[\"paint_background\"][\"background-color\"] as any as StylePropertySpecification),\n    \"background-pattern\": new CrossFadedProperty(styleSpec[\"paint_background\"][\"background-pattern\"] as any as StylePropertySpecification),\n    \"background-opacity\": new DataConstantProperty(styleSpec[\"paint_background\"][\"background-opacity\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import {StyleLayer} from '../style_layer';\n\nimport properties, {BackgroundPaintPropsPossiblyEvaluated} from './background_style_layer_properties.g';\nimport {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';\n\nimport type {BackgroundPaintProps} from './background_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport class BackgroundStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<BackgroundPaintProps>;\n    _transitioningPaint: Transitioning<BackgroundPaintProps>;\n    paint: PossiblyEvaluated<BackgroundPaintProps, BackgroundPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n}\n", "// This file is generated. Edit build/generate-style-code.ts, then run 'npm run codegen'.\n/* eslint-disable */\n\nimport {latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {\n    Properties,\n    DataConstantProperty,\n    DataDrivenProperty,\n    CrossFadedDataDrivenProperty,\n    CrossFadedProperty,\n    ColorRampProperty,\n    PossiblyEvaluatedPropertyValue,\n    CrossFaded\n} from '../properties';\n\nimport type {Color, Formatted, Padding, ResolvedImage, VariableAnchorOffsetCollection} from '@maplibre/maplibre-gl-style-spec';\nimport {StylePropertySpecification} from '@maplibre/maplibre-gl-style-spec';\n\n\nexport type RasterPaintProps = {\n    \"raster-opacity\": DataConstantProperty<number>,\n    \"raster-hue-rotate\": DataConstantProperty<number>,\n    \"raster-brightness-min\": DataConstantProperty<number>,\n    \"raster-brightness-max\": DataConstantProperty<number>,\n    \"raster-saturation\": DataConstantProperty<number>,\n    \"raster-contrast\": DataConstantProperty<number>,\n    \"raster-resampling\": DataConstantProperty<\"linear\" | \"nearest\">,\n    \"raster-fade-duration\": DataConstantProperty<number>,\n};\n\nexport type RasterPaintPropsPossiblyEvaluated = {\n    \"raster-opacity\": number,\n    \"raster-hue-rotate\": number,\n    \"raster-brightness-min\": number,\n    \"raster-brightness-max\": number,\n    \"raster-saturation\": number,\n    \"raster-contrast\": number,\n    \"raster-resampling\": \"linear\" | \"nearest\",\n    \"raster-fade-duration\": number,\n};\n\nlet paint: Properties<RasterPaintProps>;\nconst getPaint = () => paint = paint || new Properties({\n    \"raster-opacity\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-opacity\"] as any as StylePropertySpecification),\n    \"raster-hue-rotate\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-hue-rotate\"] as any as StylePropertySpecification),\n    \"raster-brightness-min\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-brightness-min\"] as any as StylePropertySpecification),\n    \"raster-brightness-max\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-brightness-max\"] as any as StylePropertySpecification),\n    \"raster-saturation\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-saturation\"] as any as StylePropertySpecification),\n    \"raster-contrast\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-contrast\"] as any as StylePropertySpecification),\n    \"raster-resampling\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-resampling\"] as any as StylePropertySpecification),\n    \"raster-fade-duration\": new DataConstantProperty(styleSpec[\"paint_raster\"][\"raster-fade-duration\"] as any as StylePropertySpecification),\n});\n\nexport default ({ get paint() { return getPaint() } });", "import {StyleLayer} from '../style_layer';\n\nimport properties, {RasterPaintPropsPossiblyEvaluated} from './raster_style_layer_properties.g';\nimport {Transitionable, Transitioning, PossiblyEvaluated} from '../properties';\n\nimport type {RasterPaintProps} from './raster_style_layer_properties.g';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport class RasterStyleLayer extends StyleLayer {\n    _transitionablePaint: Transitionable<RasterPaintProps>;\n    _transitioningPaint: Transitioning<RasterPaintProps>;\n    paint: PossiblyEvaluated<RasterPaintProps, RasterPaintPropsPossiblyEvaluated>;\n\n    constructor(layer: LayerSpecification) {\n        super(layer, properties);\n    }\n}\n", "import {StyleLayer} from '../style_layer';\nimport type {Map} from '../../ui/map';\nimport {mat4} from 'gl-matrix';\nimport {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n* Input arguments exposed by custom render function.\n*/\ntype CustomRenderMethodInput = {\n    /**\n     * This value represents the distance from the camera to the far clipping plane.\n     * It is used in the calculation of the projection matrix to determine which objects are visible.\n     * farZ should be larger than nearZ.\n     */\n    farZ: number;\n    /**\n     * This value represents the distance from the camera to the near clipping plane.\n     * It is used in the calculation of the projection matrix to determine which objects are visible.\n     * nearZ should be smaller than farZ.\n     */\n    nearZ: number;\n    /** field of view of camera **/\n    fov: number;\n    /**\n    * model view projection matrix\n    * represents the matrix converting from world space to clip space\n    * https://learnopengl.com/Getting-started/Coordinate-Systems\n    * **/\n    modelViewProjectionMatrix: mat4;\n    /**\n    * projection matrix\n    * represents the matrix converting from view space to clip space\n    * https://learnopengl.com/Getting-started/Coordinate-Systems\n    */\n    projectionMatrix: mat4;\n}\n\n/**\n * @param gl - The map's gl context.\n * @param matrix - The map's camera matrix. It projects spherical mercator\n * coordinates to gl clip space coordinates. The spherical mercator coordinate `[0, 0]` represents the\n * top left corner of the mercator world and `[1, 1]` represents the bottom right corner. When\n * the `renderingMode` is `\"3d\"`, the z coordinate is conformal. A box with identical x, y, and z\n * lengths in mercator units would be rendered as a cube. {@link MercatorCoordinate.fromLngLat}\n * can be used to project a `LngLat` to a mercator coordinate.\n * @param options - Argument object with additional render inputs like camera properties.\n */\ntype CustomRenderMethod = (gl: WebGLRenderingContext|WebGL2RenderingContext, matrix: mat4, options: CustomRenderMethodInput) => void;\n\n/**\n * Interface for custom style layers. This is a specification for\n * implementers to model: it is not an exported method or class.\n *\n * Custom layers allow a user to render directly into the map's GL context using the map's camera.\n * These layers can be added between any regular layers using {@link Map#addLayer}.\n *\n * Custom layers must have a unique `id` and must have the `type` of `\"custom\"`.\n * They must implement `render` and may implement `prerender`, `onAdd` and `onRemove`.\n * They can trigger rendering using {@link Map#triggerRepaint}\n * and they should appropriately handle {@link MapContextEvent} with `webglcontextlost` and `webglcontextrestored`.\n *\n * The `renderingMode` property controls whether the layer is treated as a `\"2d\"` or `\"3d\"` map layer. Use:\n *\n * - `\"renderingMode\": \"3d\"` to use the depth buffer and share it with other layers\n * - `\"renderingMode\": \"2d\"` to add a layer with no depth. If you need to use the depth buffer for a `\"2d\"` layer you must use an offscreen\n *   framebuffer and {@link CustomLayerInterface#prerender}\n *\n * @example\n * Custom layer implemented as ES6 class\n * ```ts\n * class NullIslandLayer {\n *     constructor() {\n *         this.id = 'null-island';\n *         this.type = 'custom';\n *         this.renderingMode = '2d';\n *     }\n *\n *     onAdd(map, gl) {\n *         const vertexSource = `\n *         uniform mat4 u_matrix;\n *         void main() {\n *             gl_Position = u_matrix * vec4(0.5, 0.5, 0.0, 1.0);\n *             gl_PointSize = 20.0;\n *         }`;\n *\n *         const fragmentSource = `\n *         void main() {\n *             fragColor = vec4(1.0, 0.0, 0.0, 1.0);\n *         }`;\n *\n *         const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n *         gl.shaderSource(vertexShader, vertexSource);\n *         gl.compileShader(vertexShader);\n *         const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n *         gl.shaderSource(fragmentShader, fragmentSource);\n *         gl.compileShader(fragmentShader);\n *\n *         this.program = gl.createProgram();\n *         gl.attachShader(this.program, vertexShader);\n *         gl.attachShader(this.program, fragmentShader);\n *         gl.linkProgram(this.program);\n *     }\n *\n *     render(gl, matrix) {\n *         gl.useProgram(this.program);\n *         gl.uniformMatrix4fv(gl.getUniformLocation(this.program, \"u_matrix\"), false, matrix);\n *         gl.drawArrays(gl.POINTS, 0, 1);\n *     }\n * }\n *\n * map.on('load', () => {\n *     map.addLayer(new NullIslandLayer());\n * });\n * ```\n */\nexport interface CustomLayerInterface {\n    /**\n     * A unique layer id.\n     */\n    id: string;\n    /**\n     * The layer's type. Must be `\"custom\"`.\n     */\n    type: 'custom';\n    /**\n     * Either `\"2d\"` or `\"3d\"`. Defaults to `\"2d\"`.\n     */\n    renderingMode?: '2d' | '3d';\n    /**\n     * Called during a render frame allowing the layer to draw into the GL context.\n     *\n     * The layer can assume blending and depth state is set to allow the layer to properly\n     * blend and clip other layers. The layer cannot make any other assumptions about the\n     * current GL state.\n     *\n     * If the layer needs to render to a texture, it should implement the `prerender` method\n     * to do this and only use the `render` method for drawing directly into the main framebuffer.\n     *\n     * The blend function is set to `gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)`. This expects\n     * colors to be provided in premultiplied alpha form where the `r`, `g` and `b` values are already\n     * multiplied by the `a` value. If you are unable to provide colors in premultiplied form you\n     * may want to change the blend function to\n     * `gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA)`.\n     */\n    render: CustomRenderMethod;\n    /**\n     * Optional method called during a render frame to allow a layer to prepare resources or render into a texture.\n     *\n     * The layer cannot make any assumptions about the current GL state and must bind a framebuffer before rendering.\n     */\n    prerender?: CustomRenderMethod;\n    /**\n     * Optional method called when the layer has been added to the Map with {@link Map#addLayer}. This\n     * gives the layer a chance to initialize gl resources and register event listeners.\n     *\n     * @param map - The Map this custom layer was just added to.\n     * @param gl - The gl context for the map.\n     */\n    onAdd?(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;\n    /**\n     * Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This\n     * gives the layer a chance to clean up gl resources and event listeners.\n     *\n     * @param map - The Map this custom layer was just added to.\n     * @param gl - The gl context for the map.\n     */\n    onRemove?(map: Map, gl: WebGLRenderingContext | WebGL2RenderingContext): void;\n}\n\nexport function validateCustomStyleLayer(layerObject: CustomLayerInterface) {\n    const errors = [];\n    const id = layerObject.id;\n\n    if (id === undefined) {\n        errors.push({\n            message: `layers.${id}: missing required property \"id\"`\n        });\n    }\n\n    if (layerObject.render === undefined) {\n        errors.push({\n            message: `layers.${id}: missing required method \"render\"`\n        });\n    }\n\n    if (layerObject.renderingMode &&\n        layerObject.renderingMode !== '2d' &&\n        layerObject.renderingMode !== '3d') {\n        errors.push({\n            message: `layers.${id}: property \"renderingMode\" must be either \"2d\" or \"3d\"`\n        });\n    }\n\n    return errors;\n}\n\nexport class CustomStyleLayer extends StyleLayer {\n\n    implementation: CustomLayerInterface;\n\n    constructor(implementation: CustomLayerInterface) {\n        super(implementation, {});\n        this.implementation = implementation;\n    }\n\n    is3D() {\n        return this.implementation.renderingMode === '3d';\n    }\n\n    hasOffscreenPass() {\n        return this.implementation.prerender !== undefined;\n    }\n\n    recalculate() {}\n    updateTransitions() {}\n    hasTransition() { return false; }\n\n    serialize(): LayerSpecification {\n        throw new Error('Custom layers cannot be serialized');\n    }\n\n    onAdd = (map: Map) => {\n        if (this.implementation.onAdd) {\n            this.implementation.onAdd(map, map.painter.context.gl);\n        }\n    };\n\n    onRemove = (map: Map) => {\n        if (this.implementation.onRemove) {\n            this.implementation.onRemove(map, map.painter.context.gl);\n        }\n    };\n}\n", "/**\n * Invokes the wrapped function in a non-blocking way when trigger() is called.\n * Invocation requests are ignored until the function was actually invoked.\n */\nexport class ThrottledInvoker {\n    _channel: MessageChannel;\n    _triggered: boolean;\n    _methodToThrottle: Function;\n\n    constructor(methodToThrottle: Function) {\n        this._methodToThrottle = methodToThrottle;\n        this._triggered = false;\n        if (typeof MessageChannel !== 'undefined') {\n            this._channel = new MessageChannel();\n            this._channel.port2.onmessage = () => {\n                this._triggered = false;\n                this._methodToThrottle();\n            };\n        }\n    }\n\n    trigger() {\n        if (this._triggered) {\n            return;\n        }\n        this._triggered = true;\n        if (this._channel) {\n            this._channel.port1.postMessage(true);\n        } else {\n            setTimeout(() => {\n                this._triggered = false;\n                this._methodToThrottle();\n            }, 0);\n        }\n    }\n\n    remove() {\n        delete this._channel;\n        this._methodToThrottle = () => {};\n    }\n}\n", "import {wrap} from '../util/util';\n\n/*\n* Approximate radius of the earth in meters.\n* Uses the WGS-84 approximation. The radius at the equator is ~6378137 and at the poles is ~6356752. https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84\n* 6371008.8 is one published \"average radius\" see https://en.wikipedia.org/wiki/Earth_radius#Mean_radius, or ftp://athena.fsv.cvut.cz/ZFG/grs80-Moritz.pdf p.4\n*/\nexport const earthRadius = 6371008.8;\n\n/**\n * A {@link LngLat} object, an array of two numbers representing longitude and latitude,\n * or an object with `lng` and `lat` or `lon` and `lat` properties.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let v1 = new LngLat(-122.420679, 37.772537);\n * let v2 = [-122.420679, 37.772537];\n * let v3 = {lon: -122.420679, lat: 37.772537};\n * ```\n */\nexport type LngLatLike = LngLat | {\n    lng: number;\n    lat: number;\n} | {\n    lon: number;\n    lat: number;\n} | [number, number];\n\n/**\n * A `LngLat` object represents a given longitude and latitude coordinate, measured in degrees.\n * These coordinates are based on the [WGS84 (EPSG:4326) standard](https://en.wikipedia.org/wiki/World_Geodetic_System#WGS84).\n *\n * MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match the\n * [GeoJSON specification](https://tools.ietf.org/html/rfc7946).\n *\n * Note that any MapLibre GL JS method that accepts a `LngLat` object as an argument or option\n * can also accept an `Array` of two numbers and will perform an implicit conversion.\n * This flexible type is documented as {@link LngLatLike}.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let ll = new LngLat(-123.9749, 40.7736);\n * ll.lng; // = -123.9749\n * ```\n * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)\n * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)\n * @see [Create a timeline animation](https://maplibre.org/maplibre-gl-js/docs/examples/timeline-animation/)\n */\nexport class LngLat {\n    lng: number;\n    lat: number;\n\n    /**\n     * @param lng - Longitude, measured in degrees.\n     * @param lat - Latitude, measured in degrees.\n     */\n    constructor(lng: number, lat: number) {\n        if (isNaN(lng) || isNaN(lat)) {\n            throw new Error(`Invalid LngLat object: (${lng}, ${lat})`);\n        }\n        this.lng = +lng;\n        this.lat = +lat;\n        if (this.lat > 90 || this.lat < -90) {\n            throw new Error('Invalid LngLat latitude value: must be between -90 and 90');\n        }\n    }\n\n    /**\n     * Returns a new `LngLat` object whose longitude is wrapped to the range (-180, 180).\n     *\n     * @returns The wrapped `LngLat` object.\n     * @example\n     * ```ts\n     * let ll = new LngLat(286.0251, 40.7736);\n     * let wrapped = ll.wrap();\n     * wrapped.lng; // = -73.9749\n     * ```\n     */\n    wrap() {\n        return new LngLat(wrap(this.lng, -180, 180), this.lat);\n    }\n\n    /**\n     * Returns the coordinates represented as an array of two numbers.\n     *\n     * @returns The coordinates represented as an array of longitude and latitude.\n     * @example\n     * ```ts\n     * let ll = new LngLat(-73.9749, 40.7736);\n     * ll.toArray(); // = [-73.9749, 40.7736]\n     * ```\n     */\n    toArray(): [number, number] {\n        return [this.lng, this.lat];\n    }\n\n    /**\n     * Returns the coordinates represent as a string.\n     *\n     * @returns The coordinates represented as a string of the format `'LngLat(lng, lat)'`.\n     * @example\n     * ```ts\n     * let ll = new LngLat(-73.9749, 40.7736);\n     * ll.toString(); // = \"LngLat(-73.9749, 40.7736)\"\n     * ```\n     */\n    toString(): string {\n        return `LngLat(${this.lng}, ${this.lat})`;\n    }\n\n    /**\n     * Returns the approximate distance between a pair of coordinates in meters\n     * Uses the Haversine Formula (from R.W. Sinnott, \"Virtues of the Haversine\", Sky and Telescope, vol. 68, no. 2, 1984, p. 159)\n     *\n     * @param lngLat - coordinates to compute the distance to\n     * @returns Distance in meters between the two coordinates.\n     * @example\n     * ```ts\n     * let new_york = new LngLat(-74.0060, 40.7128);\n     * let los_angeles = new LngLat(-118.2437, 34.0522);\n     * new_york.distanceTo(los_angeles); // = 3935751.690893987, \"true distance\" using a non-spherical approximation is ~3966km\n     * ```\n     */\n    distanceTo(lngLat: LngLat): number {\n        const rad = Math.PI / 180;\n        const lat1 = this.lat * rad;\n        const lat2 = lngLat.lat * rad;\n        const a = Math.sin(lat1) * Math.sin(lat2) + Math.cos(lat1) * Math.cos(lat2) * Math.cos((lngLat.lng - this.lng) * rad);\n\n        const maxMeters = earthRadius * Math.acos(Math.min(a, 1));\n        return maxMeters;\n    }\n\n    /**\n     * Converts an array of two numbers or an object with `lng` and `lat` or `lon` and `lat` properties\n     * to a `LngLat` object.\n     *\n     * If a `LngLat` object is passed in, the function returns it unchanged.\n     *\n     * @param input - An array of two numbers or object to convert, or a `LngLat` object to return.\n     * @returns A new `LngLat` object, if a conversion occurred, or the original `LngLat` object.\n     * @example\n     * ```ts\n     * let arr = [-73.9749, 40.7736];\n     * let ll = LngLat.convert(arr);\n     * ll;   // = LngLat {lng: -73.9749, lat: 40.7736}\n     * ```\n     */\n    static convert(input: LngLatLike): LngLat {\n        if (input instanceof LngLat) {\n            return input;\n        }\n        if (Array.isArray(input) && (input.length === 2 || input.length === 3)) {\n            return new LngLat(Number(input[0]), Number(input[1]));\n        }\n        if (!Array.isArray(input) && typeof input === 'object' && input !== null) {\n            return new LngLat(\n                // flow can't refine this to have one of lng or lat, so we have to cast to any\n                Number('lng' in input ? (input as any).lng : (input as any).lon),\n                Number(input.lat)\n            );\n        }\n        throw new Error('`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]');\n    }\n}\n", "import {LngLat, earthRadius} from '../geo/lng_lat';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport {IMercatorCoordinate} from '@maplibre/maplibre-gl-style-spec';\n\n/*\n * The average circumference of the world in meters.\n */\nconst earthCircumference = 2 * Math.PI * earthRadius; // meters\n\n/*\n * The circumference at a line of latitude in meters.\n */\nfunction circumferenceAtLatitude(latitude: number) {\n    return earthCircumference * Math.cos(latitude * Math.PI / 180);\n}\n\nexport function mercatorXfromLng(lng: number) {\n    return (180 + lng) / 360;\n}\n\nexport function mercatorYfromLat(lat: number) {\n    return (180 - (180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + lat * Math.PI / 360)))) / 360;\n}\n\nexport function mercatorZfromAltitude(altitude: number, lat: number) {\n    return altitude / circumferenceAtLatitude(lat);\n}\n\nexport function lngFromMercatorX(x: number) {\n    return x * 360 - 180;\n}\n\nexport function latFromMercatorY(y: number) {\n    const y2 = 180 - y * 360;\n    return 360 / Math.PI * Math.atan(Math.exp(y2 * Math.PI / 180)) - 90;\n}\n\nexport function altitudeFromMercatorZ(z: number, y: number) {\n    return z * circumferenceAtLatitude(latFromMercatorY(y));\n}\n\n/**\n * Determine the Mercator scale factor for a given latitude, see\n * https://en.wikipedia.org/wiki/Mercator_projection#Scale_factor\n *\n * At the equator the scale factor will be 1, which increases at higher latitudes.\n *\n * @param lat - Latitude\n * @returns scale factor\n */\nexport function mercatorScale(lat: number) {\n    return 1 / Math.cos(lat * Math.PI / 180);\n}\n\n/**\n * A `MercatorCoordinate` object represents a projected three dimensional position.\n *\n * `MercatorCoordinate` uses the web mercator projection ([EPSG:3857](https://epsg.io/3857)) with slightly different units:\n *\n * - the size of 1 unit is the width of the projected world instead of the \"mercator meter\"\n * - the origin of the coordinate space is at the north-west corner instead of the middle\n *\n * For example, `MercatorCoordinate(0, 0, 0)` is the north-west corner of the mercator world and\n * `MercatorCoordinate(1, 1, 0)` is the south-east corner. If you are familiar with\n * [vector tiles](https://github.com/mapbox/vector-tile-spec) it may be helpful to think\n * of the coordinate space as the `0/0/0` tile with an extent of `1`.\n *\n * The `z` dimension of `MercatorCoordinate` is conformal. A cube in the mercator coordinate space would be rendered as a cube.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let nullIsland = new MercatorCoordinate(0.5, 0.5, 0);\n * ```\n * @see [Add a custom style layer](https://maplibre.org/maplibre-gl-js/docs/examples/custom-style-layer/)\n */\nexport class MercatorCoordinate implements IMercatorCoordinate {\n    x: number;\n    y: number;\n    z: number;\n\n    /**\n     * @param x - The x component of the position.\n     * @param y - The y component of the position.\n     * @param z - The z component of the position.\n     */\n    constructor(x: number, y: number, z: number = 0) {\n        this.x = +x;\n        this.y = +y;\n        this.z = +z;\n    }\n\n    /**\n     * Project a `LngLat` to a `MercatorCoordinate`.\n     *\n     * @param lngLatLike - The location to project.\n     * @param altitude - The altitude in meters of the position.\n     * @returns The projected mercator coordinate.\n     * @example\n     * ```ts\n     * let coord = MercatorCoordinate.fromLngLat({ lng: 0, lat: 0}, 0);\n     * coord; // MercatorCoordinate(0.5, 0.5, 0)\n     * ```\n     */\n    static fromLngLat(lngLatLike: LngLatLike, altitude: number = 0): MercatorCoordinate {\n        const lngLat = LngLat.convert(lngLatLike);\n\n        return new MercatorCoordinate(\n            mercatorXfromLng(lngLat.lng),\n            mercatorYfromLat(lngLat.lat),\n            mercatorZfromAltitude(altitude, lngLat.lat));\n    }\n\n    /**\n     * Returns the `LngLat` for the coordinate.\n     *\n     * @returns The `LngLat` object.\n     * @example\n     * ```ts\n     * let coord = new MercatorCoordinate(0.5, 0.5, 0);\n     * let lngLat = coord.toLngLat(); // LngLat(0, 0)\n     * ```\n     */\n    toLngLat() {\n        return new LngLat(\n            lngFromMercatorX(this.x),\n            latFromMercatorY(this.y));\n    }\n\n    /**\n     * Returns the altitude in meters of the coordinate.\n     *\n     * @returns The altitude in meters.\n     * @example\n     * ```ts\n     * let coord = new MercatorCoordinate(0, 0, 0.02);\n     * coord.toAltitude(); // 6914.281956295339\n     * ```\n     */\n    toAltitude(): number {\n        return altitudeFromMercatorZ(this.z, this.y);\n    }\n\n    /**\n     * Returns the distance of 1 meter in `MercatorCoordinate` units at this latitude.\n     *\n     * For coordinates in real world units using meters, this naturally provides the scale\n     * to transform into `MercatorCoordinate`s.\n     *\n     * @returns Distance of 1 meter in `MercatorCoordinate` units.\n     */\n    meterInMercatorCoordinateUnits(): number {\n        // 1 meter / circumference at equator in meters * Mercator projection scale factor at this latitude\n        return 1 / earthCircumference * mercatorScale(latFromMercatorY(this.y));\n    }\n}\n", "export { getURL, getTileBBox, getMercCoords };\n\n\n/**\n * getURL\n *\n * @param    {String}  baseUrl  Base url of the WMS server\n * @param    {String}  layer    Layer name\n * @param    {Number}  x        Tile coordinate x\n * @param    {Number}  y        Tile coordinate y\n * @param    {Number}  z        Tile zoom\n * @param    {Object}  [options]\n * @param    {String}  [options.format='image/png']\n * @param    {String}  [options.service='WMS']\n * @param    {String}  [options.version='1.1.1']\n * @param    {String}  [options.request='GetMap']\n * @param    {String}  [options.srs='EPSG:3857']\n * @param    {Number}  [options.width='256']\n * @param    {Number}  [options.height='256']\n * @returns  {String}  url\n * @example\n * var baseUrl = 'http://geodata.state.nj.us/imagerywms/Natural2015';\n * var layer = 'Natural2015';\n * var url = whoots.getURL(baseUrl, layer, 154308, 197167, 19);\n */\nfunction getURL(baseUrl, layer, x, y, z, options) {\n    options = options || {};\n\n    var url = baseUrl + '?' + [\n        'bbox='    + getTileBBox(x, y, z),\n        'format='  + (options.format || 'image/png'),\n        'service=' + (options.service || 'WMS'),\n        'version=' + (options.version || '1.1.1'),\n        'request=' + (options.request || 'GetMap'),\n        'srs='     + (options.srs || 'EPSG:3857'),\n        'width='   + (options.width || 256),\n        'height='  + (options.height || 256),\n        'layers='  + layer\n    ].join('&');\n\n    return url;\n}\n\n\n/**\n * getTileBBox\n *\n * @param    {Number}  x  Tile coordinate x\n * @param    {Number}  y  Tile coordinate y\n * @param    {Number}  z  Tile zoom\n * @returns  {String}  String of the bounding box\n */\nfunction getTileBBox(x, y, z) {\n    // for Google/OSM tile scheme we need to alter the y\n    y = (Math.pow(2, z) - y - 1);\n\n    var min = getMercCoords(x * 256, y * 256, z),\n        max = getMercCoords((x + 1) * 256, (y + 1) * 256, z);\n\n    return min[0] + ',' + min[1] + ',' + max[0] + ',' + max[1];\n}\n\n\n/**\n * getMercCoords\n *\n * @param    {Number}  x  Pixel coordinate x\n * @param    {Number}  y  Pixel coordinate y\n * @param    {Number}  z  Tile zoom\n * @returns  {Array}   [x, y]\n */\nfunction getMercCoords(x, y, z) {\n    var resolution = (2 * Math.PI * 6378137 / 256) / Math.pow(2, z),\n        merc_x = (x * resolution - 2 * Math.PI  * 6378137 / 2.0),\n        merc_y = (y * resolution - 2 * Math.PI  * 6378137 / 2.0);\n\n    return [merc_x, merc_y];\n}\n", "import {getTileBBox} from '@mapbox/whoots-js';\nimport {EXTENT} from '../data/extent';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {register} from '../util/web_worker_transfer';\nimport {mat4} from 'gl-matrix';\nimport {ICanonicalTileID, IMercatorCoordinate} from '@maplibre/maplibre-gl-style-spec';\nimport {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from '../util/util';\nimport {isInBoundsForTileZoomXY} from '../util/world_bounds';\n\n/**\n * A canonical way to define a tile ID\n */\nexport class CanonicalTileID implements ICanonicalTileID {\n    z: number;\n    x: number;\n    y: number;\n    key: string;\n\n    constructor(z: number, x: number, y: number) {\n\n        if (!isInBoundsForTileZoomXY(z, x, y)) {\n            throw new Error(`x=${x}, y=${y}, z=${z} outside of bounds. 0<=x<${Math.pow(2, z)}, 0<=y<${Math.pow(2, z)} ${MIN_TILE_ZOOM}<=z<=${MAX_TILE_ZOOM} `);\n        }\n\n        this.z = z;\n        this.x = x;\n        this.y = y;\n        this.key = calculateKey(0, z, z, x, y);\n    }\n\n    equals(id: ICanonicalTileID) {\n        return this.z === id.z && this.x === id.x && this.y === id.y;\n    }\n\n    // given a list of urls, choose a url template and return a tile URL\n    url(urls: Array<string>, pixelRatio: number, scheme?: string | null) {\n        const bbox = getTileBBox(this.x, this.y, this.z);\n        const quadkey = getQuadkey(this.z, this.x, this.y);\n\n        return urls[(this.x + this.y) % urls.length]\n            .replace(/{prefix}/g, (this.x % 16).toString(16) + (this.y % 16).toString(16))\n            .replace(/{z}/g, String(this.z))\n            .replace(/{x}/g, String(this.x))\n            .replace(/{y}/g, String(scheme === 'tms' ? (Math.pow(2, this.z) - this.y - 1) : this.y))\n            .replace(/{ratio}/g, pixelRatio > 1 ? '@2x' : '')\n            .replace(/{quadkey}/g, quadkey)\n            .replace(/{bbox-epsg-3857}/g, bbox);\n    }\n\n    isChildOf(parent: ICanonicalTileID) {\n        const dz = this.z - parent.z;\n        return  dz > 0 && parent.x === (this.x >> dz) && parent.y === (this.y >> dz);\n    }\n\n    getTilePoint(coord: IMercatorCoordinate) {\n        const tilesAtZoom = Math.pow(2, this.z);\n        return new Point(\n            (coord.x * tilesAtZoom - this.x) * EXTENT,\n            (coord.y * tilesAtZoom - this.y) * EXTENT);\n    }\n\n    toString() {\n        return `${this.z}/${this.x}/${this.y}`;\n    }\n}\n\n/**\n * @internal\n * An unwrapped tile identifier\n */\nexport class UnwrappedTileID {\n    wrap: number;\n    canonical: CanonicalTileID;\n    key: string;\n\n    constructor(wrap: number, canonical: CanonicalTileID) {\n        this.wrap = wrap;\n        this.canonical = canonical;\n        this.key = calculateKey(wrap, canonical.z, canonical.z, canonical.x, canonical.y);\n    }\n}\n\n/**\n * An overscaled tile identifier\n */\nexport class OverscaledTileID {\n    overscaledZ: number;\n    wrap: number;\n    canonical: CanonicalTileID;\n    key: string;\n    posMatrix: mat4;\n\n    constructor(overscaledZ: number, wrap: number, z: number, x: number, y: number) {\n        if (overscaledZ < z) throw new Error(`overscaledZ should be >= z; overscaledZ = ${overscaledZ}; z = ${z}`);\n        this.overscaledZ = overscaledZ;\n        this.wrap = wrap;\n        this.canonical = new CanonicalTileID(z, +x, +y);\n        this.key = calculateKey(wrap, overscaledZ, z, x, y);\n    }\n\n    clone() {\n        return new OverscaledTileID(this.overscaledZ, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    equals(id: OverscaledTileID) {\n        return this.overscaledZ === id.overscaledZ && this.wrap === id.wrap && this.canonical.equals(id.canonical);\n    }\n\n    scaledTo(targetZ: number) {\n        if (targetZ > this.overscaledZ) throw new Error(`targetZ > this.overscaledZ; targetZ = ${targetZ}; overscaledZ = ${this.overscaledZ}`);\n        const zDifference = this.canonical.z - targetZ;\n        if (targetZ > this.canonical.z) {\n            return new OverscaledTileID(targetZ, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n        } else {\n            return new OverscaledTileID(targetZ, this.wrap, targetZ, this.canonical.x >> zDifference, this.canonical.y >> zDifference);\n        }\n    }\n\n    /*\n     * calculateScaledKey is an optimization:\n     * when withWrap == true, implements the same as this.scaledTo(z).key,\n     * when withWrap == false, implements the same as this.scaledTo(z).wrapped().key.\n     */\n    calculateScaledKey(targetZ: number, withWrap: boolean): string {\n        if (targetZ > this.overscaledZ) throw new Error(`targetZ > this.overscaledZ; targetZ = ${targetZ}; overscaledZ = ${this.overscaledZ}`);\n        const zDifference = this.canonical.z - targetZ;\n        if (targetZ > this.canonical.z) {\n            return calculateKey(this.wrap * +withWrap, targetZ, this.canonical.z, this.canonical.x, this.canonical.y);\n        } else {\n            return calculateKey(this.wrap * +withWrap, targetZ, targetZ, this.canonical.x >> zDifference, this.canonical.y >> zDifference);\n        }\n    }\n\n    isChildOf(parent: OverscaledTileID) {\n        if (parent.wrap !== this.wrap) {\n            // We can't be a child if we're in a different world copy\n            return false;\n        }\n        const zDifference = this.canonical.z - parent.canonical.z;\n        // We're first testing for z == 0, to avoid a 32 bit shift, which is undefined.\n        return parent.overscaledZ === 0 || (\n            parent.overscaledZ < this.overscaledZ &&\n                parent.canonical.x === (this.canonical.x >> zDifference) &&\n                parent.canonical.y === (this.canonical.y >> zDifference));\n    }\n\n    children(sourceMaxZoom: number) {\n        if (this.overscaledZ >= sourceMaxZoom) {\n            // return a single tile coord representing a an overscaled tile\n            return [new OverscaledTileID(this.overscaledZ + 1, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y)];\n        }\n\n        const z = this.canonical.z + 1;\n        const x = this.canonical.x * 2;\n        const y = this.canonical.y * 2;\n        return [\n            new OverscaledTileID(z, this.wrap, z, x, y),\n            new OverscaledTileID(z, this.wrap, z, x + 1, y),\n            new OverscaledTileID(z, this.wrap, z, x, y + 1),\n            new OverscaledTileID(z, this.wrap, z, x + 1, y + 1)\n        ];\n    }\n\n    isLessThan(rhs: OverscaledTileID) {\n        if (this.wrap < rhs.wrap) return true;\n        if (this.wrap > rhs.wrap) return false;\n\n        if (this.overscaledZ < rhs.overscaledZ) return true;\n        if (this.overscaledZ > rhs.overscaledZ) return false;\n\n        if (this.canonical.x < rhs.canonical.x) return true;\n        if (this.canonical.x > rhs.canonical.x) return false;\n\n        if (this.canonical.y < rhs.canonical.y) return true;\n        return false;\n    }\n\n    wrapped() {\n        return new OverscaledTileID(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    unwrapTo(wrap: number) {\n        return new OverscaledTileID(this.overscaledZ, wrap, this.canonical.z, this.canonical.x, this.canonical.y);\n    }\n\n    overscaleFactor() {\n        return Math.pow(2, this.overscaledZ - this.canonical.z);\n    }\n\n    toUnwrapped() {\n        return new UnwrappedTileID(this.wrap, this.canonical);\n    }\n\n    toString() {\n        return `${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`;\n    }\n\n    getTilePoint(coord: MercatorCoordinate) {\n        return this.canonical.getTilePoint(new MercatorCoordinate(coord.x - this.wrap, coord.y));\n    }\n}\n\nfunction calculateKey(wrap: number, overscaledZ: number, z: number, x: number, y: number): string {\n    wrap *= 2;\n    if (wrap < 0) wrap = wrap * -1 - 1;\n    const dim = 1 << z;\n    return (dim * dim * wrap + dim * y + x).toString(36) + z.toString(36) + overscaledZ.toString(36);\n}\n\nfunction getQuadkey(z, x, y) {\n    let quadkey = '', mask;\n    for (let i = z; i > 0; i--) {\n        mask = 1 << (i - 1);\n        quadkey += ((x & mask ? 1 : 0) + (y & mask ? 2 : 0));\n    }\n    return quadkey;\n}\n\nregister('CanonicalTileID', CanonicalTileID);\nregister('OverscaledTileID', OverscaledTileID, {omit: ['posMatrix']});\n", "import {MAX_TILE_ZOOM, MIN_TILE_ZOOM} from './util';\nimport {LngLat} from '../geo/lng_lat';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\n\n/**\n * Returns true if a given tile zoom (Z), X, and Y are in the bounds of the world.\n * Zoom bounds are the minimum zoom (inclusive) through the maximum zoom (inclusive).\n * X and Y bounds are 0 (inclusive) to their respective zoom-dependent maxima (exclusive).\n *\n * @param zoom - the tile zoom (Z)\n * @param x - the tile X\n * @param y - the tile Y\n * @returns `true` if a given tile zoom, X, and Y are in the bounds of the world.\n */\nexport function isInBoundsForTileZoomXY(zoom: number, x: number, y: number): boolean {\n    return !(\n        zoom < MIN_TILE_ZOOM ||\n        zoom > MAX_TILE_ZOOM ||\n        y < 0 ||\n        y >= Math.pow(2, zoom) ||\n        x < 0 ||\n        x >= Math.pow(2, zoom)\n    );\n}\n\n/**\n * Returns true if a given zoom and `LngLat` are in the bounds of the world.\n * Does not wrap `LngLat` when checking if in bounds.\n * Zoom bounds are the minimum zoom (inclusive) through the maximum zoom (inclusive).\n * `LngLat` bounds are the mercator world's north-west corner (inclusive) to its south-east corner (exclusive).\n *\n * @param zoom - the tile zoom (Z)\n * @param LngLat - the `LngLat` object containing the longitude and latitude\n * @returns `true` if a given zoom and `LngLat` are in the bounds of the world.\n */\nexport function isInBoundsForZoomLngLat(zoom: number, lnglat: LngLat): boolean {\n    const {x, y} = MercatorCoordinate.fromLngLat(lnglat);\n    return !(\n        zoom < MIN_TILE_ZOOM ||\n        zoom > MAX_TILE_ZOOM ||\n        y < 0 ||\n        y >= 1 ||\n        x < 0 ||\n        x >= 1\n    );\n}\n", "import {RGBAImage} from '../util/image';\n\nimport {warnOnce} from '../util/util';\nimport {register} from '../util/web_worker_transfer';\n\n/**\n * The possible DEM encoding types\n */\nexport type DEMEncoding = 'mapbox' | 'terrarium' | 'custom'\n\n/**\n * DEMData is a data structure for decoding, backfilling, and storing elevation data for processing in the hillshade shaders\n * data can be populated either from a pngraw image tile or from serialized data sent back from a worker. When data is initially\n * loaded from a image tile, we decode the pixel values using the appropriate decoding formula, but we store the\n * elevation data as an Int32 value. we add 65536 (2^16) to eliminate negative values and enable the use of\n * integer overflow when creating the texture used in the hillshadePrepare step.\n *\n * DEMData also handles the backfilling of data from a tile's neighboring tiles. This is necessary because we use a pixel's 8\n * surrounding pixel values to compute the slope at that pixel, and we cannot accurately calculate the slope at pixels on a\n * tile's edge without backfilling from neighboring tiles.\n */\nexport class DEMData {\n    uid: string | number;\n    data: Uint32Array;\n    stride: number;\n    dim: number;\n    min: number;\n    max: number;\n    redFactor: number;\n    greenFactor: number;\n    blueFactor: number;\n    baseShift: number;\n\n    /**\n     * Constructs a `DEMData` object\n     * @param uid - the tile's unique id\n     * @param data - RGBAImage data has uniform 1px padding on all sides: square tile edge size defines stride\n    // and dim is calculated as stride - 2.\n     * @param encoding - the encoding type of the data\n     * @param redFactor - the red channel factor used to unpack the data, used for `custom` encoding only\n     * @param greenFactor - the green channel factor used to unpack the data, used for `custom` encoding only\n     * @param blueFactor - the blue channel factor used to unpack the data, used for `custom` encoding only\n     * @param baseShift - the base shift used to unpack the data, used for `custom` encoding only\n     */\n    constructor(uid: string | number, data: RGBAImage | ImageData, encoding: DEMEncoding, redFactor = 1.0, greenFactor = 1.0, blueFactor = 1.0, baseShift = 0.0) {\n        this.uid = uid;\n        if (data.height !== data.width) throw new RangeError('DEM tiles must be square');\n        if (encoding && !['mapbox', 'terrarium', 'custom'].includes(encoding)) {\n            warnOnce(`\"${encoding}\" is not a valid encoding type. Valid types include \"mapbox\", \"terrarium\" and \"custom\".`);\n            return;\n        }\n        this.stride = data.height;\n        const dim = this.dim = data.height - 2;\n        this.data = new Uint32Array(data.data.buffer);\n        switch (encoding) {\n            case 'terrarium':\n                // unpacking formula for mapzen terrarium:\n                // https://aws.amazon.com/public-datasets/terrain/\n                this.redFactor = 256.0;\n                this.greenFactor = 1.0;\n                this.blueFactor = 1.0 / 256.0;\n                this.baseShift = 32768.0;\n                break;\n            case 'custom':\n                this.redFactor = redFactor;\n                this.greenFactor = greenFactor;\n                this.blueFactor = blueFactor;\n                this.baseShift = baseShift;\n                break;\n            case 'mapbox':\n            default:\n                // unpacking formula for mapbox.terrain-rgb:\n                // https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb\n                this.redFactor = 6553.6;\n                this.greenFactor = 25.6;\n                this.blueFactor = 0.1;\n                this.baseShift = 10000.0;\n                break;\n        }\n\n        // in order to avoid flashing seams between tiles, here we are initially populating a 1px border of pixels around the image\n        // with the data of the nearest pixel from the image. this data is eventually replaced when the tile's neighboring\n        // tiles are loaded and the accurate data can be backfilled using DEMData#backfillBorder\n        for (let x = 0; x < dim; x++) {\n            // left vertical border\n            this.data[this._idx(-1, x)] = this.data[this._idx(0, x)];\n            // right vertical border\n            this.data[this._idx(dim, x)] = this.data[this._idx(dim - 1, x)];\n            // left horizontal border\n            this.data[this._idx(x, -1)] = this.data[this._idx(x, 0)];\n            // right horizontal border\n            this.data[this._idx(x, dim)] = this.data[this._idx(x, dim - 1)];\n        }\n        // corners\n        this.data[this._idx(-1, -1)] = this.data[this._idx(0, 0)];\n        this.data[this._idx(dim, -1)] = this.data[this._idx(dim - 1, 0)];\n        this.data[this._idx(-1, dim)] = this.data[this._idx(0, dim - 1)];\n        this.data[this._idx(dim, dim)] = this.data[this._idx(dim - 1, dim - 1)];\n\n        // calculate min/max values\n        this.min = Number.MAX_SAFE_INTEGER;\n        this.max = Number.MIN_SAFE_INTEGER;\n        for (let x = 0; x < dim; x++) {\n            for (let y = 0; y < dim; y++) {\n                const ele = this.get(x, y);\n                if (ele > this.max) this.max = ele;\n                if (ele < this.min) this.min = ele;\n            }\n        }\n    }\n\n    get(x: number, y: number) {\n        const pixels = new Uint8Array(this.data.buffer);\n        const index = this._idx(x, y) * 4;\n        return this.unpack(pixels[index], pixels[index + 1], pixels[index + 2]);\n    }\n\n    getUnpackVector() {\n        return [this.redFactor, this.greenFactor, this.blueFactor, this.baseShift];\n    }\n\n    _idx(x: number, y: number) {\n        if (x < -1 || x >= this.dim + 1 ||  y < -1 || y >= this.dim + 1) throw new RangeError('out of range source coordinates for DEM data');\n        return (y + 1) * this.stride + (x + 1);\n    }\n\n    unpack(r: number, g: number, b: number) {\n        return (r * this.redFactor + g * this.greenFactor + b * this.blueFactor - this.baseShift);\n    }\n\n    getPixels() {\n        return new RGBAImage({width: this.stride, height: this.stride}, new Uint8Array(this.data.buffer));\n    }\n\n    backfillBorder(borderTile: DEMData, dx: number, dy: number) {\n        if (this.dim !== borderTile.dim) throw new Error('dem dimension mismatch');\n\n        let xMin = dx * this.dim,\n            xMax = dx * this.dim + this.dim,\n            yMin = dy * this.dim,\n            yMax = dy * this.dim + this.dim;\n\n        switch (dx) {\n            case -1:\n                xMin = xMax - 1;\n                break;\n            case 1:\n                xMax = xMin + 1;\n                break;\n        }\n\n        switch (dy) {\n            case -1:\n                yMin = yMax - 1;\n                break;\n            case 1:\n                yMax = yMin + 1;\n                break;\n        }\n\n        const ox = -dx * this.dim;\n        const oy = -dy * this.dim;\n        for (let y = yMin; y < yMax; y++) {\n            for (let x = xMin; x < xMax; x++) {\n                this.data[this._idx(x, y)] = borderTile.data[this._idx(x + ox, y + oy)];\n            }\n        }\n    }\n}\n\nregister('DEMData', DEMData);\n", "export class DictionaryCoder {\n    _stringToNumber: {[_: string]: number};\n    _numberToString: Array<string>;\n\n    constructor(strings: Array<string>) {\n        this._stringToNumber = {};\n        this._numberToString = [];\n        for (let i = 0; i < strings.length; i++) {\n            const string = strings[i];\n            this._stringToNumber[string] = i;\n            this._numberToString[i] = string;\n        }\n    }\n\n    encode(string: string) {\n        return this._stringToNumber[string];\n    }\n\n    decode(n: number) {\n        if (n >= this._numberToString.length) throw new Error(`Out of bounds. Index requested n=${n} can't be >= this._numberToString.length ${this._numberToString.length}`);\n        return this._numberToString[n];\n    }\n}\n", "import type {VectorTileFeature} from '@mapbox/vector-tile';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A helper for type to omit a property from a type\n */\ntype DistributiveKeys<T> = T extends T ? keyof T : never;\n/**\n * A helper for type to omit a property from a type\n */\ntype DistributiveOmit<T, K extends DistributiveKeys<T>> = T extends unknown\n    ? Omit<T, K>\n    : never;\n\n/**\n * An extended geojson feature used by the events to return data to the listener\n */\nexport type MapGeoJSONFeature = GeoJSONFeature & {\n    layer: DistributiveOmit<LayerSpecification, 'source'> & {source: string};\n    source: string;\n    sourceLayer?: string;\n    state: { [key: string]: any };\n}\n\n/**\n * A geojson feature\n */\nexport class GeoJSONFeature {\n    type: 'Feature';\n    _geometry: GeoJSON.Geometry;\n    properties: { [name: string]: any };\n    id: number | string | undefined;\n\n    _vectorTileFeature: VectorTileFeature;\n\n    constructor(vectorTileFeature: VectorTileFeature, z: number, x: number, y: number, id: string | number | undefined) {\n        this.type = 'Feature';\n\n        this._vectorTileFeature = vectorTileFeature;\n        (vectorTileFeature as any)._z = z;\n        (vectorTileFeature as any)._x = x;\n        (vectorTileFeature as any)._y = y;\n\n        this.properties = vectorTileFeature.properties;\n        this.id = id;\n    }\n\n    get geometry(): GeoJSON.Geometry {\n        if (this._geometry === undefined) {\n            this._geometry = this._vectorTileFeature.toGeoJSON(\n                (this._vectorTileFeature as any)._x,\n                (this._vectorTileFeature as any)._y,\n                (this._vectorTileFeature as any)._z).geometry;\n        }\n        return this._geometry;\n    }\n\n    set geometry(g: GeoJSON.Geometry) {\n        this._geometry = g;\n    }\n\n    toJSON() {\n        const json: any = {\n            geometry: this.geometry\n        };\n        for (const i in this) {\n            if (i === '_geometry' || i === '_vectorTileFeature') continue;\n            json[i] = (this)[i];\n        }\n        return json;\n    }\n}\n", "import Point from '@mapbox/point-geometry';\nimport {loadGeometry} from './load_geometry';\nimport {toEvaluationFeature} from './evaluation_feature';\nimport {EXTENT} from './extent';\nimport {featureFilter} from '@maplibre/maplibre-gl-style-spec';\nimport {TransferableGridIndex} from '../util/transferable_grid_index';\nimport {DictionaryCoder} from '../util/dictionary_coder';\nimport vt from '@mapbox/vector-tile';\nimport Protobuf from 'pbf';\nimport {GeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport {arraysIntersect, mapObject, extend} from '../util/util';\nimport {OverscaledTileID} from '../source/tile_id';\nimport {register} from '../util/web_worker_transfer';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {SourceFeatureState} from '../source/source_state';\nimport {polygonIntersectsBox} from '../util/intersection_tests';\nimport {PossiblyEvaluated} from '../style/properties';\nimport {FeatureIndexArray} from './array_types.g';\nimport {mat4} from 'gl-matrix';\n\nimport type {StyleLayer} from '../style/style_layer';\nimport type {FeatureFilter, FeatureState, FilterSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Transform} from '../geo/transform';\nimport type {VectorTileFeature, VectorTileLayer} from '@mapbox/vector-tile';\n\ntype QueryParameters = {\n    scale: number;\n    pixelPosMatrix: mat4;\n    transform: Transform;\n    tileSize: number;\n    queryGeometry: Array<Point>;\n    cameraQueryGeometry: Array<Point>;\n    queryPadding: number;\n    params: {\n        filter: FilterSpecification;\n        layers: Array<string>;\n        availableImages: Array<string>;\n    };\n};\n\n/**\n * An in memory index class to allow fast interaction with features\n */\nexport class FeatureIndex {\n    tileID: OverscaledTileID;\n    x: number;\n    y: number;\n    z: number;\n    grid: TransferableGridIndex;\n    grid3D: TransferableGridIndex;\n    featureIndexArray: FeatureIndexArray;\n    promoteId?: PromoteIdSpecification;\n\n    rawTileData: ArrayBuffer;\n    bucketLayerIDs: Array<Array<string>>;\n\n    vtLayers: {[_: string]: VectorTileLayer};\n    sourceLayerCoder: DictionaryCoder;\n\n    constructor(tileID: OverscaledTileID, promoteId?: PromoteIdSpecification | null) {\n        this.tileID = tileID;\n        this.x = tileID.canonical.x;\n        this.y = tileID.canonical.y;\n        this.z = tileID.canonical.z;\n        this.grid = new TransferableGridIndex(EXTENT, 16, 0);\n        this.grid3D = new TransferableGridIndex(EXTENT, 16, 0);\n        this.featureIndexArray = new FeatureIndexArray();\n        this.promoteId = promoteId;\n    }\n\n    insert(feature: VectorTileFeature, geometry: Array<Array<Point>>, featureIndex: number, sourceLayerIndex: number, bucketIndex: number, is3D?: boolean) {\n        const key = this.featureIndexArray.length;\n        this.featureIndexArray.emplaceBack(featureIndex, sourceLayerIndex, bucketIndex);\n\n        const grid = is3D ? this.grid3D : this.grid;\n\n        for (let r = 0; r < geometry.length; r++) {\n            const ring = geometry[r];\n\n            const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n            for (let i = 0; i < ring.length; i++) {\n                const p = ring[i];\n                bbox[0] = Math.min(bbox[0], p.x);\n                bbox[1] = Math.min(bbox[1], p.y);\n                bbox[2] = Math.max(bbox[2], p.x);\n                bbox[3] = Math.max(bbox[3], p.y);\n            }\n\n            if (bbox[0] < EXTENT &&\n                bbox[1] < EXTENT &&\n                bbox[2] >= 0 &&\n                bbox[3] >= 0) {\n                grid.insert(key, bbox[0], bbox[1], bbox[2], bbox[3]);\n            }\n        }\n    }\n\n    loadVTLayers(): {[_: string]: VectorTileLayer} {\n        if (!this.vtLayers) {\n            this.vtLayers = new vt.VectorTile(new Protobuf(this.rawTileData)).layers;\n            this.sourceLayerCoder = new DictionaryCoder(this.vtLayers ? Object.keys(this.vtLayers).sort() : ['_geojsonTileLayer']);\n        }\n        return this.vtLayers;\n    }\n\n    // Finds non-symbol features in this tile at a particular position.\n    query(\n        args: QueryParameters,\n        styleLayers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState: SourceFeatureState\n    ): {[_: string]: Array<{featureIndex: number; feature: GeoJSONFeature}>} {\n        this.loadVTLayers();\n\n        const params = args.params || {} as { filter: any; layers: string[]; availableImages: string[] },\n            pixelsToTileUnits = EXTENT / args.tileSize / args.scale,\n            filter = featureFilter(params.filter);\n\n        const queryGeometry = args.queryGeometry;\n        const queryPadding = args.queryPadding * pixelsToTileUnits;\n\n        const bounds = getBounds(queryGeometry);\n        const matching = this.grid.query(bounds.minX - queryPadding, bounds.minY - queryPadding, bounds.maxX + queryPadding, bounds.maxY + queryPadding);\n\n        const cameraBounds = getBounds(args.cameraQueryGeometry);\n        const matching3D = this.grid3D.query(\n            cameraBounds.minX - queryPadding, cameraBounds.minY - queryPadding, cameraBounds.maxX + queryPadding, cameraBounds.maxY + queryPadding,\n            (bx1, by1, bx2, by2) => {\n                return polygonIntersectsBox(args.cameraQueryGeometry, bx1 - queryPadding, by1 - queryPadding, bx2 + queryPadding, by2 + queryPadding);\n            });\n\n        for (const key of matching3D) {\n            matching.push(key);\n        }\n\n        matching.sort(topDownFeatureComparator);\n\n        const result = {};\n        let previousIndex;\n        for (let k = 0; k < matching.length; k++) {\n            const index = matching[k];\n\n            // don't check the same feature more than once\n            if (index === previousIndex) continue;\n            previousIndex = index;\n\n            const match = this.featureIndexArray.get(index);\n            let featureGeometry = null;\n            this.loadMatchingFeature(\n                result,\n                match.bucketIndex,\n                match.sourceLayerIndex,\n                match.featureIndex,\n                filter,\n                params.layers,\n                params.availableImages,\n                styleLayers,\n                serializedLayers,\n                sourceFeatureState,\n                (feature: VectorTileFeature, styleLayer: StyleLayer, featureState: FeatureState) => {\n                    if (!featureGeometry) {\n                        featureGeometry = loadGeometry(feature);\n                    }\n\n                    return styleLayer.queryIntersectsFeature(queryGeometry, feature, featureState, featureGeometry, this.z, args.transform, pixelsToTileUnits, args.pixelPosMatrix);\n                }\n            );\n        }\n\n        return result;\n    }\n\n    loadMatchingFeature(\n        result: {\n            [_: string]: Array<{\n                featureIndex: number;\n                feature: GeoJSONFeature;\n                intersectionZ?: boolean | number;\n            }>;\n        },\n        bucketIndex: number,\n        sourceLayerIndex: number,\n        featureIndex: number,\n        filter: FeatureFilter,\n        filterLayerIDs: Array<string>,\n        availableImages: Array<string>,\n        styleLayers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState?: SourceFeatureState,\n        intersectionTest?: (\n            feature: VectorTileFeature,\n            styleLayer: StyleLayer,\n            featureState: any,\n            id: string | number | void\n        ) => boolean | number) {\n\n        const layerIDs = this.bucketLayerIDs[bucketIndex];\n        if (filterLayerIDs && !arraysIntersect(filterLayerIDs, layerIDs))\n            return;\n\n        const sourceLayerName = this.sourceLayerCoder.decode(sourceLayerIndex);\n        const sourceLayer = this.vtLayers[sourceLayerName];\n        const feature = sourceLayer.feature(featureIndex);\n\n        if (filter.needGeometry) {\n            const evaluationFeature = toEvaluationFeature(feature, true);\n            if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), evaluationFeature, this.tileID.canonical)) {\n                return;\n            }\n        } else if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), feature)) {\n            return;\n        }\n\n        const id = this.getId(feature, sourceLayerName);\n\n        for (let l = 0; l < layerIDs.length; l++) {\n            const layerID = layerIDs[l];\n\n            if (filterLayerIDs && filterLayerIDs.indexOf(layerID) < 0) {\n                continue;\n            }\n\n            const styleLayer = styleLayers[layerID];\n\n            if (!styleLayer) continue;\n\n            let featureState = {};\n            if (id && sourceFeatureState) {\n                // `feature-state` expression evaluation requires feature state to be available\n                featureState = sourceFeatureState.getState(styleLayer.sourceLayer || '_geojsonTileLayer', id);\n            }\n\n            const serializedLayer = extend({}, serializedLayers[layerID]);\n\n            serializedLayer.paint = evaluateProperties(serializedLayer.paint, styleLayer.paint, feature, featureState, availableImages);\n            serializedLayer.layout = evaluateProperties(serializedLayer.layout, styleLayer.layout, feature, featureState, availableImages);\n\n            const intersectionZ = !intersectionTest || intersectionTest(feature, styleLayer, featureState);\n            if (!intersectionZ) {\n                // Only applied for non-symbol features\n                continue;\n            }\n\n            const geojsonFeature = new GeoJSONFeature(feature, this.z, this.x, this.y, id) as MapGeoJSONFeature;\n            geojsonFeature.layer = serializedLayer;\n            let layerResult = result[layerID];\n            if (layerResult === undefined) {\n                layerResult = result[layerID] = [];\n            }\n            layerResult.push({featureIndex, feature: geojsonFeature, intersectionZ});\n        }\n    }\n\n    // Given a set of symbol indexes that have already been looked up,\n    // return a matching set of GeoJSONFeatures\n    lookupSymbolFeatures(symbolFeatureIndexes: Array<number>,\n        serializedLayers: {[_: string]: StyleLayer},\n        bucketIndex: number,\n        sourceLayerIndex: number,\n        filterSpec: FilterSpecification,\n        filterLayerIDs: Array<string>,\n        availableImages: Array<string>,\n        styleLayers: {[_: string]: StyleLayer}) {\n        const result = {};\n        this.loadVTLayers();\n\n        const filter = featureFilter(filterSpec);\n\n        for (const symbolFeatureIndex of symbolFeatureIndexes) {\n            this.loadMatchingFeature(\n                result,\n                bucketIndex,\n                sourceLayerIndex,\n                symbolFeatureIndex,\n                filter,\n                filterLayerIDs,\n                availableImages,\n                styleLayers,\n                serializedLayers\n            );\n\n        }\n        return result;\n    }\n\n    hasLayer(id: string) {\n        for (const layerIDs of this.bucketLayerIDs) {\n            for (const layerID of layerIDs) {\n                if (id === layerID) return true;\n            }\n        }\n\n        return false;\n    }\n\n    getId(feature: VectorTileFeature, sourceLayerId: string): string | number {\n        let id: string | number = feature.id;\n        if (this.promoteId) {\n            const propName = typeof this.promoteId === 'string' ? this.promoteId : this.promoteId[sourceLayerId];\n            id = feature.properties[propName] as string | number;\n            if (typeof id === 'boolean') id = Number(id);\n        }\n        return id;\n    }\n}\n\nregister(\n    'FeatureIndex',\n    FeatureIndex,\n    {omit: ['rawTileData', 'sourceLayerCoder']}\n);\n\nfunction evaluateProperties(serializedProperties, styleLayerProperties, feature, featureState, availableImages) {\n    return mapObject(serializedProperties, (property, key) => {\n        const prop = styleLayerProperties instanceof PossiblyEvaluated ? styleLayerProperties.get(key) : null;\n        return prop && prop.evaluate ? prop.evaluate(feature, featureState, availableImages) : prop;\n    });\n}\n\nfunction getBounds(geometry: Array<Point>) {\n    let minX = Infinity;\n    let minY = Infinity;\n    let maxX = -Infinity;\n    let maxY = -Infinity;\n    for (const p of geometry) {\n        minX = Math.min(minX, p.x);\n        minY = Math.min(minY, p.y);\n        maxX = Math.max(maxX, p.x);\n        maxY = Math.max(maxY, p.y);\n    }\n    return {minX, minY, maxX, maxY};\n}\n\nfunction topDownFeatureComparator(a, b) {\n    return b - a;\n}\n", "import Point from '@mapbox/point-geometry';\n\n/**\n * Returns the part of a multiline that intersects with the provided rectangular box.\n *\n * @param lines - the lines to check\n * @param x1 - the left edge of the box\n * @param y1 - the top edge of the box\n * @param x2 - the right edge of the box\n * @param y2 - the bottom edge of the box\n * @returns lines\n */\nexport function clipLine(lines: Array<Array<Point>>, x1: number, y1: number, x2: number, y2: number): Array<Array<Point>> {\n    const clippedLines = [];\n\n    for (let l = 0; l < lines.length; l++) {\n        const line = lines[l];\n        let clippedLine;\n\n        for (let i = 0; i < line.length - 1; i++) {\n            let p0 = line[i];\n            let p1 = line[i + 1];\n\n            if (p0.x < x1 && p1.x < x1) {\n                continue;\n            } else if (p0.x < x1) {\n                p0 = new Point(x1, p0.y + (p1.y - p0.y) * ((x1 - p0.x) / (p1.x - p0.x)))._round();\n            } else if (p1.x < x1) {\n                p1 = new Point(x1, p0.y + (p1.y - p0.y) * ((x1 - p0.x) / (p1.x - p0.x)))._round();\n            }\n\n            if (p0.y < y1 && p1.y < y1) {\n                continue;\n            } else if (p0.y < y1) {\n                p0 = new Point(p0.x + (p1.x - p0.x) * ((y1 - p0.y) / (p1.y - p0.y)), y1)._round();\n            } else if (p1.y < y1) {\n                p1 = new Point(p0.x + (p1.x - p0.x) * ((y1 - p0.y) / (p1.y - p0.y)), y1)._round();\n            }\n\n            if (p0.x >= x2 && p1.x >= x2) {\n                continue;\n            } else if (p0.x >= x2) {\n                p0 = new Point(x2, p0.y + (p1.y - p0.y) * ((x2 - p0.x) / (p1.x - p0.x)))._round();\n            } else if (p1.x >= x2) {\n                p1 = new Point(x2, p0.y + (p1.y - p0.y) * ((x2 - p0.x) / (p1.x - p0.x)))._round();\n            }\n\n            if (p0.y >= y2 && p1.y >= y2) {\n                continue;\n            } else if (p0.y >= y2) {\n                p0 = new Point(p0.x + (p1.x - p0.x) * ((y2 - p0.y) / (p1.y - p0.y)), y2)._round();\n            } else if (p1.y >= y2) {\n                p1 = new Point(p0.x + (p1.x - p0.x) * ((y2 - p0.y) / (p1.y - p0.y)), y2)._round();\n            }\n\n            if (!clippedLine || !p0.equals(clippedLine[clippedLine.length - 1])) {\n                clippedLine = [p0];\n                clippedLines.push(clippedLine);\n            }\n\n            clippedLine.push(p1);\n        }\n    }\n\n    return clippedLines;\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport {register} from '../util/web_worker_transfer';\n\nexport class Anchor extends Point {\n    angle: any;\n    segment?: number;\n\n    constructor(x: number, y: number, angle: number, segment?: number) {\n        super(x, y);\n        this.angle = angle;\n        if (segment !== undefined) {\n            this.segment = segment;\n        }\n    }\n\n    clone() {\n        return new Anchor(this.x, this.y, this.angle, this.segment);\n    }\n}\n\nregister('Anchor', Anchor);\n", "import type Point from '@mapbox/point-geometry';\nimport type {Anchor} from './anchor';\n\n/**\n * Labels placed around really sharp angles aren't readable. Check if any\n * part of the potential label has a combined angle that is too big.\n *\n * @param line - The line to check\n * @param anchor - The point on the line around which the label is anchored.\n * @param labelLength - The length of the label in geometry units.\n * @param windowSize - The check fails if the combined angles within a part of the line that is `windowSize` long is too big.\n * @param maxAngle - The maximum combined angle that any window along the label is allowed to have.\n *\n * @returns whether the label should be placed\n */\nexport function checkMaxAngle(line: Array<Point>, anchor: Anchor, labelLength: number, windowSize: number, maxAngle: number) {\n\n    // horizontal labels and labels with length 0 always pass\n    if (anchor.segment === undefined || labelLength === 0) return true;\n\n    let p = anchor;\n    let index = anchor.segment + 1;\n    let anchorDistance = 0;\n\n    // move backwards along the line to the first segment the label appears on\n    while (anchorDistance > -labelLength / 2) {\n        index--;\n\n        // there isn't enough room for the label after the beginning of the line\n        if (index < 0) return false;\n\n        anchorDistance -= line[index].dist(p);\n        p = line[index];\n    }\n\n    anchorDistance += line[index].dist(line[index + 1]);\n    index++;\n\n    // store recent corners and their total angle difference\n    const recentCorners = [];\n    let recentAngleDelta = 0;\n\n    // move forwards by the length of the label and check angles along the way\n    while (anchorDistance < labelLength / 2) {\n        const prev = line[index - 1];\n        const current = line[index];\n        const next = line[index + 1];\n\n        // there isn't enough room for the label before the end of the line\n        if (!next) return false;\n\n        let angleDelta = prev.angleTo(current) - current.angleTo(next);\n        // restrict angle to -pi..pi range\n        angleDelta = Math.abs(((angleDelta + 3 * Math.PI) % (Math.PI * 2)) - Math.PI);\n\n        recentCorners.push({\n            distance: anchorDistance,\n            angleDelta\n        });\n        recentAngleDelta += angleDelta;\n\n        // remove corners that are far enough away from the list of recent anchors\n        while (anchorDistance - recentCorners[0].distance > windowSize) {\n            recentAngleDelta -= recentCorners.shift().angleDelta;\n        }\n\n        // the sum of angles within the window area exceeds the maximum allowed value. check fails.\n        if (recentAngleDelta > maxAngle) return false;\n\n        index++;\n        anchorDistance += current.dist(next);\n    }\n\n    // no part of the line had an angle greater than the maximum allowed. check passes.\n    return true;\n}\n", "import {interpolates} from '@maplibre/maplibre-gl-style-spec';\n\nimport {Anchor} from '../symbol/anchor';\nimport {checkMaxAngle} from './check_max_angle';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {Shaping, PositionedIcon} from './shaping';\n\nexport {getAnchors, getCenterAnchor};\n\nfunction getLineLength(line: Array<Point>): number {\n    let lineLength = 0;\n    for (let k = 0; k < line.length - 1; k++) {\n        lineLength += line[k].dist(line[k + 1]);\n    }\n    return lineLength;\n}\n\nfunction getAngleWindowSize(\n    shapedText: Shaping,\n    glyphSize: number,\n    boxScale: number\n): number {\n    return shapedText ?\n        3 / 5 * glyphSize * boxScale :\n        0;\n}\n\nfunction getShapedLabelLength(shapedText?: Shaping | null, shapedIcon?: PositionedIcon | null): number {\n    return Math.max(\n        shapedText ? shapedText.right - shapedText.left : 0,\n        shapedIcon ? shapedIcon.right - shapedIcon.left : 0);\n}\n\nfunction getCenterAnchor(line: Array<Point>,\n    maxAngle: number,\n    shapedText: Shaping,\n    shapedIcon: PositionedIcon,\n    glyphSize: number,\n    boxScale: number) {\n    const angleWindowSize = getAngleWindowSize(shapedText, glyphSize, boxScale);\n    const labelLength = getShapedLabelLength(shapedText, shapedIcon) * boxScale;\n\n    let prevDistance = 0;\n    const centerDistance = getLineLength(line) / 2;\n\n    for (let i = 0; i < line.length - 1; i++) {\n\n        const a = line[i],\n            b = line[i + 1];\n\n        const segmentDistance = a.dist(b);\n\n        if (prevDistance + segmentDistance > centerDistance) {\n            // The center is on this segment\n            const t = (centerDistance - prevDistance) / segmentDistance,\n                x = interpolates.number(a.x, b.x, t),\n                y = interpolates.number(a.y, b.y, t);\n\n            const anchor = new Anchor(x, y, b.angleTo(a), i);\n            anchor._round();\n            if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {\n                return anchor;\n            } else {\n                return;\n            }\n        }\n\n        prevDistance += segmentDistance;\n    }\n}\n\nfunction getAnchors(line: Array<Point>,\n    spacing: number,\n    maxAngle: number,\n    shapedText: Shaping,\n    shapedIcon: PositionedIcon,\n    glyphSize: number,\n    boxScale: number,\n    overscaling: number,\n    tileExtent: number) {\n\n    // Resample a line to get anchor points for labels and check that each\n    // potential label passes text-max-angle check and has enough room to fit\n    // on the line.\n\n    const angleWindowSize = getAngleWindowSize(shapedText, glyphSize, boxScale);\n    const shapedLabelLength = getShapedLabelLength(shapedText, shapedIcon);\n    const labelLength = shapedLabelLength * boxScale;\n\n    // Is the line continued from outside the tile boundary?\n    const isLineContinued = line[0].x === 0 || line[0].x === tileExtent || line[0].y === 0 || line[0].y === tileExtent;\n\n    // Is the label long, relative to the spacing?\n    // If so, adjust the spacing so there is always a minimum space of `spacing / 4` between label edges.\n    if (spacing - labelLength < spacing / 4) {\n        spacing = labelLength + spacing / 4;\n    }\n\n    // Offset the first anchor by:\n    // Either half the label length plus a fixed extra offset if the line is not continued\n    // Or half the spacing if the line is continued.\n\n    // For non-continued lines, add a bit of fixed extra offset to avoid collisions at T intersections.\n    const fixedExtraOffset = glyphSize * 2;\n\n    const offset = !isLineContinued ?\n        ((shapedLabelLength / 2 + fixedExtraOffset) * boxScale * overscaling) % spacing :\n        (spacing / 2 * overscaling) % spacing;\n\n    return resample(line, offset, spacing, angleWindowSize, maxAngle, labelLength, isLineContinued, false, tileExtent);\n}\n\nfunction resample(line, offset, spacing, angleWindowSize, maxAngle, labelLength, isLineContinued, placeAtMiddle, tileExtent) {\n\n    const halfLabelLength = labelLength / 2;\n    const lineLength = getLineLength(line);\n\n    let distance = 0,\n        markedDistance = offset - spacing;\n\n    let anchors = [];\n\n    for (let i = 0; i < line.length - 1; i++) {\n\n        const a = line[i],\n            b = line[i + 1];\n\n        const segmentDist = a.dist(b),\n            angle = b.angleTo(a);\n\n        while (markedDistance + spacing < distance + segmentDist) {\n            markedDistance += spacing;\n\n            const t = (markedDistance - distance) / segmentDist,\n                x = interpolates.number(a.x, b.x, t),\n                y = interpolates.number(a.y, b.y, t);\n\n            // Check that the point is within the tile boundaries and that\n            // the label would fit before the beginning and end of the line\n            // if placed at this point.\n            if (x >= 0 && x < tileExtent && y >= 0 && y < tileExtent &&\n                    markedDistance - halfLabelLength >= 0 &&\n                    markedDistance + halfLabelLength <= lineLength) {\n                const anchor = new Anchor(x, y, angle, i);\n                anchor._round();\n\n                if (!angleWindowSize || checkMaxAngle(line, anchor, labelLength, angleWindowSize, maxAngle)) {\n                    anchors.push(anchor);\n                }\n            }\n        }\n\n        distance += segmentDist;\n    }\n\n    if (!placeAtMiddle && !anchors.length && !isLineContinued) {\n        // The first attempt at finding anchors at which labels can be placed failed.\n        // Try again, but this time just try placing one anchor at the middle of the line.\n        // This has the most effect for short lines in overscaled tiles, since the\n        // initial offset used in overscaled tiles is calculated to align labels with positions in\n        // parent tiles instead of placing the label as close to the beginning as possible.\n        anchors = resample(line, distance / 2, spacing, angleWindowSize, maxAngle, labelLength, isLineContinued, true, tileExtent);\n    }\n\n    return anchors;\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport {GLYPH_PBF_BORDER} from '../style/parse_glyph_pbf';\n\nimport type {Anchor} from './anchor';\nimport type {Box, PositionedIcon, Shaping} from './shaping';\nimport {SHAPING_DEFAULT_OFFSET, applyTextFit} from './shaping';\nimport {IMAGE_PADDING} from '../render/image_atlas';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport type {Feature} from '@maplibre/maplibre-gl-style-spec';\nimport type {StyleImage} from '../style/style_image';\nimport ONE_EM from './one_em';\nimport {Rect} from '../render/glyph_atlas';\n\n/**\n * A textured quad for rendering a single icon or glyph.\n *\n * The zoom range the glyph can be shown is defined by minScale and maxScale.\n *\n * @param tl - The offset of the top left corner from the anchor.\n * @param tr - The offset of the top right corner from the anchor.\n * @param bl - The offset of the bottom left corner from the anchor.\n * @param br - The offset of the bottom right corner from the anchor.\n * @param tex - The texture coordinates.\n */\nexport type SymbolQuad = {\n    tl: Point;\n    tr: Point;\n    bl: Point;\n    br: Point;\n    tex: {\n        x: number;\n        y: number;\n        w: number;\n        h: number;\n    };\n    pixelOffsetTL: Point;\n    pixelOffsetBR: Point;\n    writingMode: any | void;\n    glyphOffset: [number, number];\n    sectionIndex: number;\n    isSDF: boolean;\n    minFontScaleX: number;\n    minFontScaleY: number;\n};\n\n// If you have a 10px icon that isn't perfectly aligned to the pixel grid it will cover 11 actual\n// pixels. The quad needs to be padded to account for this, otherwise they'll look slightly clipped\n// on one edge in some cases.\nconst border = IMAGE_PADDING;\n\n/**\n * Create the quads used for rendering an icon.\n */\nexport function getIconQuads(\n    shapedIcon: PositionedIcon,\n    iconRotate: number,\n    isSDFIcon: boolean,\n    hasIconTextFit: boolean\n): Array<SymbolQuad> {\n    const quads = [];\n\n    const image = shapedIcon.image;\n    const pixelRatio = image.pixelRatio;\n    const imageWidth = image.paddedRect.w - 2 * border;\n    const imageHeight = image.paddedRect.h - 2 * border;\n\n    let icon: Box = {\n        x1: shapedIcon.left,\n        y1: shapedIcon.top,\n        x2: shapedIcon.right,\n        y2: shapedIcon.bottom\n    };\n\n    const stretchX = image.stretchX || [[0, imageWidth]];\n    const stretchY = image.stretchY || [[0, imageHeight]];\n\n    const reduceRanges = (sum, range) => sum + range[1] - range[0];\n    const stretchWidth = stretchX.reduce(reduceRanges, 0);\n    const stretchHeight = stretchY.reduce(reduceRanges, 0);\n    const fixedWidth = imageWidth - stretchWidth;\n    const fixedHeight = imageHeight - stretchHeight;\n\n    let stretchOffsetX = 0;\n    let stretchContentWidth = stretchWidth;\n    let stretchOffsetY = 0;\n    let stretchContentHeight = stretchHeight;\n    let fixedOffsetX = 0;\n    let fixedContentWidth = fixedWidth;\n    let fixedOffsetY = 0;\n    let fixedContentHeight = fixedHeight;\n\n    if (image.content && hasIconTextFit) {\n        const content = image.content;\n        const contentWidth = content[2] - content[0];\n        const contentHeight = content[3] - content[1];\n        // Constrict content area to fit target aspect ratio\n        if (image.textFitWidth || image.textFitHeight) {\n            icon = applyTextFit(shapedIcon);\n        }\n        stretchOffsetX = sumWithinRange(stretchX, 0, content[0]);\n        stretchOffsetY = sumWithinRange(stretchY, 0, content[1]);\n        stretchContentWidth = sumWithinRange(stretchX, content[0], content[2]);\n        stretchContentHeight = sumWithinRange(stretchY, content[1], content[3]);\n        fixedOffsetX = content[0] - stretchOffsetX;\n        fixedOffsetY = content[1] - stretchOffsetY;\n        fixedContentWidth = contentWidth - stretchContentWidth;\n        fixedContentHeight = contentHeight - stretchContentHeight;\n    }\n\n    const iconLeft = icon.x1;\n    const iconTop = icon.y1;\n    const iconWidth = icon.x2 - iconLeft;\n    const iconHeight = icon.y2 - iconTop;\n\n    const makeBox = (left, top, right, bottom) => {\n\n        const leftEm = getEmOffset(left.stretch - stretchOffsetX, stretchContentWidth, iconWidth, iconLeft);\n        const leftPx = getPxOffset(left.fixed - fixedOffsetX, fixedContentWidth, left.stretch, stretchWidth);\n\n        const topEm = getEmOffset(top.stretch - stretchOffsetY, stretchContentHeight, iconHeight, iconTop);\n        const topPx = getPxOffset(top.fixed - fixedOffsetY, fixedContentHeight, top.stretch, stretchHeight);\n\n        const rightEm = getEmOffset(right.stretch - stretchOffsetX, stretchContentWidth, iconWidth, iconLeft);\n        const rightPx = getPxOffset(right.fixed - fixedOffsetX, fixedContentWidth, right.stretch, stretchWidth);\n\n        const bottomEm = getEmOffset(bottom.stretch - stretchOffsetY, stretchContentHeight, iconHeight, iconTop);\n        const bottomPx = getPxOffset(bottom.fixed - fixedOffsetY, fixedContentHeight, bottom.stretch, stretchHeight);\n\n        const tl = new Point(leftEm, topEm);\n        const tr = new Point(rightEm, topEm);\n        const br = new Point(rightEm, bottomEm);\n        const bl = new Point(leftEm, bottomEm);\n        const pixelOffsetTL = new Point(leftPx / pixelRatio, topPx / pixelRatio);\n        const pixelOffsetBR = new Point(rightPx / pixelRatio, bottomPx / pixelRatio);\n\n        const angle = iconRotate * Math.PI / 180;\n\n        if (angle) {\n            const sin = Math.sin(angle),\n                cos = Math.cos(angle),\n                matrix = [cos, -sin, sin, cos];\n\n            tl._matMult(matrix);\n            tr._matMult(matrix);\n            bl._matMult(matrix);\n            br._matMult(matrix);\n        }\n\n        const x1 = left.stretch + left.fixed;\n        const x2 = right.stretch + right.fixed;\n        const y1 = top.stretch + top.fixed;\n        const y2 = bottom.stretch + bottom.fixed;\n\n        const subRect = {\n            x: image.paddedRect.x + border + x1,\n            y: image.paddedRect.y + border + y1,\n            w: x2 - x1,\n            h: y2 - y1\n        };\n\n        const minFontScaleX = fixedContentWidth / pixelRatio / iconWidth;\n        const minFontScaleY = fixedContentHeight / pixelRatio / iconHeight;\n\n        // Icon quad is padded, so texture coordinates also need to be padded.\n        return {tl, tr, bl, br, tex: subRect, writingMode: undefined, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY, isSDF: isSDFIcon};\n    };\n\n    if (!hasIconTextFit || (!image.stretchX && !image.stretchY)) {\n        quads.push(makeBox(\n            {fixed: 0, stretch: -1},\n            {fixed: 0, stretch: -1},\n            {fixed: 0, stretch: imageWidth + 1},\n            {fixed: 0, stretch: imageHeight + 1}));\n    } else {\n        const xCuts = stretchZonesToCuts(stretchX, fixedWidth, stretchWidth);\n        const yCuts = stretchZonesToCuts(stretchY, fixedHeight, stretchHeight);\n\n        for (let xi = 0; xi < xCuts.length - 1; xi++) {\n            const x1 = xCuts[xi];\n            const x2 = xCuts[xi + 1];\n            for (let yi = 0; yi < yCuts.length - 1; yi++) {\n                const y1 = yCuts[yi];\n                const y2 = yCuts[yi + 1];\n                quads.push(makeBox(x1, y1, x2, y2));\n            }\n        }\n    }\n\n    return quads;\n}\n\nfunction sumWithinRange(ranges, min, max) {\n    let sum = 0;\n    for (const range of ranges) {\n        sum += Math.max(min, Math.min(max, range[1])) - Math.max(min, Math.min(max, range[0]));\n    }\n    return sum;\n}\n\nfunction stretchZonesToCuts(stretchZones, fixedSize, stretchSize) {\n    const cuts = [{fixed: -border, stretch: 0}];\n\n    for (const [c1, c2] of stretchZones) {\n        const last = cuts[cuts.length - 1];\n        cuts.push({\n            fixed: c1 - last.stretch,\n            stretch: last.stretch\n        });\n        cuts.push({\n            fixed: c1 - last.stretch,\n            stretch: last.stretch + (c2 - c1)\n        });\n    }\n    cuts.push({\n        fixed: fixedSize + border,\n        stretch: stretchSize\n    });\n    return cuts;\n}\n\nfunction getEmOffset(stretchOffset, stretchSize, iconSize, iconOffset) {\n    return stretchOffset / stretchSize * iconSize + iconOffset;\n}\n\nfunction getPxOffset(fixedOffset, fixedSize, stretchOffset, stretchSize) {\n    return fixedOffset - fixedSize * stretchOffset / stretchSize;\n}\n\n/**\n * Create the quads used for rendering a text label.\n */\nexport function getGlyphQuads(\n    anchor: Anchor,\n    shaping: Shaping,\n    textOffset: [number, number],\n    layer: SymbolStyleLayer,\n    alongLine: boolean,\n    feature: Feature,\n    imageMap: {[_: string]: StyleImage},\n    allowVerticalPlacement: boolean\n): Array<SymbolQuad> {\n\n    const textRotate = layer.layout.get('text-rotate').evaluate(feature, {}) * Math.PI / 180;\n    const quads = [];\n\n    for (const line of shaping.positionedLines) {\n        for (const positionedGlyph of line.positionedGlyphs) {\n            if (!positionedGlyph.rect) continue;\n            const textureRect: Rect = positionedGlyph.rect || {} as Rect;\n\n            // The rects have an additional buffer that is not included in their size.\n            const glyphPadding = 1.0;\n            let rectBuffer = GLYPH_PBF_BORDER + glyphPadding;\n            let isSDF = true;\n            let pixelRatio = 1.0;\n            let lineOffset = 0.0;\n\n            const rotateVerticalGlyph = (alongLine || allowVerticalPlacement) && positionedGlyph.vertical;\n            const halfAdvance = positionedGlyph.metrics.advance * positionedGlyph.scale / 2;\n\n            // Align images and scaled glyphs in the middle of a vertical line.\n            if (allowVerticalPlacement && shaping.verticalizable) {\n                const scaledGlyphOffset = (positionedGlyph.scale - 1) * ONE_EM;\n                const imageOffset = (ONE_EM - positionedGlyph.metrics.width * positionedGlyph.scale) / 2;\n                lineOffset = line.lineOffset / 2 - (positionedGlyph.imageName ? -imageOffset : scaledGlyphOffset);\n            }\n\n            if (positionedGlyph.imageName) {\n                const image = imageMap[positionedGlyph.imageName];\n                isSDF = image.sdf;\n                pixelRatio = image.pixelRatio;\n                rectBuffer = IMAGE_PADDING / pixelRatio;\n            }\n\n            const glyphOffset = alongLine ?\n                [positionedGlyph.x + halfAdvance, positionedGlyph.y] :\n                [0, 0];\n\n            let builtInOffset: [number, number] = alongLine ?\n                [0, 0] :\n                [positionedGlyph.x + halfAdvance + textOffset[0], positionedGlyph.y + textOffset[1] - lineOffset];\n\n            let verticalizedLabelOffset = [0, 0] as [number, number];\n            if (rotateVerticalGlyph) {\n                // Vertical POI labels that are rotated 90deg CW and whose glyphs must preserve upright orientation\n                // need to be rotated 90deg CCW. After a quad is rotated, it is translated to the original built-in offset.\n                verticalizedLabelOffset = builtInOffset;\n                builtInOffset = [0, 0];\n            }\n\n            const textureScale = positionedGlyph.metrics.isDoubleResolution ? 2 : 1;\n\n            const x1 = (positionedGlyph.metrics.left - rectBuffer) * positionedGlyph.scale - halfAdvance + builtInOffset[0];\n            const y1 = (-positionedGlyph.metrics.top - rectBuffer) * positionedGlyph.scale + builtInOffset[1];\n            const x2 = x1 + textureRect.w / textureScale * positionedGlyph.scale / pixelRatio;\n            const y2 = y1 + textureRect.h / textureScale * positionedGlyph.scale / pixelRatio;\n\n            const tl = new Point(x1, y1);\n            const tr = new Point(x2, y1);\n            const bl = new Point(x1, y2);\n            const br = new Point(x2, y2);\n\n            if (rotateVerticalGlyph) {\n                // Vertical-supporting glyphs are laid out in 24x24 point boxes (1 square em)\n                // In horizontal orientation, the y values for glyphs are below the midline\n                // and we use a \"yOffset\" of -17 to pull them up to the middle.\n                // By rotating counter-clockwise around the point at the center of the left\n                // edge of a 24x24 layout box centered below the midline, we align the center\n                // of the glyphs with the horizontal midline, so the yOffset is no longer\n                // necessary, but we also pull the glyph to the left along the x axis.\n                // The y coordinate includes baseline yOffset, thus needs to be accounted\n                // for when glyph is rotated and translated.\n                const center = new Point(-halfAdvance, halfAdvance - SHAPING_DEFAULT_OFFSET);\n                const verticalRotation = -Math.PI / 2;\n\n                // xHalfWidthOffsetCorrection is a difference between full-width and half-width\n                // advance, should be 0 for full-width glyphs and will pull up half-width glyphs.\n                const xHalfWidthOffsetCorrection = ONE_EM / 2 - halfAdvance;\n                const yImageOffsetCorrection = positionedGlyph.imageName ? xHalfWidthOffsetCorrection : 0.0;\n                const halfWidthOffsetCorrection = new Point(5 - SHAPING_DEFAULT_OFFSET - xHalfWidthOffsetCorrection, -yImageOffsetCorrection);\n                const verticalOffsetCorrection = new Point(...verticalizedLabelOffset);\n                tl._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n                tr._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n                bl._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n                br._rotateAround(verticalRotation, center)._add(halfWidthOffsetCorrection)._add(verticalOffsetCorrection);\n            }\n\n            if (textRotate) {\n                const sin = Math.sin(textRotate),\n                    cos = Math.cos(textRotate),\n                    matrix = [cos, -sin, sin, cos];\n\n                tl._matMult(matrix);\n                tr._matMult(matrix);\n                bl._matMult(matrix);\n                br._matMult(matrix);\n            }\n\n            const pixelOffsetTL = new Point(0, 0);\n            const pixelOffsetBR = new Point(0, 0);\n            const minFontScaleX = 0;\n            const minFontScaleY = 0;\n            quads.push({tl, tr, bl, br, tex: textureRect, writingMode: shaping.writingMode, glyphOffset, sectionIndex: positionedGlyph.sectionIndex, isSDF, pixelOffsetTL, pixelOffsetBR, minFontScaleX, minFontScaleY});\n        }\n    }\n\n    return quads;\n}\n", "import type {CollisionBoxArray} from '../data/array_types.g';\nimport Point from '@mapbox/point-geometry';\nimport type {Anchor} from './anchor';\nimport {SymbolPadding} from '../style/style_layer/symbol_style_layer';\nimport {applyTextFit} from './shaping';\n\n/**\n * A CollisionFeature represents the area of the tile covered by a single label.\n * It is used with CollisionIndex to check if the label overlaps with any\n * previous labels. A CollisionFeature is mostly just a set of CollisionBox\n * objects.\n */\nexport class CollisionFeature {\n    boxStartIndex: number;\n    boxEndIndex: number;\n    circleDiameter: number;\n\n    /**\n     * Create a CollisionFeature, adding its collision box data to the given collisionBoxArray in the process.\n     * For line aligned labels a collision circle diameter is computed instead.\n     *\n     * @param anchor - The point along the line around which the label is anchored.\n     * @param shaped - The text or icon shaping results.\n     * @param boxScale - A magic number used to convert from glyph metrics units to geometry units.\n     * @param padding - The amount of padding to add around the label edges.\n     * @param alignLine - Whether the label is aligned with the line or the viewport.\n     */\n    constructor(collisionBoxArray: CollisionBoxArray,\n        anchor: Anchor,\n        featureIndex: number,\n        sourceLayerIndex: number,\n        bucketIndex: number,\n        shaped: any,\n        boxScale: number,\n        padding: SymbolPadding,\n        alignLine: boolean,\n        rotate: number) {\n\n        this.boxStartIndex = collisionBoxArray.length;\n\n        if (alignLine) {\n            // Compute height of the shape in glyph metrics and apply collision padding.\n            // Note that the pixel based 'text-padding' is applied at runtime\n            let top = shaped.top;\n            let bottom = shaped.bottom;\n            const collisionPadding = shaped.collisionPadding;\n\n            if (collisionPadding) {\n                top -= collisionPadding[1];\n                bottom += collisionPadding[3];\n            }\n\n            let height = bottom - top;\n\n            if (height > 0) {\n                // set minimum box height to avoid very many small labels\n                height = Math.max(10, height);\n                this.circleDiameter = height;\n            }\n        } else {\n            const icon = shaped.image?.content && (shaped.image.textFitWidth || shaped.image.textFitHeight) ?\n                applyTextFit(shaped) :\n                {\n                    x1: shaped.left,\n                    y1: shaped.top,\n                    x2: shaped.right,\n                    y2: shaped.bottom\n                };\n\n            // margin is in CSS order: [top, right, bottom, left]\n            icon.y1 = icon.y1 * boxScale - padding[0];\n            icon.y2 = icon.y2 * boxScale + padding[2];\n            icon.x1 = icon.x1 * boxScale - padding[3];\n            icon.x2 = icon.x2 * boxScale + padding[1];\n\n            const collisionPadding = shaped.collisionPadding;\n            if (collisionPadding) {\n                icon.x1 -= collisionPadding[0] * boxScale;\n                icon.y1 -= collisionPadding[1] * boxScale;\n                icon.x2 += collisionPadding[2] * boxScale;\n                icon.y2 += collisionPadding[3] * boxScale;\n            }\n\n            if (rotate) {\n                // Account for *-rotate in point collision boxes\n                // See https://github.com/mapbox/mapbox-gl-js/issues/6075\n                // Doesn't account for icon-text-fit\n\n                const tl = new Point(icon.x1, icon.y1);\n                const tr = new Point(icon.x2, icon.y1);\n                const bl = new Point(icon.x1, icon.y2);\n                const br = new Point(icon.x2, icon.y2);\n\n                const rotateRadians = rotate * Math.PI / 180;\n\n                tl._rotate(rotateRadians);\n                tr._rotate(rotateRadians);\n                bl._rotate(rotateRadians);\n                br._rotate(rotateRadians);\n\n                // Collision features require an \"on-axis\" geometry,\n                // so take the envelope of the rotated geometry\n                // (may be quite large for wide labels rotated 45 degrees)\n                icon.x1 = Math.min(tl.x, tr.x, bl.x, br.x);\n                icon.x2 = Math.max(tl.x, tr.x, bl.x, br.x);\n                icon.y1 = Math.min(tl.y, tr.y, bl.y, br.y);\n                icon.y2 = Math.max(tl.y, tr.y, bl.y, br.y);\n            }\n            collisionBoxArray.emplaceBack(anchor.x, anchor.y, icon.x1, icon.y1, icon.x2, icon.y2, featureIndex, sourceLayerIndex, bucketIndex);\n        }\n\n        this.boxEndIndex = collisionBoxArray.length;\n    }\n}\n", "\nexport default class TinyQueue {\n    constructor(data = [], compare = (a, b) => (a < b ? -1 : a > b ? 1 : 0)) {\n        this.data = data;\n        this.length = this.data.length;\n        this.compare = compare;\n\n        if (this.length > 0) {\n            for (let i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n        }\n    }\n\n    push(item) {\n        this.data.push(item);\n        this._up(this.length++);\n    }\n\n    pop() {\n        if (this.length === 0) return undefined;\n\n        const top = this.data[0];\n        const bottom = this.data.pop();\n\n        if (--this.length > 0) {\n            this.data[0] = bottom;\n            this._down(0);\n        }\n\n        return top;\n    }\n\n    peek() {\n        return this.data[0];\n    }\n\n    _up(pos) {\n        const {data, compare} = this;\n        const item = data[pos];\n\n        while (pos > 0) {\n            const parent = (pos - 1) >> 1;\n            const current = data[parent];\n            if (compare(item, current) >= 0) break;\n            data[pos] = current;\n            pos = parent;\n        }\n\n        data[pos] = item;\n    }\n\n    _down(pos) {\n        const {data, compare} = this;\n        const halfLength = this.length >> 1;\n        const item = data[pos];\n\n        while (pos < halfLength) {\n            let bestChild = (pos << 1) + 1; // initially it is the left child\n            const right = bestChild + 1;\n\n            if (right < this.length && compare(data[right], data[bestChild]) < 0) {\n                bestChild = right;\n            }\n            if (compare(data[bestChild], item) >= 0) break;\n\n            data[pos] = data[bestChild];\n            pos = bestChild;\n        }\n\n        data[pos] = item;\n    }\n}\n", "import Queue from 'tinyqueue';\n\nimport Point from '@mapbox/point-geometry';\nimport {distToSegmentSquared} from './intersection_tests';\n\n/**\n * Finds an approximation of a polygon's Pole Of Inaccessibility https://en.wikipedia.org/wiki/Pole_of_inaccessibility\n * This is a copy of https://github.com/mapbox/polylabel adapted to use Points\n *\n * @param polygonRings - first item in array is the outer ring followed optionally by the list of holes, should be an element of the result of util/classify_rings\n * @param precision - Specified in input coordinate units. If 0 returns after first run, if `> 0` repeatedly narrows the search space until the radius of the area searched for the best pole is less than precision\n * @param debug - Print some statistics to the console during execution\n * @returns Pole of Inaccessibility.\n */\nexport function findPoleOfInaccessibility(\n    polygonRings: Array<Array<Point>>,\n    precision: number = 1,\n    debug: boolean = false\n): Point {\n    // find the bounding box of the outer ring\n    let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n    const outerRing = polygonRings[0];\n    for (let i = 0; i < outerRing.length; i++) {\n        const p = outerRing[i];\n        if (!i || p.x < minX) minX = p.x;\n        if (!i || p.y < minY) minY = p.y;\n        if (!i || p.x > maxX) maxX = p.x;\n        if (!i || p.y > maxY) maxY = p.y;\n    }\n\n    const width = maxX - minX;\n    const height = maxY - minY;\n    const cellSize = Math.min(width, height);\n    let h = cellSize / 2;\n\n    // a priority queue of cells in order of their \"potential\" (max distance to polygon)\n    const cellQueue = new Queue([], compareMax);\n\n    if (cellSize === 0) return new Point(minX, minY);\n\n    // cover polygon with initial cells\n    for (let x = minX; x < maxX; x += cellSize) {\n        for (let y = minY; y < maxY; y += cellSize) {\n            cellQueue.push(new Cell(x + h, y + h, h, polygonRings));\n        }\n    }\n\n    // take centroid as the first best guess\n    let bestCell = getCentroidCell(polygonRings);\n    let numProbes = cellQueue.length;\n\n    while (cellQueue.length) {\n        // pick the most promising cell from the queue\n        const cell = cellQueue.pop();\n\n        // update the best cell if we found a better one\n        if (cell.d > bestCell.d || !bestCell.d) {\n            bestCell = cell;\n            if (debug) console.log('found best %d after %d probes', Math.round(1e4 * cell.d) / 1e4, numProbes);\n        }\n\n        // do not drill down further if there's no chance of a better solution\n        if (cell.max - bestCell.d <= precision) continue;\n\n        // split the cell into four cells\n        h = cell.h / 2;\n        cellQueue.push(new Cell(cell.p.x - h, cell.p.y - h, h, polygonRings));\n        cellQueue.push(new Cell(cell.p.x + h, cell.p.y - h, h, polygonRings));\n        cellQueue.push(new Cell(cell.p.x - h, cell.p.y + h, h, polygonRings));\n        cellQueue.push(new Cell(cell.p.x + h, cell.p.y + h, h, polygonRings));\n        numProbes += 4;\n    }\n\n    if (debug) {\n        console.log(`num probes: ${numProbes}`);\n        console.log(`best distance: ${bestCell.d}`);\n    }\n\n    return bestCell.p;\n}\n\nfunction compareMax(a, b) {\n    return b.max - a.max;\n}\n\nfunction Cell(x, y, h, polygon) {\n    this.p = new Point(x, y);\n    this.h = h; // half the cell size\n    this.d = pointToPolygonDist(this.p, polygon); // distance from cell center to polygon\n    this.max = this.d + this.h * Math.SQRT2; // max distance to polygon within a cell\n}\n\n// signed distance from point to polygon outline (negative if point is outside)\nfunction pointToPolygonDist(p, polygon) {\n    let inside = false;\n    let minDistSq = Infinity;\n\n    for (let k = 0; k < polygon.length; k++) {\n        const ring = polygon[k];\n\n        for (let i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n            const a = ring[i];\n            const b = ring[j];\n\n            if ((a.y > p.y !== b.y > p.y) &&\n                (p.x < (b.x - a.x) * (p.y - a.y) / (b.y - a.y) + a.x)) inside = !inside;\n\n            minDistSq = Math.min(minDistSq, distToSegmentSquared(p, a, b));\n        }\n    }\n\n    return (inside ? 1 : -1) * Math.sqrt(minDistSq);\n}\n\n// get polygon centroid\nfunction getCentroidCell(polygon) {\n    let area = 0;\n    let x = 0;\n    let y = 0;\n    const points = polygon[0];\n    for (let i = 0, len = points.length, j = len - 1; i < len; j = i++) {\n        const a = points[i];\n        const b = points[j];\n        const f = a.x * b.y - b.x * a.y;\n        x += (a.x + b.x) * f;\n        y += (a.y + b.y) * f;\n        area += f * 3;\n    }\n    return new Cell(x / area, y / area, 0, polygon);\n}\n", "import {VariableAnchorOffsetCollection, VariableAnchorOffsetCollectionSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {SymbolFeature} from '../../data/bucket/symbol_bucket';\nimport {CanonicalTileID} from '../../source/tile_id';\nimport ONE_EM from '../../symbol/one_em';\nimport {SymbolStyleLayer} from './symbol_style_layer';\n\nexport enum TextAnchorEnum {\n    'center' = 1,\n    'left' = 2,\n    'right' = 3,\n    'top' = 4,\n    'bottom' = 5,\n    'top-left' = 6,\n    'top-right' = 7,\n    'bottom-left' = 8,\n    'bottom-right' = 9\n}\n\nexport type TextAnchor = keyof typeof TextAnchorEnum;\n\n// The radial offset is to the edge of the text box\n// In the horizontal direction, the edge of the text box is where glyphs start\n// But in the vertical direction, the glyphs appear to \"start\" at the baseline\n// We don't actually load baseline data, but we assume an offset of ONE_EM - 17\n// (see \"yOffset\" in shaping.js)\nconst baselineOffset = 7;\nexport const INVALID_TEXT_OFFSET = Number.POSITIVE_INFINITY;\n\nexport function evaluateVariableOffset(anchor: TextAnchor, offset: [number, number]): [number, number] {\n\n    function fromRadialOffset(anchor: TextAnchor, radialOffset: number): [number, number] {\n        let x = 0, y = 0;\n        if (radialOffset < 0) radialOffset = 0; // Ignore negative offset.\n        // solve for r where r^2 + r^2 = radialOffset^2\n        const hypotenuse = radialOffset / Math.SQRT2;\n        switch (anchor) {\n            case 'top-right':\n            case 'top-left':\n                y = hypotenuse - baselineOffset;\n                break;\n            case 'bottom-right':\n            case 'bottom-left':\n                y = -hypotenuse + baselineOffset;\n                break;\n            case 'bottom':\n                y = -radialOffset + baselineOffset;\n                break;\n            case 'top':\n                y = radialOffset - baselineOffset;\n                break;\n        }\n\n        switch (anchor) {\n            case 'top-right':\n            case 'bottom-right':\n                x = -hypotenuse;\n                break;\n            case 'top-left':\n            case 'bottom-left':\n                x = hypotenuse;\n                break;\n            case 'left':\n                x = radialOffset;\n                break;\n            case 'right':\n                x = -radialOffset;\n                break;\n        }\n\n        return [x, y];\n    }\n\n    function fromTextOffset(anchor: TextAnchor, offsetX: number, offsetY: number): [number, number] {\n        let x = 0, y = 0;\n        // Use absolute offset values.\n        offsetX = Math.abs(offsetX);\n        offsetY = Math.abs(offsetY);\n\n        switch (anchor) {\n            case 'top-right':\n            case 'top-left':\n            case 'top':\n                y = offsetY - baselineOffset;\n                break;\n            case 'bottom-right':\n            case 'bottom-left':\n            case 'bottom':\n                y = -offsetY + baselineOffset;\n                break;\n        }\n\n        switch (anchor) {\n            case 'top-right':\n            case 'bottom-right':\n            case 'right':\n                x = -offsetX;\n                break;\n            case 'top-left':\n            case 'bottom-left':\n            case 'left':\n                x = offsetX;\n                break;\n        }\n\n        return [x, y];\n    }\n\n    return (offset[1] !== INVALID_TEXT_OFFSET) ? fromTextOffset(anchor, offset[0], offset[1]) : fromRadialOffset(anchor, offset[0]);\n}\n\n// Helper to support both text-variable-anchor and text-variable-anchor-offset. Offset values converted from EMs to PXs\nexport function getTextVariableAnchorOffset(layer: SymbolStyleLayer, feature: SymbolFeature, canonical: CanonicalTileID): VariableAnchorOffsetCollection | null {\n    const layout = layer.layout;\n    // If style specifies text-variable-anchor-offset, just return it\n    const variableAnchorOffset = layout.get('text-variable-anchor-offset')?.evaluate(feature, {}, canonical);\n\n    if (variableAnchorOffset) {\n        const sourceValues = variableAnchorOffset.values;\n        const destValues: VariableAnchorOffsetCollectionSpecification = [];\n\n        // Convert offsets from EM to PX, and apply baseline shift\n        for (let i = 0; i < sourceValues.length; i += 2) {\n            const anchor = destValues[i] = sourceValues[i] as TextAnchor;\n            const offset = (sourceValues[i + 1] as [number, number]).map(t => t * ONE_EM) as [number, number];\n\n            if (anchor.startsWith('top')) {\n                offset[1] -= baselineOffset;\n            } else if (anchor.startsWith('bottom')) {\n                offset[1] += baselineOffset;\n            }\n\n            destValues[i + 1] = offset;\n        }\n\n        return new VariableAnchorOffsetCollection(destValues);\n    }\n\n    // If style specifies text-variable-anchor, convert to the new format\n    const variableAnchor = layout.get('text-variable-anchor');\n\n    if (variableAnchor) {\n        let textOffset: [number, number];\n        const unevaluatedLayout = layer._unevaluatedLayout;\n\n        // The style spec says don't use `text-offset` and `text-radial-offset` together\n        // but doesn't actually specify what happens if you use both. We go with the radial offset.\n        if (unevaluatedLayout.getValue('text-radial-offset') !== undefined) {\n            textOffset = [layout.get('text-radial-offset').evaluate(feature, {}, canonical) * ONE_EM, INVALID_TEXT_OFFSET];\n        } else {\n            textOffset = layout.get('text-offset').evaluate(feature, {}, canonical).map(t => t * ONE_EM) as [number, number];\n        }\n\n        const anchorOffsets: VariableAnchorOffsetCollectionSpecification = [];\n\n        for (const anchor of variableAnchor) {\n            anchorOffsets.push(anchor, evaluateVariableOffset(anchor, textOffset));\n        }\n\n        return new VariableAnchorOffsetCollection(anchorOffsets);\n    }\n\n    return null;\n}\n", "import {Anchor} from './anchor';\n\nimport {getAnchors, getCenterAnchor} from './get_anchors';\nimport {clipLine} from './clip_line';\nimport {shapeText, shapeIcon, WritingMode, fitIconToText} from './shaping';\nimport {getGlyphQuads, getIconQuads} from './quads';\nimport {CollisionFeature} from './collision_feature';\nimport {warnOnce} from '../util/util';\nimport {\n    allowsVerticalWritingMode,\n    allowsLetterSpacing\n} from '../util/script_detection';\nimport {findPoleOfInaccessibility} from '../util/find_pole_of_inaccessibility';\nimport {EXTENT} from '../data/extent';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {SIZE_PACK_FACTOR, MAX_PACKED_SIZE, MAX_GLYPH_ICON_SIZE} from './symbol_size';\nimport ONE_EM from './one_em';\nimport type {CanonicalTileID} from '../source/tile_id';\nimport type {Shaping, PositionedIcon, TextJustify} from './shaping';\nimport type {CollisionBoxArray, TextAnchorOffsetArray} from '../data/array_types.g';\nimport type {SymbolFeature} from '../data/bucket/symbol_bucket';\nimport type {StyleImage} from '../style/style_image';\nimport type {StyleGlyph} from '../style/style_glyph';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {GlyphPosition} from '../render/glyph_atlas';\nimport type {PossiblyEvaluatedPropertyValue} from '../style/properties';\n\nimport Point from '@mapbox/point-geometry';\nimport murmur3 from 'murmurhash-js';\nimport {getIconPadding, SymbolPadding} from '../style/style_layer/symbol_style_layer';\nimport {VariableAnchorOffsetCollection, classifyRings} from '@maplibre/maplibre-gl-style-spec';\nimport {getTextVariableAnchorOffset, evaluateVariableOffset, INVALID_TEXT_OFFSET, TextAnchor, TextAnchorEnum} from '../style/style_layer/variable_text_anchor';\n\n// The symbol layout process needs `text-size` evaluated at up to five different zoom levels, and\n// `icon-size` at up to three:\n//\n//   1. `text-size` at the zoom level of the bucket. Used to calculate a per-feature size for source `text-size`\n//       expressions, and to calculate the box dimensions for icon-text-fit.\n//   2. `icon-size` at the zoom level of the bucket. Used to calculate a per-feature size for source `icon-size`\n//       expressions.\n//   3. `text-size` and `icon-size` at the zoom level of the bucket, plus one. Used to calculate collision boxes.\n//   4. `text-size` at zoom level 18. Used for something line-symbol-placement-related.\n//   5.  For composite `*-size` expressions: two zoom levels of curve stops that \"cover\" the zoom level of the\n//       bucket. These go into a vertex buffer and are used by the shader to interpolate the size at render time.\n//\n// (1) and (2) are stored in `bucket.layers[0].layout`. The remainder are below.\n//\ntype Sizes = {\n    layoutTextSize: PossiblyEvaluatedPropertyValue<number>; // (3),\n    layoutIconSize: PossiblyEvaluatedPropertyValue<number>; // (3),\n    textMaxSize: PossiblyEvaluatedPropertyValue<number>;    // (4),\n    compositeTextSizes: [PossiblyEvaluatedPropertyValue<number>, PossiblyEvaluatedPropertyValue<number>]; // (5),\n    compositeIconSizes: [PossiblyEvaluatedPropertyValue<number>, PossiblyEvaluatedPropertyValue<number>]; // (5)\n};\n\ntype ShapedTextOrientations = {\n    vertical: Shaping | false;\n    horizontal: Record<TextJustify, Shaping>;\n};\n\nexport function performSymbolLayout(args: {\n    bucket: SymbolBucket;\n    glyphMap: {\n        [_: string]: {\n            [x: number]: StyleGlyph;\n        };\n    };\n    glyphPositions: {\n        [_: string]: {\n            [x: number]: GlyphPosition;\n        };\n    };\n    imageMap: {[_: string]: StyleImage};\n    imagePositions: {[_: string]: ImagePosition};\n    showCollisionBoxes: boolean;\n    canonical: CanonicalTileID;\n}) {\n    args.bucket.createArrays();\n\n    const tileSize = 512 * args.bucket.overscaling;\n    args.bucket.tilePixelRatio = EXTENT / tileSize;\n    args.bucket.compareText = {};\n    args.bucket.iconsNeedLinear = false;\n\n    const layer = args.bucket.layers[0];\n    const layout = layer.layout;\n    const unevaluatedLayoutValues = layer._unevaluatedLayout._values;\n\n    const sizes: Sizes = {\n        // Filled in below, if *SizeData.kind is 'composite'\n        // compositeIconSizes: undefined,\n        // compositeTextSizes: undefined,\n        layoutIconSize: unevaluatedLayoutValues['icon-size'].possiblyEvaluate(new EvaluationParameters(args.bucket.zoom + 1), args.canonical),\n        layoutTextSize: unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(args.bucket.zoom + 1), args.canonical),\n        textMaxSize: unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(18))\n    } as Sizes;\n\n    if (args.bucket.textSizeData.kind === 'composite') {\n        const {minZoom, maxZoom} = args.bucket.textSizeData;\n        sizes.compositeTextSizes = [\n            unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(minZoom), args.canonical),\n            unevaluatedLayoutValues['text-size'].possiblyEvaluate(new EvaluationParameters(maxZoom), args.canonical)\n        ];\n    }\n\n    if (args.bucket.iconSizeData.kind === 'composite') {\n        const {minZoom, maxZoom} = args.bucket.iconSizeData;\n        sizes.compositeIconSizes = [\n            unevaluatedLayoutValues['icon-size'].possiblyEvaluate(new EvaluationParameters(minZoom), args.canonical),\n            unevaluatedLayoutValues['icon-size'].possiblyEvaluate(new EvaluationParameters(maxZoom), args.canonical)\n        ];\n    }\n\n    const lineHeight = layout.get('text-line-height') * ONE_EM;\n    const textAlongLine = layout.get('text-rotation-alignment') !== 'viewport' && layout.get('symbol-placement') !== 'point';\n    const keepUpright = layout.get('text-keep-upright');\n    const textSize = layout.get('text-size');\n\n    for (const feature of args.bucket.features) {\n        const fontstack = layout.get('text-font').evaluate(feature, {}, args.canonical).join(',');\n        const layoutTextSizeThisZoom = textSize.evaluate(feature, {}, args.canonical);\n        const layoutTextSize = sizes.layoutTextSize.evaluate(feature, {}, args.canonical);\n        const layoutIconSize = sizes.layoutIconSize.evaluate(feature, {}, args.canonical);\n\n        const shapedTextOrientations: ShapedTextOrientations = {\n            horizontal: {} as Record<TextJustify, Shaping>,\n            vertical: undefined\n        };\n        const text = feature.text;\n        let textOffset: [number, number] = [0, 0];\n        if (text) {\n            const unformattedText = text.toString();\n            const spacing = layout.get('text-letter-spacing').evaluate(feature, {}, args.canonical) * ONE_EM;\n            const spacingIfAllowed = allowsLetterSpacing(unformattedText) ? spacing : 0;\n\n            const textAnchor = layout.get('text-anchor').evaluate(feature, {}, args.canonical);\n            const variableAnchorOffset = getTextVariableAnchorOffset(layer, feature, args.canonical);\n\n            if (!variableAnchorOffset) {\n                const radialOffset = layout.get('text-radial-offset').evaluate(feature, {}, args.canonical);\n                // Layers with variable anchors use the `text-radial-offset` property and the [x, y] offset vector\n                // is calculated at placement time instead of layout time\n                if (radialOffset) {\n                    // The style spec says don't use `text-offset` and `text-radial-offset` together\n                    // but doesn't actually specify what happens if you use both. We go with the radial offset.\n                    textOffset = evaluateVariableOffset(textAnchor, [radialOffset * ONE_EM, INVALID_TEXT_OFFSET]);\n                } else {\n                    textOffset = (layout.get('text-offset').evaluate(feature, {}, args.canonical).map(t => t * ONE_EM) as [number, number]);\n                }\n            }\n\n            let textJustify = textAlongLine ?\n                'center' :\n                layout.get('text-justify').evaluate(feature, {}, args.canonical);\n\n            const symbolPlacement = layout.get('symbol-placement');\n            const maxWidth = symbolPlacement === 'point' ?\n                layout.get('text-max-width').evaluate(feature, {}, args.canonical) * ONE_EM :\n                Infinity;\n\n            const addVerticalShapingForPointLabelIfNeeded = () => {\n                if (args.bucket.allowVerticalPlacement && allowsVerticalWritingMode(unformattedText)) {\n                    // Vertical POI label placement is meant to be used for scripts that support vertical\n                    // writing mode, thus, default left justification is used. If Latin\n                    // scripts would need to be supported, this should take into account other justifications.\n                    shapedTextOrientations.vertical = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, textAnchor,\n                        'left', spacingIfAllowed, textOffset, WritingMode.vertical, true, layoutTextSize, layoutTextSizeThisZoom);\n                }\n            };\n\n            // If this layer uses text-variable-anchor, generate shapings for all justification possibilities.\n            if (!textAlongLine && variableAnchorOffset) {\n                const justifications = new Set<TextJustify>();\n\n                if (textJustify === 'auto') {\n                    for (let i = 0; i < variableAnchorOffset.values.length; i += 2) {\n                        justifications.add(getAnchorJustification(variableAnchorOffset.values[i] as TextAnchor));\n                    }\n                } else {\n                    justifications.add(textJustify);\n                }\n\n                let singleLine = false;\n                for (const justification of justifications) {\n                    if (shapedTextOrientations.horizontal[justification]) continue;\n                    if (singleLine) {\n                        // If the shaping for the first justification was only a single line, we\n                        // can re-use it for the other justifications\n                        shapedTextOrientations.horizontal[justification] = shapedTextOrientations.horizontal[0];\n                    } else {\n                        // If using text-variable-anchor for the layer, we use a center anchor for all shapings and apply\n                        // the offsets for the anchor in the placement step.\n                        const shaping = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, 'center',\n                            justification, spacingIfAllowed, textOffset, WritingMode.horizontal, false, layoutTextSize, layoutTextSizeThisZoom);\n                        if (shaping) {\n                            shapedTextOrientations.horizontal[justification] = shaping;\n                            singleLine = shaping.positionedLines.length === 1;\n                        }\n                    }\n                }\n\n                addVerticalShapingForPointLabelIfNeeded();\n            } else {\n                if (textJustify === 'auto') {\n                    textJustify = getAnchorJustification(textAnchor);\n                }\n\n                // Horizontal point or line label.\n                const shaping = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, textAnchor, textJustify, spacingIfAllowed,\n                    textOffset, WritingMode.horizontal, false, layoutTextSize, layoutTextSizeThisZoom);\n                if (shaping) shapedTextOrientations.horizontal[textJustify] = shaping;\n\n                // Vertical point label (if allowVerticalPlacement is enabled).\n                addVerticalShapingForPointLabelIfNeeded();\n\n                // Verticalized line label.\n                if (allowsVerticalWritingMode(unformattedText) && textAlongLine && keepUpright) {\n                    shapedTextOrientations.vertical = shapeText(text, args.glyphMap, args.glyphPositions, args.imagePositions, fontstack, maxWidth, lineHeight, textAnchor, textJustify,\n                        spacingIfAllowed, textOffset, WritingMode.vertical, false, layoutTextSize, layoutTextSizeThisZoom);\n                }\n            }\n        }\n\n        let shapedIcon;\n        let isSDFIcon = false;\n        if (feature.icon && feature.icon.name) {\n            const image = args.imageMap[feature.icon.name];\n            if (image) {\n                shapedIcon = shapeIcon(\n                    args.imagePositions[feature.icon.name],\n                    layout.get('icon-offset').evaluate(feature, {}, args.canonical),\n                    layout.get('icon-anchor').evaluate(feature, {}, args.canonical));\n                // null/undefined SDF property treated same as default (false)\n                isSDFIcon = !!image.sdf;\n                if (args.bucket.sdfIcons === undefined) {\n                    args.bucket.sdfIcons = isSDFIcon;\n                } else if (args.bucket.sdfIcons !== isSDFIcon) {\n                    warnOnce('Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer');\n                }\n                if (image.pixelRatio !== args.bucket.pixelRatio) {\n                    args.bucket.iconsNeedLinear = true;\n                } else if (layout.get('icon-rotate').constantOr(1) !== 0) {\n                    args.bucket.iconsNeedLinear = true;\n                }\n            }\n        }\n\n        const shapedText = getDefaultHorizontalShaping(shapedTextOrientations.horizontal) || shapedTextOrientations.vertical;\n        args.bucket.iconsInText = shapedText ? shapedText.iconsInText : false;\n        if (shapedText || shapedIcon) {\n            addFeature(args.bucket, feature, shapedTextOrientations, shapedIcon, args.imageMap, sizes, layoutTextSize, layoutIconSize, textOffset, isSDFIcon, args.canonical);\n        }\n    }\n\n    if (args.showCollisionBoxes) {\n        args.bucket.generateCollisionDebugBuffers();\n    }\n}\n\n// Choose the justification that matches the direction of the TextAnchor\nexport function getAnchorJustification(anchor: TextAnchor): TextJustify {\n    switch (anchor) {\n        case 'right':\n        case 'top-right':\n        case 'bottom-right':\n            return 'right';\n        case 'left':\n        case 'top-left':\n        case 'bottom-left':\n            return 'left';\n    }\n    return 'center';\n}\n\n/**\n * Given a feature and its shaped text and icon data, add a 'symbol\n * instance' for each _possible_ placement of the symbol feature.\n * (At render timePlaceSymbols#place() selects which of these instances to\n * show or hide based on collisions with symbols in other layers.)\n */\nfunction addFeature(bucket: SymbolBucket,\n    feature: SymbolFeature,\n    shapedTextOrientations: ShapedTextOrientations,\n    shapedIcon: PositionedIcon,\n    imageMap: {[_: string]: StyleImage},\n    sizes: Sizes,\n    layoutTextSize: number,\n    layoutIconSize: number,\n    textOffset: [number, number],\n    isSDFIcon: boolean,\n    canonical: CanonicalTileID) {\n    // To reduce the number of labels that jump around when zooming we need\n    // to use a text-size value that is the same for all zoom levels.\n    // bucket calculates text-size at a high zoom level so that all tiles can\n    // use the same value when calculating anchor positions.\n    let textMaxSize = sizes.textMaxSize.evaluate(feature, {});\n    if (textMaxSize === undefined) {\n        textMaxSize = layoutTextSize;\n    }\n    const layout = bucket.layers[0].layout;\n    const iconOffset = layout.get('icon-offset').evaluate(feature, {}, canonical);\n    const defaultHorizontalShaping = getDefaultHorizontalShaping(shapedTextOrientations.horizontal);\n    const glyphSize = 24,\n        fontScale = layoutTextSize / glyphSize,\n        textBoxScale = bucket.tilePixelRatio * fontScale,\n        textMaxBoxScale = bucket.tilePixelRatio * textMaxSize / glyphSize,\n        iconBoxScale = bucket.tilePixelRatio * layoutIconSize,\n        symbolMinDistance = bucket.tilePixelRatio * layout.get('symbol-spacing'),\n        textPadding = layout.get('text-padding') * bucket.tilePixelRatio,\n        iconPadding = getIconPadding(layout, feature, canonical, bucket.tilePixelRatio),\n        textMaxAngle = layout.get('text-max-angle') / 180 * Math.PI,\n        textAlongLine = layout.get('text-rotation-alignment') !== 'viewport' && layout.get('symbol-placement') !== 'point',\n        iconAlongLine = layout.get('icon-rotation-alignment') === 'map' && layout.get('symbol-placement') !== 'point',\n        symbolPlacement = layout.get('symbol-placement'),\n        textRepeatDistance = symbolMinDistance / 2;\n\n    const iconTextFit = layout.get('icon-text-fit');\n    let verticallyShapedIcon;\n    // Adjust shaped icon size when icon-text-fit is used.\n    if (shapedIcon && iconTextFit !== 'none') {\n        if (bucket.allowVerticalPlacement && shapedTextOrientations.vertical) {\n            verticallyShapedIcon = fitIconToText(shapedIcon, shapedTextOrientations.vertical, iconTextFit,\n                layout.get('icon-text-fit-padding'), iconOffset, fontScale);\n        }\n        if (defaultHorizontalShaping) {\n            shapedIcon = fitIconToText(shapedIcon, defaultHorizontalShaping, iconTextFit,\n                layout.get('icon-text-fit-padding'), iconOffset, fontScale);\n        }\n    }\n\n    const addSymbolAtAnchor = (line, anchor) => {\n        if (anchor.x < 0 || anchor.x >= EXTENT || anchor.y < 0 || anchor.y >= EXTENT) {\n            // Symbol layers are drawn across tile boundaries, We filter out symbols\n            // outside our tile boundaries (which may be included in vector tile buffers)\n            // to prevent double-drawing symbols.\n            return;\n        }\n        addSymbol(bucket, anchor, line, shapedTextOrientations, shapedIcon, imageMap, verticallyShapedIcon, bucket.layers[0],\n            bucket.collisionBoxArray, feature.index, feature.sourceLayerIndex, bucket.index,\n            textBoxScale, [textPadding, textPadding, textPadding, textPadding], textAlongLine, textOffset,\n            iconBoxScale, iconPadding, iconAlongLine, iconOffset,\n            feature, sizes, isSDFIcon, canonical, layoutTextSize);\n    };\n\n    if (symbolPlacement === 'line') {\n        for (const line of clipLine(feature.geometry, 0, 0, EXTENT, EXTENT)) {\n            const anchors = getAnchors(\n                line,\n                symbolMinDistance,\n                textMaxAngle,\n                shapedTextOrientations.vertical || defaultHorizontalShaping,\n                shapedIcon,\n                glyphSize,\n                textMaxBoxScale,\n                bucket.overscaling,\n                EXTENT\n            );\n            for (const anchor of anchors) {\n                const shapedText = defaultHorizontalShaping;\n                if (!shapedText || !anchorIsTooClose(bucket, shapedText.text, textRepeatDistance, anchor)) {\n                    addSymbolAtAnchor(line, anchor);\n                }\n            }\n        }\n    } else if (symbolPlacement === 'line-center') {\n        // No clipping, multiple lines per feature are allowed\n        // \"lines\" with only one point are ignored as in clipLines\n        for (const line of feature.geometry) {\n            if (line.length > 1) {\n                const anchor = getCenterAnchor(\n                    line,\n                    textMaxAngle,\n                    shapedTextOrientations.vertical || defaultHorizontalShaping,\n                    shapedIcon,\n                    glyphSize,\n                    textMaxBoxScale);\n                if (anchor) {\n                    addSymbolAtAnchor(line, anchor);\n                }\n            }\n        }\n    } else if (feature.type === 'Polygon') {\n        for (const polygon of classifyRings(feature.geometry, 0)) {\n            // 16 here represents 2 pixels\n            const poi = findPoleOfInaccessibility(polygon, 16);\n            addSymbolAtAnchor(polygon[0], new Anchor(poi.x, poi.y, 0));\n        }\n    } else if (feature.type === 'LineString') {\n        // https://github.com/mapbox/mapbox-gl-js/issues/3808\n        for (const line of feature.geometry) {\n            addSymbolAtAnchor(line, new Anchor(line[0].x, line[0].y, 0));\n        }\n    } else if (feature.type === 'Point') {\n        for (const points of feature.geometry) {\n            for (const point of points) {\n                addSymbolAtAnchor([point], new Anchor(point.x, point.y, 0));\n            }\n        }\n    }\n}\n\nfunction addTextVariableAnchorOffsets(textAnchorOffsets: TextAnchorOffsetArray, variableAnchorOffset: VariableAnchorOffsetCollection): [number, number] {\n    const startIndex = textAnchorOffsets.length;\n    const values = variableAnchorOffset?.values;\n\n    if (values?.length > 0) {\n        for (let i = 0; i < values.length; i += 2) {\n            const anchor = TextAnchorEnum[values[i] as TextAnchor];\n            const offset = values[i + 1] as [number, number];\n\n            textAnchorOffsets.emplaceBack(anchor, offset[0], offset[1]);\n        }\n    }\n\n    return [startIndex, textAnchorOffsets.length];\n}\n\nfunction addTextVertices(bucket: SymbolBucket,\n    anchor: Point,\n    shapedText: Shaping,\n    imageMap: {[_: string]: StyleImage},\n    layer: SymbolStyleLayer,\n    textAlongLine: boolean,\n    feature: SymbolFeature,\n    textOffset: [number, number],\n    lineArray: {\n        lineStartIndex: number;\n        lineLength: number;\n    },\n    writingMode: WritingMode,\n    placementTypes: Array<'vertical' | 'center' | 'left' | 'right'>,\n    placedTextSymbolIndices: {[_: string]: number},\n    placedIconIndex: number,\n    sizes: Sizes,\n    canonical: CanonicalTileID) {\n    const glyphQuads = getGlyphQuads(anchor, shapedText, textOffset,\n        layer, textAlongLine, feature, imageMap, bucket.allowVerticalPlacement);\n\n    const sizeData = bucket.textSizeData;\n    let textSizeData = null;\n\n    if (sizeData.kind === 'source') {\n        textSizeData = [\n            SIZE_PACK_FACTOR * layer.layout.get('text-size').evaluate(feature, {})\n        ];\n        if (textSizeData[0] > MAX_PACKED_SIZE) {\n            warnOnce(`${bucket.layerIds[0]}: Value for \"text-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"text-size\".`);\n        }\n    } else if (sizeData.kind === 'composite') {\n        textSizeData = [\n            SIZE_PACK_FACTOR * sizes.compositeTextSizes[0].evaluate(feature, {}, canonical),\n            SIZE_PACK_FACTOR * sizes.compositeTextSizes[1].evaluate(feature, {}, canonical)\n        ];\n        if (textSizeData[0] > MAX_PACKED_SIZE || textSizeData[1] > MAX_PACKED_SIZE) {\n            warnOnce(`${bucket.layerIds[0]}: Value for \"text-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"text-size\".`);\n        }\n    }\n\n    bucket.addSymbols(\n        bucket.text,\n        glyphQuads,\n        textSizeData,\n        textOffset,\n        textAlongLine,\n        feature,\n        writingMode,\n        anchor,\n        lineArray.lineStartIndex,\n        lineArray.lineLength,\n        placedIconIndex,\n        canonical);\n\n    // The placedSymbolArray is used at render time in drawTileSymbols\n    // These indices allow access to the array at collision detection time\n    for (const placementType of placementTypes) {\n        placedTextSymbolIndices[placementType] = bucket.text.placedSymbolArray.length - 1;\n    }\n\n    return glyphQuads.length * 4;\n}\n\nfunction getDefaultHorizontalShaping(\n    horizontalShaping: Record<TextJustify, Shaping>\n): Shaping | null {\n    // We don't care which shaping we get because this is used for collision purposes\n    // and all the justifications have the same collision box\n    for (const justification in horizontalShaping) {\n        return horizontalShaping[justification];\n    }\n    return null;\n}\n\n/**\n * Add a single label & icon placement.\n */\nfunction addSymbol(bucket: SymbolBucket,\n    anchor: Anchor,\n    line: Array<Point>,\n    shapedTextOrientations: ShapedTextOrientations,\n    shapedIcon: PositionedIcon | void,\n    imageMap: {[_: string]: StyleImage},\n    verticallyShapedIcon: PositionedIcon | void,\n    layer: SymbolStyleLayer,\n    collisionBoxArray: CollisionBoxArray,\n    featureIndex: number,\n    sourceLayerIndex: number,\n    bucketIndex: number,\n    textBoxScale: number,\n    textPadding: SymbolPadding,\n    textAlongLine: boolean,\n    textOffset: [number, number],\n    iconBoxScale: number,\n    iconPadding: SymbolPadding,\n    iconAlongLine: boolean,\n    iconOffset: [number, number],\n    feature: SymbolFeature,\n    sizes: Sizes,\n    isSDFIcon: boolean,\n    canonical: CanonicalTileID,\n    layoutTextSize: number) {\n\n    const lineArray = bucket.addToLineVertexArray(anchor, line);\n\n    let textCollisionFeature, iconCollisionFeature, verticalTextCollisionFeature, verticalIconCollisionFeature;\n\n    let numIconVertices = 0;\n    let numVerticalIconVertices = 0;\n    let numHorizontalGlyphVertices = 0;\n    let numVerticalGlyphVertices = 0;\n    let placedIconSymbolIndex = -1;\n    let verticalPlacedIconSymbolIndex = -1;\n    const placedTextSymbolIndices: {[k: string]: number} = {};\n    let key = murmur3('');\n\n    if (bucket.allowVerticalPlacement && shapedTextOrientations.vertical) {\n        const textRotation = layer.layout.get('text-rotate').evaluate(feature, {}, canonical);\n        const verticalTextRotation = textRotation + 90.0;\n        const verticalShaping = shapedTextOrientations.vertical;\n        verticalTextCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, verticalShaping, textBoxScale, textPadding, textAlongLine, verticalTextRotation);\n\n        if (verticallyShapedIcon) {\n            verticalIconCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, verticallyShapedIcon, iconBoxScale, iconPadding, textAlongLine, verticalTextRotation);\n        }\n    }\n\n    //Place icon first, so text can have a reference to its index in the placed symbol array.\n    //Text symbols can lazily shift at render-time because of variable anchor placement.\n    //If the style specifies an `icon-text-fit` then the icon would have to shift along with it.\n    // For more info check `updateVariableAnchors` in `draw_symbol.js` .\n    if (shapedIcon) {\n        const iconRotate = layer.layout.get('icon-rotate').evaluate(feature, {});\n        const hasIconTextFit = layer.layout.get('icon-text-fit') !== 'none';\n        const iconQuads = getIconQuads(shapedIcon, iconRotate, isSDFIcon, hasIconTextFit);\n        const verticalIconQuads = verticallyShapedIcon ? getIconQuads(verticallyShapedIcon, iconRotate, isSDFIcon, hasIconTextFit) : undefined;\n        iconCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, shapedIcon, iconBoxScale, iconPadding, /*align boxes to line*/false, iconRotate);\n\n        numIconVertices = iconQuads.length * 4;\n\n        const sizeData = bucket.iconSizeData;\n        let iconSizeData = null;\n\n        if (sizeData.kind === 'source') {\n            iconSizeData = [\n                SIZE_PACK_FACTOR * layer.layout.get('icon-size').evaluate(feature, {})\n            ];\n            if (iconSizeData[0] > MAX_PACKED_SIZE) {\n                warnOnce(`${bucket.layerIds[0]}: Value for \"icon-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"icon-size\".`);\n            }\n        } else if (sizeData.kind === 'composite') {\n            iconSizeData = [\n                SIZE_PACK_FACTOR * sizes.compositeIconSizes[0].evaluate(feature, {}, canonical),\n                SIZE_PACK_FACTOR * sizes.compositeIconSizes[1].evaluate(feature, {}, canonical)\n            ];\n            if (iconSizeData[0] > MAX_PACKED_SIZE || iconSizeData[1] > MAX_PACKED_SIZE) {\n                warnOnce(`${bucket.layerIds[0]}: Value for \"icon-size\" is >= ${MAX_GLYPH_ICON_SIZE}. Reduce your \"icon-size\".`);\n            }\n        }\n\n        bucket.addSymbols(\n            bucket.icon,\n            iconQuads,\n            iconSizeData,\n            iconOffset,\n            iconAlongLine,\n            feature,\n            WritingMode.none,\n            anchor,\n            lineArray.lineStartIndex,\n            lineArray.lineLength,\n            // The icon itself does not have an associated symbol since the text isn't placed yet\n            -1, canonical);\n\n        placedIconSymbolIndex = bucket.icon.placedSymbolArray.length - 1;\n\n        if (verticalIconQuads) {\n            numVerticalIconVertices = verticalIconQuads.length * 4;\n\n            bucket.addSymbols(\n                bucket.icon,\n                verticalIconQuads,\n                iconSizeData,\n                iconOffset,\n                iconAlongLine,\n                feature,\n                WritingMode.vertical,\n                anchor,\n                lineArray.lineStartIndex,\n                lineArray.lineLength,\n                // The icon itself does not have an associated symbol since the text isn't placed yet\n                -1, canonical);\n\n            verticalPlacedIconSymbolIndex = bucket.icon.placedSymbolArray.length - 1;\n        }\n    }\n\n    const justifications = Object.keys(shapedTextOrientations.horizontal) as TextJustify[];\n    for (const justification of justifications) {\n        const shaping = shapedTextOrientations.horizontal[justification];\n\n        if (!textCollisionFeature) {\n            key = murmur3(shaping.text);\n            const textRotate = layer.layout.get('text-rotate').evaluate(feature, {}, canonical);\n            // As a collision approximation, we can use either the vertical or any of the horizontal versions of the feature\n            // We're counting on all versions having similar dimensions\n            textCollisionFeature = new CollisionFeature(collisionBoxArray, anchor, featureIndex, sourceLayerIndex, bucketIndex, shaping, textBoxScale, textPadding, textAlongLine, textRotate);\n        }\n\n        const singleLine = shaping.positionedLines.length === 1;\n        numHorizontalGlyphVertices += addTextVertices(\n            bucket, anchor, shaping, imageMap, layer, textAlongLine, feature, textOffset, lineArray,\n            shapedTextOrientations.vertical ? WritingMode.horizontal : WritingMode.horizontalOnly,\n            singleLine ? justifications : [justification],\n            placedTextSymbolIndices, placedIconSymbolIndex, sizes, canonical);\n\n        if (singleLine) {\n            break;\n        }\n    }\n\n    if (shapedTextOrientations.vertical) {\n        numVerticalGlyphVertices += addTextVertices(\n            bucket, anchor, shapedTextOrientations.vertical, imageMap, layer, textAlongLine, feature,\n            textOffset, lineArray, WritingMode.vertical, ['vertical'], placedTextSymbolIndices, verticalPlacedIconSymbolIndex, sizes, canonical);\n    }\n\n    const textBoxStartIndex = textCollisionFeature ? textCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const textBoxEndIndex = textCollisionFeature ? textCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    const verticalTextBoxStartIndex = verticalTextCollisionFeature ? verticalTextCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const verticalTextBoxEndIndex = verticalTextCollisionFeature ? verticalTextCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    const iconBoxStartIndex = iconCollisionFeature ? iconCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const iconBoxEndIndex = iconCollisionFeature ? iconCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    const verticalIconBoxStartIndex = verticalIconCollisionFeature ? verticalIconCollisionFeature.boxStartIndex : bucket.collisionBoxArray.length;\n    const verticalIconBoxEndIndex = verticalIconCollisionFeature ? verticalIconCollisionFeature.boxEndIndex : bucket.collisionBoxArray.length;\n\n    // Check if runtime collision circles should be used for any of the collision features.\n    // It is enough to choose the tallest feature shape as circles are always placed on a line.\n    // All measurements are in glyph metrics and later converted into pixels using proper font size \"layoutTextSize\"\n    let collisionCircleDiameter = -1;\n\n    const getCollisionCircleHeight = (feature: CollisionFeature, prevHeight: number): number => {\n        if (feature && feature.circleDiameter)\n            return Math.max(feature.circleDiameter, prevHeight);\n        return prevHeight;\n    };\n\n    collisionCircleDiameter = getCollisionCircleHeight(textCollisionFeature, collisionCircleDiameter);\n    collisionCircleDiameter = getCollisionCircleHeight(verticalTextCollisionFeature, collisionCircleDiameter);\n    collisionCircleDiameter = getCollisionCircleHeight(iconCollisionFeature, collisionCircleDiameter);\n    collisionCircleDiameter = getCollisionCircleHeight(verticalIconCollisionFeature, collisionCircleDiameter);\n    const useRuntimeCollisionCircles = (collisionCircleDiameter > -1) ? 1 : 0;\n\n    // Convert circle collision height into pixels\n    if (useRuntimeCollisionCircles)\n        collisionCircleDiameter *= layoutTextSize / ONE_EM;\n\n    if (bucket.glyphOffsetArray.length >= SymbolBucket.MAX_GLYPHS) warnOnce(\n        'Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907'\n    );\n\n    if (feature.sortKey !== undefined) {\n        bucket.addToSortKeyRanges(bucket.symbolInstances.length, feature.sortKey as number);\n    }\n\n    const variableAnchorOffset = getTextVariableAnchorOffset(layer, feature, canonical);\n    const [textAnchorOffsetStartIndex, textAnchorOffsetEndIndex] = addTextVariableAnchorOffsets(bucket.textAnchorOffsets, variableAnchorOffset);\n\n    bucket.symbolInstances.emplaceBack(\n        anchor.x,\n        anchor.y,\n        placedTextSymbolIndices.right >= 0 ? placedTextSymbolIndices.right : -1,\n        placedTextSymbolIndices.center >= 0 ? placedTextSymbolIndices.center : -1,\n        placedTextSymbolIndices.left >= 0 ? placedTextSymbolIndices.left : -1,\n        placedTextSymbolIndices.vertical || -1,\n        placedIconSymbolIndex,\n        verticalPlacedIconSymbolIndex,\n        key,\n        textBoxStartIndex,\n        textBoxEndIndex,\n        verticalTextBoxStartIndex,\n        verticalTextBoxEndIndex,\n        iconBoxStartIndex,\n        iconBoxEndIndex,\n        verticalIconBoxStartIndex,\n        verticalIconBoxEndIndex,\n        featureIndex,\n        numHorizontalGlyphVertices,\n        numVerticalGlyphVertices,\n        numIconVertices,\n        numVerticalIconVertices,\n        useRuntimeCollisionCircles,\n        0,\n        textBoxScale,\n        collisionCircleDiameter,\n        textAnchorOffsetStartIndex,\n        textAnchorOffsetEndIndex);\n}\n\nfunction anchorIsTooClose(bucket: SymbolBucket, text: string, repeatDistance: number, anchor: Point) {\n    const compareText = bucket.compareText;\n    if (!(text in compareText)) {\n        compareText[text] = [];\n    } else {\n        const otherAnchors = compareText[text];\n        for (let k = otherAnchors.length - 1; k >= 0; k--) {\n            if (anchor.dist(otherAnchors[k]) < repeatDistance) {\n                // If it's within repeatDistance of one anchor, stop looking\n                return true;\n            }\n        }\n    }\n    // If anchor is not within repeatDistance of any other anchor, add to array\n    compareText[text].push(anchor);\n    return false;\n}\n", "\nconst ARRAY_TYPES = [\n    Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array,\n    Int32Array, Uint32Array, Float32Array, Float64Array\n];\n\n/** @typedef {Int8ArrayConstructor | Uint8ArrayConstructor | Uint8ClampedArrayConstructor | Int16ArrayConstructor | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor} TypedArrayConstructor */\n\nconst VERSION = 1; // serialized format version\nconst HEADER_SIZE = 8;\n\nexport default class KDBush {\n\n    /**\n     * Creates an index from raw `ArrayBuffer` data.\n     * @param {ArrayBuffer} data\n     */\n    static from(data) {\n        if (!(data instanceof ArrayBuffer)) {\n            throw new Error('Data must be an instance of ArrayBuffer.');\n        }\n        const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n        if (magic !== 0xdb) {\n            throw new Error('Data does not appear to be in a KDBush format.');\n        }\n        const version = versionAndType >> 4;\n        if (version !== VERSION) {\n            throw new Error(`Got v${version} data when expected v${VERSION}.`);\n        }\n        const ArrayType = ARRAY_TYPES[versionAndType & 0x0f];\n        if (!ArrayType) {\n            throw new Error('Unrecognized array type.');\n        }\n        const [nodeSize] = new Uint16Array(data, 2, 1);\n        const [numItems] = new Uint32Array(data, 4, 1);\n\n        return new KDBush(numItems, nodeSize, ArrayType, data);\n    }\n\n    /**\n     * Creates an index that will hold a given number of items.\n     * @param {number} numItems\n     * @param {number} [nodeSize=64] Size of the KD-tree node (64 by default).\n     * @param {TypedArrayConstructor} [ArrayType=Float64Array] The array type used for coordinates storage (`Float64Array` by default).\n     * @param {ArrayBuffer} [data] (For internal use only)\n     */\n    constructor(numItems, nodeSize = 64, ArrayType = Float64Array, data) {\n        if (isNaN(numItems) || numItems < 0) throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n        this.numItems = +numItems;\n        this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n        this.ArrayType = ArrayType;\n        this.IndexArrayType = numItems < 65536 ? Uint16Array : Uint32Array;\n\n        const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n        const coordsByteSize = numItems * 2 * this.ArrayType.BYTES_PER_ELEMENT;\n        const idsByteSize = numItems * this.IndexArrayType.BYTES_PER_ELEMENT;\n        const padCoords = (8 - idsByteSize % 8) % 8;\n\n        if (arrayTypeIndex < 0) {\n            throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n        }\n\n        if (data && (data instanceof ArrayBuffer)) { // reconstruct an index from a buffer\n            this.data = data;\n            this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n            this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n            this._pos = numItems * 2;\n            this._finished = true;\n        } else { // initialize a new index\n            this.data = new ArrayBuffer(HEADER_SIZE + coordsByteSize + idsByteSize + padCoords);\n            this.ids = new this.IndexArrayType(this.data, HEADER_SIZE, numItems);\n            this.coords = new this.ArrayType(this.data, HEADER_SIZE + idsByteSize + padCoords, numItems * 2);\n            this._pos = 0;\n            this._finished = false;\n\n            // set header\n            new Uint8Array(this.data, 0, 2).set([0xdb, (VERSION << 4) + arrayTypeIndex]);\n            new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n            new Uint32Array(this.data, 4, 1)[0] = numItems;\n        }\n    }\n\n    /**\n     * Add a point to the index.\n     * @param {number} x\n     * @param {number} y\n     * @returns {number} An incremental index associated with the added item (starting from `0`).\n     */\n    add(x, y) {\n        const index = this._pos >> 1;\n        this.ids[index] = index;\n        this.coords[this._pos++] = x;\n        this.coords[this._pos++] = y;\n        return index;\n    }\n\n    /**\n     * Perform indexing of the added points.\n     */\n    finish() {\n        const numAdded = this._pos >> 1;\n        if (numAdded !== this.numItems) {\n            throw new Error(`Added ${numAdded} items when expected ${this.numItems}.`);\n        }\n        // kd-sort both arrays for efficient search\n        sort(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0);\n\n        this._finished = true;\n        return this;\n    }\n\n    /**\n     * Search the index for items within a given bounding box.\n     * @param {number} minX\n     * @param {number} minY\n     * @param {number} maxX\n     * @param {number} maxY\n     * @returns {number[]} An array of indices correponding to the found items.\n     */\n    range(minX, minY, maxX, maxY) {\n        if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n        const {ids, coords, nodeSize} = this;\n        const stack = [0, ids.length - 1, 0];\n        const result = [];\n\n        // recursively search for items in range in the kd-sorted arrays\n        while (stack.length) {\n            const axis = stack.pop() || 0;\n            const right = stack.pop() || 0;\n            const left = stack.pop() || 0;\n\n            // if we reached \"tree node\", search linearly\n            if (right - left <= nodeSize) {\n                for (let i = left; i <= right; i++) {\n                    const x = coords[2 * i];\n                    const y = coords[2 * i + 1];\n                    if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[i]);\n                }\n                continue;\n            }\n\n            // otherwise find the middle index\n            const m = (left + right) >> 1;\n\n            // include the middle item if it's in range\n            const x = coords[2 * m];\n            const y = coords[2 * m + 1];\n            if (x >= minX && x <= maxX && y >= minY && y <= maxY) result.push(ids[m]);\n\n            // queue search in halves that intersect the query\n            if (axis === 0 ? minX <= x : minY <= y) {\n                stack.push(left);\n                stack.push(m - 1);\n                stack.push(1 - axis);\n            }\n            if (axis === 0 ? maxX >= x : maxY >= y) {\n                stack.push(m + 1);\n                stack.push(right);\n                stack.push(1 - axis);\n            }\n        }\n\n        return result;\n    }\n\n    /**\n     * Search the index for items within a given radius.\n     * @param {number} qx\n     * @param {number} qy\n     * @param {number} r Query radius.\n     * @returns {number[]} An array of indices correponding to the found items.\n     */\n    within(qx, qy, r) {\n        if (!this._finished) throw new Error('Data not yet indexed - call index.finish().');\n\n        const {ids, coords, nodeSize} = this;\n        const stack = [0, ids.length - 1, 0];\n        const result = [];\n        const r2 = r * r;\n\n        // recursively search for items within radius in the kd-sorted arrays\n        while (stack.length) {\n            const axis = stack.pop() || 0;\n            const right = stack.pop() || 0;\n            const left = stack.pop() || 0;\n\n            // if we reached \"tree node\", search linearly\n            if (right - left <= nodeSize) {\n                for (let i = left; i <= right; i++) {\n                    if (sqDist(coords[2 * i], coords[2 * i + 1], qx, qy) <= r2) result.push(ids[i]);\n                }\n                continue;\n            }\n\n            // otherwise find the middle index\n            const m = (left + right) >> 1;\n\n            // include the middle item if it's in range\n            const x = coords[2 * m];\n            const y = coords[2 * m + 1];\n            if (sqDist(x, y, qx, qy) <= r2) result.push(ids[m]);\n\n            // queue search in halves that intersect the query\n            if (axis === 0 ? qx - r <= x : qy - r <= y) {\n                stack.push(left);\n                stack.push(m - 1);\n                stack.push(1 - axis);\n            }\n            if (axis === 0 ? qx + r >= x : qy + r >= y) {\n                stack.push(m + 1);\n                stack.push(right);\n                stack.push(1 - axis);\n            }\n        }\n\n        return result;\n    }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} nodeSize\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction sort(ids, coords, nodeSize, left, right, axis) {\n    if (right - left <= nodeSize) return;\n\n    const m = (left + right) >> 1; // middle index\n\n    // sort ids and coords around the middle index so that the halves lie\n    // either left/right or top/bottom correspondingly (taking turns)\n    select(ids, coords, m, left, right, axis);\n\n    // recursively kd-sort first half and second half on the opposite axis\n    sort(ids, coords, nodeSize, left, m - 1, 1 - axis);\n    sort(ids, coords, nodeSize, m + 1, right, 1 - axis);\n}\n\n/**\n * Custom Floyd-Rivest selection algorithm: sort ids and coords so that\n * [left..k-1] items are smaller than k-th item (on either x or y axis)\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} k\n * @param {number} left\n * @param {number} right\n * @param {number} axis\n */\nfunction select(ids, coords, k, left, right, axis) {\n\n    while (right > left) {\n        if (right - left > 600) {\n            const n = right - left + 1;\n            const m = k - left + 1;\n            const z = Math.log(n);\n            const s = 0.5 * Math.exp(2 * z / 3);\n            const sd = 0.5 * Math.sqrt(z * s * (n - s) / n) * (m - n / 2 < 0 ? -1 : 1);\n            const newLeft = Math.max(left, Math.floor(k - m * s / n + sd));\n            const newRight = Math.min(right, Math.floor(k + (n - m) * s / n + sd));\n            select(ids, coords, k, newLeft, newRight, axis);\n        }\n\n        const t = coords[2 * k + axis];\n        let i = left;\n        let j = right;\n\n        swapItem(ids, coords, left, k);\n        if (coords[2 * right + axis] > t) swapItem(ids, coords, left, right);\n\n        while (i < j) {\n            swapItem(ids, coords, i, j);\n            i++;\n            j--;\n            while (coords[2 * i + axis] < t) i++;\n            while (coords[2 * j + axis] > t) j--;\n        }\n\n        if (coords[2 * left + axis] === t) swapItem(ids, coords, left, j);\n        else {\n            j++;\n            swapItem(ids, coords, j, right);\n        }\n\n        if (j <= k) left = j + 1;\n        if (k <= j) right = j - 1;\n    }\n}\n\n/**\n * @param {Uint16Array | Uint32Array} ids\n * @param {InstanceType<TypedArrayConstructor>} coords\n * @param {number} i\n * @param {number} j\n */\nfunction swapItem(ids, coords, i, j) {\n    swap(ids, i, j);\n    swap(coords, 2 * i, 2 * j);\n    swap(coords, 2 * i + 1, 2 * j + 1);\n}\n\n/**\n * @param {InstanceType<TypedArrayConstructor>} arr\n * @param {number} i\n * @param {number} j\n */\nfunction swap(arr, i, j) {\n    const tmp = arr[i];\n    arr[i] = arr[j];\n    arr[j] = tmp;\n}\n\n/**\n * @param {number} ax\n * @param {number} ay\n * @param {number} bx\n * @param {number} by\n */\nfunction sqDist(ax, ay, bx, by) {\n    const dx = ax - bx;\n    const dy = ay - by;\n    return dx * dx + dy * dy;\n}\n", "import type {RequestParameters} from '../util/ajax';\n\nexport type PerformanceMetrics = {\n    loadTime: number;\n    fullLoadTime: number;\n    fps: number;\n    percentDroppedFrames: number;\n    totalFrames: number;\n};\n\nexport enum PerformanceMarkers {\n    create = 'create',\n    load = 'load',\n    fullLoad = 'fullLoad'\n}\n\nlet lastFrameTime = null;\nlet frameTimes = [];\n\nconst minFramerateTarget = 60;\nconst frameTimeTarget = 1000 / minFramerateTarget;\n\nconst loadTimeKey = 'loadTime';\nconst fullLoadTimeKey = 'fullLoadTime';\n\nexport const PerformanceUtils = {\n    mark(marker: PerformanceMarkers) {\n        performance.mark(marker);\n    },\n    frame(timestamp: number) {\n        const currTimestamp = timestamp;\n        if (lastFrameTime != null) {\n            const frameTime = currTimestamp - lastFrameTime;\n            frameTimes.push(frameTime);\n        }\n        lastFrameTime = currTimestamp;\n    },\n    clearMetrics() {\n        lastFrameTime = null;\n        frameTimes = [];\n        performance.clearMeasures(loadTimeKey);\n        performance.clearMeasures(fullLoadTimeKey);\n\n        for (const marker in PerformanceMarkers) {\n            performance.clearMarks(PerformanceMarkers[marker]);\n        }\n    },\n\n    getPerformanceMetrics(): PerformanceMetrics {\n        performance.measure(loadTimeKey, PerformanceMarkers.create, PerformanceMarkers.load);\n        performance.measure(fullLoadTimeKey, PerformanceMarkers.create, PerformanceMarkers.fullLoad);\n        const loadTime = performance.getEntriesByName(loadTimeKey)[0].duration;\n        const fullLoadTime = performance.getEntriesByName(fullLoadTimeKey)[0].duration;\n        const totalFrames = frameTimes.length;\n\n        const avgFrameTime = frameTimes.reduce((prev, curr) => prev + curr, 0) / totalFrames / 1000;\n        const fps = 1 / avgFrameTime;\n\n        // count frames that missed our framerate target\n        const droppedFrames = frameTimes\n            .filter((frameTime) => frameTime > frameTimeTarget)\n            .reduce((acc, curr) => {\n                return acc + (curr -  frameTimeTarget) / frameTimeTarget;\n            }, 0);\n        const percentDroppedFrames = (droppedFrames / (totalFrames + droppedFrames)) * 100;\n\n        return {\n            loadTime,\n            fullLoadTime,\n            fps,\n            percentDroppedFrames,\n            totalFrames\n        };\n    }\n};\n\n/**\n * @internal\n * Safe wrapper for the performance resource timing API in web workers with graceful degradation\n */\nexport class RequestPerformance {\n    _marks: {\n        start: string;\n        end: string;\n        measure: string;\n    };\n\n    constructor (request: RequestParameters) {\n        this._marks = {\n            start: [request.url, 'start'].join('#'),\n            end: [request.url, 'end'].join('#'),\n            measure: request.url.toString()\n        };\n\n        performance.mark(this._marks.start);\n    }\n\n    finish() {\n        performance.mark(this._marks.end);\n        let resourceTimingData = performance.getEntriesByName(this._marks.measure);\n\n        // fallback if web worker implementation of perf.getEntriesByName returns empty\n        if (resourceTimingData.length === 0) {\n            performance.measure(this._marks.measure, this._marks.start, this._marks.end);\n            resourceTimingData = performance.getEntriesByName(this._marks.measure);\n\n            // cleanup\n            performance.clearMarks(this._marks.start);\n            performance.clearMarks(this._marks.end);\n            performance.clearMeasures(this._marks.measure);\n        }\n\n        return resourceTimingData;\n    }\n}\n\nexport default performance;\n", "import {Subscription, isWorker, subscribe} from './util';\nimport {serialize, deserialize, Serialized} from './web_worker_transfer';\nimport {ThrottledInvoker} from './throttled_invoker';\n\nimport {\n    MessageType,\n    type ActorMessage,\n    type RequestResponseMessageMap} from './actor_messages';\n\n/**\n * An interface to be sent to the actor in order for it to allow communication between the worker and the main thread\n */\nexport interface ActorTarget {\n    addEventListener: typeof window.addEventListener;\n    removeEventListener: typeof window.removeEventListener;\n    postMessage: typeof window.postMessage;\n    terminate?: () => void;\n}\n\n/**\n * This is used to define the parameters of the message that is sent to the worker and back\n */\ntype MessageData = {\n    id: string;\n    type: MessageType | '<cancel>' | '<response>';\n    origin: string;\n    data?: Serialized;\n    targetMapId?: string | number | null;\n    mustQueue?: boolean;\n    error?: Serialized | null;\n    sourceMapId: string | number | null;\n}\n\ntype ResolveReject = {\n    resolve: (value?: RequestResponseMessageMap[MessageType][1]) => void;\n    reject: (reason?: Error) => void;\n}\n\n/**\n * This interface allowing to substitute only the sendAsync method of the Actor class.\n */\nexport interface IActor {\n    sendAsync<T extends MessageType>(message: ActorMessage<T>, abortController?: AbortController): Promise<RequestResponseMessageMap[T][1]>;\n}\n\nexport type MessageHandler<T extends MessageType> = (mapId: string | number, params: RequestResponseMessageMap[T][0], abortController?: AbortController) => Promise<RequestResponseMessageMap[T][1]>\n\n/**\n * An implementation of the [Actor design pattern](https://en.wikipedia.org/wiki/Actor_model)\n * that maintains the relationship between asynchronous tasks and the objects\n * that spin them off - in this case, tasks like parsing parts of styles,\n * owned by the styles\n */\nexport class Actor implements IActor {\n    target: ActorTarget;\n    mapId: string | number | null;\n    resolveRejects: { [x: string]: ResolveReject};\n    name: string;\n    tasks: { [x: string]: MessageData };\n    taskQueue: Array<string>;\n    abortControllers: { [x: number | string]: AbortController };\n    invoker: ThrottledInvoker;\n    globalScope: ActorTarget;\n    messageHandlers: { [x in MessageType]?: MessageHandler<MessageType>};\n    subscription: Subscription;\n\n    /**\n     * @param target - The target\n     * @param mapId - A unique identifier for the Map instance using this Actor.\n     */\n    constructor(target: ActorTarget, mapId?: string | number) {\n        this.target = target;\n        this.mapId = mapId;\n        this.resolveRejects = {};\n        this.tasks = {};\n        this.taskQueue = [];\n        this.abortControllers = {};\n        this.messageHandlers = {};\n        this.invoker = new ThrottledInvoker(() => this.process());\n        this.subscription = subscribe(this.target, 'message', (message) => this.receive(message), false);\n        this.globalScope = isWorker(self) ? target : window;\n    }\n\n    registerMessageHandler<T extends MessageType>(type: T, handler: MessageHandler<T>) {\n        this.messageHandlers[type] = handler;\n    }\n\n    /**\n     * Sends a message from a main-thread map to a Worker or from a Worker back to\n     * a main-thread map instance.\n     * @param message - the message to send\n     * @param abortController - an optional AbortController to abort the request\n     * @returns a promise that will be resolved with the response data\n     */\n    sendAsync<T extends MessageType>(message: ActorMessage<T>, abortController?: AbortController): Promise<RequestResponseMessageMap[T][1]> {\n        return new Promise((resolve, reject) => {\n            // We're using a string ID instead of numbers because they are being used as object keys\n            // anyway, and thus stringified implicitly. We use random IDs because an actor may receive\n            // message from multiple other actors which could run in different execution context. A\n            // linearly increasing ID could produce collisions.\n            const id = Math.round((Math.random() * 1e18)).toString(36).substring(0, 10);\n            this.resolveRejects[id] = {\n                resolve,\n                reject\n            };\n            if (abortController) {\n                abortController.signal.addEventListener('abort', () => {\n                    delete this.resolveRejects[id];\n                    const cancelMessage: MessageData = {\n                        id,\n                        type: '<cancel>',\n                        origin: location.origin,\n                        targetMapId: message.targetMapId,\n                        sourceMapId: this.mapId\n                    };\n                    this.target.postMessage(cancelMessage);\n                    // In case of abort the current behavior is to keep the promise pending.\n                }, {once: true});\n            }\n            const buffers: Array<Transferable> = [];\n            const messageToPost: MessageData = {\n                ...message,\n                id,\n                sourceMapId: this.mapId,\n                origin: location.origin,\n                data: serialize(message.data, buffers)\n            };\n            this.target.postMessage(messageToPost, {transfer: buffers});\n        });\n    }\n\n    receive(message: {data: MessageData}) {\n        const data = message.data;\n        const id = data.id;\n        if (data.origin !== 'file://' && location.origin !== 'file://' && data.origin !== 'resource://android' && location.origin !== 'resource://android' && data.origin !== location.origin) {\n            return;\n        }\n        if (data.targetMapId && this.mapId !== data.targetMapId) {\n            return;\n        }\n        if (data.type === '<cancel>') {\n            // Remove the original request from the queue. This is only possible if it\n            // hasn't been kicked off yet. The id will remain in the queue, but because\n            // there is no associated task, it will be dropped once it's time to execute it.\n            delete this.tasks[id];\n            const abortController = this.abortControllers[id];\n            delete this.abortControllers[id];\n            if (abortController) {\n                abortController.abort();\n            }\n            return;\n        }\n        if (isWorker(self) || data.mustQueue) {\n            // In workers, store the tasks that we need to process before actually processing them. This\n            // is necessary because we want to keep receiving messages, and in particular,\n            // <cancel> messages. Some tasks may take a while in the worker thread, so before\n            // executing the next task in our queue, postMessage preempts this and <cancel>\n            // messages can be processed. We're using a MessageChannel object to get throttle the\n            // process() flow to one at a time.\n            this.tasks[id] = data;\n            this.taskQueue.push(id);\n            this.invoker.trigger();\n            return;\n        }\n        // In the main thread, process messages immediately so that other work does not slip in\n        // between getting partial data back from workers.\n        this.processTask(id, data);\n    }\n\n    process() {\n        if (this.taskQueue.length === 0) {\n            return;\n        }\n        const id = this.taskQueue.shift();\n        const task = this.tasks[id];\n        delete this.tasks[id];\n        // Schedule another process call if we know there's more to process _before_ invoking the\n        // current task. This is necessary so that processing continues even if the current task\n        // doesn't execute successfully.\n        if (this.taskQueue.length > 0) {\n            this.invoker.trigger();\n        }\n        if (!task) {\n            // If the task ID doesn't have associated task data anymore, it was canceled.\n            return;\n        }\n\n        this.processTask(id, task);\n    }\n\n    async processTask(id: string, task: MessageData) {\n        if (task.type === '<response>') {\n            // The `completeTask` function in the counterpart actor has been called, and we are now\n            // resolving or rejecting the promise in the originating actor, if there is one.\n            const resolveReject = this.resolveRejects[id];\n            delete this.resolveRejects[id];\n            if (!resolveReject) {\n                // If we get a response, but don't have a resolve or reject, the request was canceled.\n                return;\n            }\n            if (task.error) {\n                resolveReject.reject(deserialize(task.error) as Error);\n            } else {\n                resolveReject.resolve(deserialize(task.data));\n            }\n            return;\n        }\n        if (!this.messageHandlers[task.type]) {\n            this.completeTask(id, new Error(`Could not find a registered handler for ${task.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(', ')}`));\n            return;\n        }\n        const params = deserialize(task.data) as RequestResponseMessageMap[MessageType][0];\n        const abortController = new AbortController();\n        this.abortControllers[id] = abortController;\n        try {\n            const data = await this.messageHandlers[task.type](task.sourceMapId, params, abortController);\n            this.completeTask(id, null, data);\n        } catch (err) {\n            this.completeTask(id, err);\n        }\n    }\n\n    completeTask(id: string, err: Error, data?: RequestResponseMessageMap[MessageType][1]) {\n        const buffers: Array<Transferable> = [];\n        delete this.abortControllers[id];\n        const responseMessage: MessageData = {\n            id,\n            type: '<response>',\n            sourceMapId: this.mapId,\n            origin: location.origin,\n            error: err ? serialize(err) : null,\n            data: serialize(data, buffers)\n        };\n        this.target.postMessage(responseMessage, {transfer: buffers});\n    }\n\n    remove() {\n        this.invoker.remove();\n        this.subscription.unsubscribe();\n    }\n}\n", "import {CircleStyleLayer} from './style_layer/circle_style_layer';\nimport {HeatmapStyleLayer} from './style_layer/heatmap_style_layer';\nimport {HillshadeStyleLayer} from './style_layer/hillshade_style_layer';\nimport {FillStyleLayer} from './style_layer/fill_style_layer';\nimport {FillExtrusionStyleLayer} from './style_layer/fill_extrusion_style_layer';\nimport {LineStyleLayer} from './style_layer/line_style_layer';\nimport {SymbolStyleLayer} from './style_layer/symbol_style_layer';\nimport {BackgroundStyleLayer} from './style_layer/background_style_layer';\nimport {RasterStyleLayer} from './style_layer/raster_style_layer';\nimport {CustomStyleLayer, type CustomLayerInterface} from './style_layer/custom_style_layer';\n\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport function createStyleLayer(layer: LayerSpecification | CustomLayerInterface) {\n    if (layer.type === 'custom') {\n        return new CustomStyleLayer(layer);\n    }\n    switch (layer.type) {\n        case 'background':\n            return new BackgroundStyleLayer(layer);\n        case 'circle':\n            return new CircleStyleLayer(layer);\n        case 'fill':\n            return new FillStyleLayer(layer);\n        case 'fill-extrusion':\n            return new FillExtrusionStyleLayer(layer);\n        case 'heatmap':\n            return new HeatmapStyleLayer(layer);\n        case 'hillshade':\n            return new HillshadeStyleLayer(layer);\n        case 'line':\n            return new LineStyleLayer(layer);\n        case 'raster':\n            return new RasterStyleLayer(layer);\n        case 'symbol':\n            return new SymbolStyleLayer(layer);\n    }\n}\n\n", "import {StyleLayer} from './style_layer';\nimport {createStyleLayer} from './create_style_layer';\n\nimport {featureFilter, groupByLayout} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {TypedStyleLayer} from './style_layer/typed_style_layer';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LayerConfigs = {[_: string]: LayerSpecification};\nexport type Family<Layer extends TypedStyleLayer> = Array<Layer>;\n\nexport class StyleLayerIndex {\n    familiesBySource: {\n        [source: string]: {\n            [sourceLayer: string]: Array<Family<any>>;\n        };\n    };\n    keyCache: {[source: string]: string};\n\n    _layerConfigs: LayerConfigs;\n    _layers: {[_: string]: StyleLayer};\n\n    constructor(layerConfigs?: Array<LayerSpecification> | null) {\n        this.keyCache = {};\n        if (layerConfigs) {\n            this.replace(layerConfigs);\n        }\n    }\n\n    replace(layerConfigs: Array<LayerSpecification>) {\n        this._layerConfigs = {};\n        this._layers = {};\n        this.update(layerConfigs, []);\n    }\n\n    update(layerConfigs: Array<LayerSpecification>, removedIds: Array<string>) {\n        for (const layerConfig of layerConfigs) {\n            this._layerConfigs[layerConfig.id] = layerConfig;\n\n            const layer = this._layers[layerConfig.id] = createStyleLayer(layerConfig);\n            layer._featureFilter = featureFilter(layer.filter);\n            if (this.keyCache[layerConfig.id])\n                delete this.keyCache[layerConfig.id];\n        }\n        for (const id of removedIds) {\n            delete this.keyCache[id];\n            delete this._layerConfigs[id];\n            delete this._layers[id];\n        }\n\n        this.familiesBySource = {};\n\n        const groups = groupByLayout(Object.values(this._layerConfigs), this.keyCache);\n\n        for (const layerConfigs of groups) {\n            const layers = layerConfigs.map((layerConfig) => this._layers[layerConfig.id]);\n\n            const layer = layers[0];\n            if (layer.visibility === 'none') {\n                continue;\n            }\n\n            const sourceId = layer.source || '';\n            let sourceGroup = this.familiesBySource[sourceId];\n            if (!sourceGroup) {\n                sourceGroup = this.familiesBySource[sourceId] = {};\n            }\n\n            const sourceLayerId = layer.sourceLayer || '_geojsonTileLayer';\n            let sourceLayerFamilies = sourceGroup[sourceLayerId];\n            if (!sourceLayerFamilies) {\n                sourceLayerFamilies = sourceGroup[sourceLayerId] = [];\n            }\n\n            sourceLayerFamilies.push(layers);\n        }\n    }\n}\n", "import {AlphaImage} from '../util/image';\nimport {register} from '../util/web_worker_transfer';\nimport potpack from 'potpack';\n\nimport type {GlyphMetrics} from '../style/style_glyph';\nimport type {GetGlyphsResponse} from '../util/actor_messages';\n\nconst padding = 1;\n\n/**\n * A rectangle type with postion, width and height.\n */\nexport type Rect = {\n    x: number;\n    y: number;\n    w: number;\n    h: number;\n};\n\n/**\n * The glyph's position\n */\nexport type GlyphPosition = {\n    rect: Rect;\n    metrics: GlyphMetrics;\n};\n\n/**\n * The glyphs' positions\n */\nexport type GlyphPositions = {\n    [_: string]: {\n        [_: number]: GlyphPosition;\n    };\n};\n\nexport class GlyphAtlas {\n    image: AlphaImage;\n    positions: GlyphPositions;\n\n    constructor(stacks: GetGlyphsResponse) {\n        const positions = {};\n        const bins = [];\n\n        for (const stack in stacks) {\n            const glyphs = stacks[stack];\n            const stackPositions = positions[stack] = {};\n\n            for (const id in glyphs) {\n                const src = glyphs[+id];\n                if (!src || src.bitmap.width === 0 || src.bitmap.height === 0) continue;\n\n                const bin = {\n                    x: 0,\n                    y: 0,\n                    w: src.bitmap.width + 2 * padding,\n                    h: src.bitmap.height + 2 * padding\n                };\n                bins.push(bin);\n                stackPositions[id] = {rect: bin, metrics: src.metrics};\n            }\n        }\n\n        const {w, h} = potpack(bins);\n        const image = new AlphaImage({width: w || 1, height: h || 1});\n\n        for (const stack in stacks) {\n            const glyphs = stacks[stack];\n\n            for (const id in glyphs) {\n                const src = glyphs[+id];\n                if (!src || src.bitmap.width === 0 || src.bitmap.height === 0) continue;\n                const bin = positions[stack][id].rect;\n                AlphaImage.copy(src.bitmap, image, {x: 0, y: 0}, {x: bin.x + padding, y: bin.y + padding}, src.bitmap);\n            }\n        }\n\n        this.image = image;\n        this.positions = positions;\n    }\n}\n\nregister('GlyphAtlas', GlyphAtlas);\n", "import {FeatureIndex} from '../data/feature_index';\nimport {performSymbolLayout} from '../symbol/symbol_layout';\nimport {CollisionBoxArray} from '../data/array_types.g';\nimport {DictionaryCoder} from '../util/dictionary_coder';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {LineBucket} from '../data/bucket/line_bucket';\nimport {FillBucket} from '../data/bucket/fill_bucket';\nimport {FillExtrusionBucket} from '../data/bucket/fill_extrusion_bucket';\nimport {warnOnce, mapObject} from '../util/util';\nimport {ImageAtlas} from '../render/image_atlas';\nimport {GlyphAtlas} from '../render/glyph_atlas';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {OverscaledTileID} from './tile_id';\n\nimport type {Bucket} from '../data/bucket';\nimport type {IActor} from '../util/actor';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\nimport type {\n    WorkerTileParameters,\n    WorkerTileResult,\n} from '../source/worker_source';\nimport type {PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {VectorTile} from '@mapbox/vector-tile';\nimport {MessageType, type GetGlyphsResponse, type GetImagesResponse} from '../util/actor_messages';\n\nexport class WorkerTile {\n    tileID: OverscaledTileID;\n    uid: string | number;\n    zoom: number;\n    pixelRatio: number;\n    tileSize: number;\n    source: string;\n    promoteId: PromoteIdSpecification;\n    overscaling: number;\n    showCollisionBoxes: boolean;\n    collectResourceTiming: boolean;\n    returnDependencies: boolean;\n\n    status: 'parsing' | 'done';\n    data: VectorTile;\n    collisionBoxArray: CollisionBoxArray;\n\n    abort: AbortController;\n    vectorTile: VectorTile;\n    inFlightDependencies: AbortController[];\n\n    constructor(params: WorkerTileParameters) {\n        this.tileID = new OverscaledTileID(params.tileID.overscaledZ, params.tileID.wrap, params.tileID.canonical.z, params.tileID.canonical.x, params.tileID.canonical.y);\n        this.uid = params.uid;\n        this.zoom = params.zoom;\n        this.pixelRatio = params.pixelRatio;\n        this.tileSize = params.tileSize;\n        this.source = params.source;\n        this.overscaling = this.tileID.overscaleFactor();\n        this.showCollisionBoxes = params.showCollisionBoxes;\n        this.collectResourceTiming = !!params.collectResourceTiming;\n        this.returnDependencies = !!params.returnDependencies;\n        this.promoteId = params.promoteId;\n        this.inFlightDependencies = [];\n    }\n\n    async parse(data: VectorTile, layerIndex: StyleLayerIndex, availableImages: Array<string>, actor: IActor): Promise<WorkerTileResult> {\n        this.status = 'parsing';\n        this.data = data;\n\n        this.collisionBoxArray = new CollisionBoxArray();\n        const sourceLayerCoder = new DictionaryCoder(Object.keys(data.layers).sort());\n\n        const featureIndex = new FeatureIndex(this.tileID, this.promoteId);\n        featureIndex.bucketLayerIDs = [];\n\n        const buckets: {[_: string]: Bucket} = {};\n\n        const options = {\n            featureIndex,\n            iconDependencies: {},\n            patternDependencies: {},\n            glyphDependencies: {},\n            availableImages\n        };\n\n        const layerFamilies = layerIndex.familiesBySource[this.source];\n        for (const sourceLayerId in layerFamilies) {\n            const sourceLayer = data.layers[sourceLayerId];\n            if (!sourceLayer) {\n                continue;\n            }\n\n            if (sourceLayer.version === 1) {\n                warnOnce(`Vector tile source \"${this.source}\" layer \"${sourceLayerId}\" ` +\n                    'does not use vector tile spec v2 and therefore may have some rendering errors.');\n            }\n\n            const sourceLayerIndex = sourceLayerCoder.encode(sourceLayerId);\n            const features = [];\n            for (let index = 0; index < sourceLayer.length; index++) {\n                const feature = sourceLayer.feature(index);\n                const id = featureIndex.getId(feature, sourceLayerId);\n                features.push({feature, id, index, sourceLayerIndex});\n            }\n\n            for (const family of layerFamilies[sourceLayerId]) {\n                const layer = family[0];\n\n                if (layer.source !== this.source) {\n                    warnOnce(`layer.source = ${layer.source} does not equal this.source = ${this.source}`);\n                }\n                if (layer.minzoom && this.zoom < Math.floor(layer.minzoom)) continue;\n                if (layer.maxzoom && this.zoom >= layer.maxzoom) continue;\n                if (layer.visibility === 'none') continue;\n\n                recalculateLayers(family, this.zoom, availableImages);\n\n                const bucket: Bucket = buckets[layer.id] = layer.createBucket({\n                    index: featureIndex.bucketLayerIDs.length,\n                    layers: family,\n                    zoom: this.zoom,\n                    pixelRatio: this.pixelRatio,\n                    overscaling: this.overscaling,\n                    collisionBoxArray: this.collisionBoxArray,\n                    sourceLayerIndex,\n                    sourceID: this.source\n                });\n\n                bucket.populate(features, options, this.tileID.canonical);\n                featureIndex.bucketLayerIDs.push(family.map((l) => l.id));\n            }\n        }\n\n        // options.glyphDependencies looks like: {\"SomeFontName\":{\"10\":true,\"32\":true}}\n        // this line makes an object like: {\"SomeFontName\":[10,32]}\n        const stacks: {[_: string]: Array<number>} = mapObject(options.glyphDependencies, (glyphs) => Object.keys(glyphs).map(Number));\n\n        this.inFlightDependencies.forEach((request) => request?.abort());\n        this.inFlightDependencies = [];\n\n        let getGlyphsPromise = Promise.resolve<GetGlyphsResponse>({});\n        if (Object.keys(stacks).length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getGlyphsPromise = actor.sendAsync({type: MessageType.getGlyphs, data: {stacks, source: this.source, tileID: this.tileID, type: 'glyphs'}}, abortController);\n        }\n\n        const icons = Object.keys(options.iconDependencies);\n        let getIconsPromise = Promise.resolve<GetImagesResponse>({});\n        if (icons.length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getIconsPromise = actor.sendAsync({type: MessageType.getImages, data: {icons, source: this.source, tileID: this.tileID, type: 'icons'}}, abortController);\n        }\n\n        const patterns = Object.keys(options.patternDependencies);\n        let getPatternsPromise = Promise.resolve<GetImagesResponse>({});\n        if (patterns.length) {\n            const abortController = new AbortController();\n            this.inFlightDependencies.push(abortController);\n            getPatternsPromise = actor.sendAsync({type: MessageType.getImages, data: {icons: patterns, source: this.source, tileID: this.tileID, type: 'patterns'}}, abortController);\n        }\n\n        const [glyphMap, iconMap, patternMap] = await Promise.all([getGlyphsPromise, getIconsPromise, getPatternsPromise]);\n        const glyphAtlas = new GlyphAtlas(glyphMap);\n        const imageAtlas = new ImageAtlas(iconMap, patternMap);\n\n        for (const key in buckets) {\n            const bucket = buckets[key];\n            if (bucket instanceof SymbolBucket) {\n                recalculateLayers(bucket.layers, this.zoom, availableImages);\n                performSymbolLayout({\n                    bucket,\n                    glyphMap,\n                    glyphPositions: glyphAtlas.positions,\n                    imageMap: iconMap,\n                    imagePositions: imageAtlas.iconPositions,\n                    showCollisionBoxes: this.showCollisionBoxes,\n                    canonical: this.tileID.canonical\n                });\n            } else if (bucket.hasPattern &&\n                (bucket instanceof LineBucket ||\n                bucket instanceof FillBucket ||\n                bucket instanceof FillExtrusionBucket)) {\n                recalculateLayers(bucket.layers, this.zoom, availableImages);\n                bucket.addFeatures(options, this.tileID.canonical, imageAtlas.patternPositions);\n            }\n        }\n\n        this.status = 'done';\n        return {\n            buckets: Object.values(buckets).filter(b => !b.isEmpty()),\n            featureIndex,\n            collisionBoxArray: this.collisionBoxArray,\n            glyphAtlasImage: glyphAtlas.image,\n            imageAtlas,\n            // Only used for benchmarking:\n            glyphMap: this.returnDependencies ? glyphMap : null,\n            iconMap: this.returnDependencies ? iconMap : null,\n            glyphPositions: this.returnDependencies ? glyphAtlas.positions : null\n        };\n    }\n}\n\nfunction recalculateLayers(layers: ReadonlyArray<StyleLayer>, zoom: number, availableImages: Array<string>) {\n    // Layers are shared and may have been used by a WorkerTile with a different zoom.\n    const parameters = new EvaluationParameters(zoom);\n    for (const layer of layers) {\n        layer.recalculate(parameters, availableImages);\n    }\n}\n", "import {ExpiryData, getArrayBuffer} from '../util/ajax';\n\nimport vt from '@mapbox/vector-tile';\nimport Protobuf from 'pbf';\nimport {WorkerTile} from './worker_tile';\nimport {extend} from '../util/util';\nimport {RequestPerformance} from '../util/performance';\n\nimport type {\n    WorkerSource,\n    WorkerTileParameters,\n    TileParameters,\n    WorkerTileResult\n} from '../source/worker_source';\n\nimport type {IActor} from '../util/actor';\nimport type {StyleLayerIndex} from '../style/style_layer_index';\nimport type {VectorTile} from '@mapbox/vector-tile';\n\nexport type LoadVectorTileResult = {\n    vectorTile: VectorTile;\n    rawData: ArrayBuffer;\n    resourceTiming?: Array<PerformanceResourceTiming>;\n} & ExpiryData;\n\ntype FetchingState = {\n    rawTileData: ArrayBuffer;\n    cacheControl: ExpiryData;\n    resourceTiming: any;\n}\n\nexport type AbortVectorData = () => void;\nexport type LoadVectorData = (params: WorkerTileParameters, abortController: AbortController) => Promise<LoadVectorTileResult | null>;\n\n/**\n * The {@link WorkerSource} implementation that supports {@link VectorTileSource}.\n * This class is designed to be easily reused to support custom source types\n * for data formats that can be parsed/converted into an in-memory VectorTile\n * representation. To do so, override its `loadVectorTile` method.\n */\nexport class VectorTileWorkerSource implements WorkerSource {\n    actor: IActor;\n    layerIndex: StyleLayerIndex;\n    availableImages: Array<string>;\n    fetching: {[_: string]: FetchingState };\n    loading: {[_: string]: WorkerTile};\n    loaded: {[_: string]: WorkerTile};\n\n    /**\n     * @param loadVectorData - Optional method for custom loading of a VectorTile\n     * object based on parameters passed from the main-thread Source. See\n     * {@link VectorTileWorkerSource#loadTile}. The default implementation simply\n     * loads the pbf at `params.url`.\n     */\n    constructor(actor: IActor, layerIndex: StyleLayerIndex, availableImages: Array<string>) {\n        this.actor = actor;\n        this.layerIndex = layerIndex;\n        this.availableImages = availableImages;\n        this.fetching = {};\n        this.loading = {};\n        this.loaded = {};\n    }\n\n    /**\n     * Loads a vector tile\n     */\n    async loadVectorTile(params: WorkerTileParameters, abortController: AbortController): Promise<LoadVectorTileResult> {\n        const response = await getArrayBuffer(params.request, abortController);\n        try {\n            const vectorTile = new vt.VectorTile(new Protobuf(response.data));\n            return {\n                vectorTile,\n                rawData: response.data,\n                cacheControl: response.cacheControl,\n                expires: response.expires\n            };\n        } catch (ex) {\n            const bytes = new Uint8Array(response.data);\n            const isGzipped = bytes[0] === 0x1f && bytes[1] === 0x8b;\n            let errorMessage = `Unable to parse the tile at ${params.request.url}, `;\n            if (isGzipped) {\n                errorMessage += 'please make sure the data is not gzipped and that you have configured the relevant header in the server';\n            } else {\n                errorMessage += `got error: ${ex.message}`;\n            }\n            throw new Error(errorMessage);\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource#loadTile}. Delegates to\n     * {@link VectorTileWorkerSource#loadVectorData} (which by default expects\n     * a `params.url` property) for fetching and producing a VectorTile object.\n     */\n    async loadTile(params: WorkerTileParameters): Promise<WorkerTileResult | null> {\n        const tileUid = params.uid;\n\n        const perf = (params && params.request && params.request.collectResourceTiming) ?\n            new RequestPerformance(params.request) : false;\n\n        const workerTile = new WorkerTile(params);\n        this.loading[tileUid] = workerTile;\n\n        const abortController = new AbortController();\n        workerTile.abort = abortController;\n        try {\n            const response = await this.loadVectorTile(params, abortController);\n            delete this.loading[tileUid];\n            if (!response) {\n                return null;\n            }\n\n            const rawTileData = response.rawData;\n            const cacheControl = {} as ExpiryData;\n            if (response.expires) cacheControl.expires = response.expires;\n            if (response.cacheControl) cacheControl.cacheControl = response.cacheControl;\n\n            const resourceTiming = {} as {resourceTiming: any};\n            if (perf) {\n                const resourceTimingData = perf.finish();\n                // it's necessary to eval the result of getEntriesByName() here via parse/stringify\n                // late evaluation in the main thread causes TypeError: illegal invocation\n                if (resourceTimingData)\n                    resourceTiming.resourceTiming = JSON.parse(JSON.stringify(resourceTimingData));\n            }\n\n            workerTile.vectorTile = response.vectorTile;\n            const parsePromise = workerTile.parse(response.vectorTile, this.layerIndex, this.availableImages, this.actor);\n            this.loaded[tileUid] = workerTile;\n            // keep the original fetching state so that reload tile can pick it up if the original parse is cancelled by reloads' parse\n            this.fetching[tileUid] = {rawTileData, cacheControl, resourceTiming};\n\n            try {\n                const result = await parsePromise;\n                // Transferring a copy of rawTileData because the worker needs to retain its copy.\n                return extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming);\n            } finally {\n                delete this.fetching[tileUid];\n            }\n        } catch (err) {\n            delete this.loading[tileUid];\n            workerTile.status = 'done';\n            this.loaded[tileUid] = workerTile;\n            throw err;\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource#reloadTile}.\n     */\n    async reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult> {\n        const uid = params.uid;\n        if (!this.loaded || !this.loaded[uid]) {\n            throw new Error('Should not be trying to reload a tile that was never loaded or has been removed');\n        }\n        const workerTile = this.loaded[uid];\n        workerTile.showCollisionBoxes = params.showCollisionBoxes;\n        if (workerTile.status === 'parsing') {\n            const result = await workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor);\n            // if we have cancelled the original parse, make sure to pass the rawTileData from the original fetch\n            let parseResult: WorkerTileResult;\n            if (this.fetching[uid]) {\n                const {rawTileData, cacheControl, resourceTiming} = this.fetching[uid];\n                delete this.fetching[uid];\n                parseResult = extend({rawTileData: rawTileData.slice(0)}, result, cacheControl, resourceTiming);\n            } else {\n                parseResult = result;\n            }\n            return parseResult;\n\n        }\n        // if there was no vector tile data on the initial load, don't try and re-parse tile\n        if (workerTile.status === 'done' && workerTile.vectorTile) {\n            // this seems like a missing case where cache control is lost? see #3309\n            return workerTile.parse(workerTile.vectorTile, this.layerIndex, this.availableImages, this.actor);\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource#abortTile}.\n     */\n    async abortTile(params: TileParameters): Promise<void> {\n        const loading = this.loading;\n        const uid = params.uid;\n        if (loading && loading[uid] && loading[uid].abort) {\n            loading[uid].abort.abort();\n            delete loading[uid];\n        }\n    }\n\n    /**\n     * Implements {@link WorkerSource#removeTile}.\n     */\n    async removeTile(params: TileParameters): Promise<void> {\n        if (this.loaded && this.loaded[params.uid]) {\n            delete this.loaded[params.uid];\n        }\n    }\n}\n", "import {DEMData} from '../data/dem_data';\nimport {RGBAImage} from '../util/image';\nimport type {Actor} from '../util/actor';\nimport type {\n    WorkerDEMTileParameters,\n    TileParameters\n} from './worker_source';\nimport {getImageData, isImageBitmap} from '../util/util';\n\nexport class RasterDEMTileWorkerSource {\n    actor: Actor;\n    loaded: {[_: string]: DEMData};\n\n    constructor() {\n        this.loaded = {};\n    }\n\n    async loadTile(params: WorkerDEMTileParameters): Promise<DEMData | null> {\n        const {uid, encoding, rawImageData, redFactor, greenFactor, blueFactor, baseShift} = params;\n        const width = rawImageData.width + 2;\n        const height = rawImageData.height + 2;\n        const imagePixels: RGBAImage | ImageData = isImageBitmap(rawImageData) ?\n            new RGBAImage({width, height}, await getImageData(rawImageData, -1, -1, width, height)) :\n            rawImageData;\n        const dem = new DEMData(uid, imagePixels, encoding, redFactor, greenFactor, blueFactor, baseShift);\n        this.loaded = this.loaded || {};\n        this.loaded[uid] = dem;\n        return dem;\n    }\n\n    removeTile(params: TileParameters) {\n        const loaded = this.loaded,\n            uid = params.uid;\n        if (loaded && loaded[uid]) {\n            delete loaded[uid];\n        }\n    }\n}\n", "\nmodule.exports = rewind;\n\nfunction rewind(gj, outer) {\n    var type = gj && gj.type, i;\n\n    if (type === 'FeatureCollection') {\n        for (i = 0; i < gj.features.length; i++) rewind(gj.features[i], outer);\n\n    } else if (type === 'GeometryCollection') {\n        for (i = 0; i < gj.geometries.length; i++) rewind(gj.geometries[i], outer);\n\n    } else if (type === 'Feature') {\n        rewind(gj.geometry, outer);\n\n    } else if (type === 'Polygon') {\n        rewindRings(gj.coordinates, outer);\n\n    } else if (type === 'MultiPolygon') {\n        for (i = 0; i < gj.coordinates.length; i++) rewindRings(gj.coordinates[i], outer);\n    }\n\n    return gj;\n}\n\nfunction rewindRings(rings, outer) {\n    if (rings.length === 0) return;\n\n    rewindRing(rings[0], outer);\n    for (var i = 1; i < rings.length; i++) {\n        rewindRing(rings[i], !outer);\n    }\n}\n\nfunction rewindRing(ring, dir) {\n    var area = 0, err = 0;\n    for (var i = 0, len = ring.length, j = len - 1; i < len; j = i++) {\n        var k = (ring[i][0] - ring[j][0]) * (ring[j][1] + ring[i][1]);\n        var m = area + k;\n        err += Math.abs(area) >= Math.abs(k) ? area - m + k : k - m + area;\n        area = m;\n    }\n    if (area + err >= 0 !== !!dir) ring.reverse();\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport mvt from '@mapbox/vector-tile';\nimport type {VectorTileFeature, VectorTileLayer, VectorTile} from '@mapbox/vector-tile';\nconst toGeoJSON = mvt.VectorTileFeature.prototype.toGeoJSON;\nimport {EXTENT} from '../data/extent';\nimport type {TileFeature, AnyProps} from 'supercluster';\nimport type {Feature as GeoJSONVTFeature} from 'geojson-vt';\n\nexport type Feature = TileFeature<AnyProps, AnyProps> | GeoJSONVTFeature;\n\nclass FeatureWrapper implements VectorTileFeature {\n    _feature: Feature;\n\n    extent: number;\n    type: Feature['type'];\n    id: number;\n    properties: {[_: string]: string | number | boolean};\n\n    constructor(feature: Feature) {\n        this._feature = feature;\n\n        this.extent = EXTENT;\n        this.type = feature.type;\n        this.properties = feature.tags;\n\n        // If the feature has a top-level `id` property, copy it over, but only\n        // if it can be coerced to an integer, because this wrapper is used for\n        // serializing geojson feature data into vector tile PBF data, and the\n        // vector tile spec only supports integer values for feature ids --\n        // allowing non-integer values here results in a non-compliant PBF\n        // that causes an exception when it is parsed with vector-tile-js\n        if ('id' in feature && !isNaN(feature.id as any)) {\n            this.id = parseInt(feature.id, 10);\n        }\n    }\n\n    loadGeometry() {\n        if (this._feature.type === 1) {\n            const geometry = [];\n            for (const point of this._feature.geometry) {\n                geometry.push([new Point(point[0], point[1])]);\n            }\n            return geometry;\n        } else {\n            const geometry = [];\n            for (const ring of this._feature.geometry) {\n                const newRing = [];\n                for (const point of ring) {\n                    newRing.push(new Point(point[0], point[1]));\n                }\n                geometry.push(newRing);\n            }\n            return geometry;\n        }\n    }\n\n    toGeoJSON(x: number, y: number, z: number) {\n        return toGeoJSON.call(this, x, y, z);\n    }\n}\n\nexport class GeoJSONWrapper implements VectorTile, VectorTileLayer {\n    layers: {[_: string]: VectorTileLayer};\n    name: string;\n    extent: number;\n    length: number;\n    _features: Array<Feature>;\n\n    constructor(features: Array<Feature>) {\n        this.layers = {'_geojsonTileLayer': this};\n        this.name = '_geojsonTileLayer';\n        this.extent = EXTENT;\n        this.length = features.length;\n        this._features = features;\n    }\n\n    feature(i: number): VectorTileFeature {\n        return new FeatureWrapper(this._features[i]);\n    }\n}\n", "'use strict'\n\nvar Point = require('@mapbox/point-geometry')\nvar VectorTileFeature = require('@mapbox/vector-tile').VectorTileFeature\n\nmodule.exports = GeoJSONWrapper\n\n// conform to vectortile api\nfunction GeoJSONWrapper (features, options) {\n  this.options = options || {}\n  this.features = features\n  this.length = features.length\n}\n\nGeoJSONWrapper.prototype.feature = function (i) {\n  return new FeatureWrapper(this.features[i], this.options.extent)\n}\n\nfunction FeatureWrapper (feature, extent) {\n  this.id = typeof feature.id === 'number' ? feature.id : undefined\n  this.type = feature.type\n  this.rawGeometry = feature.type === 1 ? [feature.geometry] : feature.geometry\n  this.properties = feature.tags\n  this.extent = extent || 4096\n}\n\nFeatureWrapper.prototype.loadGeometry = function () {\n  var rings = this.rawGeometry\n  this.geometry = []\n\n  for (var i = 0; i < rings.length; i++) {\n    var ring = rings[i]\n    var newRing = []\n    for (var j = 0; j < ring.length; j++) {\n      newRing.push(new Point(ring[j][0], ring[j][1]))\n    }\n    this.geometry.push(newRing)\n  }\n  return this.geometry\n}\n\nFeatureWrapper.prototype.bbox = function () {\n  if (!this.geometry) this.loadGeometry()\n\n  var rings = this.geometry\n  var x1 = Infinity\n  var x2 = -Infinity\n  var y1 = Infinity\n  var y2 = -Infinity\n\n  for (var i = 0; i < rings.length; i++) {\n    var ring = rings[i]\n\n    for (var j = 0; j < ring.length; j++) {\n      var coord = ring[j]\n\n      x1 = Math.min(x1, coord.x)\n      x2 = Math.max(x2, coord.x)\n      y1 = Math.min(y1, coord.y)\n      y2 = Math.max(y2, coord.y)\n    }\n  }\n\n  return [x1, y1, x2, y2]\n}\n\nFeatureWrapper.prototype.toGeoJSON = VectorTileFeature.prototype.toGeoJSON\n", "var Pbf = require('pbf')\nvar GeoJSONWrapper = require('./lib/geojson_wrapper')\n\nmodule.exports = fromVectorTileJs\nmodule.exports.fromVectorTileJs = fromVectorTileJs\nmodule.exports.fromGeojsonVt = fromGeojsonVt\nmodule.exports.GeoJSONWrapper = GeoJSONWrapper\n\n/**\n * Serialize a vector-tile-js-created tile to pbf\n *\n * @param {Object} tile\n * @return {Buffer} uncompressed, pbf-serialized tile data\n */\nfunction fromVectorTileJs (tile) {\n  var out = new Pbf()\n  writeTile(tile, out)\n  return out.finish()\n}\n\n/**\n * Serialized a geojson-vt-created tile to pbf.\n *\n * @param {Object} layers - An object mapping layer names to geojson-vt-created vector tile objects\n * @param {Object} [options] - An object specifying the vector-tile specification version and extent that were used to create `layers`.\n * @param {Number} [options.version=1] - Version of vector-tile spec used\n * @param {Number} [options.extent=4096] - Extent of the vector tile\n * @return {Buffer} uncompressed, pbf-serialized tile data\n */\nfunction fromGeojsonVt (layers, options) {\n  options = options || {}\n  var l = {}\n  for (var k in layers) {\n    l[k] = new GeoJSONWrapper(layers[k].features, options)\n    l[k].name = k\n    l[k].version = options.version\n    l[k].extent = options.extent\n  }\n  return fromVectorTileJs({ layers: l })\n}\n\nfunction writeTile (tile, pbf) {\n  for (var key in tile.layers) {\n    pbf.writeMessage(3, writeLayer, tile.layers[key])\n  }\n}\n\nfunction writeLayer (layer, pbf) {\n  pbf.writeVarintField(15, layer.version || 1)\n  pbf.writeStringField(1, layer.name || '')\n  pbf.writeVarintField(5, layer.extent || 4096)\n\n  var i\n  var context = {\n    keys: [],\n    values: [],\n    keycache: {},\n    valuecache: {}\n  }\n\n  for (i = 0; i < layer.length; i++) {\n    context.feature = layer.feature(i)\n    pbf.writeMessage(2, writeFeature, context)\n  }\n\n  var keys = context.keys\n  for (i = 0; i < keys.length; i++) {\n    pbf.writeStringField(3, keys[i])\n  }\n\n  var values = context.values\n  for (i = 0; i < values.length; i++) {\n    pbf.writeMessage(4, writeValue, values[i])\n  }\n}\n\nfunction writeFeature (context, pbf) {\n  var feature = context.feature\n\n  if (feature.id !== undefined) {\n    pbf.writeVarintField(1, feature.id)\n  }\n\n  pbf.writeMessage(2, writeProperties, context)\n  pbf.writeVarintField(3, feature.type)\n  pbf.writeMessage(4, writeGeometry, feature)\n}\n\nfunction writeProperties (context, pbf) {\n  var feature = context.feature\n  var keys = context.keys\n  var values = context.values\n  var keycache = context.keycache\n  var valuecache = context.valuecache\n\n  for (var key in feature.properties) {\n    var value = feature.properties[key]\n\n    var keyIndex = keycache[key]\n    if (value === null) continue // don't encode null value properties\n\n    if (typeof keyIndex === 'undefined') {\n      keys.push(key)\n      keyIndex = keys.length - 1\n      keycache[key] = keyIndex\n    }\n    pbf.writeVarint(keyIndex)\n\n    var type = typeof value\n    if (type !== 'string' && type !== 'boolean' && type !== 'number') {\n      value = JSON.stringify(value)\n    }\n    var valueKey = type + ':' + value\n    var valueIndex = valuecache[valueKey]\n    if (typeof valueIndex === 'undefined') {\n      values.push(value)\n      valueIndex = values.length - 1\n      valuecache[valueKey] = valueIndex\n    }\n    pbf.writeVarint(valueIndex)\n  }\n}\n\nfunction command (cmd, length) {\n  return (length << 3) + (cmd & 0x7)\n}\n\nfunction zigzag (num) {\n  return (num << 1) ^ (num >> 31)\n}\n\nfunction writeGeometry (feature, pbf) {\n  var geometry = feature.loadGeometry()\n  var type = feature.type\n  var x = 0\n  var y = 0\n  var rings = geometry.length\n  for (var r = 0; r < rings; r++) {\n    var ring = geometry[r]\n    var count = 1\n    if (type === 1) {\n      count = ring.length\n    }\n    pbf.writeVarint(command(1, count)) // moveto\n    // do not write polygon closing path as lineto\n    var lineCount = type === 3 ? ring.length - 1 : ring.length\n    for (var i = 0; i < lineCount; i++) {\n      if (i === 1 && type !== 1) {\n        pbf.writeVarint(command(2, lineCount - 1)) // lineto\n      }\n      var dx = ring[i].x - x\n      var dy = ring[i].y - y\n      pbf.writeVarint(zigzag(dx))\n      pbf.writeVarint(zigzag(dy))\n      x += dx\n      y += dy\n    }\n    if (type === 3) {\n      pbf.writeVarint(command(7, 1)) // closepath\n    }\n  }\n}\n\nfunction writeValue (value, pbf) {\n  var type = typeof value\n  if (type === 'string') {\n    pbf.writeStringField(1, value)\n  } else if (type === 'boolean') {\n    pbf.writeBooleanField(7, value)\n  } else if (type === 'number') {\n    if (value % 1 !== 0) {\n      pbf.writeDoubleField(3, value)\n    } else if (value < 0) {\n      pbf.writeSVarintField(6, value)\n    } else {\n      pbf.writeVarintField(5, value)\n    }\n  }\n}\n", "\nimport KDBush from 'kdbush';\n\nconst defaultOptions = {\n    minZoom: 0,   // min zoom to generate clusters on\n    maxZoom: 16,  // max zoom level to cluster the points on\n    minPoints: 2, // minimum points to form a cluster\n    radius: 40,   // cluster radius in pixels\n    extent: 512,  // tile extent (radius is calculated relative to it)\n    nodeSize: 64, // size of the KD-tree leaf node, affects performance\n    log: false,   // whether to log timing info\n\n    // whether to generate numeric ids for input features (in vector tiles)\n    generateId: false,\n\n    // a reduce function for calculating custom cluster properties\n    reduce: null, // (accumulated, props) => { accumulated.sum += props.sum; }\n\n    // properties to use for individual points when running the reducer\n    map: props => props // props => ({sum: props.my_value})\n};\n\nconst fround = Math.fround || (tmp => ((x) => { tmp[0] = +x; return tmp[0]; }))(new Float32Array(1));\n\nconst OFFSET_ZOOM = 2;\nconst OFFSET_ID = 3;\nconst OFFSET_PARENT = 4;\nconst OFFSET_NUM = 5;\nconst OFFSET_PROP = 6;\n\nexport default class Supercluster {\n    constructor(options) {\n        this.options = Object.assign(Object.create(defaultOptions), options);\n        this.trees = new Array(this.options.maxZoom + 1);\n        this.stride = this.options.reduce ? 7 : 6;\n        this.clusterProps = [];\n    }\n\n    load(points) {\n        const {log, minZoom, maxZoom} = this.options;\n\n        if (log) console.time('total time');\n\n        const timerId = `prepare ${  points.length  } points`;\n        if (log) console.time(timerId);\n\n        this.points = points;\n\n        // generate a cluster object for each point and index input points into a KD-tree\n        const data = [];\n\n        for (let i = 0; i < points.length; i++) {\n            const p = points[i];\n            if (!p.geometry) continue;\n\n            const [lng, lat] = p.geometry.coordinates;\n            const x = fround(lngX(lng));\n            const y = fround(latY(lat));\n            // store internal point/cluster data in flat numeric arrays for performance\n            data.push(\n                x, y, // projected point coordinates\n                Infinity, // the last zoom the point was processed at\n                i, // index of the source feature in the original input array\n                -1, // parent cluster id\n                1 // number of points in a cluster\n            );\n            if (this.options.reduce) data.push(0); // noop\n        }\n        let tree = this.trees[maxZoom + 1] = this._createTree(data);\n\n        if (log) console.timeEnd(timerId);\n\n        // cluster points on max zoom, then cluster the results on previous zoom, etc.;\n        // results in a cluster hierarchy across zoom levels\n        for (let z = maxZoom; z >= minZoom; z--) {\n            const now = +Date.now();\n\n            // create a new set of clusters for the zoom and index them with a KD-tree\n            tree = this.trees[z] = this._createTree(this._cluster(tree, z));\n\n            if (log) console.log('z%d: %d clusters in %dms', z, tree.numItems, +Date.now() - now);\n        }\n\n        if (log) console.timeEnd('total time');\n\n        return this;\n    }\n\n    getClusters(bbox, zoom) {\n        let minLng = ((bbox[0] + 180) % 360 + 360) % 360 - 180;\n        const minLat = Math.max(-90, Math.min(90, bbox[1]));\n        let maxLng = bbox[2] === 180 ? 180 : ((bbox[2] + 180) % 360 + 360) % 360 - 180;\n        const maxLat = Math.max(-90, Math.min(90, bbox[3]));\n\n        if (bbox[2] - bbox[0] >= 360) {\n            minLng = -180;\n            maxLng = 180;\n        } else if (minLng > maxLng) {\n            const easternHem = this.getClusters([minLng, minLat, 180, maxLat], zoom);\n            const westernHem = this.getClusters([-180, minLat, maxLng, maxLat], zoom);\n            return easternHem.concat(westernHem);\n        }\n\n        const tree = this.trees[this._limitZoom(zoom)];\n        const ids = tree.range(lngX(minLng), latY(maxLat), lngX(maxLng), latY(minLat));\n        const data = tree.data;\n        const clusters = [];\n        for (const id of ids) {\n            const k = this.stride * id;\n            clusters.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n        }\n        return clusters;\n    }\n\n    getChildren(clusterId) {\n        const originId = this._getOriginId(clusterId);\n        const originZoom = this._getOriginZoom(clusterId);\n        const errorMsg = 'No cluster with the specified id.';\n\n        const tree = this.trees[originZoom];\n        if (!tree) throw new Error(errorMsg);\n\n        const data = tree.data;\n        if (originId * this.stride >= data.length) throw new Error(errorMsg);\n\n        const r = this.options.radius / (this.options.extent * Math.pow(2, originZoom - 1));\n        const x = data[originId * this.stride];\n        const y = data[originId * this.stride + 1];\n        const ids = tree.within(x, y, r);\n        const children = [];\n        for (const id of ids) {\n            const k = id * this.stride;\n            if (data[k + OFFSET_PARENT] === clusterId) {\n                children.push(data[k + OFFSET_NUM] > 1 ? getClusterJSON(data, k, this.clusterProps) : this.points[data[k + OFFSET_ID]]);\n            }\n        }\n\n        if (children.length === 0) throw new Error(errorMsg);\n\n        return children;\n    }\n\n    getLeaves(clusterId, limit, offset) {\n        limit = limit || 10;\n        offset = offset || 0;\n\n        const leaves = [];\n        this._appendLeaves(leaves, clusterId, limit, offset, 0);\n\n        return leaves;\n    }\n\n    getTile(z, x, y) {\n        const tree = this.trees[this._limitZoom(z)];\n        const z2 = Math.pow(2, z);\n        const {extent, radius} = this.options;\n        const p = radius / extent;\n        const top = (y - p) / z2;\n        const bottom = (y + 1 + p) / z2;\n\n        const tile = {\n            features: []\n        };\n\n        this._addTileFeatures(\n            tree.range((x - p) / z2, top, (x + 1 + p) / z2, bottom),\n            tree.data, x, y, z2, tile);\n\n        if (x === 0) {\n            this._addTileFeatures(\n                tree.range(1 - p / z2, top, 1, bottom),\n                tree.data, z2, y, z2, tile);\n        }\n        if (x === z2 - 1) {\n            this._addTileFeatures(\n                tree.range(0, top, p / z2, bottom),\n                tree.data, -1, y, z2, tile);\n        }\n\n        return tile.features.length ? tile : null;\n    }\n\n    getClusterExpansionZoom(clusterId) {\n        let expansionZoom = this._getOriginZoom(clusterId) - 1;\n        while (expansionZoom <= this.options.maxZoom) {\n            const children = this.getChildren(clusterId);\n            expansionZoom++;\n            if (children.length !== 1) break;\n            clusterId = children[0].properties.cluster_id;\n        }\n        return expansionZoom;\n    }\n\n    _appendLeaves(result, clusterId, limit, offset, skipped) {\n        const children = this.getChildren(clusterId);\n\n        for (const child of children) {\n            const props = child.properties;\n\n            if (props && props.cluster) {\n                if (skipped + props.point_count <= offset) {\n                    // skip the whole cluster\n                    skipped += props.point_count;\n                } else {\n                    // enter the cluster\n                    skipped = this._appendLeaves(result, props.cluster_id, limit, offset, skipped);\n                    // exit the cluster\n                }\n            } else if (skipped < offset) {\n                // skip a single point\n                skipped++;\n            } else {\n                // add a single point\n                result.push(child);\n            }\n            if (result.length === limit) break;\n        }\n\n        return skipped;\n    }\n\n    _createTree(data) {\n        const tree = new KDBush(data.length / this.stride | 0, this.options.nodeSize, Float32Array);\n        for (let i = 0; i < data.length; i += this.stride) tree.add(data[i], data[i + 1]);\n        tree.finish();\n        tree.data = data;\n        return tree;\n    }\n\n    _addTileFeatures(ids, data, x, y, z2, tile) {\n        for (const i of ids) {\n            const k = i * this.stride;\n            const isCluster = data[k + OFFSET_NUM] > 1;\n\n            let tags, px, py;\n            if (isCluster) {\n                tags = getClusterProperties(data, k, this.clusterProps);\n                px = data[k];\n                py = data[k + 1];\n            } else {\n                const p = this.points[data[k + OFFSET_ID]];\n                tags = p.properties;\n                const [lng, lat] = p.geometry.coordinates;\n                px = lngX(lng);\n                py = latY(lat);\n            }\n\n            const f = {\n                type: 1,\n                geometry: [[\n                    Math.round(this.options.extent * (px * z2 - x)),\n                    Math.round(this.options.extent * (py * z2 - y))\n                ]],\n                tags\n            };\n\n            // assign id\n            let id;\n            if (isCluster || this.options.generateId) {\n                // optionally generate id for points\n                id = data[k + OFFSET_ID];\n            } else {\n                // keep id if already assigned\n                id = this.points[data[k + OFFSET_ID]].id;\n            }\n\n            if (id !== undefined) f.id = id;\n\n            tile.features.push(f);\n        }\n    }\n\n    _limitZoom(z) {\n        return Math.max(this.options.minZoom, Math.min(Math.floor(+z), this.options.maxZoom + 1));\n    }\n\n    _cluster(tree, zoom) {\n        const {radius, extent, reduce, minPoints} = this.options;\n        const r = radius / (extent * Math.pow(2, zoom));\n        const data = tree.data;\n        const nextData = [];\n        const stride = this.stride;\n\n        // loop through each point\n        for (let i = 0; i < data.length; i += stride) {\n            // if we've already visited the point at this zoom level, skip it\n            if (data[i + OFFSET_ZOOM] <= zoom) continue;\n            data[i + OFFSET_ZOOM] = zoom;\n\n            // find all nearby points\n            const x = data[i];\n            const y = data[i + 1];\n            const neighborIds = tree.within(data[i], data[i + 1], r);\n\n            const numPointsOrigin = data[i + OFFSET_NUM];\n            let numPoints = numPointsOrigin;\n\n            // count the number of points in a potential cluster\n            for (const neighborId of neighborIds) {\n                const k = neighborId * stride;\n                // filter out neighbors that are already processed\n                if (data[k + OFFSET_ZOOM] > zoom) numPoints += data[k + OFFSET_NUM];\n            }\n\n            // if there were neighbors to merge, and there are enough points to form a cluster\n            if (numPoints > numPointsOrigin && numPoints >= minPoints) {\n                let wx = x * numPointsOrigin;\n                let wy = y * numPointsOrigin;\n\n                let clusterProperties;\n                let clusterPropIndex = -1;\n\n                // encode both zoom and point index on which the cluster originated -- offset by total length of features\n                const id = ((i / stride | 0) << 5) + (zoom + 1) + this.points.length;\n\n                for (const neighborId of neighborIds) {\n                    const k = neighborId * stride;\n\n                    if (data[k + OFFSET_ZOOM] <= zoom) continue;\n                    data[k + OFFSET_ZOOM] = zoom; // save the zoom (so it doesn't get processed twice)\n\n                    const numPoints2 = data[k + OFFSET_NUM];\n                    wx += data[k] * numPoints2; // accumulate coordinates for calculating weighted center\n                    wy += data[k + 1] * numPoints2;\n\n                    data[k + OFFSET_PARENT] = id;\n\n                    if (reduce) {\n                        if (!clusterProperties) {\n                            clusterProperties = this._map(data, i, true);\n                            clusterPropIndex = this.clusterProps.length;\n                            this.clusterProps.push(clusterProperties);\n                        }\n                        reduce(clusterProperties, this._map(data, k));\n                    }\n                }\n\n                data[i + OFFSET_PARENT] = id;\n                nextData.push(wx / numPoints, wy / numPoints, Infinity, id, -1, numPoints);\n                if (reduce) nextData.push(clusterPropIndex);\n\n            } else { // left points as unclustered\n                for (let j = 0; j < stride; j++) nextData.push(data[i + j]);\n\n                if (numPoints > 1) {\n                    for (const neighborId of neighborIds) {\n                        const k = neighborId * stride;\n                        if (data[k + OFFSET_ZOOM] <= zoom) continue;\n                        data[k + OFFSET_ZOOM] = zoom;\n                        for (let j = 0; j < stride; j++) nextData.push(data[k + j]);\n                    }\n                }\n            }\n        }\n\n        return nextData;\n    }\n\n    // get index of the point from which the cluster originated\n    _getOriginId(clusterId) {\n        return (clusterId - this.points.length) >> 5;\n    }\n\n    // get zoom of the point from which the cluster originated\n    _getOriginZoom(clusterId) {\n        return (clusterId - this.points.length) % 32;\n    }\n\n    _map(data, i, clone) {\n        if (data[i + OFFSET_NUM] > 1) {\n            const props = this.clusterProps[data[i + OFFSET_PROP]];\n            return clone ? Object.assign({}, props) : props;\n        }\n        const original = this.points[data[i + OFFSET_ID]].properties;\n        const result = this.options.map(original);\n        return clone && result === original ? Object.assign({}, result) : result;\n    }\n}\n\nfunction getClusterJSON(data, i, clusterProps) {\n    return {\n        type: 'Feature',\n        id: data[i + OFFSET_ID],\n        properties: getClusterProperties(data, i, clusterProps),\n        geometry: {\n            type: 'Point',\n            coordinates: [xLng(data[i]), yLat(data[i + 1])]\n        }\n    };\n}\n\nfunction getClusterProperties(data, i, clusterProps) {\n    const count = data[i + OFFSET_NUM];\n    const abbrev =\n        count >= 10000 ? `${Math.round(count / 1000)  }k` :\n        count >= 1000 ? `${Math.round(count / 100) / 10  }k` : count;\n    const propIndex = data[i + OFFSET_PROP];\n    const properties = propIndex === -1 ? {} : Object.assign({}, clusterProps[propIndex]);\n    return Object.assign(properties, {\n        cluster: true,\n        cluster_id: data[i + OFFSET_ID],\n        point_count: count,\n        point_count_abbreviated: abbrev\n    });\n}\n\n// longitude/latitude to spherical mercator in [0..1] range\nfunction lngX(lng) {\n    return lng / 360 + 0.5;\n}\nfunction latY(lat) {\n    const sin = Math.sin(lat * Math.PI / 180);\n    const y = (0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI);\n    return y < 0 ? 0 : y > 1 ? 1 : y;\n}\n\n// spherical mercator to longitude/latitude\nfunction xLng(x) {\n    return (x - 0.5) * 360;\n}\nfunction yLat(y) {\n    const y2 = (180 - y * 360) * Math.PI / 180;\n    return 360 * Math.atan(Math.exp(y2)) / Math.PI - 90;\n}\n", "\n// calculate simplification data using optimized Douglas-Peucker algorithm\n\nexport default function simplify(coords, first, last, sqTolerance) {\n    let maxSqDist = sqTolerance;\n    const mid = first + ((last - first) >> 1);\n    let minPosToMid = last - first;\n    let index;\n\n    const ax = coords[first];\n    const ay = coords[first + 1];\n    const bx = coords[last];\n    const by = coords[last + 1];\n\n    for (let i = first + 3; i < last; i += 3) {\n        const d = getSqSegDist(coords[i], coords[i + 1], ax, ay, bx, by);\n\n        if (d > maxSqDist) {\n            index = i;\n            maxSqDist = d;\n\n        } else if (d === maxSqDist) {\n            // a workaround to ensure we choose a pivot close to the middle of the list,\n            // reducing recursion depth, for certain degenerate inputs\n            // https://github.com/mapbox/geojson-vt/issues/104\n            const posToMid = Math.abs(i - mid);\n            if (posToMid < minPosToMid) {\n                index = i;\n                minPosToMid = posToMid;\n            }\n        }\n    }\n\n    if (maxSqDist > sqTolerance) {\n        if (index - first > 3) simplify(coords, first, index, sqTolerance);\n        coords[index + 2] = maxSqDist;\n        if (last - index > 3) simplify(coords, index, last, sqTolerance);\n    }\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(px, py, x, y, bx, by) {\n\n    let dx = bx - x;\n    let dy = by - y;\n\n    if (dx !== 0 || dy !== 0) {\n\n        const t = ((px - x) * dx + (py - y) * dy) / (dx * dx + dy * dy);\n\n        if (t > 1) {\n            x = bx;\n            y = by;\n\n        } else if (t > 0) {\n            x += dx * t;\n            y += dy * t;\n        }\n    }\n\n    dx = px - x;\n    dy = py - y;\n\n    return dx * dx + dy * dy;\n}\n", "\nexport default function createFeature(id, type, geom, tags) {\n    const feature = {\n        id: id == null ? null : id,\n        type,\n        geometry: geom,\n        tags,\n        minX: Infinity,\n        minY: Infinity,\n        maxX: -Infinity,\n        maxY: -Infinity\n    };\n\n    if (type === 'Point' || type === 'MultiPoint' || type === 'LineString') {\n        calcLineBBox(feature, geom);\n\n    } else if (type === 'Polygon') {\n        // the outer ring (ie [0]) contains all inner rings\n        calcLineBBox(feature, geom[0]);\n\n    } else if (type === 'MultiLineString') {\n        for (const line of geom) {\n            calcLineBBox(feature, line);\n        }\n\n    } else if (type === 'MultiPolygon') {\n        for (const polygon of geom) {\n            // the outer ring (ie [0]) contains all inner rings\n            calcLineBBox(feature, polygon[0]);\n        }\n    }\n\n    return feature;\n}\n\nfunction calcLineBBox(feature, geom) {\n    for (let i = 0; i < geom.length; i += 3) {\n        feature.minX = Math.min(feature.minX, geom[i]);\n        feature.minY = Math.min(feature.minY, geom[i + 1]);\n        feature.maxX = Math.max(feature.maxX, geom[i]);\n        feature.maxY = Math.max(feature.maxY, geom[i + 1]);\n    }\n}\n", "\nimport simplify from './simplify.js';\nimport createFeature from './feature.js';\n\n// converts GeoJSON feature into an intermediate projected JSON vector format with simplification data\n\nexport default function convert(data, options) {\n    const features = [];\n    if (data.type === 'FeatureCollection') {\n        for (let i = 0; i < data.features.length; i++) {\n            convertFeature(features, data.features[i], options, i);\n        }\n\n    } else if (data.type === 'Feature') {\n        convertFeature(features, data, options);\n\n    } else {\n        // single geometry or a geometry collection\n        convertFeature(features, {geometry: data}, options);\n    }\n\n    return features;\n}\n\nfunction convertFeature(features, geojson, options, index) {\n    if (!geojson.geometry) return;\n\n    const coords = geojson.geometry.coordinates;\n    if (coords && coords.length === 0) return;\n\n    const type = geojson.geometry.type;\n    const tolerance = Math.pow(options.tolerance / ((1 << options.maxZoom) * options.extent), 2);\n    let geometry = [];\n    let id = geojson.id;\n    if (options.promoteId) {\n        id = geojson.properties[options.promoteId];\n    } else if (options.generateId) {\n        id = index || 0;\n    }\n    if (type === 'Point') {\n        convertPoint(coords, geometry);\n\n    } else if (type === 'MultiPoint') {\n        for (const p of coords) {\n            convertPoint(p, geometry);\n        }\n\n    } else if (type === 'LineString') {\n        convertLine(coords, geometry, tolerance, false);\n\n    } else if (type === 'MultiLineString') {\n        if (options.lineMetrics) {\n            // explode into linestrings to be able to track metrics\n            for (const line of coords) {\n                geometry = [];\n                convertLine(line, geometry, tolerance, false);\n                features.push(createFeature(id, 'LineString', geometry, geojson.properties));\n            }\n            return;\n        } else {\n            convertLines(coords, geometry, tolerance, false);\n        }\n\n    } else if (type === 'Polygon') {\n        convertLines(coords, geometry, tolerance, true);\n\n    } else if (type === 'MultiPolygon') {\n        for (const polygon of coords) {\n            const newPolygon = [];\n            convertLines(polygon, newPolygon, tolerance, true);\n            geometry.push(newPolygon);\n        }\n    } else if (type === 'GeometryCollection') {\n        for (const singleGeometry of geojson.geometry.geometries) {\n            convertFeature(features, {\n                id,\n                geometry: singleGeometry,\n                properties: geojson.properties\n            }, options, index);\n        }\n        return;\n    } else {\n        throw new Error('Input data is not a valid GeoJSON object.');\n    }\n\n    features.push(createFeature(id, type, geometry, geojson.properties));\n}\n\nfunction convertPoint(coords, out) {\n    out.push(projectX(coords[0]), projectY(coords[1]), 0);\n}\n\nfunction convertLine(ring, out, tolerance, isPolygon) {\n    let x0, y0;\n    let size = 0;\n\n    for (let j = 0; j < ring.length; j++) {\n        const x = projectX(ring[j][0]);\n        const y = projectY(ring[j][1]);\n\n        out.push(x, y, 0);\n\n        if (j > 0) {\n            if (isPolygon) {\n                size += (x0 * y - x * y0) / 2; // area\n            } else {\n                size += Math.sqrt(Math.pow(x - x0, 2) + Math.pow(y - y0, 2)); // length\n            }\n        }\n        x0 = x;\n        y0 = y;\n    }\n\n    const last = out.length - 3;\n    out[2] = 1;\n    simplify(out, 0, last, tolerance);\n    out[last + 2] = 1;\n\n    out.size = Math.abs(size);\n    out.start = 0;\n    out.end = out.size;\n}\n\nfunction convertLines(rings, out, tolerance, isPolygon) {\n    for (let i = 0; i < rings.length; i++) {\n        const geom = [];\n        convertLine(rings[i], geom, tolerance, isPolygon);\n        out.push(geom);\n    }\n}\n\nfunction projectX(x) {\n    return x / 360 + 0.5;\n}\n\nfunction projectY(y) {\n    const sin = Math.sin(y * Math.PI / 180);\n    const y2 = 0.5 - 0.25 * Math.log((1 + sin) / (1 - sin)) / Math.PI;\n    return y2 < 0 ? 0 : y2 > 1 ? 1 : y2;\n}\n", "\nimport createFeature from './feature.js';\n\n/* clip features between two vertical or horizontal axis-parallel lines:\n *     |        |\n *  ___|___     |     /\n * /   |   \\____|____/\n *     |        |\n *\n * k1 and k2 are the line coordinates\n * axis: 0 for x, 1 for y\n * minAll and maxAll: minimum and maximum coordinate value for all features\n */\nexport default function clip(features, scale, k1, k2, axis, minAll, maxAll, options) {\n    k1 /= scale;\n    k2 /= scale;\n\n    if (minAll >= k1 && maxAll < k2) return features; // trivial accept\n    else if (maxAll < k1 || minAll >= k2) return null; // trivial reject\n\n    const clipped = [];\n\n    for (const feature of features) {\n        const geometry = feature.geometry;\n        let type = feature.type;\n\n        const min = axis === 0 ? feature.minX : feature.minY;\n        const max = axis === 0 ? feature.maxX : feature.maxY;\n\n        if (min >= k1 && max < k2) { // trivial accept\n            clipped.push(feature);\n            continue;\n        } else if (max < k1 || min >= k2) { // trivial reject\n            continue;\n        }\n\n        let newGeometry = [];\n\n        if (type === 'Point' || type === 'MultiPoint') {\n            clipPoints(geometry, newGeometry, k1, k2, axis);\n\n        } else if (type === 'LineString') {\n            clipLine(geometry, newGeometry, k1, k2, axis, false, options.lineMetrics);\n\n        } else if (type === 'MultiLineString') {\n            clipLines(geometry, newGeometry, k1, k2, axis, false);\n\n        } else if (type === 'Polygon') {\n            clipLines(geometry, newGeometry, k1, k2, axis, true);\n\n        } else if (type === 'MultiPolygon') {\n            for (const polygon of geometry) {\n                const newPolygon = [];\n                clipLines(polygon, newPolygon, k1, k2, axis, true);\n                if (newPolygon.length) {\n                    newGeometry.push(newPolygon);\n                }\n            }\n        }\n\n        if (newGeometry.length) {\n            if (options.lineMetrics && type === 'LineString') {\n                for (const line of newGeometry) {\n                    clipped.push(createFeature(feature.id, type, line, feature.tags));\n                }\n                continue;\n            }\n\n            if (type === 'LineString' || type === 'MultiLineString') {\n                if (newGeometry.length === 1) {\n                    type = 'LineString';\n                    newGeometry = newGeometry[0];\n                } else {\n                    type = 'MultiLineString';\n                }\n            }\n            if (type === 'Point' || type === 'MultiPoint') {\n                type = newGeometry.length === 3 ? 'Point' : 'MultiPoint';\n            }\n\n            clipped.push(createFeature(feature.id, type, newGeometry, feature.tags));\n        }\n    }\n\n    return clipped.length ? clipped : null;\n}\n\nfunction clipPoints(geom, newGeom, k1, k2, axis) {\n    for (let i = 0; i < geom.length; i += 3) {\n        const a = geom[i + axis];\n\n        if (a >= k1 && a <= k2) {\n            addPoint(newGeom, geom[i], geom[i + 1], geom[i + 2]);\n        }\n    }\n}\n\nfunction clipLine(geom, newGeom, k1, k2, axis, isPolygon, trackMetrics) {\n\n    let slice = newSlice(geom);\n    const intersect = axis === 0 ? intersectX : intersectY;\n    let len = geom.start;\n    let segLen, t;\n\n    for (let i = 0; i < geom.length - 3; i += 3) {\n        const ax = geom[i];\n        const ay = geom[i + 1];\n        const az = geom[i + 2];\n        const bx = geom[i + 3];\n        const by = geom[i + 4];\n        const a = axis === 0 ? ax : ay;\n        const b = axis === 0 ? bx : by;\n        let exited = false;\n\n        if (trackMetrics) segLen = Math.sqrt(Math.pow(ax - bx, 2) + Math.pow(ay - by, 2));\n\n        if (a < k1) {\n            // ---|-->  | (line enters the clip region from the left)\n            if (b > k1) {\n                t = intersect(slice, ax, ay, bx, by, k1);\n                if (trackMetrics) slice.start = len + segLen * t;\n            }\n        } else if (a > k2) {\n            // |  <--|--- (line enters the clip region from the right)\n            if (b < k2) {\n                t = intersect(slice, ax, ay, bx, by, k2);\n                if (trackMetrics) slice.start = len + segLen * t;\n            }\n        } else {\n            addPoint(slice, ax, ay, az);\n        }\n        if (b < k1 && a >= k1) {\n            // <--|---  | or <--|-----|--- (line exits the clip region on the left)\n            t = intersect(slice, ax, ay, bx, by, k1);\n            exited = true;\n        }\n        if (b > k2 && a <= k2) {\n            // |  ---|--> or ---|-----|--> (line exits the clip region on the right)\n            t = intersect(slice, ax, ay, bx, by, k2);\n            exited = true;\n        }\n\n        if (!isPolygon && exited) {\n            if (trackMetrics) slice.end = len + segLen * t;\n            newGeom.push(slice);\n            slice = newSlice(geom);\n        }\n\n        if (trackMetrics) len += segLen;\n    }\n\n    // add the last point\n    let last = geom.length - 3;\n    const ax = geom[last];\n    const ay = geom[last + 1];\n    const az = geom[last + 2];\n    const a = axis === 0 ? ax : ay;\n    if (a >= k1 && a <= k2) addPoint(slice, ax, ay, az);\n\n    // close the polygon if its endpoints are not the same after clipping\n    last = slice.length - 3;\n    if (isPolygon && last >= 3 && (slice[last] !== slice[0] || slice[last + 1] !== slice[1])) {\n        addPoint(slice, slice[0], slice[1], slice[2]);\n    }\n\n    // add the final slice\n    if (slice.length) {\n        newGeom.push(slice);\n    }\n}\n\nfunction newSlice(line) {\n    const slice = [];\n    slice.size = line.size;\n    slice.start = line.start;\n    slice.end = line.end;\n    return slice;\n}\n\nfunction clipLines(geom, newGeom, k1, k2, axis, isPolygon) {\n    for (const line of geom) {\n        clipLine(line, newGeom, k1, k2, axis, isPolygon, false);\n    }\n}\n\nfunction addPoint(out, x, y, z) {\n    out.push(x, y, z);\n}\n\nfunction intersectX(out, ax, ay, bx, by, x) {\n    const t = (x - ax) / (bx - ax);\n    addPoint(out, x, ay + (by - ay) * t, 1);\n    return t;\n}\n\nfunction intersectY(out, ax, ay, bx, by, y) {\n    const t = (y - ay) / (by - ay);\n    addPoint(out, ax + (bx - ax) * t, y, 1);\n    return t;\n}\n", "\nimport clip from './clip.js';\nimport createFeature from './feature.js';\n\nexport default function wrap(features, options) {\n    const buffer = options.buffer / options.extent;\n    let merged = features;\n    const left  = clip(features, 1, -1 - buffer, buffer,     0, -1, 2, options); // left world copy\n    const right = clip(features, 1,  1 - buffer, 2 + buffer, 0, -1, 2, options); // right world copy\n\n    if (left || right) {\n        merged = clip(features, 1, -buffer, 1 + buffer, 0, -1, 2, options) || []; // center world copy\n\n        if (left) merged = shiftFeatureCoords(left, 1).concat(merged); // merge left into center\n        if (right) merged = merged.concat(shiftFeatureCoords(right, -1)); // merge right into center\n    }\n\n    return merged;\n}\n\nfunction shiftFeatureCoords(features, offset) {\n    const newFeatures = [];\n\n    for (let i = 0; i < features.length; i++) {\n        const feature = features[i];\n        const type = feature.type;\n\n        let newGeometry;\n\n        if (type === 'Point' || type === 'MultiPoint' || type === 'LineString') {\n            newGeometry = shiftCoords(feature.geometry, offset);\n\n        } else if (type === 'MultiLineString' || type === 'Polygon') {\n            newGeometry = [];\n            for (const line of feature.geometry) {\n                newGeometry.push(shiftCoords(line, offset));\n            }\n        } else if (type === 'MultiPolygon') {\n            newGeometry = [];\n            for (const polygon of feature.geometry) {\n                const newPolygon = [];\n                for (const line of polygon) {\n                    newPolygon.push(shiftCoords(line, offset));\n                }\n                newGeometry.push(newPolygon);\n            }\n        }\n\n        newFeatures.push(createFeature(feature.id, type, newGeometry, feature.tags));\n    }\n\n    return newFeatures;\n}\n\nfunction shiftCoords(points, offset) {\n    const newPoints = [];\n    newPoints.size = points.size;\n\n    if (points.start !== undefined) {\n        newPoints.start = points.start;\n        newPoints.end = points.end;\n    }\n\n    for (let i = 0; i < points.length; i += 3) {\n        newPoints.push(points[i] + offset, points[i + 1], points[i + 2]);\n    }\n    return newPoints;\n}\n", "\n// Transforms the coordinates of each feature in the given tile from\n// mercator-projected space into (extent x extent) tile space.\nexport default function transformTile(tile, extent) {\n    if (tile.transformed) return tile;\n\n    const z2 = 1 << tile.z;\n    const tx = tile.x;\n    const ty = tile.y;\n\n    for (const feature of tile.features) {\n        const geom = feature.geometry;\n        const type = feature.type;\n\n        feature.geometry = [];\n\n        if (type === 1) {\n            for (let j = 0; j < geom.length; j += 2) {\n                feature.geometry.push(transformPoint(geom[j], geom[j + 1], extent, z2, tx, ty));\n            }\n        } else {\n            for (let j = 0; j < geom.length; j++) {\n                const ring = [];\n                for (let k = 0; k < geom[j].length; k += 2) {\n                    ring.push(transformPoint(geom[j][k], geom[j][k + 1], extent, z2, tx, ty));\n                }\n                feature.geometry.push(ring);\n            }\n        }\n    }\n\n    tile.transformed = true;\n\n    return tile;\n}\n\nfunction transformPoint(x, y, extent, z2, tx, ty) {\n    return [\n        Math.round(extent * (x * z2 - tx)),\n        Math.round(extent * (y * z2 - ty))];\n}\n", "\nexport default function createTile(features, z, tx, ty, options) {\n    const tolerance = z === options.maxZoom ? 0 : options.tolerance / ((1 << z) * options.extent);\n    const tile = {\n        features: [],\n        numPoints: 0,\n        numSimplified: 0,\n        numFeatures: features.length,\n        source: null,\n        x: tx,\n        y: ty,\n        z,\n        transformed: false,\n        minX: 2,\n        minY: 1,\n        maxX: -1,\n        maxY: 0\n    };\n    for (const feature of features) {\n        addFeature(tile, feature, tolerance, options);\n    }\n    return tile;\n}\n\nfunction addFeature(tile, feature, tolerance, options) {\n    const geom = feature.geometry;\n    const type = feature.type;\n    const simplified = [];\n\n    tile.minX = Math.min(tile.minX, feature.minX);\n    tile.minY = Math.min(tile.minY, feature.minY);\n    tile.maxX = Math.max(tile.maxX, feature.maxX);\n    tile.maxY = Math.max(tile.maxY, feature.maxY);\n\n    if (type === 'Point' || type === 'MultiPoint') {\n        for (let i = 0; i < geom.length; i += 3) {\n            simplified.push(geom[i], geom[i + 1]);\n            tile.numPoints++;\n            tile.numSimplified++;\n        }\n\n    } else if (type === 'LineString') {\n        addLine(simplified, geom, tile, tolerance, false, false);\n\n    } else if (type === 'MultiLineString' || type === 'Polygon') {\n        for (let i = 0; i < geom.length; i++) {\n            addLine(simplified, geom[i], tile, tolerance, type === 'Polygon', i === 0);\n        }\n\n    } else if (type === 'MultiPolygon') {\n\n        for (let k = 0; k < geom.length; k++) {\n            const polygon = geom[k];\n            for (let i = 0; i < polygon.length; i++) {\n                addLine(simplified, polygon[i], tile, tolerance, true, i === 0);\n            }\n        }\n    }\n\n    if (simplified.length) {\n        let tags = feature.tags || null;\n\n        if (type === 'LineString' && options.lineMetrics) {\n            tags = {};\n            for (const key in feature.tags) tags[key] = feature.tags[key];\n            tags['mapbox_clip_start'] = geom.start / geom.size;\n            tags['mapbox_clip_end'] = geom.end / geom.size;\n        }\n\n        const tileFeature = {\n            geometry: simplified,\n            type: type === 'Polygon' || type === 'MultiPolygon' ? 3 :\n            (type === 'LineString' || type === 'MultiLineString' ? 2 : 1),\n            tags\n        };\n        if (feature.id !== null) {\n            tileFeature.id = feature.id;\n        }\n        tile.features.push(tileFeature);\n    }\n}\n\nfunction addLine(result, geom, tile, tolerance, isPolygon, isOuter) {\n    const sqTolerance = tolerance * tolerance;\n\n    if (tolerance > 0 && (geom.size < (isPolygon ? sqTolerance : tolerance))) {\n        tile.numPoints += geom.length / 3;\n        return;\n    }\n\n    const ring = [];\n\n    for (let i = 0; i < geom.length; i += 3) {\n        if (tolerance === 0 || geom[i + 2] > sqTolerance) {\n            tile.numSimplified++;\n            ring.push(geom[i], geom[i + 1]);\n        }\n        tile.numPoints++;\n    }\n\n    if (isPolygon) rewind(ring, isOuter);\n\n    result.push(ring);\n}\n\nfunction rewind(ring, clockwise) {\n    let area = 0;\n    for (let i = 0, len = ring.length, j = len - 2; i < len; j = i, i += 2) {\n        area += (ring[i] - ring[j]) * (ring[i + 1] + ring[j + 1]);\n    }\n    if (area > 0 === clockwise) {\n        for (let i = 0, len = ring.length; i < len / 2; i += 2) {\n            const x = ring[i];\n            const y = ring[i + 1];\n            ring[i] = ring[len - 2 - i];\n            ring[i + 1] = ring[len - 1 - i];\n            ring[len - 2 - i] = x;\n            ring[len - 1 - i] = y;\n        }\n    }\n}\n", "\nimport convert from './convert.js';     // GeoJSON conversion and preprocessing\nimport clip from './clip.js';           // stripe clipping algorithm\nimport wrap from './wrap.js';           // date line processing\nimport transform from './transform.js'; // coordinate transformation\nimport createTile from './tile.js';     // final simplified tile generation\n\nconst defaultOptions = {\n    maxZoom: 14,            // max zoom to preserve detail on\n    indexMaxZoom: 5,        // max zoom in the tile index\n    indexMaxPoints: 100000, // max number of points per tile in the tile index\n    tolerance: 3,           // simplification tolerance (higher means simpler)\n    extent: 4096,           // tile extent\n    buffer: 64,             // tile buffer on each side\n    lineMetrics: false,     // whether to calculate line metrics\n    promoteId: null,        // name of a feature property to be promoted to feature.id\n    generateId: false,      // whether to generate feature ids. Cannot be used with promoteId\n    debug: 0                // logging level (0, 1 or 2)\n};\n\nclass GeoJSONVT {\n    constructor(data, options) {\n        options = this.options = extend(Object.create(defaultOptions), options);\n\n        const debug = options.debug;\n\n        if (debug) console.time('preprocess data');\n\n        if (options.maxZoom < 0 || options.maxZoom > 24) throw new Error('maxZoom should be in the 0-24 range');\n        if (options.promoteId && options.generateId) throw new Error('promoteId and generateId cannot be used together.');\n\n        // projects and adds simplification info\n        let features = convert(data, options);\n\n        // tiles and tileCoords are part of the public API\n        this.tiles = {};\n        this.tileCoords = [];\n\n        if (debug) {\n            console.timeEnd('preprocess data');\n            console.log('index: maxZoom: %d, maxPoints: %d', options.indexMaxZoom, options.indexMaxPoints);\n            console.time('generate tiles');\n            this.stats = {};\n            this.total = 0;\n        }\n\n        // wraps features (ie extreme west and extreme east)\n        features = wrap(features, options);\n\n        // start slicing from the top tile down\n        if (features.length) this.splitTile(features, 0, 0, 0);\n\n        if (debug) {\n            if (features.length) console.log('features: %d, points: %d', this.tiles[0].numFeatures, this.tiles[0].numPoints);\n            console.timeEnd('generate tiles');\n            console.log('tiles generated:', this.total, JSON.stringify(this.stats));\n        }\n    }\n\n    // splits features from a parent tile to sub-tiles.\n    // z, x, and y are the coordinates of the parent tile\n    // cz, cx, and cy are the coordinates of the target tile\n    //\n    // If no target tile is specified, splitting stops when we reach the maximum\n    // zoom or the number of points is low as specified in the options.\n    splitTile(features, z, x, y, cz, cx, cy) {\n\n        const stack = [features, z, x, y];\n        const options = this.options;\n        const debug = options.debug;\n\n        // avoid recursion by using a processing queue\n        while (stack.length) {\n            y = stack.pop();\n            x = stack.pop();\n            z = stack.pop();\n            features = stack.pop();\n\n            const z2 = 1 << z;\n            const id = toID(z, x, y);\n            let tile = this.tiles[id];\n\n            if (!tile) {\n                if (debug > 1) console.time('creation');\n\n                tile = this.tiles[id] = createTile(features, z, x, y, options);\n                this.tileCoords.push({z, x, y});\n\n                if (debug) {\n                    if (debug > 1) {\n                        console.log('tile z%d-%d-%d (features: %d, points: %d, simplified: %d)',\n                            z, x, y, tile.numFeatures, tile.numPoints, tile.numSimplified);\n                        console.timeEnd('creation');\n                    }\n                    const key = `z${  z}`;\n                    this.stats[key] = (this.stats[key] || 0) + 1;\n                    this.total++;\n                }\n            }\n\n            // save reference to original geometry in tile so that we can drill down later if we stop now\n            tile.source = features;\n\n            // if it's the first-pass tiling\n            if (cz == null) {\n                // stop tiling if we reached max zoom, or if the tile is too simple\n                if (z === options.indexMaxZoom || tile.numPoints <= options.indexMaxPoints) continue;\n            // if a drilldown to a specific tile\n            } else if (z === options.maxZoom || z === cz) {\n                // stop tiling if we reached base zoom or our target tile zoom\n                continue;\n            } else if (cz != null) {\n                // stop tiling if it's not an ancestor of the target tile\n                const zoomSteps = cz - z;\n                if (x !== cx >> zoomSteps || y !== cy >> zoomSteps) continue;\n            }\n\n            // if we slice further down, no need to keep source geometry\n            tile.source = null;\n\n            if (features.length === 0) continue;\n\n            if (debug > 1) console.time('clipping');\n\n            // values we'll use for clipping\n            const k1 = 0.5 * options.buffer / options.extent;\n            const k2 = 0.5 - k1;\n            const k3 = 0.5 + k1;\n            const k4 = 1 + k1;\n\n            let tl = null;\n            let bl = null;\n            let tr = null;\n            let br = null;\n\n            let left  = clip(features, z2, x - k1, x + k3, 0, tile.minX, tile.maxX, options);\n            let right = clip(features, z2, x + k2, x + k4, 0, tile.minX, tile.maxX, options);\n            features = null;\n\n            if (left) {\n                tl = clip(left, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n                bl = clip(left, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n                left = null;\n            }\n\n            if (right) {\n                tr = clip(right, z2, y - k1, y + k3, 1, tile.minY, tile.maxY, options);\n                br = clip(right, z2, y + k2, y + k4, 1, tile.minY, tile.maxY, options);\n                right = null;\n            }\n\n            if (debug > 1) console.timeEnd('clipping');\n\n            stack.push(tl || [], z + 1, x * 2,     y * 2);\n            stack.push(bl || [], z + 1, x * 2,     y * 2 + 1);\n            stack.push(tr || [], z + 1, x * 2 + 1, y * 2);\n            stack.push(br || [], z + 1, x * 2 + 1, y * 2 + 1);\n        }\n    }\n\n    getTile(z, x, y) {\n        z = +z;\n        x = +x;\n        y = +y;\n\n        const options = this.options;\n        const {extent, debug} = options;\n\n        if (z < 0 || z > 24) return null;\n\n        const z2 = 1 << z;\n        x = (x + z2) & (z2 - 1); // wrap tile x coordinate\n\n        const id = toID(z, x, y);\n        if (this.tiles[id]) return transform(this.tiles[id], extent);\n\n        if (debug > 1) console.log('drilling down to z%d-%d-%d', z, x, y);\n\n        let z0 = z;\n        let x0 = x;\n        let y0 = y;\n        let parent;\n\n        while (!parent && z0 > 0) {\n            z0--;\n            x0 = x0 >> 1;\n            y0 = y0 >> 1;\n            parent = this.tiles[toID(z0, x0, y0)];\n        }\n\n        if (!parent || !parent.source) return null;\n\n        // if we found a parent tile containing the original geometry, we can drill down from it\n        if (debug > 1) {\n            console.log('found parent tile z%d-%d-%d', z0, x0, y0);\n            console.time('drilling down');\n        }\n        this.splitTile(parent.source, z0, x0, y0, z, x, y);\n        if (debug > 1) console.timeEnd('drilling down');\n\n        return this.tiles[id] ? transform(this.tiles[id], extent) : null;\n    }\n}\n\nfunction toID(z, x, y) {\n    return (((1 << z) * y + x) * 32) + z;\n}\n\nfunction extend(dest, src) {\n    for (const i in src) dest[i] = src[i];\n    return dest;\n}\n\nexport default function geojsonvt(data, options) {\n    return new GeoJSONVT(data, options);\n}\n", "/**\n * A way to identify a feature, either by string or by number\n */\nexport type GeoJSONFeatureId = number | string;\n\n/**\n * The geojson source diff object\n */\nexport type GeoJSONSourceDiff = {\n    /**\n     * When set to `true` it will remove all features\n     */\n    removeAll?: boolean;\n    /**\n     * An array of features IDs to remove\n     */\n    remove?: Array<GeoJSONFeatureId>;\n    /**\n     * An array of features to add\n     */\n    add?: Array<GeoJSON.Feature>;\n    /**\n     * An array of update objects\n     */\n    update?: Array<GeoJSONFeatureDiff>;\n}\n\n/**\n * A geojson feature diff object\n */\nexport type GeoJSONFeatureDiff = {\n    /**\n     * The feature ID\n     */\n    id: GeoJSONFeatureId;\n    /**\n     * If it's a new geometry, place it here\n     */\n    newGeometry?: GeoJSON.Geometry;\n    /**\n     * Setting to `true` will remove all preperties\n     */\n    removeAllProperties?: boolean;\n    /**\n     * The properties keys to remove\n     */\n    removeProperties?: Array<string>;\n    /**\n     * The properties to add or update along side their values\n     */\n    addOrUpdateProperties?: Array<{key: string; value: any}>;\n}\n\nexport type UpdateableGeoJSON = GeoJSON.Feature | GeoJSON.FeatureCollection | undefined;\n\nfunction getFeatureId(feature: GeoJSON.Feature, promoteId?: string): GeoJSONFeatureId | undefined {\n    return promoteId ? feature.properties[promoteId] : feature.id;\n}\n\nexport function isUpdateableGeoJSON(data: GeoJSON.GeoJSON | undefined, promoteId?: string): data is UpdateableGeoJSON {\n    // null can be updated\n    if (data == null) {\n        return true;\n    }\n\n    // a single feature with an id can be updated, need to explicitly check against null because 0 is a valid feature id that is falsy\n    if (data.type === 'Feature') {\n        return getFeatureId(data, promoteId) != null;\n    }\n\n    // a feature collection can be updated if every feature has an id, and the ids are all unique\n    // this prevents us from silently dropping features if ids get reused\n    if (data.type === 'FeatureCollection') {\n        const seenIds = new Set<GeoJSONFeatureId>();\n        for (const feature of data.features) {\n            const id = getFeatureId(feature, promoteId);\n            if (id == null) {\n                return false;\n            }\n\n            if (seenIds.has(id)) {\n                return false;\n            }\n\n            seenIds.add(id);\n        }\n\n        return true;\n    }\n\n    return false;\n}\n\nexport function toUpdateable(data: UpdateableGeoJSON, promoteId?: string) {\n    const result = new Map<GeoJSONFeatureId, GeoJSON.Feature>();\n    if (data == null) {\n        // empty result\n    } else if (data.type === 'Feature') {\n        result.set(getFeatureId(data, promoteId)!, data);\n    } else {\n        for (const feature of data.features) {\n            result.set(getFeatureId(feature, promoteId)!, feature);\n        }\n    }\n\n    return result;\n}\n\n// mutates updateable\nexport function applySourceDiff(updateable: Map<GeoJSONFeatureId, GeoJSON.Feature>, diff: GeoJSONSourceDiff, promoteId?: string): void {\n    if (diff.removeAll) {\n        updateable.clear();\n    }\n\n    if (diff.remove) {\n        for (const id of diff.remove) {\n            updateable.delete(id);\n        }\n    }\n\n    if (diff.add) {\n        for (const feature of diff.add) {\n            const id = getFeatureId(feature, promoteId);\n\n            if (id != null) {\n                updateable.set(id, feature);\n            }\n        }\n    }\n\n    if (diff.update) {\n        for (const update of diff.update) {\n            let feature = updateable.get(update.id);\n\n            if (feature == null) {\n                continue;\n            }\n\n            // be careful to clone the feature and/or properties objects to avoid mutating our input\n            const cloneFeature = update.newGeometry || update.removeAllProperties;\n            // note: removeAllProperties gives us a new properties object, so we can skip the clone step\n            const cloneProperties = !update.removeAllProperties && (update.removeProperties?.length > 0 || update.addOrUpdateProperties?.length > 0);\n            if (cloneFeature || cloneProperties) {\n                feature = {...feature};\n                updateable.set(update.id, feature);\n                if (cloneProperties) {\n                    feature.properties = {...feature.properties};\n                }\n            }\n\n            if (update.newGeometry) {\n                feature.geometry = update.newGeometry;\n            }\n\n            if (update.removeAllProperties) {\n                feature.properties = {};\n            } else if (update.removeProperties?.length > 0) {\n                for (const prop of update.removeProperties) {\n                    if (Object.prototype.hasOwnProperty.call(feature.properties, prop)) {\n                        delete feature.properties[prop];\n                    }\n                }\n            }\n\n            if (update.addOrUpdateProperties?.length > 0) {\n                for (const {key, value} of update.addOrUpdateProperties) {\n                    feature.properties[key] = value;\n                }\n            }\n        }\n    }\n}\n", "import {getJSON} from '../util/ajax';\nimport {RequestPerformance} from '../util/performance';\nimport rewind from '@mapbox/geojson-rewind';\nimport {GeoJSONWrapper} from './geojson_wrapper';\nimport vtpbf from 'vt-pbf';\nimport Supercluster, {type Options as SuperclusterOptions, type ClusterProperties} from 'supercluster';\nimport geojsonvt, {type Options as GeoJSONVTOptions} from 'geojson-vt';\nimport {VectorTileWorkerSource} from './vector_tile_worker_source';\nimport {createExpression} from '@maplibre/maplibre-gl-style-spec';\nimport {isAbortError} from '../util/abort_error';\n\nimport type {\n    WorkerTileParameters,\n    WorkerTileResult,\n} from '../source/worker_source';\n\nimport type {LoadVectorTileResult} from './vector_tile_worker_source';\nimport type {RequestParameters} from '../util/ajax';\nimport {isUpdateableGeoJSON, type GeoJSONSourceDiff, applySourceDiff, toUpdateable, GeoJSONFeatureId} from './geojson_source_diff';\nimport type {ClusterIDAndSource, GeoJSONWorkerSourceLoadDataResult, RemoveSourceParams} from '../util/actor_messages';\n\n/**\n * The geojson worker options that can be passed to the worker\n */\nexport type GeoJSONWorkerOptions = {\n    source?: string;\n    cluster?: boolean;\n    geojsonVtOptions?: GeoJSONVTOptions;\n    superclusterOptions?: SuperclusterOptions<any, any>;\n    clusterProperties?: ClusterProperties;\n    filter?: Array<unknown>;\n    promoteId?: string;\n    collectResourceTiming?: boolean;\n}\n\n/**\n * Parameters needed to load a geojson to the worker\n */\nexport type LoadGeoJSONParameters = GeoJSONWorkerOptions & {\n    type: 'geojson';\n    request?: RequestParameters;\n    /**\n     * Literal GeoJSON data. Must be provided if `request.url` is not.\n     */\n    data?: string;\n    dataDiff?: GeoJSONSourceDiff;\n};\n\nexport type LoadGeoJSON = (params: LoadGeoJSONParameters, abortController: AbortController) => Promise<GeoJSON.GeoJSON>;\n\ntype GeoJSONIndex = ReturnType<typeof geojsonvt> | Supercluster;\n\n/**\n * The {@link WorkerSource} implementation that supports {@link GeoJSONSource}.\n * This class is designed to be easily reused to support custom source types\n * for data formats that can be parsed/converted into an in-memory GeoJSON\n * representation. To do so, create it with\n * `new GeoJSONWorkerSource(actor, layerIndex, customLoadGeoJSONFunction)`.\n * For a full example, see [mapbox-gl-topojson](https://github.com/developmentseed/mapbox-gl-topojson).\n */\nexport class GeoJSONWorkerSource extends VectorTileWorkerSource {\n    /**\n     * The actual GeoJSON takes some time to load (as there may be a need to parse a diff, or to apply filters, or the\n     * data may even need to be loaded via a URL). This promise resolves with a ready-to-be-consumed GeoJSON which is\n     * ready to be returned by the `getData` method.\n     */\n    _pendingData: Promise<GeoJSON.GeoJSON>;\n    _pendingRequest: AbortController;\n    _geoJSONIndex: GeoJSONIndex;\n    _dataUpdateable = new Map<GeoJSONFeatureId, GeoJSON.Feature>();\n\n    override async loadVectorTile(params: WorkerTileParameters, _abortController: AbortController): Promise<LoadVectorTileResult | null> {\n        const canonical = params.tileID.canonical;\n\n        if (!this._geoJSONIndex) {\n            throw new Error('Unable to parse the data into a cluster or geojson');\n        }\n\n        const geoJSONTile = this._geoJSONIndex.getTile(canonical.z, canonical.x, canonical.y);\n        if (!geoJSONTile) {\n            return null;\n        }\n\n        const geojsonWrapper = new GeoJSONWrapper(geoJSONTile.features);\n        // Encode the geojson-vt tile into binary vector tile form.  This\n        // is a convenience that allows `FeatureIndex` to operate the same way\n        // across `VectorTileSource` and `GeoJSONSource` data.\n        let pbf = vtpbf(geojsonWrapper);\n        if (pbf.byteOffset !== 0 || pbf.byteLength !== pbf.buffer.byteLength) {\n            // Compatibility with node Buffer (https://github.com/mapbox/pbf/issues/35)\n            pbf = new Uint8Array(pbf);\n        }\n\n        return {\n            vectorTile: geojsonWrapper,\n            rawData: pbf.buffer\n        };\n    }\n\n    /**\n     * Fetches (if appropriate), parses, and index geojson data into tiles. This\n     * preparatory method must be called before {@link GeoJSONWorkerSource#loadTile}\n     * can correctly serve up tiles.\n     *\n     * Defers to {@link GeoJSONWorkerSource#loadAndProcessGeoJSON} for the pre-processing.\n     *\n     * When a `loadData` request comes in while a previous one is being processed,\n     * the previous one is aborted.\n     *\n     * @param params - the parameters\n     * @returns a promise that resolves when the data is loaded and parsed into a GeoJSON object\n     */\n    async loadData(params: LoadGeoJSONParameters): Promise<GeoJSONWorkerSourceLoadDataResult> {\n        this._pendingRequest?.abort();\n        const perf = (params && params.request && params.request.collectResourceTiming) ?\n            new RequestPerformance(params.request) : false;\n\n        this._pendingRequest = new AbortController();\n        try {\n            this._pendingData = this.loadAndProcessGeoJSON(params, this._pendingRequest);\n\n            this._geoJSONIndex = params.cluster ?\n                new Supercluster(getSuperclusterOptions(params)).load((await this._pendingData as any).features) :\n                geojsonvt(await this._pendingData, params.geojsonVtOptions);\n\n            this.loaded = {};\n\n            const result = {} as GeoJSONWorkerSourceLoadDataResult;\n            if (perf) {\n                const resourceTimingData = perf.finish();\n                // it's necessary to eval the result of getEntriesByName() here via parse/stringify\n                // late evaluation in the main thread causes TypeError: illegal invocation\n                if (resourceTimingData) {\n                    result.resourceTiming = {};\n                    result.resourceTiming[params.source] = JSON.parse(JSON.stringify(resourceTimingData));\n                }\n            }\n            return result;\n        } catch (err) {\n            delete this._pendingRequest;\n            if (isAbortError(err)) {\n                return {abandoned: true};\n            }\n            throw err;\n        }\n    }\n\n    /**\n     * Allows to get the source's actual GeoJSON.\n     *\n     * @returns a promise which is resolved with the source's actual GeoJSON\n     */\n    async getData(): Promise<GeoJSON.GeoJSON> {\n        return this._pendingData;\n    }\n\n    /**\n    * Implements {@link WorkerSource#reloadTile}.\n    *\n    * If the tile is loaded, uses the implementation in VectorTileWorkerSource.\n    * Otherwise, such as after a setData() call, we load the tile fresh.\n    *\n    * @param params - the parameters\n    * @returns A promise that resolves when the tile is reloaded\n    */\n    reloadTile(params: WorkerTileParameters): Promise<WorkerTileResult> {\n        const loaded = this.loaded,\n            uid = params.uid;\n\n        if (loaded && loaded[uid]) {\n            return super.reloadTile(params);\n        } else {\n            return this.loadTile(params);\n        }\n    }\n\n    /**\n     * Fetch, parse and process GeoJSON according to the given params.\n     *\n     * Defers to {@link GeoJSONWorkerSource#loadGeoJSON} for the fetching and parsing.\n     *\n     * @param params - the parameters\n     * @param abortController - the abort controller that allows aborting this operation\n     * @returns a promise that is resolved with the processes GeoJSON\n     */\n    async loadAndProcessGeoJSON(params: LoadGeoJSONParameters, abortController: AbortController): Promise<GeoJSON.GeoJSON> {\n        let data = await this.loadGeoJSON(params, abortController);\n\n        delete this._pendingRequest;\n        if (typeof data !== 'object') {\n            throw new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`);\n        }\n        rewind(data, true);\n\n        if (params.filter) {\n            const compiled = createExpression(params.filter, {type: 'boolean', 'property-type': 'data-driven', overridable: false, transition: false} as any);\n            if (compiled.result === 'error')\n                throw new Error(compiled.value.map(err => `${err.key}: ${err.message}`).join(', '));\n\n            const features = (data as any).features.filter(feature => compiled.value.evaluate({zoom: 0}, feature));\n            data = {type: 'FeatureCollection', features};\n        }\n\n        return data;\n    }\n\n    /**\n     * Fetch and parse GeoJSON according to the given params.\n     *\n     * GeoJSON is loaded and parsed from `params.url` if it exists, or else\n     * expected as a literal (string or object) `params.data`.\n     *\n     * @param params - the parameters\n     * @param abortController - the abort controller that allows aborting this operation\n     * @returns a promise that resolves when the data is loaded\n     */\n    async loadGeoJSON(params: LoadGeoJSONParameters, abortController: AbortController): Promise<GeoJSON.GeoJSON> {\n        const {promoteId} = params;\n        if (params.request) {\n            const response = await getJSON<GeoJSON.GeoJSON>(params.request, abortController);\n            this._dataUpdateable = isUpdateableGeoJSON(response.data, promoteId) ? toUpdateable(response.data, promoteId) : undefined;\n            return response.data;\n        }\n        if (typeof params.data === 'string') {\n            try {\n                const parsed = JSON.parse(params.data);\n                this._dataUpdateable = isUpdateableGeoJSON(parsed, promoteId) ? toUpdateable(parsed, promoteId) : undefined;\n                return parsed;\n            } catch (e) {\n                throw new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`);\n            }\n        }\n        if (!params.dataDiff) {\n            throw new Error(`Input data given to '${params.source}' is not a valid GeoJSON object.`);\n        }\n        if (!this._dataUpdateable) {\n            throw new Error(`Cannot update existing geojson data in ${params.source}`);\n        }\n        applySourceDiff(this._dataUpdateable, params.dataDiff, promoteId);\n        return {type: 'FeatureCollection', features: Array.from(this._dataUpdateable.values())};\n    }\n\n    async removeSource(_params: RemoveSourceParams): Promise<void> {\n        if (this._pendingRequest) {\n            this._pendingRequest.abort();\n        }\n    }\n\n    getClusterExpansionZoom(params: ClusterIDAndSource): number {\n        return (this._geoJSONIndex as Supercluster).getClusterExpansionZoom(params.clusterId);\n    }\n\n    getClusterChildren(params: ClusterIDAndSource): Array<GeoJSON.Feature> {\n        return (this._geoJSONIndex as Supercluster).getChildren(params.clusterId);\n    }\n\n    getClusterLeaves(params: {\n        clusterId: number;\n        limit: number;\n        offset: number;\n    }): Array<GeoJSON.Feature> {\n        return (this._geoJSONIndex as Supercluster).getLeaves(params.clusterId, params.limit, params.offset);\n    }\n}\n\nfunction getSuperclusterOptions({superclusterOptions, clusterProperties}: LoadGeoJSONParameters) {\n    if (!clusterProperties || !superclusterOptions) return superclusterOptions;\n\n    const mapExpressions = {};\n    const reduceExpressions = {};\n    const globals = {accumulated: null, zoom: 0};\n    const feature = {properties: null};\n    const propertyNames = Object.keys(clusterProperties);\n\n    for (const key of propertyNames) {\n        const [operator, mapExpression] = clusterProperties[key];\n\n        const mapExpressionParsed = createExpression(mapExpression);\n        const reduceExpressionParsed = createExpression(\n            typeof operator === 'string' ? [operator, ['accumulated'], ['get', key]] : operator);\n\n        mapExpressions[key] = mapExpressionParsed.value;\n        reduceExpressions[key] = reduceExpressionParsed.value;\n    }\n\n    superclusterOptions.map = (pointProperties) => {\n        feature.properties = pointProperties;\n        const properties = {};\n        for (const key of propertyNames) {\n            properties[key] = mapExpressions[key].evaluate(globals, feature);\n        }\n        return properties;\n    };\n    superclusterOptions.reduce = (accumulated, clusterProperties) => {\n        feature.properties = clusterProperties;\n        for (const key of propertyNames) {\n            globals.accumulated = accumulated[key];\n            accumulated[key] = reduceExpressions[key].evaluate(globals, feature);\n        }\n    };\n\n    return superclusterOptions;\n}\n", "import {Actor, ActorTarget, IActor} from '../util/actor';\nimport {StyleLayerIndex} from '../style/style_layer_index';\nimport {VectorTileWorkerSource} from './vector_tile_worker_source';\nimport {RasterDEMTileWorkerSource} from './raster_dem_tile_worker_source';\nimport {rtlWorkerPlugin, RTLTextPlugin} from './rtl_text_plugin_worker';\nimport {GeoJSONWorkerSource, LoadGeoJSONParameters} from './geojson_worker_source';\nimport {isWorker} from '../util/util';\nimport {addProtocol, removeProtocol} from './protocol_crud';\nimport {PluginState} from './rtl_text_plugin_status';\nimport type {\n    WorkerSource,\n    WorkerSourceConstructor,\n    WorkerTileParameters,\n    WorkerDEMTileParameters,\n    TileParameters\n} from '../source/worker_source';\n\nimport type {WorkerGlobalScopeInterface} from '../util/web_worker';\nimport type {LayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {\n    MessageType,\n    type ClusterIDAndSource,\n    type GetClusterLeavesParams,\n    type RemoveSourceParams,\n    type UpdateLayersParamaeters\n} from '../util/actor_messages';\n\n/**\n * The Worker class responsible for background thread related execution\n */\nexport default class Worker {\n    self: WorkerGlobalScopeInterface & ActorTarget;\n    actor: Actor;\n    layerIndexes: {[_: string]: StyleLayerIndex};\n    availableImages: {[_: string]: Array<string>};\n    externalWorkerSourceTypes: { [_: string]: WorkerSourceConstructor };\n    /**\n     * This holds a cache for the already created worker source instances.\n     * The cache is build with the following hierarchy:\n     * [mapId][sourceType][sourceName]: worker source instance\n     * sourceType can be 'vector' for example\n     */\n    workerSources: {\n        [_: string]: {\n            [_: string]: {\n                [_: string]: WorkerSource;\n            };\n        };\n    };\n    /**\n     * This holds a cache for the already created DEM worker source instances.\n     * The cache is build with the following hierarchy:\n     * [mapId][sourceType]: DEM worker source instance\n     * sourceType can be 'raster-dem' for example\n     */\n    demWorkerSources: {\n        [_: string]: {\n            [_: string]: RasterDEMTileWorkerSource;\n        };\n    };\n    referrer: string;\n\n    constructor(self: WorkerGlobalScopeInterface & ActorTarget) {\n        this.self = self;\n        this.actor = new Actor(self);\n\n        this.layerIndexes = {};\n        this.availableImages = {};\n\n        this.workerSources = {};\n        this.demWorkerSources = {};\n        this.externalWorkerSourceTypes = {};\n\n        this.self.registerWorkerSource = (name: string, WorkerSource: WorkerSourceConstructor) => {\n            if (this.externalWorkerSourceTypes[name]) {\n                throw new Error(`Worker source with name \"${name}\" already registered.`);\n            }\n            this.externalWorkerSourceTypes[name] = WorkerSource;\n        };\n\n        this.self.addProtocol = addProtocol;\n        this.self.removeProtocol = removeProtocol;\n\n        // This is invoked by the RTL text plugin when the download via the `importScripts` call has finished, and the code has been parsed.\n        this.self.registerRTLTextPlugin = (rtlTextPlugin: RTLTextPlugin) => {\n            if (rtlWorkerPlugin.isParsed()) {\n                throw new Error('RTL text plugin already registered.');\n            }\n            rtlWorkerPlugin.setMethods(rtlTextPlugin);\n        };\n\n        this.actor.registerMessageHandler(MessageType.loadDEMTile, (mapId: string, params: WorkerDEMTileParameters) => {\n            return this._getDEMWorkerSource(mapId, params.source).loadTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeDEMTile, async (mapId: string, params: TileParameters) => {\n            this._getDEMWorkerSource(mapId, params.source).removeTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getClusterExpansionZoom, async (mapId: string, params: ClusterIDAndSource) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getClusterExpansionZoom(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getClusterChildren, async (mapId: string, params: ClusterIDAndSource) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getClusterChildren(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getClusterLeaves, async (mapId: string, params: GetClusterLeavesParams) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getClusterLeaves(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.loadData, (mapId: string, params: LoadGeoJSONParameters) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).loadData(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.getData, (mapId: string, params: LoadGeoJSONParameters) => {\n            return (this._getWorkerSource(mapId, params.type, params.source) as GeoJSONWorkerSource).getData();\n        });\n\n        this.actor.registerMessageHandler(MessageType.loadTile, (mapId: string, params: WorkerTileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).loadTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.reloadTile, (mapId: string, params: WorkerTileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).reloadTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.abortTile, (mapId: string, params: TileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).abortTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeTile, (mapId: string, params: TileParameters) => {\n            return this._getWorkerSource(mapId, params.type, params.source).removeTile(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeSource, async (mapId: string, params: RemoveSourceParams) => {\n            if (!this.workerSources[mapId] ||\n                !this.workerSources[mapId][params.type] ||\n                !this.workerSources[mapId][params.type][params.source]) {\n                return;\n            }\n\n            const worker = this.workerSources[mapId][params.type][params.source];\n            delete this.workerSources[mapId][params.type][params.source];\n\n            if (worker.removeSource !== undefined) {\n                worker.removeSource(params);\n            }\n        });\n\n        this.actor.registerMessageHandler(MessageType.removeMap, async (mapId: string) => {\n            delete this.layerIndexes[mapId];\n            delete this.availableImages[mapId];\n            delete this.workerSources[mapId];\n            delete this.demWorkerSources[mapId];\n        });\n\n        this.actor.registerMessageHandler(MessageType.setReferrer, async (_mapId: string, params: string) => {\n            this.referrer = params;\n        });\n\n        this.actor.registerMessageHandler(MessageType.syncRTLPluginState, (mapId: string, params: PluginState) => {\n            return this._syncRTLPluginState(mapId, params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.importScript, async (_mapId: string, params: string) => {\n            this.self.importScripts(params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.setImages, (mapId: string, params: string[]) => {\n            return this._setImages(mapId, params);\n        });\n\n        this.actor.registerMessageHandler(MessageType.updateLayers, async (mapId: string, params: UpdateLayersParamaeters) => {\n            this._getLayerIndex(mapId).update(params.layers, params.removedIds);\n        });\n\n        this.actor.registerMessageHandler(MessageType.setLayers, async (mapId: string, params: Array<LayerSpecification>) => {\n            this._getLayerIndex(mapId).replace(params);\n        });\n    }\n\n    private async _setImages(mapId: string, images: Array<string>): Promise<void> {\n        this.availableImages[mapId] = images;\n        for (const workerSource in this.workerSources[mapId]) {\n            const ws = this.workerSources[mapId][workerSource];\n            for (const source in ws) {\n                ws[source].availableImages = images;\n            }\n        }\n    }\n\n    private async _syncRTLPluginState(mapId: string, incomingState: PluginState): Promise<PluginState> {\n\n        // Parsed plugin cannot be changed, so just return its current state.\n        if (rtlWorkerPlugin.isParsed()) {\n            return rtlWorkerPlugin.getState();\n        }\n\n        if (incomingState.pluginStatus !== 'loading') {\n            // simply sync and done\n            rtlWorkerPlugin.setState(incomingState);\n            return incomingState;\n        }\n        const urlToLoad = incomingState.pluginURL;\n        this.self.importScripts(urlToLoad);\n        const complete = rtlWorkerPlugin.isParsed();\n        if (complete) {\n            const loadedState: PluginState = {\n                pluginStatus: 'loaded',\n                pluginURL: urlToLoad\n            };\n            rtlWorkerPlugin.setState(loadedState);\n            return loadedState;\n        }\n\n        // error case\n        rtlWorkerPlugin.setState({\n            pluginStatus: 'error',\n            pluginURL: ''\n        });\n        throw new Error(`RTL Text Plugin failed to import scripts from ${urlToLoad}`);\n    }\n\n    private _getAvailableImages(mapId: string) {\n        let availableImages = this.availableImages[mapId];\n\n        if (!availableImages) {\n            availableImages = [];\n        }\n\n        return availableImages;\n    }\n\n    private _getLayerIndex(mapId: string) {\n        let layerIndexes = this.layerIndexes[mapId];\n        if (!layerIndexes) {\n            layerIndexes = this.layerIndexes[mapId] = new StyleLayerIndex();\n        }\n        return layerIndexes;\n    }\n\n    /**\n     * This is basically a lazy initialization of a worker per mapId and sourceType and sourceName\n     * @param mapId - the mapId\n     * @param sourceType - the source type - 'vector' for example\n     * @param sourceName - the source name - 'osm' for example\n     * @returns a new instance or a cached one\n     */\n    private _getWorkerSource(mapId: string, sourceType: string, sourceName: string): WorkerSource {\n        if (!this.workerSources[mapId])\n            this.workerSources[mapId] = {};\n        if (!this.workerSources[mapId][sourceType])\n            this.workerSources[mapId][sourceType] = {};\n\n        if (!this.workerSources[mapId][sourceType][sourceName]) {\n            // use a wrapped actor so that we can attach a target mapId param\n            // to any messages invoked by the WorkerSource, this is very important when there are multiple maps\n            const actor: IActor = {\n                sendAsync: (message, abortController) => {\n                    message.targetMapId = mapId;\n                    return this.actor.sendAsync(message, abortController);\n                }\n            };\n            switch (sourceType) {\n                case 'vector':\n                    this.workerSources[mapId][sourceType][sourceName] = new VectorTileWorkerSource(actor, this._getLayerIndex(mapId), this._getAvailableImages(mapId));\n                    break;\n                case 'geojson':\n                    this.workerSources[mapId][sourceType][sourceName] = new GeoJSONWorkerSource(actor, this._getLayerIndex(mapId), this._getAvailableImages(mapId));\n                    break;\n                default:\n                    this.workerSources[mapId][sourceType][sourceName] = new (this.externalWorkerSourceTypes[sourceType])(actor, this._getLayerIndex(mapId), this._getAvailableImages(mapId));\n                    break;\n            }\n        }\n\n        return this.workerSources[mapId][sourceType][sourceName];\n    }\n\n    /**\n     * This is basically a lazy initialization of a worker per mapId and source\n     * @param mapId - the mapId\n     * @param sourceType - the source type - 'raster-dem' for example\n     * @returns a new instance or a cached one\n     */\n    private _getDEMWorkerSource(mapId: string, sourceType: string) {\n        if (!this.demWorkerSources[mapId])\n            this.demWorkerSources[mapId] = {};\n\n        if (!this.demWorkerSources[mapId][sourceType]) {\n            this.demWorkerSources[mapId][sourceType] = new RasterDEMTileWorkerSource();\n        }\n\n        return this.demWorkerSources[mapId][sourceType];\n    }\n}\n\nif (isWorker(self)) {\n    self.worker = new Worker(self);\n}\n", "import {createAbortError} from './abort_error';\n\nconst now = typeof performance !== 'undefined' && performance && performance.now ?\n    performance.now.bind(performance) :\n    Date.now.bind(Date);\n\nlet linkEl;\n\nlet reducedMotionQuery: MediaQueryList;\n\n/** */\nexport const browser = {\n    /**\n     * Provides a function that outputs milliseconds: either performance.now()\n     * or a fallback to Date.now()\n     */\n    now,\n\n    frameAsync(abortController: AbortController): Promise<number> {\n        return new Promise((resolve, reject) => {\n            const frame = requestAnimationFrame(resolve);\n            abortController.signal.addEventListener('abort', () => {\n                cancelAnimationFrame(frame);\n                reject(createAbortError());\n            });\n        });\n    },\n\n    getImageData(img:  HTMLImageElement | ImageBitmap, padding: number = 0): ImageData {\n        const context = this.getImageCanvasContext(img);\n        return context.getImageData(-padding, -padding, img.width as number + 2 * padding, img.height as number + 2 * padding);\n    },\n\n    getImageCanvasContext(img: HTMLImageElement | ImageBitmap): CanvasRenderingContext2D {\n        const canvas = window.document.createElement('canvas') as HTMLCanvasElement;\n        const context = canvas.getContext('2d', {willReadFrequently: true});\n        if (!context) {\n            throw new Error('failed to create canvas 2d context');\n        }\n        canvas.width = img.width as number;\n        canvas.height = img.height as number;\n        context.drawImage(img, 0, 0, img.width as number, img.height as number);\n        return context;\n    },\n\n    resolveURL(path: string) {\n        if (!linkEl) linkEl = document.createElement('a');\n        linkEl.href = path;\n        return linkEl.href;\n    },\n\n    hardwareConcurrency: typeof navigator !== 'undefined' && navigator.hardwareConcurrency || 4,\n\n    get prefersReducedMotion(): boolean {\n        // In case your test crashes when checking matchMedia, call setMatchMedia from 'src/util/test/util'\n        if (!matchMedia) return false;\n        //Lazily initialize media query\n        if (reducedMotionQuery == null) {\n            reducedMotionQuery = matchMedia('(prefers-reduced-motion: reduce)');\n        }\n        return reducedMotionQuery.matches;\n    },\n};\n", "import Point from '@mapbox/point-geometry';\n\ntype ScaleReturnValue = {\n    x: number;\n    y: number;\n    boundingClientRect: DOMRect;\n};\n\nexport class DOM {\n    private static readonly docStyle = typeof window !== 'undefined' && window.document && window.document.documentElement.style;\n\n    private static userSelect: string;\n\n    private static selectProp = DOM.testProp(['userSelect', 'MozUserSelect', 'WebkitUserSelect', 'msUserSelect']);\n\n    private static transformProp = DOM.testProp(['transform', 'WebkitTransform']);\n\n    private static testProp(props: string[]): string {\n        if (!DOM.docStyle) return props[0];\n        for (let i = 0; i < props.length; i++) {\n            if (props[i] in DOM.docStyle) {\n                return props[i];\n            }\n        }\n        return props[0];\n    }\n\n    public static create<K extends keyof HTMLElementTagNameMap>(tagName: K, className?: string, container?: HTMLElement): HTMLElementTagNameMap[K] {\n        const el = window.document.createElement(tagName);\n        if (className !== undefined) el.className = className;\n        if (container) container.appendChild(el);\n        return el;\n    }\n\n    public static createNS(namespaceURI: string, tagName: string) {\n        const el = window.document.createElementNS(namespaceURI, tagName);\n        return el;\n    }\n\n    public static disableDrag() {\n        if (DOM.docStyle && DOM.selectProp) {\n            DOM.userSelect = DOM.docStyle[DOM.selectProp];\n            DOM.docStyle[DOM.selectProp] = 'none';\n        }\n    }\n\n    public static enableDrag() {\n        if (DOM.docStyle && DOM.selectProp) {\n            DOM.docStyle[DOM.selectProp] = DOM.userSelect;\n        }\n    }\n\n    public static setTransform(el: HTMLElement, value: string) {\n        el.style[DOM.transformProp] = value;\n    }\n\n    public static addEventListener(target: HTMLElement | Window | Document, type: string, callback: EventListenerOrEventListenerObject, options: {\n        passive?: boolean;\n        capture?: boolean;\n    } = {}) {\n        if ('passive' in options) {\n            target.addEventListener(type, callback, options);\n        } else {\n            target.addEventListener(type, callback, options.capture);\n        }\n    }\n\n    public static removeEventListener(target: HTMLElement | Window | Document, type: string, callback: EventListenerOrEventListenerObject, options: {\n        passive?: boolean;\n        capture?: boolean;\n    } = {}) {\n        if ('passive' in options) {\n            target.removeEventListener(type, callback, options);\n        } else {\n            target.removeEventListener(type, callback, options.capture);\n        }\n    }\n\n    // Suppress the next click, but only if it's immediate.\n    private static suppressClickInternal(e) {\n        e.preventDefault();\n        e.stopPropagation();\n        window.removeEventListener('click', DOM.suppressClickInternal, true);\n    }\n\n    public static suppressClick() {\n        window.addEventListener('click', DOM.suppressClickInternal, true);\n        window.setTimeout(() => {\n            window.removeEventListener('click', DOM.suppressClickInternal, true);\n        }, 0);\n    }\n\n    private static getScale(element: HTMLElement): ScaleReturnValue {\n        const rect = element.getBoundingClientRect();\n        return {\n            x: (rect.width / element.offsetWidth) || 1,\n            y: (rect.height / element.offsetHeight) || 1,\n            boundingClientRect: rect,\n        };\n    }\n\n    private static getPoint(el: HTMLElement, scale: ScaleReturnValue, e: MouseEvent | Touch): Point {\n        const rect = scale.boundingClientRect;\n        return new Point(\n            // rect.left/top values are in page scale (like clientX/Y),\n            // whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\n            ((e.clientX - rect.left) / scale.x) - el.clientLeft,\n            ((e.clientY - rect.top) / scale.y) - el.clientTop\n        );\n    }\n\n    public static mousePos(el: HTMLElement, e: MouseEvent | Touch): Point {\n        const scale = DOM.getScale(el);\n        return DOM.getPoint(el, scale, e);\n    }\n\n    public static touchPos(el: HTMLElement, touches: TouchList) {\n        const points: Point[] = [];\n        const scale = DOM.getScale(el);\n        for (let i = 0; i < touches.length; i++) {\n            points.push(DOM.getPoint(el, scale, touches[i]));\n        }\n        return points;\n    }\n\n    public static mouseButton(e: MouseEvent) {\n        return e.button;\n    }\n\n    public static remove(node: HTMLElement) {\n        if (node.parentNode) {\n            node.parentNode.removeChild(node);\n        }\n    }\n}\n", "export const webpSupported = {\n    supported: false,\n    testSupport\n};\n\nlet glForTesting: WebGLRenderingContext|WebGL2RenderingContext;\nlet webpCheckComplete = false;\nlet webpImgTest;\nlet webpImgTestOnloadComplete = false;\n\nif (typeof document !== 'undefined') {\n    webpImgTest = document.createElement('img');\n    webpImgTest.onload = () => {\n        if (glForTesting) testWebpTextureUpload(glForTesting);\n        glForTesting = null;\n        webpImgTestOnloadComplete = true;\n    };\n    webpImgTest.onerror = () => {\n        webpCheckComplete = true;\n        glForTesting = null;\n    };\n    webpImgTest.src = 'data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=';\n}\n\nfunction testSupport(gl: WebGLRenderingContext | WebGL2RenderingContext) {\n    if (webpCheckComplete || !webpImgTest) return;\n\n    // HTMLImageElement.complete is set when an image is done loading it's source\n    // regardless of whether the load was successful or not.\n    // It's possible for an error to set HTMLImageElement.complete to true which would trigger\n    // testWebpTextureUpload and mistakenly set exported.supported to true in browsers which don't support webp\n    // To avoid this, we set a flag in the image's onload handler and only call testWebpTextureUpload\n    // after a successful image load event.\n    if (webpImgTestOnloadComplete) {\n        testWebpTextureUpload(gl);\n    } else {\n        glForTesting = gl;\n\n    }\n}\n\nfunction testWebpTextureUpload(gl: WebGLRenderingContext|WebGL2RenderingContext) {\n    // Edge 18 supports WebP but not uploading a WebP image to a gl texture\n    // Test support for this before allowing WebP images.\n    // https://github.com/mapbox/mapbox-gl-js/issues/7671\n    const texture = gl.createTexture();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n\n    try {\n        gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, webpImgTest);\n\n        // The error does not get triggered in Edge if the context is lost\n        if (gl.isContextLost()) return;\n\n        webpSupported.supported = true;\n    } catch (e) {\n        // Catch \"Unspecified Error.\" in Edge 18.\n    }\n\n    gl.deleteTexture(texture);\n\n    webpCheckComplete = true;\n}\n", "import {RequestParameters, makeRequest, sameOrigin, GetResourceResponse} from './ajax';\nimport {arrayBufferToImageBitmap, arrayBufferToImage, extend, isWorker, isImageBitmap} from './util';\nimport {webpSupported} from './webp_supported';\nimport {config} from './config';\nimport {createAbortError} from './abort_error';\nimport {getProtocol} from '../source/protocol_crud';\n\ntype ImageQueueThrottleControlCallback = () => boolean;\n\nexport type ImageRequestQueueItem  = {\n    requestParameters: RequestParameters;\n    supportImageRefresh: boolean;\n    state: 'queued' | 'running' | 'completed';\n    abortController: AbortController;\n    onError: (error: Error) => void;\n    onSuccess: (response: GetResourceResponse<HTMLImageElement | ImageBitmap | null>) => void;\n}\n\ntype ImageQueueThrottleCallbackDictionary = {\n    [Key: number]: ImageQueueThrottleControlCallback;\n}\n\ntype HTMLImageElementWithPriority = HTMLImageElement &\n{\n    // fetchPriority is experimental property supported on Chromium browsers from Version 102\n    // By default images are downloaded with priority low, whereas fetch request downloads with priority high\n    // https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/fetchPriority\n    fetchPriority?: 'auto' | 'high' | 'low';\n};\n\n/**\n * By default, the image queue is self driven, meaning as soon as one requested item is processed,\n * it will move on to next one as quickly as it can while limiting\n * the number of concurrent requests to MAX_PARALLEL_IMAGE_REQUESTS. The default behavior\n * ensures that static views of the map can be rendered with minimal delay.\n *\n * However, the default behavior can prevent dynamic views of the map from rendering\n * smoothly in that many requests can finish in one render frame, putting too much pressure on GPU.\n *\n * When the view of the map is moving dynamically, smoother frame rates can be achieved\n * by throttling the number of items processed by the queue per frame. This can be\n * accomplished by using {@link addThrottleControl} to allow the caller to\n * use a lambda function to determine when the queue should be throttled (e.g. when isMoving())\n * and manually calling {@link processQueue} in the render loop.\n */\nexport namespace ImageRequest {\n    let imageRequestQueue : ImageRequestQueueItem[];\n    let currentParallelImageRequests:number;\n\n    let throttleControlCallbackHandleCounter: number;\n    let throttleControlCallbacks: ImageQueueThrottleCallbackDictionary;\n\n    /**\n     * Reset the image request queue, removing all pending requests.\n     */\n    export const resetRequestQueue = (): void => {\n        imageRequestQueue = [];\n        currentParallelImageRequests = 0;\n        throttleControlCallbackHandleCounter = 0;\n        throttleControlCallbacks = {};\n    };\n\n    /**\n     * Install a callback to control when image queue throttling is desired.\n     * (e.g. when the map view is moving)\n     * @param callback - The callback function to install\n     * @returns handle that identifies the installed callback.\n     */\n    export const addThrottleControl = (callback: ImageQueueThrottleControlCallback): number => {\n        const handle = throttleControlCallbackHandleCounter++;\n        throttleControlCallbacks[handle] = callback;\n        return handle;\n    };\n\n    /**\n     * Remove a previously installed callback by passing in the handle returned\n     * by {@link addThrottleControl}.\n     * @param callbackHandle - The handle for the callback to remove.\n     */\n    export const removeThrottleControl = (callbackHandle: number): void => {\n        delete throttleControlCallbacks[callbackHandle];\n        // Try updating the queue\n        processQueue();\n    };\n\n    /**\n     * Check to see if any of the installed callbacks are requesting the queue\n     * to be throttled.\n     * @returns `true` if any callback is causing the queue to be throttled.\n     */\n    const isThrottled = (): boolean => {\n        for (const key of Object.keys(throttleControlCallbacks)) {\n            if (throttleControlCallbacks[key]()) {\n                return true;\n            }\n        }\n        return false;\n    };\n\n    /**\n     * Request to load an image.\n     * @param requestParameters - Request parameters.\n     * @param abortController - allows to abort the request.\n     * @param supportImageRefresh - `true`, if the image request need to support refresh based on cache headers.\n     * @returns - A promise resolved when the image is loaded.\n     */\n    export const getImage = (requestParameters: RequestParameters, abortController: AbortController, supportImageRefresh: boolean = true): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>> => {\n        return new Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>>((resolve, reject) => {\n            if (webpSupported.supported) {\n                if (!requestParameters.headers) {\n                    requestParameters.headers = {};\n                }\n                requestParameters.headers.accept = 'image/webp,*/*';\n            }\n            extend(requestParameters, {type: 'image'});\n            const request: ImageRequestQueueItem = {\n                abortController,\n                requestParameters,\n                supportImageRefresh,\n                state: 'queued',\n                onError: (error: Error) => {\n                    reject(error);\n                },\n                onSuccess: (response) => {\n                    resolve(response);\n                }\n            };\n\n            imageRequestQueue.push(request);\n            processQueue();\n        });\n    };\n\n    const arrayBufferToCanvasImageSource = (data: ArrayBuffer): Promise<HTMLImageElement | ImageBitmap | null> => {\n        const imageBitmapSupported = typeof createImageBitmap === 'function';\n        if (imageBitmapSupported) {\n            return arrayBufferToImageBitmap(data);\n        } else {\n            return arrayBufferToImage(data);\n        }\n    };\n\n    const doImageRequest = async (itemInQueue: ImageRequestQueueItem) => {\n        itemInQueue.state = 'running';\n        const {requestParameters, supportImageRefresh, onError, onSuccess, abortController} = itemInQueue;\n        // - If refreshExpiredTiles is false, then we can use HTMLImageElement to download raster images.\n        // - Fetch/XHR (via MakeRequest API) will be used to download images for following scenarios:\n        //      1. Style image sprite will had a issue with HTMLImageElement as described\n        //          here: https://github.com/mapbox/mapbox-gl-js/issues/1470\n        //      2. If refreshExpiredTiles is true (default), then in order to read the image cache header,\n        //          fetch/XHR request will be required\n        // - For any special case handling like use of AddProtocol, worker initiated request or additional headers\n        //      let makeRequest handle it.\n        // - HtmlImageElement request automatically adds accept header for all the browser supported images\n        const canUseHTMLImageElement = supportImageRefresh === false &&\n            !isWorker(self) &&\n            !getProtocol(requestParameters.url) &&\n            (!requestParameters.headers ||\n                Object.keys(requestParameters.headers).reduce((acc, item) => acc && item === 'accept', true));\n\n        currentParallelImageRequests++;\n\n        const getImagePromise = canUseHTMLImageElement ?\n            getImageUsingHtmlImage(requestParameters, abortController) :\n            makeRequest(requestParameters, abortController);\n\n        try {\n            const response = await getImagePromise;\n            delete itemInQueue.abortController;\n            itemInQueue.state = 'completed';\n            if (response.data instanceof HTMLImageElement || isImageBitmap(response.data)) {\n                // User using addProtocol can directly return HTMLImageElement/ImageBitmap type\n                // If HtmlImageElement is used to get image then response type will be HTMLImageElement\n                onSuccess(response as GetResourceResponse<HTMLImageElement | ImageBitmap | null>);\n            } else if (response.data) {\n                const img = await arrayBufferToCanvasImageSource(response.data);\n                onSuccess({data: img, cacheControl: response.cacheControl, expires: response.expires});\n            }\n        } catch (err) {\n            delete itemInQueue.abortController;\n            onError(err);\n        } finally {\n            currentParallelImageRequests--;\n            processQueue();\n        }\n    };\n\n    /**\n     * Process some number of items in the image request queue.\n     */\n    const processQueue = (): void => {\n\n        const maxImageRequests = isThrottled() ?\n            config.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME :\n            config.MAX_PARALLEL_IMAGE_REQUESTS;\n\n        // limit concurrent image loads to help with raster sources performance on big screens\n        for (let numImageRequests = currentParallelImageRequests;\n            numImageRequests < maxImageRequests && imageRequestQueue.length > 0;\n            numImageRequests++) {\n\n            const topItemInQueue: ImageRequestQueueItem = imageRequestQueue.shift();\n            if (topItemInQueue.abortController.signal.aborted) {\n                numImageRequests--;\n                continue;\n            }\n            doImageRequest(topItemInQueue);\n        }\n    };\n\n    const getImageUsingHtmlImage = (requestParameters: RequestParameters, abortController: AbortController): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>>  => {\n        return new Promise<GetResourceResponse<HTMLImageElement | ImageBitmap | null>>((resolve, reject) => {\n\n            const image = new Image() as HTMLImageElementWithPriority;\n            const url = requestParameters.url;\n            const credentials = requestParameters.credentials;\n            if (credentials && credentials === 'include') {\n                image.crossOrigin = 'use-credentials';\n            } else if ((credentials && credentials === 'same-origin') || !sameOrigin(url)) {\n                image.crossOrigin = 'anonymous';\n            }\n\n            abortController.signal.addEventListener('abort', () => {\n                // Set src to '' to actually cancel the request\n                image.src = '';\n                reject(createAbortError());\n            });\n\n            image.fetchPriority = 'high';\n            image.onload = () => {\n                image.onerror = image.onload = null;\n                resolve({data: image});\n            };\n            image.onerror = () => {\n                image.onerror = image.onload = null;\n                if (abortController.signal.aborted) {\n                    return;\n                }\n                reject(new Error('Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.'));\n            };\n            image.src = url;\n        });\n    };\n}\n\nImageRequest.resetRequestQueue();\n", "import type {RequestParameters} from './ajax';\n\n/**\n * A type of MapLibre resource.\n */\nexport const enum ResourceType {\n    Glyphs = 'Glyphs',\n    Image = 'Image',\n    Source = 'Source',\n    SpriteImage = 'SpriteImage',\n    SpriteJSON = 'SpriteJSON',\n    Style = 'Style',\n    Tile = 'Tile',\n    Unknown = 'Unknown',\n}\n\n/**\n * This function is used to tranform a request.\n * It is used just before executing the relevant request.\n */\nexport type RequestTransformFunction = (url: string, resourceType?: ResourceType) => RequestParameters | undefined;\n\nexport class RequestManager {\n    _transformRequestFn: RequestTransformFunction;\n\n    constructor(transformRequestFn?: RequestTransformFunction) {\n        this._transformRequestFn = transformRequestFn;\n    }\n\n    transformRequest(url: string, type: ResourceType) {\n        if (this._transformRequestFn) {\n            return this._transformRequestFn(url, type) || {url};\n        }\n\n        return {url};\n    }\n\n    setTransformRequest(transformRequest: RequestTransformFunction) {\n        this._transformRequestFn = transformRequest;\n    }\n}\n\n", "import * as glMatrix from \"./common.js\";\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(3);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n    out[2] = 0;\n  }\n\n  return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\nexport function fromValues(x, y, z) {\n  var out = new glMatrix.ARRAY_TYPE(3);\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\nexport function set(out, x, y, z) {\n  out[0] = x;\n  out[1] = y;\n  out[2] = z;\n  return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  out[2] = a[2] * b[2];\n  return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  out[2] = a[2] / b[2];\n  return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  out[2] = Math.ceil(a[2]);\n  return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  out[2] = Math.floor(a[2]);\n  return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  out[2] = Math.min(a[2], b[2]);\n  return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  out[2] = Math.max(a[2], b[2]);\n  return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\nexport function round(out, a) {\n  out[0] = Math.round(a[0]);\n  out[1] = Math.round(a[1]);\n  out[2] = Math.round(a[2]);\n  return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0];\n  var y = b[1] - a[1];\n  var z = b[2] - a[2];\n  return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  out[2] = 1.0 / a[2];\n  return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\nexport function normalize(out, a) {\n  var x = a[0];\n  var y = a[1];\n  var z = a[2];\n  var len = x * x + y * y + z * z;\n\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  out[2] = a[2] * len;\n  return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nexport function cross(out, a, b) {\n  var ax = a[0],\n      ay = a[1],\n      az = a[2];\n  var bx = b[0],\n      by = b[1],\n      bz = b[2];\n  out[0] = ay * bz - az * by;\n  out[1] = az * bx - ax * bz;\n  out[2] = ax * by - ay * bx;\n  return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function lerp(out, a, b, t) {\n  var ax = a[0];\n  var ay = a[1];\n  var az = a[2];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  out[2] = az + t * (b[2] - az);\n  return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function hermite(out, a, b, c, d, t) {\n  var factorTimes2 = t * t;\n  var factor1 = factorTimes2 * (2 * t - 3) + 1;\n  var factor2 = factorTimes2 * (t - 2) + t;\n  var factor3 = factorTimes2 * (t - 1);\n  var factor4 = factorTimes2 * (3 - 2 * t);\n  out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n  out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n  out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n  return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nexport function bezier(out, a, b, c, d, t) {\n  var inverseFactor = 1 - t;\n  var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n  var factorTimes2 = t * t;\n  var factor1 = inverseFactorTimesTwo * inverseFactor;\n  var factor2 = 3 * t * inverseFactorTimesTwo;\n  var factor3 = 3 * factorTimes2 * inverseFactor;\n  var factor4 = factorTimes2 * t;\n  out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n  out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n  out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n  return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\nexport function random(out, scale) {\n  scale = scale || 1.0;\n  var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n  var z = glMatrix.RANDOM() * 2.0 - 1.0;\n  var zScale = Math.sqrt(1.0 - z * z) * scale;\n  out[0] = Math.cos(r) * zScale;\n  out[1] = Math.sin(r) * zScale;\n  out[2] = z * scale;\n  return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat4(out, a, m) {\n  var x = a[0],\n      y = a[1],\n      z = a[2];\n  var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n  w = w || 1.0;\n  out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n  out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n  out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n  return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\nexport function transformMat3(out, a, m) {\n  var x = a[0],\n      y = a[1],\n      z = a[2];\n  out[0] = x * m[0] + y * m[3] + z * m[6];\n  out[1] = x * m[1] + y * m[4] + z * m[7];\n  out[2] = x * m[2] + y * m[5] + z * m[8];\n  return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\nexport function transformQuat(out, a, q) {\n  // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n  var qx = q[0],\n      qy = q[1],\n      qz = q[2],\n      qw = q[3];\n  var x = a[0],\n      y = a[1],\n      z = a[2]; // var qvec = [qx, qy, qz];\n  // var uv = vec3.cross([], qvec, a);\n\n  var uvx = qy * z - qz * y,\n      uvy = qz * x - qx * z,\n      uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n  var uuvx = qy * uvz - qz * uvy,\n      uuvy = qz * uvx - qx * uvz,\n      uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n  var w2 = qw * 2;\n  uvx *= w2;\n  uvy *= w2;\n  uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n  uuvx *= 2;\n  uuvy *= 2;\n  uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n  out[0] = x + uvx + uuvx;\n  out[1] = y + uvy + uuvy;\n  out[2] = z + uvz + uuvz;\n  return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateX(out, a, b, rad) {\n  var p = [],\n      r = []; //Translate point to the origin\n\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2]; //perform rotation\n\n  r[0] = p[0];\n  r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n  r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateY(out, a, b, rad) {\n  var p = [],\n      r = []; //Translate point to the origin\n\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2]; //perform rotation\n\n  r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n  r[1] = p[1];\n  r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nexport function rotateZ(out, a, b, rad) {\n  var p = [],\n      r = []; //Translate point to the origin\n\n  p[0] = a[0] - b[0];\n  p[1] = a[1] - b[1];\n  p[2] = a[2] - b[2]; //perform rotation\n\n  r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n  r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n  r[2] = p[2]; //translate to correct position\n\n  out[0] = r[0] + b[0];\n  out[1] = r[1] + b[1];\n  out[2] = r[2] + b[2];\n  return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\nexport function angle(a, b) {\n  var ax = a[0],\n      ay = a[1],\n      az = a[2],\n      bx = b[0],\n      by = b[1],\n      bz = b[2],\n      mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n      mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n      mag = mag1 * mag2,\n      cosine = mag && dot(a, b) / mag;\n  return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  out[2] = 0.0;\n  return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n  return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n\n    if (!stride) {\n      stride = 3;\n    }\n\n    if (!offset) {\n      offset = 0;\n    }\n\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      vec[2] = a[i + 2];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n      a[i + 2] = vec[2];\n    }\n\n    return a;\n  };\n}();", "import * as glMatrix from \"./common.js\";\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(2);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[0] = 0;\n    out[1] = 0;\n  }\n\n  return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\nexport function fromValues(x, y) {\n  var out = new glMatrix.ARRAY_TYPE(2);\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\nexport function set(out, x, y) {\n  out[0] = x;\n  out[1] = y;\n  return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function multiply(out, a, b) {\n  out[0] = a[0] * b[0];\n  out[1] = a[1] * b[1];\n  return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function divide(out, a, b) {\n  out[0] = a[0] / b[0];\n  out[1] = a[1] / b[1];\n  return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\nexport function ceil(out, a) {\n  out[0] = Math.ceil(a[0]);\n  out[1] = Math.ceil(a[1]);\n  return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\nexport function floor(out, a) {\n  out[0] = Math.floor(a[0]);\n  out[1] = Math.floor(a[1]);\n  return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function min(out, a, b) {\n  out[0] = Math.min(a[0], b[0]);\n  out[1] = Math.min(a[1], b[1]);\n  return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nexport function max(out, a, b) {\n  out[0] = Math.max(a[0], b[0]);\n  out[1] = Math.max(a[1], b[1]);\n  return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\nexport function round(out, a) {\n  out[0] = Math.round(a[0]);\n  out[1] = Math.round(a[1]);\n  return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\nexport function scale(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\nexport function scaleAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\nexport function distance(a, b) {\n  var x = b[0] - a[0],\n      y = b[1] - a[1];\n  return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nexport function squaredDistance(a, b) {\n  var x = b[0] - a[0],\n      y = b[1] - a[1];\n  return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nexport function length(a) {\n  var x = a[0],\n      y = a[1];\n  return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nexport function squaredLength(a) {\n  var x = a[0],\n      y = a[1];\n  return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\nexport function negate(out, a) {\n  out[0] = -a[0];\n  out[1] = -a[1];\n  return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\nexport function inverse(out, a) {\n  out[0] = 1.0 / a[0];\n  out[1] = 1.0 / a[1];\n  return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\nexport function normalize(out, a) {\n  var x = a[0],\n      y = a[1];\n  var len = x * x + y * y;\n\n  if (len > 0) {\n    //TODO: evaluate use of glm_invsqrt here?\n    len = 1 / Math.sqrt(len);\n  }\n\n  out[0] = a[0] * len;\n  out[1] = a[1] * len;\n  return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nexport function dot(a, b) {\n  return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\nexport function cross(out, a, b) {\n  var z = a[0] * b[1] - a[1] * b[0];\n  out[0] = out[1] = 0;\n  out[2] = z;\n  return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\nexport function lerp(out, a, b, t) {\n  var ax = a[0],\n      ay = a[1];\n  out[0] = ax + t * (b[0] - ax);\n  out[1] = ay + t * (b[1] - ay);\n  return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\nexport function random(out, scale) {\n  scale = scale || 1.0;\n  var r = glMatrix.RANDOM() * 2.0 * Math.PI;\n  out[0] = Math.cos(r) * scale;\n  out[1] = Math.sin(r) * scale;\n  return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat2(out, a, m) {\n  var x = a[0],\n      y = a[1];\n  out[0] = m[0] * x + m[2] * y;\n  out[1] = m[1] * x + m[3] * y;\n  return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat2d(out, a, m) {\n  var x = a[0],\n      y = a[1];\n  out[0] = m[0] * x + m[2] * y + m[4];\n  out[1] = m[1] * x + m[3] * y + m[5];\n  return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat3(out, a, m) {\n  var x = a[0],\n      y = a[1];\n  out[0] = m[0] * x + m[3] * y + m[6];\n  out[1] = m[1] * x + m[4] * y + m[7];\n  return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\nexport function transformMat4(out, a, m) {\n  var x = a[0];\n  var y = a[1];\n  out[0] = m[0] * x + m[4] * y + m[12];\n  out[1] = m[1] * x + m[5] * y + m[13];\n  return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\nexport function rotate(out, a, b, rad) {\n  //Translate point to the origin\n  var p0 = a[0] - b[0],\n      p1 = a[1] - b[1],\n      sinC = Math.sin(rad),\n      cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n  out[0] = p0 * cosC - p1 * sinC + b[0];\n  out[1] = p0 * sinC + p1 * cosC + b[1];\n  return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\nexport function angle(a, b) {\n  var x1 = a[0],\n      y1 = a[1],\n      x2 = b[0],\n      y2 = b[1],\n      // mag is the product of the magnitudes of a and b\n  mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n      // mag &&.. short circuits if mag == 0\n  cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n  return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\nexport function zero(out) {\n  out[0] = 0.0;\n  out[1] = 0.0;\n  return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nexport function str(a) {\n  return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1];\n  var b0 = b[0],\n      b1 = b[1];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\nexport var len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nexport var sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nexport var div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nexport var dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nexport var sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nexport var sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nexport var forEach = function () {\n  var vec = create();\n  return function (a, stride, offset, count, fn, arg) {\n    var i, l;\n\n    if (!stride) {\n      stride = 2;\n    }\n\n    if (!offset) {\n      offset = 0;\n    }\n\n    if (count) {\n      l = Math.min(count * stride + offset, a.length);\n    } else {\n      l = a.length;\n    }\n\n    for (i = offset; i < l; i += stride) {\n      vec[0] = a[i];\n      vec[1] = a[i + 1];\n      fn(vec, vec, arg);\n      a[i] = vec[0];\n      a[i + 1] = vec[1];\n    }\n\n    return a;\n  };\n}();", "import type {SpriteSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * Takes a SpriteSpecification value and returns it in its array form. If `undefined` is passed as an input value, an\n * empty array is returned.\n * duplicated entries with identical id/url will be removed in returned array\n * @param sprite - optional sprite to coerce\n * @returns an empty array in case `undefined` is passed; id-url pairs otherwise\n */\nexport function coerceSpriteToArray(sprite?: SpriteSpecification): {id: string; url: string}[] {\n    const resultArray: {id: string; url: string}[]  = [];\n\n    if (typeof sprite === 'string') {\n        resultArray.push({id: 'default', url: sprite});\n    } else if (sprite && sprite.length > 0) {\n        const dedupArray: string[] = [];\n        for (const {id, url} of sprite) {\n            const key = `${id}${url}`;\n            if (dedupArray.indexOf(key) === -1) {\n                dedupArray.push(key);\n                resultArray.push({id, url});\n            }\n        }\n    }\n\n    return resultArray;\n\n}\n", "import {GetResourceResponse, getJSON} from '../util/ajax';\nimport {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\n\nimport {browser} from '../util/browser';\nimport {coerceSpriteToArray} from '../util/style';\n\nimport type {SpriteSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {SpriteJSON, StyleImage} from './style_image';\nimport type {RequestManager} from '../util/request_manager';\n\nexport type LoadSpriteResult = {\n    [spriteName: string]: {\n        [id: string]: StyleImage;\n    };\n}\n\nexport function normalizeSpriteURL(url: string, format: string, extension: string): string {\n    const split = url.split('?');\n    split[0] += `${format}${extension}`;\n    return split.join('?');\n}\n\nexport async function loadSprite(\n    originalSprite: SpriteSpecification,\n    requestManager: RequestManager,\n    pixelRatio: number,\n    abortController: AbortController,\n): Promise<LoadSpriteResult> {\n    const spriteArray = coerceSpriteToArray(originalSprite);\n    const format = pixelRatio > 1 ? '@2x' : '';\n\n    const jsonsMap: {[id: string]: Promise<GetResourceResponse<SpriteJSON>>} = {};\n    const imagesMap: {[id: string]: Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>>} = {};\n\n    for (const {id, url} of spriteArray) {\n        const jsonRequestParameters = requestManager.transformRequest(normalizeSpriteURL(url, format, '.json'), ResourceType.SpriteJSON);\n        jsonsMap[id] = getJSON<SpriteJSON>(jsonRequestParameters, abortController);\n\n        const imageRequestParameters = requestManager.transformRequest(normalizeSpriteURL(url, format, '.png'), ResourceType.SpriteImage);\n        imagesMap[id] = ImageRequest.getImage(imageRequestParameters, abortController);\n    }\n\n    await Promise.all([...Object.values(jsonsMap), ...Object.values(imagesMap)]);\n    return doOnceCompleted(jsonsMap, imagesMap);\n}\n\n/**\n * @param jsonsMap - JSON data map\n * @param imagesMap - image data map\n */\nasync function doOnceCompleted(\n    jsonsMap:{[id: string]: Promise<GetResourceResponse<SpriteJSON>>},\n    imagesMap:{[id: string]: Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>>}): Promise<LoadSpriteResult> {\n\n    const result = {} as {[spriteName: string]: {[id: string]: StyleImage}};\n    for (const spriteName in jsonsMap) {\n        result[spriteName] = {};\n\n        const context = browser.getImageCanvasContext((await imagesMap[spriteName]).data);\n        const json = (await jsonsMap[spriteName]).data;\n\n        for (const id in json) {\n            const {width, height, x, y, sdf, pixelRatio, stretchX, stretchY, content, textFitWidth, textFitHeight} = json[id];\n            const spriteData = {width, height, x, y, context};\n            result[spriteName][id] = {data: null, pixelRatio, sdf, stretchX, stretchY, content, textFitWidth, textFitHeight, spriteData};\n        }\n    }\n\n    return result;\n}\n", "import type {Context} from '../gl/context';\nimport type {RGBAImage, AlphaImage} from '../util/image';\nimport {isImageBitmap} from '../util/util';\n\nexport type TextureFormat = WebGLRenderingContextBase['RGBA'] | WebGLRenderingContextBase['ALPHA'];\nexport type TextureFilter = WebGLRenderingContextBase['LINEAR'] | WebGLRenderingContextBase['LINEAR_MIPMAP_NEAREST'] | WebGLRenderingContextBase['NEAREST'];\nexport type TextureWrap = WebGLRenderingContextBase['REPEAT'] | WebGLRenderingContextBase['CLAMP_TO_EDGE'] | WebGLRenderingContextBase['MIRRORED_REPEAT'];\n\ntype EmptyImage = {\n    width: number;\n    height: number;\n    data: null;\n};\n\ntype DataTextureImage = RGBAImage | AlphaImage | EmptyImage;\nexport type TextureImage = TexImageSource | DataTextureImage;\n\n/**\n * @internal\n * A `Texture` GL related object\n */\nexport class Texture {\n    context: Context;\n    size: [number, number];\n    texture: WebGLTexture;\n    format: TextureFormat;\n    filter: TextureFilter;\n    wrap: TextureWrap;\n    useMipmap: boolean;\n\n    constructor(context: Context, image: TextureImage, format: TextureFormat, options?: {\n        premultiply?: boolean;\n        useMipmap?: boolean;\n    } | null) {\n        this.context = context;\n        this.format = format;\n        this.texture = context.gl.createTexture();\n        this.update(image, options);\n    }\n\n    update(image: TextureImage, options?: {\n        premultiply?: boolean;\n        useMipmap?: boolean;\n    } | null, position?: {\n        x: number;\n        y: number;\n    }) {\n        const {width, height} = image as {width: number; height: number};\n        const resize = (!this.size || this.size[0] !== width || this.size[1] !== height) && !position;\n        const {context} = this;\n        const {gl} = context;\n\n        this.useMipmap = Boolean(options && options.useMipmap);\n        gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n        context.pixelStoreUnpackFlipY.set(false);\n        context.pixelStoreUnpack.set(1);\n        context.pixelStoreUnpackPremultiplyAlpha.set(this.format === gl.RGBA && (!options || options.premultiply !== false));\n\n        if (resize) {\n            this.size = [width, height];\n\n            if (image instanceof HTMLImageElement || image instanceof HTMLCanvasElement || image instanceof HTMLVideoElement || image instanceof ImageData || isImageBitmap(image)) {\n                gl.texImage2D(gl.TEXTURE_2D, 0, this.format, this.format, gl.UNSIGNED_BYTE, image);\n            } else {\n                gl.texImage2D(gl.TEXTURE_2D, 0, this.format, width, height, 0, this.format, gl.UNSIGNED_BYTE, (image as DataTextureImage).data);\n            }\n\n        } else {\n            const {x, y} = position || {x: 0, y: 0};\n            if (image instanceof HTMLImageElement || image instanceof HTMLCanvasElement || image instanceof HTMLVideoElement || image instanceof ImageData || isImageBitmap(image)) {\n                gl.texSubImage2D(gl.TEXTURE_2D, 0, x, y, gl.RGBA, gl.UNSIGNED_BYTE, image);\n            } else {\n                gl.texSubImage2D(gl.TEXTURE_2D, 0, x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, (image as DataTextureImage).data);\n            }\n        }\n\n        if (this.useMipmap && this.isSizePowerOfTwo()) {\n            gl.generateMipmap(gl.TEXTURE_2D);\n        }\n    }\n\n    bind(filter: TextureFilter, wrap: TextureWrap, minFilter?: TextureFilter | null) {\n        const {context} = this;\n        const {gl} = context;\n        gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n        if (minFilter === gl.LINEAR_MIPMAP_NEAREST && !this.isSizePowerOfTwo()) {\n            minFilter = gl.LINEAR;\n        }\n\n        if (filter !== this.filter) {\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, minFilter || filter);\n            this.filter = filter;\n        }\n\n        if (wrap !== this.wrap) {\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, wrap);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, wrap);\n            this.wrap = wrap;\n        }\n    }\n\n    isSizePowerOfTwo() {\n        return this.size[0] === this.size[1] && (Math.log(this.size[0]) / Math.LN2) % 1 === 0;\n    }\n\n    destroy() {\n        const {gl} = this.context;\n        gl.deleteTexture(this.texture);\n        this.texture = null;\n    }\n}\n", "import {RGBAImage} from '../util/image';\n\nimport type {Map} from '../ui/map';\n\nexport type SpriteJSON = {[id: string]: StyleImageMetadata & {\n    width: number;\n    height: number;\n    x: number;\n    y: number;\n};}\n\n/**\n * The sprite data\n */\nexport type SpriteOnDemandStyleImage = {\n    width: number;\n    height: number;\n    x: number;\n    y: number;\n    context: CanvasRenderingContext2D;\n};\n\n/**\n * The style's image metadata\n */\nexport type StyleImageData = {\n    data: RGBAImage;\n    version?: number;\n    hasRenderCallback?: boolean;\n    userImage?: StyleImageInterface;\n    spriteData?: SpriteOnDemandStyleImage;\n};\n\n/**\n * Enumeration of possible values for StyleImageMetadata.textFitWidth and textFitHeight.\n */\nexport const enum TextFit {\n    /**\n     * The image will be resized on the specified axis to tightly fit the content rectangle to target text.\n     * This is the same as not being defined.\n     */\n    stretchOrShrink = 'stretchOrShrink',\n    /**\n     * The image will be resized on the specified axis to fit the content rectangle to the target text, but will not\n     * fall below the aspect ratio of the original content rectangle if the other axis is set to proportional.\n     */\n    stretchOnly = 'stretchOnly',\n    /**\n     * The image will be resized on the specified axis to fit the content rectangle to the target text and\n     * will resize the other axis to maintain the aspect ratio of the content rectangle.\n     */\n    proportional = 'proportional'\n}\n\n/**\n * The style's image metadata\n */\nexport type StyleImageMetadata = {\n    /**\n     * The ratio of pixels in the image to physical pixels on the screen\n     */\n    pixelRatio: number;\n    /**\n     * Whether the image should be interpreted as an SDF image\n     */\n    sdf: boolean;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched horizontally.\n     */\n    stretchX?: Array<[number, number]>;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched vertically.\n     */\n    stretchY?: Array<[number, number]>;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines the part of the image that can be covered by the content in `text-field`.\n     */\n    content?: [number, number, number, number];\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines constraints on the horizontal scaling of the image.\n     */\n    textFitWidth?: TextFit;\n    /**\n     * If `icon-text-fit` is used in a layer with this image, this option defines constraints on the vertical scaling of the image.\n     */\n    textFitHeight?: TextFit;\n};\n\n/**\n * the style's image, including data and metedata\n */\nexport type StyleImage = StyleImageData & StyleImageMetadata;\n\n/**\n * Interface for dynamically generated style images. This is a specification for\n * implementers to model: it is not an exported method or class.\n *\n * Images implementing this interface can be redrawn for every frame. They can be used to animate\n * icons and patterns or make them respond to user input. Style images can implement a\n * {@link StyleImageInterface#render} method. The method is called every frame and\n * can be used to update the image.\n *\n * @see [Add an animated icon to the map.](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-animated/)\n *\n * @example\n * ```ts\n * let flashingSquare = {\n *     width: 64,\n *     height: 64,\n *     data: new Uint8Array(64 * 64 * 4),\n *\n *     onAdd: function(map) {\n *         this.map = map;\n *     },\n *\n *     render: function() {\n *         // keep repainting while the icon is on the map\n *         this.map.triggerRepaint();\n *\n *         // alternate between black and white based on the time\n *         let value = Math.round(Date.now() / 1000) % 2 === 0  ? 255 : 0;\n *\n *         // check if image needs to be changed\n *         if (value !== this.previousValue) {\n *             this.previousValue = value;\n *\n *             let bytesPerPixel = 4;\n *             for (let x = 0; x < this.width; x++) {\n *                 for (let y = 0; y < this.height; y++) {\n *                     let offset = (y * this.width + x) * bytesPerPixel;\n *                     this.data[offset + 0] = value;\n *                     this.data[offset + 1] = value;\n *                     this.data[offset + 2] = value;\n *                     this.data[offset + 3] = 255;\n *                 }\n *             }\n *\n *             // return true to indicate that the image changed\n *             return true;\n *         }\n *     }\n *  }\n *\n *  map.addImage('flashing_square', flashingSquare);\n * ```\n */\n\nexport interface StyleImageInterface {\n    width: number;\n    height: number;\n    data: Uint8Array | Uint8ClampedArray;\n    /**\n     * This method is called once before every frame where the icon will be used.\n     * The method can optionally update the image's `data` member with a new image.\n     *\n     * If the method updates the image it must return `true` to commit the change.\n     * If the method returns `false` or nothing the image is assumed to not have changed.\n     *\n     * If updates are infrequent it maybe easier to use {@link Map#updateImage} to update\n     * the image instead of implementing this method.\n     *\n     * @returns `true` if this method updated the image. `false` if the image was not changed.\n     */\n    render?: () => boolean;\n    /**\n     * Optional method called when the layer has been added to the Map with {@link Map#addImage}.\n     *\n     * @param map - The Map this custom layer was just added to.\n     */\n    onAdd?: (map: Map, id: string) => void;\n    /**\n     * Optional method called when the icon is removed from the map with {@link Map#removeImage}.\n     * This gives the image a chance to clean up resources and event listeners.\n     */\n    onRemove?: () => void;\n}\n\nexport function renderStyleImage(image: StyleImage) {\n    const {userImage} = image;\n    if (userImage && userImage.render) {\n        const updated = userImage.render();\n        if (updated) {\n            image.data.replace(new Uint8Array(userImage.data.buffer));\n            return true;\n        }\n    }\n    return false;\n}\n", "/* eslint-disable key-spacing */\nimport potpack from 'potpack';\n\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {RGBAImage} from '../util/image';\nimport {ImagePosition} from './image_atlas';\nimport {Texture} from './texture';\nimport {renderStyleImage} from '../style/style_image';\nimport {warnOnce} from '../util/util';\n\nimport type {StyleImage} from '../style/style_image';\nimport type {Context} from '../gl/context';\nimport type {PotpackBox} from 'potpack';\nimport type {GetImagesResponse} from '../util/actor_messages';\n\ntype Pattern = {\n    bin: PotpackBox;\n    position: ImagePosition;\n};\n\n/**\n * When copied into the atlas texture, image data is padded by one pixel on each side. Icon\n * images are padded with fully transparent pixels, while pattern images are padded with a\n * copy of the image data wrapped from the opposite side. In both cases, this ensures the\n * correct behavior of GL_LINEAR texture sampling mode.\n */\nconst padding = 1;\n\n/**\n * ImageManager does three things:\n *\n * 1. Tracks requests for icon images from tile workers and sends responses when the requests are fulfilled.\n * 2. Builds a texture atlas for pattern images.\n * 3. Rerenders renderable images once per frame\n *\n * These are disparate responsibilities and should eventually be handled by different classes. When we implement\n * data-driven support for `*-pattern`, we'll likely use per-bucket pattern atlases, and that would be a good time\n * to refactor this.\n*/\nexport class ImageManager extends Evented {\n    images: {[_: string]: StyleImage};\n    updatedImages: {[_: string]: boolean};\n    callbackDispatchedThisFrame: {[_: string]: boolean};\n    loaded: boolean;\n    /**\n     * This is used to track requests for images that are not yet available. When the image is loaded,\n     * the requestors will be notified.\n     */\n    requestors: Array<{\n        ids: Array<string>;\n        promiseResolve: (value: GetImagesResponse) => void;\n    }>;\n\n    patterns: {[_: string]: Pattern};\n    atlasImage: RGBAImage;\n    atlasTexture: Texture;\n    dirty: boolean;\n\n    constructor() {\n        super();\n        this.images = {};\n        this.updatedImages = {};\n        this.callbackDispatchedThisFrame = {};\n        this.loaded = false;\n        this.requestors = [];\n\n        this.patterns = {};\n        this.atlasImage = new RGBAImage({width: 1, height: 1});\n        this.dirty = true;\n    }\n\n    isLoaded() {\n        return this.loaded;\n    }\n\n    setLoaded(loaded: boolean) {\n        if (this.loaded === loaded) {\n            return;\n        }\n\n        this.loaded = loaded;\n\n        if (loaded) {\n            for (const {ids, promiseResolve} of this.requestors) {\n                promiseResolve(this._getImagesForIds(ids));\n            }\n            this.requestors = [];\n        }\n    }\n\n    getImage(id: string): StyleImage {\n        const image = this.images[id];\n\n        // Extract sprite image data on demand\n        if (image && !image.data && image.spriteData) {\n            const spriteData = image.spriteData;\n            image.data = new RGBAImage({\n                width: spriteData.width,\n                height: spriteData.height\n            }, spriteData.context.getImageData(\n                spriteData.x,\n                spriteData.y,\n                spriteData.width,\n                spriteData.height).data);\n            image.spriteData = null;\n        }\n\n        return image;\n    }\n\n    addImage(id: string, image: StyleImage) {\n        if (this.images[id]) throw new Error(`Image id ${id} already exist, use updateImage instead`);\n        if (this._validate(id, image)) {\n            this.images[id] = image;\n        }\n    }\n\n    _validate(id: string, image: StyleImage) {\n        let valid = true;\n        const data = image.data || image.spriteData;\n        if (!this._validateStretch(image.stretchX, data && data.width)) {\n            this.fire(new ErrorEvent(new Error(`Image \"${id}\" has invalid \"stretchX\" value`)));\n            valid = false;\n        }\n        if (!this._validateStretch(image.stretchY, data && data.height)) {\n            this.fire(new ErrorEvent(new Error(`Image \"${id}\" has invalid \"stretchY\" value`)));\n            valid = false;\n        }\n        if (!this._validateContent(image.content, image)) {\n            this.fire(new ErrorEvent(new Error(`Image \"${id}\" has invalid \"content\" value`)));\n            valid = false;\n        }\n        return valid;\n    }\n\n    _validateStretch(stretch: Array<[number, number]>, size: number) {\n        if (!stretch) return true;\n        let last = 0;\n        for (const part of stretch) {\n            if (part[0] < last || part[1] < part[0] || size < part[1]) return false;\n            last = part[1];\n        }\n        return true;\n    }\n\n    _validateContent(content: [number, number, number, number], image: StyleImage) {\n        if (!content) return true;\n        if (content.length !== 4) return false;\n        const spriteData = image.spriteData;\n        const width = (spriteData && spriteData.width) || image.data.width;\n        const height = (spriteData && spriteData.height) || image.data.height;\n        if (content[0] < 0 || width < content[0]) return false;\n        if (content[1] < 0 || height < content[1]) return false;\n        if (content[2] < 0 || width < content[2]) return false;\n        if (content[3] < 0 || height < content[3]) return false;\n        if (content[2] < content[0]) return false;\n        if (content[3] < content[1]) return false;\n        return true;\n    }\n\n    updateImage(id: string, image: StyleImage, validate = true) {\n        const oldImage = this.getImage(id);\n        if (validate && (oldImage.data.width !== image.data.width || oldImage.data.height !== image.data.height)) {\n            throw new Error(`size mismatch between old image (${oldImage.data.width}x${oldImage.data.height}) and new image (${image.data.width}x${image.data.height}).`);\n        }\n        image.version = oldImage.version + 1;\n        this.images[id] = image;\n        this.updatedImages[id] = true;\n    }\n\n    removeImage(id: string) {\n        const image = this.images[id];\n        delete this.images[id];\n        delete this.patterns[id];\n\n        if (image.userImage && image.userImage.onRemove) {\n            image.userImage.onRemove();\n        }\n    }\n\n    listImages(): Array<string> {\n        return Object.keys(this.images);\n    }\n\n    getImages(ids: Array<string>): Promise<GetImagesResponse> {\n        return new Promise<GetImagesResponse>((resolve, _reject) => {\n            // If the sprite has been loaded, or if all the icon dependencies are already present\n            // (i.e. if they've been added via runtime styling), then notify the requestor immediately.\n            // Otherwise, delay notification until the sprite is loaded. At that point, if any of the\n            // dependencies are still unavailable, we'll just assume they are permanently missing.\n            let hasAllDependencies = true;\n            if (!this.isLoaded()) {\n                for (const id of ids) {\n                    if (!this.images[id]) {\n                        hasAllDependencies = false;\n                    }\n                }\n            }\n            if (this.isLoaded() || hasAllDependencies) {\n                resolve(this._getImagesForIds(ids));\n            } else {\n                this.requestors.push({ids, promiseResolve: resolve});\n            }\n        });\n    }\n\n    _getImagesForIds(ids: Array<string>): GetImagesResponse {\n        const response: GetImagesResponse = {};\n\n        for (const id of ids) {\n            let image = this.getImage(id);\n\n            if (!image) {\n                this.fire(new Event('styleimagemissing', {id}));\n                //Try to acquire image again in case styleimagemissing has populated it\n                image = this.getImage(id);\n            }\n\n            if (image) {\n                // Clone the image so that our own copy of its ArrayBuffer doesn't get transferred.\n                response[id] = {\n                    data: image.data.clone(),\n                    pixelRatio: image.pixelRatio,\n                    sdf: image.sdf,\n                    version: image.version,\n                    stretchX: image.stretchX,\n                    stretchY: image.stretchY,\n                    content: image.content,\n                    textFitWidth: image.textFitWidth,\n                    textFitHeight: image.textFitHeight,\n                    hasRenderCallback: Boolean(image.userImage && image.userImage.render)\n                };\n            } else {\n                warnOnce(`Image \"${id}\" could not be loaded. Please make sure you have added the image with map.addImage() or a \"sprite\" property in your style. You can provide missing images by listening for the \"styleimagemissing\" map event.`);\n            }\n        }\n        return response;\n    }\n\n    // Pattern stuff\n\n    getPixelSize() {\n        const {width, height} = this.atlasImage;\n        return {width, height};\n    }\n\n    getPattern(id: string): ImagePosition {\n        const pattern = this.patterns[id];\n\n        const image = this.getImage(id);\n        if (!image) {\n            return null;\n        }\n\n        if (pattern && pattern.position.version === image.version) {\n            return pattern.position;\n        }\n\n        if (!pattern) {\n            const w = image.data.width + padding * 2;\n            const h = image.data.height + padding * 2;\n            const bin = {w, h, x: 0, y: 0};\n            const position = new ImagePosition(bin, image);\n            this.patterns[id] = {bin, position};\n        } else {\n            pattern.position.version = image.version;\n        }\n\n        this._updatePatternAtlas();\n\n        return this.patterns[id].position;\n    }\n\n    bind(context: Context) {\n        const gl = context.gl;\n        if (!this.atlasTexture) {\n            this.atlasTexture = new Texture(context, this.atlasImage, gl.RGBA);\n        } else if (this.dirty) {\n            this.atlasTexture.update(this.atlasImage);\n            this.dirty = false;\n        }\n\n        this.atlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n    }\n\n    _updatePatternAtlas() {\n        const bins = [];\n        for (const id in this.patterns) {\n            bins.push(this.patterns[id].bin);\n        }\n\n        const {w, h} = potpack(bins);\n\n        const dst = this.atlasImage;\n        dst.resize({width: w || 1, height: h || 1});\n\n        for (const id in this.patterns) {\n            const {bin} = this.patterns[id];\n            const x = bin.x + padding;\n            const y = bin.y + padding;\n            const src = this.getImage(id).data;\n            const w = src.width;\n            const h = src.height;\n\n            RGBAImage.copy(src, dst, {x: 0, y: 0}, {x, y}, {width: w, height: h});\n\n            // Add 1 pixel wrapped padding on each side of the image.\n            RGBAImage.copy(src, dst, {x: 0, y: h - 1}, {x, y: y - 1}, {width: w, height: 1}); // T\n            RGBAImage.copy(src, dst, {x: 0, y:     0}, {x, y: y + h}, {width: w, height: 1}); // B\n            RGBAImage.copy(src, dst, {x: w - 1, y: 0}, {x: x - 1, y}, {width: 1, height: h}); // L\n            RGBAImage.copy(src, dst, {x: 0,     y: 0}, {x: x + w, y}, {width: 1, height: h}); // R\n        }\n\n        this.dirty = true;\n    }\n\n    beginFrame() {\n        this.callbackDispatchedThisFrame = {};\n    }\n\n    dispatchRenderCallbacks(ids: Array<string>) {\n        for (const id of ids) {\n\n            // the callback for the image was already dispatched for a different frame\n            if (this.callbackDispatchedThisFrame[id]) continue;\n            this.callbackDispatchedThisFrame[id] = true;\n\n            const image = this.getImage(id);\n            if (!image) warnOnce(`Image with ID: \"${id}\" was not found`);\n\n            const updated = renderStyleImage(image);\n            if (updated) {\n                this.updateImage(id, image);\n            }\n        }\n    }\n}\n", "const INF = 1e20;\n\nexport default class TinySDF {\n    constructor({\n        fontSize = 24,\n        buffer = 3,\n        radius = 8,\n        cutoff = 0.25,\n        fontFamily = 'sans-serif',\n        fontWeight = 'normal',\n        fontStyle = 'normal'\n    } = {}) {\n        this.buffer = buffer;\n        this.cutoff = cutoff;\n        this.radius = radius;\n\n        // make the canvas size big enough to both have the specified buffer around the glyph\n        // for \"halo\", and account for some glyphs possibly being larger than their font size\n        const size = this.size = fontSize + buffer * 4;\n\n        const canvas = this._createCanvas(size);\n        const ctx = this.ctx = canvas.getContext('2d', {willReadFrequently: true});\n        ctx.font = `${fontStyle} ${fontWeight} ${fontSize}px ${fontFamily}`;\n\n        ctx.textBaseline = 'alphabetic';\n        ctx.textAlign = 'left'; // Necessary so that RTL text doesn't have different alignment\n        ctx.fillStyle = 'black';\n\n        // temporary arrays for the distance transform\n        this.gridOuter = new Float64Array(size * size);\n        this.gridInner = new Float64Array(size * size);\n        this.f = new Float64Array(size);\n        this.z = new Float64Array(size + 1);\n        this.v = new Uint16Array(size);\n    }\n\n    _createCanvas(size) {\n        const canvas = document.createElement('canvas');\n        canvas.width = canvas.height = size;\n        return canvas;\n    }\n\n    draw(char) {\n        const {\n            width: glyphAdvance,\n            actualBoundingBoxAscent,\n            actualBoundingBoxDescent,\n            actualBoundingBoxLeft,\n            actualBoundingBoxRight\n        } = this.ctx.measureText(char);\n\n        // The integer/pixel part of the top alignment is encoded in metrics.glyphTop\n        // The remainder is implicitly encoded in the rasterization\n        const glyphTop = Math.ceil(actualBoundingBoxAscent);\n        const glyphLeft = 0;\n\n        // If the glyph overflows the canvas size, it will be clipped at the bottom/right\n        const glyphWidth = Math.max(0, Math.min(this.size - this.buffer, Math.ceil(actualBoundingBoxRight - actualBoundingBoxLeft)));\n        const glyphHeight = Math.min(this.size - this.buffer, glyphTop + Math.ceil(actualBoundingBoxDescent));\n\n        const width = glyphWidth + 2 * this.buffer;\n        const height = glyphHeight + 2 * this.buffer;\n\n        const len = Math.max(width * height, 0);\n        const data = new Uint8ClampedArray(len);\n        const glyph = {data, width, height, glyphWidth, glyphHeight, glyphTop, glyphLeft, glyphAdvance};\n        if (glyphWidth === 0 || glyphHeight === 0) return glyph;\n\n        const {ctx, buffer, gridInner, gridOuter} = this;\n        ctx.clearRect(buffer, buffer, glyphWidth, glyphHeight);\n        ctx.fillText(char, buffer, buffer + glyphTop);\n        const imgData = ctx.getImageData(buffer, buffer, glyphWidth, glyphHeight);\n\n        // Initialize grids outside the glyph range to alpha 0\n        gridOuter.fill(INF, 0, len);\n        gridInner.fill(0, 0, len);\n\n        for (let y = 0; y < glyphHeight; y++) {\n            for (let x = 0; x < glyphWidth; x++) {\n                const a = imgData.data[4 * (y * glyphWidth + x) + 3] / 255; // alpha value\n                if (a === 0) continue; // empty pixels\n\n                const j = (y + buffer) * width + x + buffer;\n\n                if (a === 1) { // fully drawn pixels\n                    gridOuter[j] = 0;\n                    gridInner[j] = INF;\n\n                } else { // aliased pixels\n                    const d = 0.5 - a;\n                    gridOuter[j] = d > 0 ? d * d : 0;\n                    gridInner[j] = d < 0 ? d * d : 0;\n                }\n            }\n        }\n\n        edt(gridOuter, 0, 0, width, height, width, this.f, this.v, this.z);\n        edt(gridInner, buffer, buffer, glyphWidth, glyphHeight, width, this.f, this.v, this.z);\n\n        for (let i = 0; i < len; i++) {\n            const d = Math.sqrt(gridOuter[i]) - Math.sqrt(gridInner[i]);\n            data[i] = Math.round(255 - 255 * (d / this.radius + this.cutoff));\n        }\n\n        return glyph;\n    }\n}\n\n// 2D Euclidean squared distance transform by Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/papers/dt-final.pdf\nfunction edt(data, x0, y0, width, height, gridSize, f, v, z) {\n    for (let x = x0; x < x0 + width; x++) edt1d(data, y0 * gridSize + x, gridSize, height, f, v, z);\n    for (let y = y0; y < y0 + height; y++) edt1d(data, y * gridSize + x0, 1, width, f, v, z);\n}\n\n// 1D squared distance transform\nfunction edt1d(grid, offset, stride, length, f, v, z) {\n    v[0] = 0;\n    z[0] = -INF;\n    z[1] = INF;\n    f[0] = grid[offset];\n\n    for (let q = 1, k = 0, s = 0; q < length; q++) {\n        f[q] = grid[offset + q * stride];\n        const q2 = q * q;\n        do {\n            const r = v[k];\n            s = (f[q] - f[r] + q2 - r * r) / (q - r) / 2;\n        } while (s <= z[k] && --k > -1);\n\n        k++;\n        v[k] = q;\n        z[k] = s;\n        z[k + 1] = INF;\n    }\n\n    for (let q = 0, k = 0; q < length; q++) {\n        while (z[k + 1] < q) k++;\n        const r = v[k];\n        const qr = q - r;\n        grid[offset + q * stride] = f[r] + qr * qr;\n    }\n}\n", "import {loadGlyphRange} from '../style/load_glyph_range';\n\nimport TinySDF from '@mapbox/tiny-sdf';\nimport {AlphaImage} from '../util/image';\n\nimport type {StyleGlyph} from '../style/style_glyph';\nimport type {RequestManager} from '../util/request_manager';\nimport type {GetGlyphsResponse} from '../util/actor_messages';\n\ntype Entry = {\n    // null means we've requested the range, but the glyph wasn't included in the result.\n    glyphs: {\n        [id: number]: StyleGlyph | null;\n    };\n    requests: {\n        [range: number]: Promise<{[_: number]: StyleGlyph | null}>;\n    };\n    ranges: {\n        [range: number]: boolean | null;\n    };\n    tinySDF?: TinySDF;\n};\n\nexport class GlyphManager {\n    requestManager: RequestManager;\n    localIdeographFontFamily: string | false;\n    entries: {[stack: string]: Entry};\n    url: string;\n\n    // exposed as statics to enable stubbing in unit tests\n    static loadGlyphRange = loadGlyphRange;\n    static TinySDF = TinySDF;\n\n    constructor(requestManager: RequestManager, localIdeographFontFamily?: string | false) {\n        this.requestManager = requestManager;\n        this.localIdeographFontFamily = localIdeographFontFamily;\n        this.entries = {};\n    }\n\n    setURL(url?: string | null) {\n        this.url = url;\n    }\n\n    async getGlyphs(glyphs: {[stack: string]: Array<number>}): Promise<GetGlyphsResponse> {\n        const glyphsPromises: Promise<{stack: string; id: number; glyph: StyleGlyph}>[] = [];\n\n        for (const stack in glyphs) {\n            for (const id of glyphs[stack]) {\n                glyphsPromises.push(this._getAndCacheGlyphsPromise(stack, id));\n            }\n        }\n\n        const updatedGlyphs = await Promise.all(glyphsPromises);\n\n        const result: GetGlyphsResponse = {};\n\n        for (const {stack, id, glyph} of updatedGlyphs) {\n            if (!result[stack]) {\n                result[stack] = {};\n            }\n            // Clone the glyph so that our own copy of its ArrayBuffer doesn't get transferred.\n            result[stack][id] = glyph && {\n                id: glyph.id,\n                bitmap: glyph.bitmap.clone(),\n                metrics: glyph.metrics\n            };\n        }\n\n        return result;\n    }\n\n    async _getAndCacheGlyphsPromise(stack: string, id: number): Promise<{stack: string; id: number; glyph: StyleGlyph}> {\n        let entry = this.entries[stack];\n        if (!entry) {\n            entry = this.entries[stack] = {\n                glyphs: {},\n                requests: {},\n                ranges: {}\n            };\n        }\n\n        let glyph = entry.glyphs[id];\n        if (glyph !== undefined) {\n            return {stack, id, glyph};\n        }\n\n        glyph = this._tinySDF(entry, stack, id);\n        if (glyph) {\n            entry.glyphs[id] = glyph;\n            return {stack, id, glyph};\n        }\n\n        const range = Math.floor(id / 256);\n        if (range * 256 > 65535) {\n            throw new Error('glyphs > 65535 not supported');\n        }\n\n        if (entry.ranges[range]) {\n            return {stack, id, glyph};\n        }\n\n        if (!this.url) {\n            throw new Error('glyphsUrl is not set');\n        }\n\n        if (!entry.requests[range]) {\n            const promise = GlyphManager.loadGlyphRange(stack, range, this.url, this.requestManager);\n            entry.requests[range] = promise;\n        }\n\n        const response = await entry.requests[range];\n        for (const id in response) {\n            if (!this._doesCharSupportLocalGlyph(+id)) {\n                entry.glyphs[+id] = response[+id];\n            }\n        }\n        entry.ranges[range] = true;\n        return {stack, id, glyph: response[id] || null};\n    }\n\n    _doesCharSupportLocalGlyph(id: number): boolean {\n        // The CJK Unified Ideographs blocks and Hangul Syllables blocks are\n        // spread across many glyph PBFs and are typically accessed very\n        // randomly. Preferring local rendering for these blocks reduces\n        // wasteful bandwidth consumption. For visual consistency within CJKV\n        // text, also include any other CJKV or siniform ideograph or hangul,\n        // hiragana, or katakana character.\n        return !!this.localIdeographFontFamily &&\n            /\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}/u.test(String.fromCodePoint(id));\n    }\n\n    _tinySDF(entry: Entry, stack: string, id: number): StyleGlyph {\n        const fontFamily = this.localIdeographFontFamily;\n        if (!fontFamily) {\n            return;\n        }\n\n        if (!this._doesCharSupportLocalGlyph(id)) {\n            return;\n        }\n\n        // Client-generated glyphs are rendered at 2x texture scale,\n        // because CJK glyphs are more detailed than others.\n        const textureScale = 2;\n\n        let tinySDF = entry.tinySDF;\n        if (!tinySDF) {\n            let fontWeight = '400';\n            if (/bold/i.test(stack)) {\n                fontWeight = '900';\n            } else if (/medium/i.test(stack)) {\n                fontWeight = '500';\n            } else if (/light/i.test(stack)) {\n                fontWeight = '200';\n            }\n            tinySDF = entry.tinySDF = new GlyphManager.TinySDF({\n                fontSize: 24 * textureScale,\n                buffer: 3 * textureScale,\n                radius: 8 * textureScale,\n                cutoff: 0.25,\n                fontFamily,\n                fontWeight\n            });\n        }\n\n        const char = tinySDF.draw(String.fromCharCode(id));\n\n        /**\n         * TinySDF's \"top\" is the distance from the alphabetic baseline to the top of the glyph.\n         * Server-generated fonts specify \"top\" relative to an origin above the em box (the origin\n         * comes from FreeType, but I'm unclear on exactly how it's derived)\n         * ref: https://github.com/mapbox/sdf-glyph-foundry\n         *\n         * Server fonts don't yet include baseline information, so we can't line up exactly with them\n         * (and they don't line up with each other)\n         * ref: https://github.com/mapbox/node-fontnik/pull/160\n         *\n         * To approximately align TinySDF glyphs with server-provided glyphs, we use this baseline adjustment\n         * factor calibrated to be in between DIN Pro and Arial Unicode (but closer to Arial Unicode)\n         */\n        const topAdjustment = 27.5;\n\n        const leftAdjustment = 0.5;\n\n        return {\n            id,\n            bitmap: new AlphaImage({width: char.width || 30 * textureScale, height: char.height || 30 * textureScale}, char.data),\n            metrics: {\n                width: char.glyphWidth / textureScale || 24,\n                height: char.glyphHeight / textureScale || 24,\n                left: (char.glyphLeft / textureScale + leftAdjustment) || 0,\n                top: char.glyphTop / textureScale - topAdjustment || -8,\n                advance: char.glyphAdvance / textureScale || 24,\n                isDoubleResolution: true\n            }\n        };\n    }\n}\n", "import {getArrayBuffer} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\n\nimport {parseGlyphPbf} from './parse_glyph_pbf';\n\nimport type {StyleGlyph} from './style_glyph';\nimport type {RequestManager} from '../util/request_manager';\n\nexport async function loadGlyphRange(fontstack: string,\n    range: number,\n    urlTemplate: string,\n    requestManager: RequestManager): Promise<{[_: number]: StyleGlyph | null}> {\n    const begin = range * 256;\n    const end = begin + 255;\n\n    const request = requestManager.transformRequest(\n        urlTemplate.replace('{fontstack}', fontstack).replace('{range}', `${begin}-${end}`),\n        ResourceType.Glyphs\n    );\n\n    const response = await getArrayBuffer(request, new AbortController());\n    if (!response || !response.data) {\n        throw new Error(`Could not load glyph range. range: ${range}, ${begin}-${end}`);\n    }\n    const glyphs = {};\n\n    for (const glyph of parseGlyphPbf(response.data)) {\n        glyphs[glyph.id] = glyph;\n    }\n\n    return glyphs;\n}\n", "import {interpolates, Color, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\n\nimport {sphericalToCartesian} from '../util/util';\nimport {Evented} from '../util/evented';\nimport {\n    validateStyle,\n    validateLight,\n    emitValidationErrors\n} from './validate_style';\n\nimport type {StylePropertySpecification, LightSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {EvaluationParameters} from './evaluation_parameters';\nimport type {StyleSetterOptions} from '../style/style';\nimport {Properties, Transitionable, Transitioning, PossiblyEvaluated, DataConstantProperty} from './properties';\n\nimport type {\n    Property,\n    PropertyValue,\n    TransitionParameters\n} from './properties';\n\ntype LightPosition = {\n    x: number;\n    y: number;\n    z: number;\n};\n\nclass LightPositionProperty implements Property<[number, number, number], LightPosition> {\n    specification: StylePropertySpecification;\n\n    constructor() {\n        this.specification = styleSpec.light.position as StylePropertySpecification;\n    }\n\n    possiblyEvaluate(\n        value: PropertyValue<[number, number, number], LightPosition>,\n        parameters: EvaluationParameters\n    ): LightPosition {\n        return sphericalToCartesian(value.expression.evaluate(parameters));\n    }\n\n    interpolate(a: LightPosition, b: LightPosition, t: number): LightPosition {\n        return {\n            x: interpolates.number(a.x, b.x, t),\n            y: interpolates.number(a.y, b.y, t),\n            z: interpolates.number(a.z, b.z, t),\n        };\n    }\n}\n\ntype LightProps = {\n    'anchor': DataConstantProperty<'map' | 'viewport'>;\n    'position': LightPositionProperty;\n    'color': DataConstantProperty<Color>;\n    'intensity': DataConstantProperty<number>;\n};\n\ntype LightPropsPossiblyEvaluated = {\n    'anchor': 'map' | 'viewport';\n    'position': LightPosition;\n    'color': Color;\n    'intensity': number;\n};\n\nconst TRANSITION_SUFFIX = '-transition';\n\nlet lightProperties: Properties<LightProps>;\n\n/*\n * Represents the light used to light extruded features.\n */\nexport class Light extends Evented {\n    _transitionable: Transitionable<LightProps>;\n    _transitioning: Transitioning<LightProps>;\n    properties: PossiblyEvaluated<LightProps, LightPropsPossiblyEvaluated>;\n\n    constructor(lightOptions?: LightSpecification) {\n        super();\n        lightProperties = lightProperties || new Properties({\n            'anchor': new DataConstantProperty(styleSpec.light.anchor as StylePropertySpecification),\n            'position': new LightPositionProperty(),\n            'color': new DataConstantProperty(styleSpec.light.color as StylePropertySpecification),\n            'intensity': new DataConstantProperty(styleSpec.light.intensity as StylePropertySpecification),\n        });\n        this._transitionable = new Transitionable(lightProperties);\n        this.setLight(lightOptions);\n        this._transitioning = this._transitionable.untransitioned();\n    }\n\n    getLight(): LightSpecification {\n        return this._transitionable.serialize();\n    }\n\n    setLight(light?: LightSpecification, options: StyleSetterOptions = {}) {\n        if (this._validate(validateLight, light, options)) {\n            return;\n        }\n\n        for (const name in light) {\n            const value = light[name];\n            if (name.endsWith(TRANSITION_SUFFIX)) {\n                this._transitionable.setTransition(name.slice(0, -TRANSITION_SUFFIX.length) as keyof LightProps, value);\n            } else {\n                this._transitionable.setValue(name as keyof LightProps, value);\n            }\n        }\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioning = this._transitionable.transitioned(parameters, this._transitioning);\n    }\n\n    hasTransition() {\n        return this._transitioning.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters) {\n        this.properties = this._transitioning.possiblyEvaluate(parameters);\n    }\n\n    _validate(validate: Function, value: unknown, options?: {\n        validate?: boolean;\n    }) {\n        if (options && options.validate === false) {\n            return false;\n        }\n\n        return emitValidationErrors(this, validate.call(validateStyle, {\n            value,\n            // Workaround for https://github.com/mapbox/mapbox-gl-js/issues/2407\n            style: {glyphs: true, sprite: true},\n            styleSpec\n        }));\n    }\n}\n", "import {DataConstantProperty, PossiblyEvaluated, Properties, Transitionable, Transitioning, TransitionParameters} from './properties';\nimport {Evented} from '../util/evented';\nimport {EvaluationParameters} from './evaluation_parameters';\nimport {emitValidationErrors, validateSky, validateStyle} from './validate_style';\nimport {extend} from '../util/util';\nimport {Color, latest as styleSpec} from '@maplibre/maplibre-gl-style-spec';\nimport {Mesh} from '../render/mesh';\nimport type {StylePropertySpecification, SkySpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {StyleSetterOptions} from './style';\n\ntype SkyProps = {\n    'sky-color': DataConstantProperty<Color>;\n    'horizon-color': DataConstantProperty<Color>;\n    'fog-color': DataConstantProperty<Color>;\n    'fog-ground-blend': DataConstantProperty<number>;\n    'horizon-fog-blend': DataConstantProperty<number>;\n    'sky-horizon-blend': DataConstantProperty<number>;\n    'atmosphere-blend': DataConstantProperty<number>;\n};\n\ntype SkyPropsPossiblyEvaluated = {\n    'sky-color': Color;\n    'horizon-color': Color;\n    'fog-color': Color;\n    'fog-ground-blend': number;\n    'horizon-fog-blend': number;\n    'sky-horizon-blend': number;\n    'atmosphere-blend': number;\n};\n\nconst properties: Properties<SkyProps> = new Properties({\n    'sky-color': new DataConstantProperty(styleSpec.sky['sky-color'] as StylePropertySpecification),\n    'horizon-color': new DataConstantProperty(styleSpec.sky['horizon-color'] as StylePropertySpecification),\n    'fog-color': new DataConstantProperty(styleSpec.sky['fog-color'] as StylePropertySpecification),\n    'fog-ground-blend': new DataConstantProperty(styleSpec.sky['fog-ground-blend'] as StylePropertySpecification),\n    'horizon-fog-blend': new DataConstantProperty(styleSpec.sky['horizon-fog-blend'] as StylePropertySpecification),\n    'sky-horizon-blend': new DataConstantProperty(styleSpec.sky['sky-horizon-blend'] as StylePropertySpecification),\n    'atmosphere-blend': new DataConstantProperty(styleSpec.sky['atmosphere-blend'] as StylePropertySpecification)\n});\n\nconst TRANSITION_SUFFIX = '-transition';\n\nexport class Sky extends Evented {\n    properties: PossiblyEvaluated<SkyProps, SkyPropsPossiblyEvaluated>;\n\n    /**\n     * This is used to cache the gl mesh for the sky, it should be initialized only once.\n     */\n    mesh: Mesh | undefined;\n    _transitionable: Transitionable<SkyProps>;\n    _transitioning: Transitioning<SkyProps>;\n\n    constructor(sky?: SkySpecification) {\n        super();\n        this._transitionable = new Transitionable(properties);\n        this.setSky(sky);\n        this._transitioning = this._transitionable.untransitioned();\n        this.recalculate(new EvaluationParameters(0));\n    }\n\n    setSky(sky?: SkySpecification, options: StyleSetterOptions = {}) {\n        if (this._validate(validateSky, sky, options)) return;\n\n        if (!sky) {\n            sky = {\n                'sky-color': 'transparent',\n                'horizon-color': 'transparent',\n                'fog-color': 'transparent',\n                'fog-ground-blend': 1,\n                'atmosphere-blend': 0,\n            };\n        }\n\n        for (const name in sky) {\n            const value = sky[name];\n            if (name.endsWith(TRANSITION_SUFFIX)) {\n                this._transitionable.setTransition(name.slice(0, -TRANSITION_SUFFIX.length) as keyof SkyProps, value);\n            } else {\n                this._transitionable.setValue(name as keyof SkyProps, value);\n            }\n        }\n    }\n\n    getSky(): SkySpecification {\n        return this._transitionable.serialize();\n    }\n\n    updateTransitions(parameters: TransitionParameters) {\n        this._transitioning = this._transitionable.transitioned(parameters, this._transitioning);\n    }\n\n    hasTransition() {\n        return this._transitioning.hasTransition();\n    }\n\n    recalculate(parameters: EvaluationParameters) {\n        this.properties = this._transitioning.possiblyEvaluate(parameters);\n    }\n\n    _validate(validate: Function, value: unknown, options: StyleSetterOptions = {}) {\n        if (options?.validate === false) {\n            return false;\n        }\n        return emitValidationErrors(this, validate.call(validateStyle, extend({\n            value,\n            // Workaround for https://github.com/mapbox/mapbox-gl-js/issues/2407\n            style: {glyphs: true, sprite: true},\n            styleSpec\n        })));\n    }\n\n    /**\n     * Currently fog is a very simple implementation, and should only used\n     * to create an atmosphere near the horizon.\n     * But because the fog is drawn from the far-clipping-plane to\n     * map-center, and because the fog does nothing know about the horizon,\n     * this method does a fadeout in respect of pitch. So, when the horizon\n     * gets out of view, which is at about pitch 70, this methods calculates\n     * the corresponding opacity values. Below pitch 60 the fog is completely\n     * invisible.\n     */\n    calculateFogBlendOpacity(pitch: number) {\n        if (pitch < 60) return 0; // disable\n        if (pitch < 70) return (pitch - 60) / 10; // fade in\n        return 1;\n    }\n}\n", "import {warnOnce} from '../util/util';\n\nimport type {Context} from '../gl/context';\n\n/**\n * A dash entry\n */\ntype DashEntry = {\n    y: number;\n    height: number;\n    width: number;\n}\n\n/**\n * @internal\n * A LineAtlas lets us reuse rendered dashed lines\n * by writing many of them to a texture and then fetching their positions\n * using {@link LineAtlas#getDash}.\n *\n * @param width - the width\n * @param height - the height\n */\nexport class LineAtlas {\n    width: number;\n    height: number;\n    nextRow: number;\n    bytes: number;\n    data: Uint8Array;\n    dashEntry: {[_: string]: DashEntry};\n    dirty: boolean;\n    texture: WebGLTexture;\n\n    constructor(width: number, height: number) {\n        this.width = width;\n        this.height = height;\n        this.nextRow = 0;\n\n        this.data = new Uint8Array(this.width * this.height);\n\n        this.dashEntry = {};\n    }\n\n    /**\n     * Get or create a dash line pattern.\n     *\n     * @param dasharray - the key (represented by numbers) to get the dash texture\n     * @param round - whether to add circle caps in between dash segments\n     * @returns position of dash texture in {@link DashEntry}\n     */\n    getDash(dasharray: Array<number>, round: boolean) {\n        const key = dasharray.join(',') + String(round);\n\n        if (!this.dashEntry[key]) {\n            this.dashEntry[key] = this.addDash(dasharray, round);\n        }\n        return this.dashEntry[key];\n    }\n\n    getDashRanges(dasharray: Array<number>, lineAtlasWidth: number, stretch: number) {\n        // If dasharray has an odd length, both the first and last parts\n        // are dashes and should be joined seamlessly.\n        const oddDashArray = dasharray.length % 2 === 1;\n\n        const ranges = [];\n\n        let left = oddDashArray ? -dasharray[dasharray.length - 1] * stretch : 0;\n        let right = dasharray[0] * stretch;\n        let isDash = true;\n\n        ranges.push({left, right, isDash, zeroLength: dasharray[0] === 0});\n\n        let currentDashLength = dasharray[0];\n        for (let i = 1; i < dasharray.length; i++) {\n            isDash = !isDash;\n\n            const dashLength = dasharray[i];\n            left = currentDashLength * stretch;\n            currentDashLength += dashLength;\n            right = currentDashLength * stretch;\n\n            ranges.push({left, right, isDash, zeroLength: dashLength === 0});\n        }\n\n        return ranges;\n    }\n\n    addRoundDash(ranges: any, stretch: number, n: number) {\n        const halfStretch = stretch / 2;\n\n        for (let y = -n; y <= n; y++) {\n            const row = this.nextRow + n + y;\n            const index = this.width * row;\n            let currIndex = 0;\n            let range = ranges[currIndex];\n\n            for (let x = 0; x < this.width; x++) {\n                if (x / range.right > 1) { range = ranges[++currIndex]; }\n\n                const distLeft = Math.abs(x - range.left);\n                const distRight = Math.abs(x - range.right);\n                const minDist = Math.min(distLeft, distRight);\n                let signedDistance;\n\n                const distMiddle =  y / n * (halfStretch + 1);\n                if (range.isDash) {\n                    const distEdge = halfStretch - Math.abs(distMiddle);\n                    signedDistance = Math.sqrt(minDist * minDist + distEdge * distEdge);\n                } else {\n                    signedDistance = halfStretch - Math.sqrt(minDist * minDist + distMiddle * distMiddle);\n                }\n\n                this.data[index + x] = Math.max(0, Math.min(255, signedDistance + 128));\n            }\n        }\n    }\n\n    addRegularDash(ranges: any) {\n\n        // Collapse any zero-length range\n        // Collapse neighbouring same-type parts into a single part\n        for (let i = ranges.length - 1; i >= 0; --i) {\n            const part = ranges[i];\n            const next = ranges[i + 1];\n            if (part.zeroLength) {\n                ranges.splice(i, 1);\n            } else if (next && next.isDash === part.isDash) {\n                next.left = part.left;\n                ranges.splice(i, 1);\n            }\n        }\n\n        // Combine the first and last parts if possible\n        const first = ranges[0];\n        const last = ranges[ranges.length - 1];\n        if (first.isDash === last.isDash) {\n            first.left = last.left - this.width;\n            last.right = first.right + this.width;\n        }\n\n        const index = this.width * this.nextRow;\n        let currIndex = 0;\n        let range = ranges[currIndex];\n\n        for (let x = 0; x < this.width; x++) {\n            if (x / range.right > 1) {\n                range = ranges[++currIndex];\n            }\n\n            const distLeft = Math.abs(x - range.left);\n            const distRight = Math.abs(x - range.right);\n\n            const minDist = Math.min(distLeft, distRight);\n            const signedDistance = range.isDash ? minDist : -minDist;\n\n            this.data[index + x] = Math.max(0, Math.min(255, signedDistance + 128));\n        }\n    }\n\n    addDash(dasharray: Array<number>, round: boolean): DashEntry {\n        const n = round ? 7 : 0;\n        const height = 2 * n + 1;\n\n        if (this.nextRow + height > this.height) {\n            warnOnce('LineAtlas out of space');\n            return null;\n        }\n\n        let length = 0;\n        for (let i = 0; i < dasharray.length; i++) { length += dasharray[i]; }\n\n        if (length !== 0) {\n            const stretch = this.width / length;\n            const ranges = this.getDashRanges(dasharray, this.width, stretch);\n\n            if (round) {\n                this.addRoundDash(ranges, stretch, n);\n            } else {\n                this.addRegularDash(ranges);\n            }\n        }\n\n        const dashEntry = {\n            y: (this.nextRow + n + 0.5) / this.height,\n            height: 2 * n / this.height,\n            width: length\n        };\n\n        this.nextRow += height;\n        this.dirty = true;\n\n        return dashEntry;\n    }\n\n    bind(context: Context) {\n        const gl = context.gl;\n        if (!this.texture) {\n            this.texture = gl.createTexture();\n            gl.bindTexture(gl.TEXTURE_2D, this.texture);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.REPEAT);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.REPEAT);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n            gl.texImage2D(gl.TEXTURE_2D, 0, gl.ALPHA, this.width, this.height, 0, gl.ALPHA, gl.UNSIGNED_BYTE, this.data);\n\n        } else {\n            gl.bindTexture(gl.TEXTURE_2D, this.texture);\n\n            if (this.dirty) {\n                this.dirty = false;\n                gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, this.width, this.height, gl.ALPHA, gl.UNSIGNED_BYTE, this.data);\n            }\n        }\n    }\n}\n", "import {workerFactory} from './web_worker';\nimport {browser} from './browser';\nimport {isSafari} from './util';\nimport {ActorTarget} from './actor';\n\nexport const PRELOAD_POOL_ID = 'maplibre_preloaded_worker_pool';\n\n/**\n * Constructs a worker pool.\n */\nexport class WorkerPool {\n    static workerCount: number;\n\n    active: {\n        [_ in number | string]: boolean;\n    };\n    workers: Array<ActorTarget>;\n\n    constructor() {\n        this.active = {};\n    }\n\n    acquire(mapId: number | string): Array<ActorTarget> {\n        if (!this.workers) {\n            // Lazily look up the value of getWorkerCount so that\n            // client code has had a chance to set it.\n            this.workers = [];\n            while (this.workers.length < WorkerPool.workerCount) {\n                this.workers.push(workerFactory());\n            }\n        }\n\n        this.active[mapId] = true;\n        return this.workers.slice();\n    }\n\n    release(mapId: number | string) {\n        delete this.active[mapId];\n        if (this.numActive() === 0) {\n            this.workers.forEach((w) => {\n                w.terminate();\n            });\n            this.workers = null;\n        }\n    }\n\n    isPreloaded(): boolean {\n        return !!this.active[PRELOAD_POOL_ID];\n    }\n\n    numActive(): number {\n        return Object.keys(this.active).length;\n    }\n}\n\n// Based on results from A/B testing: https://github.com/maplibre/maplibre-gl-js/pull/2354\nconst availableLogicalProcessors = Math.floor(browser.hardwareConcurrency / 2);\nWorkerPool.workerCount = isSafari(globalThis) ? Math.max(Math.min(availableLogicalProcessors, 3), 1) : 1;\n", "import {AddProtocolAction, config} from './config';\nimport type {default as MaplibreWorker} from '../source/worker';\nimport type {WorkerSourceConstructor} from '../source/worker_source';\n\nexport interface WorkerGlobalScopeInterface {\n    importScripts(...urls: Array<string>): void;\n    registerWorkerSource: (sourceName: string, sourceConstructor: WorkerSourceConstructor) => void;\n    registerRTLTextPlugin: (_: any) => void;\n    addProtocol: (customProtocol: string, loadFn: AddProtocolAction) => void;\n    removeProtocol: (customProtocol: string) => void;\n    worker: MaplibreWorker;\n}\n\nexport function workerFactory() {\n    return new Worker(config.WORKER_URL);\n}\n", "import {WorkerPool, PRELOAD_POOL_ID} from './worker_pool';\n\nlet globalWorkerPool;\n\n/**\n * Creates (if necessary) and returns the single, global WorkerPool instance\n * to be shared across each Map\n */\nexport function getGlobalWorkerPool() {\n    if (!globalWorkerPool) {\n        globalWorkerPool = new WorkerPool();\n    }\n    return globalWorkerPool;\n}\n\n/**\n * Initializes resources like WebWorkers that can be shared across maps to lower load\n * times in some situations. `setWorkerUrl()` and `setWorkerCount()`, if being\n * used, must be set before `prewarm()` is called to have an effect.\n *\n * By default, the lifecycle of these resources is managed automatically, and they are\n * lazily initialized when a Map is first created. By invoking `prewarm()`, these\n * resources will be created ahead of time, and will not be cleared when the last Map\n * is removed from the page. This allows them to be re-used by new Map instances that\n * are created later. They can be manually cleared by calling\n * `clearPrewarmedResources()`. This is only necessary if your web page remains\n * active but stops using maps altogether.\n *\n * This is primarily useful when using GL-JS maps in a single page app, wherein a user\n * would navigate between various views that can cause Map instances to constantly be\n * created and destroyed.\n *\n * @example\n * ```ts\n * prewarm()\n * ```\n */\nexport function prewarm() {\n    const workerPool = getGlobalWorkerPool();\n    workerPool.acquire(PRELOAD_POOL_ID);\n}\n\n/**\n * Clears up resources that have previously been created by `prewarm()`.\n * Note that this is typically not necessary. You should only call this function\n * if you expect the user of your app to not return to a Map view at any point\n * in your application.\n *\n * @example\n * ```ts\n * clearPrewarmedResources()\n * ```\n */\nexport function clearPrewarmedResources() {\n    const pool = globalWorkerPool;\n    if (pool) {\n        // Remove the pool only if all maps that referenced the preloaded global worker pool have been removed.\n        if (pool.isPreloaded() && pool.numActive() === 1) {\n            pool.release(PRELOAD_POOL_ID);\n            globalWorkerPool = null;\n        } else {\n            console.warn('Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()');\n        }\n    }\n}\n", "import {Actor, MessageHandler} from './actor';\nimport {getGlobalWorkerPool} from './global_worker_pool';\nimport {GLOBAL_DISPATCHER_ID, makeRequest} from './ajax';\n\nimport type {WorkerPool} from './worker_pool';\nimport type {WorkerSource} from '../source/worker_source'; /* eslint-disable-line */ // this is used for the docs' import\nimport type {RequestResponseMessageMap} from './actor_messages';\nimport {MessageType} from './actor_messages';\n\n/**\n * Responsible for sending messages from a {@link Source} to an associated\n * {@link WorkerSource}.\n */\nexport class Dispatcher {\n    workerPool: WorkerPool;\n    actors: Array<Actor>;\n    currentActor: number;\n    id: string | number;\n\n    constructor(workerPool: WorkerPool, mapId: string | number) {\n        this.workerPool = workerPool;\n        this.actors = [];\n        this.currentActor = 0;\n        this.id = mapId;\n        const workers = this.workerPool.acquire(mapId);\n        for (let i = 0; i < workers.length; i++) {\n            const worker = workers[i];\n            const actor = new Actor(worker, mapId);\n            actor.name = `Worker ${i}`;\n            this.actors.push(actor);\n        }\n        if (!this.actors.length) throw new Error('No actors found');\n    }\n\n    /**\n     * Broadcast a message to all Workers.\n     */\n    broadcast<T extends MessageType>(type: T, data: RequestResponseMessageMap[T][0]): Promise<RequestResponseMessageMap[T][1][]> {\n        const promises: Promise<RequestResponseMessageMap[T][1]>[] = [];\n        for (const actor of this.actors) {\n            promises.push(actor.sendAsync({type, data}));\n        }\n        return Promise.all(promises);\n    }\n\n    /**\n     * Acquires an actor to dispatch messages to. The actors are distributed in round-robin fashion.\n     * @returns An actor object backed by a web worker for processing messages.\n     */\n    getActor(): Actor {\n        this.currentActor = (this.currentActor + 1) % this.actors.length;\n        return this.actors[this.currentActor];\n    }\n\n    remove(mapRemoved: boolean = true) {\n        this.actors.forEach((actor) => { actor.remove(); });\n        this.actors = [];\n        if (mapRemoved) this.workerPool.release(this.id);\n    }\n\n    public registerMessageHandler<T extends MessageType>(type: T, handler: MessageHandler<T>) {\n        for (const actor of this.actors) {\n            actor.registerMessageHandler(type, handler);\n        }\n    }\n}\n\nlet globalDispatcher: Dispatcher;\n\nexport function getGlobalDispatcher(): Dispatcher {\n    if (!globalDispatcher) {\n        globalDispatcher = new Dispatcher(getGlobalWorkerPool(), GLOBAL_DISPATCHER_ID);\n        globalDispatcher.registerMessageHandler(MessageType.getResource, (_mapId, params, abortController) => {\n            return makeRequest(params, abortController);\n        });\n    }\n    return globalDispatcher;\n}\n", "import type {SourceCache} from './source_cache';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CollisionIndex} from '../symbol/collision_index';\nimport type {Transform} from '../geo/transform';\nimport type {RetainedQueryData} from '../symbol/placement';\nimport type {FilterSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type Point from '@mapbox/point-geometry';\nimport {mat4} from 'gl-matrix';\n\n/**\n * Options to pass to query the map for the rendered features\n */\nexport type QueryRenderedFeaturesOptions = {\n    /**\n     * An array of [style layer IDs](https://maplibre.org/maplibre-style-spec/#layer-id) for the query to inspect.\n     * Only features within these layers will be returned. If this parameter is undefined, all layers will be checked.\n     */\n    layers?: Array<string>;\n    /**\n     * A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter) to limit query results.\n     */\n    filter?: FilterSpecification;\n    /**\n     * An array of string representing the available images\n     */\n    availableImages?: Array<string>;\n    /**\n     * Whether to check if the [options.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.\n     */\n    validate?: boolean;\n};\n\n/**\n * The options object related to the {@link Map#querySourceFeatures} method\n */\nexport type QuerySourceFeatureOptions = {\n    /**\n     * The name of the source layer to query. *For vector tile sources, this parameter is required.* For GeoJSON sources, it is ignored.\n     */\n    sourceLayer?: string;\n    /**\n     * A [filter](https://maplibre.org/maplibre-style-spec/layers/#filter)\n     * to limit query results.\n     */\n    filter?: FilterSpecification;\n    /**\n     * Whether to check if the [parameters.filter] conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.\n     * @defaultValue true\n     */\n    validate?: boolean;\n}\n\n/*\n * Returns a matrix that can be used to convert from tile coordinates to viewport pixel coordinates.\n */\nfunction getPixelPosMatrix(transform, tileID) {\n    const t = mat4.create();\n    mat4.translate(t, t, [1, 1, 0]);\n    mat4.scale(t, t, [transform.width * 0.5, transform.height * 0.5, 1]);\n    return mat4.multiply(t, t, transform.calculatePosMatrix(tileID.toUnwrapped()));\n}\n\nfunction queryIncludes3DLayer(layers: Array<string>, styleLayers: {[_: string]: StyleLayer}, sourceID: string) {\n    if (layers) {\n        for (const layerID of layers) {\n            const layer = styleLayers[layerID];\n            if (layer && layer.source === sourceID && layer.type === 'fill-extrusion') {\n                return true;\n            }\n        }\n    } else {\n        for (const key in styleLayers) {\n            const layer = styleLayers[key];\n            if (layer.source === sourceID && layer.type === 'fill-extrusion') {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\nexport function queryRenderedFeatures(\n    sourceCache: SourceCache,\n    styleLayers: {[_: string]: StyleLayer},\n    serializedLayers: {[_: string]: any},\n    queryGeometry: Array<Point>,\n    params: QueryRenderedFeaturesOptions,\n    transform: Transform\n): { [key: string]: Array<{featureIndex: number; feature: MapGeoJSONFeature}> } {\n\n    const has3DLayer = queryIncludes3DLayer(params && params.layers, styleLayers, sourceCache.id);\n    const maxPitchScaleFactor = transform.maxPitchScaleFactor();\n    const tilesIn = sourceCache.tilesIn(queryGeometry, maxPitchScaleFactor, has3DLayer);\n\n    tilesIn.sort(sortTilesIn);\n    const renderedFeatureLayers = [];\n    for (const tileIn of tilesIn) {\n        renderedFeatureLayers.push({\n            wrappedTileID: tileIn.tileID.wrapped().key,\n            queryResults: tileIn.tile.queryRenderedFeatures(\n                styleLayers,\n                serializedLayers,\n                sourceCache._state,\n                tileIn.queryGeometry,\n                tileIn.cameraQueryGeometry,\n                tileIn.scale,\n                params,\n                transform,\n                maxPitchScaleFactor,\n                getPixelPosMatrix(sourceCache.transform, tileIn.tileID))\n        });\n    }\n\n    const result = mergeRenderedFeatureLayers(renderedFeatureLayers);\n\n    // Merge state from SourceCache into the results\n    for (const layerID in result) {\n        result[layerID].forEach((featureWrapper) => {\n            const feature = featureWrapper.feature as MapGeoJSONFeature;\n            const state = sourceCache.getFeatureState(feature.layer['source-layer'], feature.id);\n            feature.source = feature.layer.source;\n            if (feature.layer['source-layer']) {\n                feature.sourceLayer = feature.layer['source-layer'];\n            }\n            feature.state = state;\n        });\n    }\n    return result;\n}\n\nexport function queryRenderedSymbols(styleLayers: {[_: string]: StyleLayer},\n    serializedLayers: {[_: string]: StyleLayer},\n    sourceCaches: {[_: string]: SourceCache},\n    queryGeometry: Array<Point>,\n    params: QueryRenderedFeaturesOptions,\n    collisionIndex: CollisionIndex,\n    retainedQueryData: {\n        [_: number]: RetainedQueryData;\n    }) {\n    const result = {};\n    const renderedSymbols = collisionIndex.queryRenderedSymbols(queryGeometry);\n    const bucketQueryData = [];\n    for (const bucketInstanceId of Object.keys(renderedSymbols).map(Number)) {\n        bucketQueryData.push(retainedQueryData[bucketInstanceId]);\n    }\n    bucketQueryData.sort(sortTilesIn);\n\n    for (const queryData of bucketQueryData) {\n        const bucketSymbols = queryData.featureIndex.lookupSymbolFeatures(\n            renderedSymbols[queryData.bucketInstanceId],\n            serializedLayers,\n            queryData.bucketIndex,\n            queryData.sourceLayerIndex,\n            params.filter,\n            params.layers,\n            params.availableImages,\n            styleLayers);\n\n        for (const layerID in bucketSymbols) {\n            const resultFeatures = result[layerID] = result[layerID] || [];\n            const layerSymbols = bucketSymbols[layerID];\n            layerSymbols.sort((a, b) => {\n                // Match topDownFeatureComparator from FeatureIndex, but using\n                // most recent sorting of features from bucket.sortFeatures\n                const featureSortOrder = queryData.featureSortOrder;\n                if (featureSortOrder) {\n                    // queryRenderedSymbols documentation says we'll return features in\n                    // \"top-to-bottom\" rendering order (aka last-to-first).\n                    // Actually there can be multiple symbol instances per feature, so\n                    // we sort each feature based on the first matching symbol instance.\n                    const sortedA = featureSortOrder.indexOf(a.featureIndex);\n                    const sortedB = featureSortOrder.indexOf(b.featureIndex);\n                    return sortedB - sortedA;\n                } else {\n                    // Bucket hasn't been re-sorted based on angle, so use the\n                    // reverse of the order the features appeared in the data.\n                    return b.featureIndex - a.featureIndex;\n                }\n            });\n            for (const symbolFeature of layerSymbols) {\n                resultFeatures.push(symbolFeature);\n            }\n        }\n    }\n\n    // Merge state from SourceCache into the results\n    for (const layerName in result) {\n        result[layerName].forEach((featureWrapper) => {\n            const feature = featureWrapper.feature;\n            const layer = styleLayers[layerName];\n            const sourceCache = sourceCaches[layer.source];\n            const state = sourceCache.getFeatureState(feature.layer['source-layer'], feature.id);\n            feature.source = feature.layer.source;\n            if (feature.layer['source-layer']) {\n                feature.sourceLayer = feature.layer['source-layer'];\n            }\n            feature.state = state;\n        });\n    }\n    return result;\n}\n\nexport function querySourceFeatures(sourceCache: SourceCache, params: QuerySourceFeatureOptions) {\n    const tiles = sourceCache.getRenderableIds().map((id) => {\n        return sourceCache.getTileByID(id);\n    });\n\n    const result = [];\n\n    const dataTiles = {};\n    for (let i = 0; i < tiles.length; i++) {\n        const tile = tiles[i];\n        const dataID = tile.tileID.canonical.key;\n        if (!dataTiles[dataID]) {\n            dataTiles[dataID] = true;\n            tile.querySourceFeatures(result, params);\n        }\n    }\n\n    return result;\n}\n\nfunction sortTilesIn(a, b) {\n    const idA = a.tileID;\n    const idB = b.tileID;\n    return (idA.overscaledZ - idB.overscaledZ) || (idA.canonical.y - idB.canonical.y) || (idA.wrap - idB.wrap) || (idA.canonical.x - idB.canonical.x);\n}\n\nfunction mergeRenderedFeatureLayers(tiles) {\n    // Merge results from all tiles, but if two tiles share the same\n    // wrapped ID, don't duplicate features between the two tiles\n    const result = {};\n    const wrappedIDLayerMap = {};\n    for (const tile of tiles) {\n        const queryResults = tile.queryResults;\n        const wrappedID = tile.wrappedTileID;\n        const wrappedIDLayers = wrappedIDLayerMap[wrappedID] = wrappedIDLayerMap[wrappedID] || {};\n        for (const layerID in queryResults) {\n            const tileFeatures = queryResults[layerID];\n            const wrappedIDFeatures = wrappedIDLayers[layerID] = wrappedIDLayers[layerID] || {};\n            const resultFeatures = result[layerID] = result[layerID] || [];\n            for (const tileFeature of tileFeatures) {\n                if (!wrappedIDFeatures[tileFeature.featureIndex]) {\n                    wrappedIDFeatures[tileFeature.featureIndex] = true;\n                    resultFeatures.push(tileFeature);\n                }\n            }\n        }\n    }\n    return result;\n}\n", "import {pick, extend, TileJSON} from '../util/util';\nimport {getJSON} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\n\nimport type {RequestManager} from '../util/request_manager';\nimport type {RasterDEMSourceSpecification, RasterSourceSpecification, VectorSourceSpecification} from '@maplibre/maplibre-gl-style-spec';\n\nexport type LoadTileJsonResponse = {\n    tiles: Array<string>;\n    minzoom: number;\n    maxzoom: number;\n    attribution: string;\n    bounds: RasterSourceSpecification['bounds'];\n    scheme: RasterSourceSpecification['scheme'];\n    tileSize: number;\n    encoding: RasterDEMSourceSpecification['encoding'];\n    vectorLayerIds?: Array<string>;\n}\n\nexport async function loadTileJson(\n    options: RasterSourceSpecification | RasterDEMSourceSpecification | VectorSourceSpecification,\n    requestManager: RequestManager,\n    abortController: AbortController,\n): Promise<LoadTileJsonResponse | null> {\n    let tileJSON: TileJSON | typeof options = options;\n    if (options.url) {\n        const response = await getJSON<TileJSON>(requestManager.transformRequest(options.url, ResourceType.Source), abortController);\n        tileJSON = response.data;\n    } else {\n        await browser.frameAsync(abortController);\n    }\n    if (!tileJSON) {\n        return null;\n    }\n    const result = pick(\n        // explicit source options take precedence over TileJSON\n        extend(tileJSON, options),\n        ['tiles', 'minzoom', 'maxzoom', 'attribution', 'bounds', 'scheme', 'tileSize', 'encoding']\n    ) as LoadTileJsonResponse;\n\n    if ('vector_layers' in tileJSON && tileJSON.vector_layers) {\n        result.vectorLayerIds = tileJSON.vector_layers.map((layer) => { return layer.id; });\n    }\n\n    return result;\n}\n", "import {LngLat} from './lng_lat';\nimport type {LngLatLike} from './lng_lat';\n\n/**\n * A {@link LngLatBounds} object, an array of {@link LngLatLike} objects in [sw, ne] order,\n * or an array of numbers in [west, south, east, north] order.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let v1 = new LngLatBounds(\n *   new LngLat(-73.9876, 40.7661),\n *   new LngLat(-73.9397, 40.8002)\n * );\n * let v2 = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002])\n * let v3 = [[-73.9876, 40.7661], [-73.9397, 40.8002]];\n * ```\n */\nexport type LngLatBoundsLike = LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number];\n\n/**\n * A `LngLatBounds` object represents a geographical bounding box,\n * defined by its southwest and northeast points in longitude and latitude.\n *\n * If no arguments are provided to the constructor, a `null` bounding box is created.\n *\n * Note that any Mapbox GL method that accepts a `LngLatBounds` object as an argument or option\n * can also accept an `Array` of two {@link LngLatLike} constructs and will perform an implicit conversion.\n * This flexible type is documented as {@link LngLatBoundsLike}.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let sw = new LngLat(-73.9876, 40.7661);\n * let ne = new LngLat(-73.9397, 40.8002);\n * let llb = new LngLatBounds(sw, ne);\n * ```\n */\nexport class LngLatBounds {\n    _ne: LngLat;\n    _sw: LngLat;\n\n    /**\n     * @param sw - The southwest corner of the bounding box.\n     * OR array of 4 numbers in the order of  west, south, east, north\n     * OR array of 2 LngLatLike: [sw,ne]\n     * @param ne - The northeast corner of the bounding box.\n     * @example\n     * ```ts\n     * let sw = new LngLat(-73.9876, 40.7661);\n     * let ne = new LngLat(-73.9397, 40.8002);\n     * let llb = new LngLatBounds(sw, ne);\n     * ```\n     * OR\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661, -73.9397, 40.8002]);\n     * ```\n     * OR\n     * ```ts\n     * let llb = new LngLatBounds([sw, ne]);\n     * ```\n     */\n    constructor(sw?: LngLatLike | [number, number, number, number] | [LngLatLike, LngLatLike], ne?: LngLatLike) {\n        if (!sw) {\n            // noop\n        } else if (ne) {\n            this.setSouthWest(<LngLatLike>sw).setNorthEast(ne);\n        } else if (Array.isArray(sw)) {\n            if (sw.length === 4) {\n            // 4 element array: west, south, east, north\n                this.setSouthWest([sw[0], sw[1]]).setNorthEast([sw[2], sw[3]]);\n            } else {\n                this.setSouthWest(sw[0] as LngLatLike).setNorthEast(sw[1] as LngLatLike);\n            }\n        }\n    }\n\n    /**\n     * Set the northeast corner of the bounding box\n     *\n     * @param ne - a {@link LngLatLike} object describing the northeast corner of the bounding box.\n     */\n    setNorthEast(ne: LngLatLike): this {\n        this._ne = ne instanceof LngLat ? new LngLat(ne.lng, ne.lat) : LngLat.convert(ne);\n        return this;\n    }\n\n    /**\n     * Set the southwest corner of the bounding box\n     *\n     * @param sw - a {@link LngLatLike} object describing the southwest corner of the bounding box.\n     */\n    setSouthWest(sw: LngLatLike): this {\n        this._sw = sw instanceof LngLat ? new LngLat(sw.lng, sw.lat) : LngLat.convert(sw);\n        return this;\n    }\n\n    /**\n     * Extend the bounds to include a given LngLatLike or LngLatBoundsLike.\n     *\n     * @param obj - object to extend to\n     */\n    extend(obj: LngLatLike | LngLatBoundsLike): this {\n        const sw = this._sw,\n            ne = this._ne;\n        let sw2, ne2;\n\n        if (obj instanceof LngLat) {\n            sw2 = obj;\n            ne2 = obj;\n\n        } else if (obj instanceof LngLatBounds) {\n            sw2 = obj._sw;\n            ne2 = obj._ne;\n\n            if (!sw2 || !ne2) return this;\n\n        } else {\n            if (Array.isArray(obj)) {\n                if (obj.length === 4 || (obj as any[]).every(Array.isArray)) {\n                    const lngLatBoundsObj = (obj as any as LngLatBoundsLike);\n                    return this.extend(LngLatBounds.convert(lngLatBoundsObj));\n                } else {\n                    const lngLatObj = (obj as any as LngLatLike);\n                    return this.extend(LngLat.convert(lngLatObj));\n                }\n\n            } else if (obj && ('lng' in obj || 'lon' in obj) && 'lat' in obj) {\n                return this.extend(LngLat.convert(obj));\n            }\n\n            return this;\n        }\n\n        if (!sw && !ne) {\n            this._sw = new LngLat(sw2.lng, sw2.lat);\n            this._ne = new LngLat(ne2.lng, ne2.lat);\n\n        } else {\n            sw.lng = Math.min(sw2.lng, sw.lng);\n            sw.lat = Math.min(sw2.lat, sw.lat);\n            ne.lng = Math.max(ne2.lng, ne.lng);\n            ne.lat = Math.max(ne2.lat, ne.lat);\n        }\n\n        return this;\n    }\n\n    /**\n     * Returns the geographical coordinate equidistant from the bounding box's corners.\n     *\n     * @returns The bounding box's center.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);\n     * llb.getCenter(); // = LngLat {lng: -73.96365, lat: 40.78315}\n     * ```\n     */\n    getCenter(): LngLat {\n        return new LngLat((this._sw.lng + this._ne.lng) / 2, (this._sw.lat + this._ne.lat) / 2);\n    }\n\n    /**\n     * Returns the southwest corner of the bounding box.\n     *\n     * @returns The southwest corner of the bounding box.\n     */\n    getSouthWest(): LngLat { return this._sw; }\n\n    /**\n     * Returns the northeast corner of the bounding box.\n     *\n     * @returns The northeast corner of the bounding box.\n     */\n    getNorthEast(): LngLat { return this._ne; }\n\n    /**\n     * Returns the northwest corner of the bounding box.\n     *\n     * @returns The northwest corner of the bounding box.\n     */\n    getNorthWest(): LngLat { return new LngLat(this.getWest(), this.getNorth()); }\n\n    /**\n     * Returns the southeast corner of the bounding box.\n     *\n     * @returns The southeast corner of the bounding box.\n     */\n    getSouthEast(): LngLat { return new LngLat(this.getEast(), this.getSouth()); }\n\n    /**\n     * Returns the west edge of the bounding box.\n     *\n     * @returns The west edge of the bounding box.\n     */\n    getWest(): number { return this._sw.lng; }\n\n    /**\n     * Returns the south edge of the bounding box.\n     *\n     * @returns The south edge of the bounding box.\n     */\n    getSouth(): number { return this._sw.lat; }\n\n    /**\n     * Returns the east edge of the bounding box.\n     *\n     * @returns The east edge of the bounding box.\n     */\n    getEast(): number { return this._ne.lng; }\n\n    /**\n     * Returns the north edge of the bounding box.\n     *\n     * @returns The north edge of the bounding box.\n     */\n    getNorth(): number { return this._ne.lat; }\n\n    /**\n     * Returns the bounding box represented as an array.\n     *\n     * @returns The bounding box represented as an array, consisting of the\n     * southwest and northeast coordinates of the bounding represented as arrays of numbers.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);\n     * llb.toArray(); // = [[-73.9876, 40.7661], [-73.9397, 40.8002]]\n     * ```\n     */\n    toArray() {\n        return [this._sw.toArray(), this._ne.toArray()];\n    }\n\n    /**\n     * Return the bounding box represented as a string.\n     *\n     * @returns The bounding box represents as a string of the format\n     * `'LngLatBounds(LngLat(lng, lat), LngLat(lng, lat))'`.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds([-73.9876, 40.7661], [-73.9397, 40.8002]);\n     * llb.toString(); // = \"LngLatBounds(LngLat(-73.9876, 40.7661), LngLat(-73.9397, 40.8002))\"\n     * ```\n     */\n    toString() {\n        return `LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`;\n    }\n\n    /**\n     * Check if the bounding box is an empty/`null`-type box.\n     *\n     * @returns True if bounds have been defined, otherwise false.\n     */\n    isEmpty() {\n        return !(this._sw && this._ne);\n    }\n\n    /**\n     * Check if the point is within the bounding box.\n     *\n     * @param lnglat - geographic point to check against.\n     * @returns `true` if the point is within the bounding box.\n     * @example\n     * ```ts\n     * let llb = new LngLatBounds(\n     *   new LngLat(-73.9876, 40.7661),\n     *   new LngLat(-73.9397, 40.8002)\n     * );\n     *\n     * let ll = new LngLat(-73.9567, 40.7789);\n     *\n     * console.log(llb.contains(ll)); // = true\n     * ```\n     */\n    contains(lnglat: LngLatLike) {\n        const {lng, lat} = LngLat.convert(lnglat);\n\n        const containsLatitude = this._sw.lat <= lat && lat <= this._ne.lat;\n        let containsLongitude = this._sw.lng <= lng && lng <= this._ne.lng;\n        if (this._sw.lng > this._ne.lng) { // wrapped coordinates\n            containsLongitude = this._sw.lng >= lng && lng >= this._ne.lng;\n        }\n\n        return containsLatitude && containsLongitude;\n    }\n\n    /**\n     * Converts an array to a `LngLatBounds` object.\n     *\n     * If a `LngLatBounds` object is passed in, the function returns it unchanged.\n     *\n     * Internally, the function calls `LngLat#convert` to convert arrays to `LngLat` values.\n     *\n     * @param input - An array of two coordinates to convert, or a `LngLatBounds` object to return.\n     * @returns A new `LngLatBounds` object, if a conversion occurred, or the original `LngLatBounds` object.\n     * @example\n     * ```ts\n     * let arr = [[-73.9876, 40.7661], [-73.9397, 40.8002]];\n     * let llb = LngLatBounds.convert(arr); // = LngLatBounds {_sw: LngLat {lng: -73.9876, lat: 40.7661}, _ne: LngLat {lng: -73.9397, lat: 40.8002}}\n     * ```\n     */\n    static convert(input: LngLatBoundsLike | null): LngLatBounds {\n        if (input instanceof LngLatBounds) return input;\n        if (!input) return input as null;\n        return new LngLatBounds(input);\n    }\n\n    /**\n     * Returns a `LngLatBounds` from the coordinates extended by a given `radius`. The returned `LngLatBounds` completely contains the `radius`.\n     *\n     * @param center - center coordinates of the new bounds.\n     * @param radius - Distance in meters from the coordinates to extend the bounds.\n     * @returns A new `LngLatBounds` object representing the coordinates extended by the `radius`.\n     * @example\n     * ```ts\n     * let center = new LngLat(-73.9749, 40.7736);\n     * LngLatBounds.fromLngLat(100).toArray(); // = [[-73.97501862141328, 40.77351016847229], [-73.97478137858673, 40.77368983152771]]\n     * ```\n     */\n    static fromLngLat(center: LngLat, radius:number = 0): LngLatBounds {\n        const earthCircumferenceInMetersAtEquator = 40075017;\n        const latAccuracy = 360 * radius / earthCircumferenceInMetersAtEquator,\n            lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * center.lat);\n\n        return new LngLatBounds(new LngLat(center.lng - lngAccuracy, center.lat - latAccuracy),\n            new LngLat(center.lng + lngAccuracy, center.lat + latAccuracy));\n    }\n\n    /**\n     * Adjusts the given bounds to handle the case where the bounds cross the 180th meridian (antimeridian).\n     *\n     * @returns The adjusted LngLatBounds\n     * @example\n     * ```ts\n     * let bounds = new LngLatBounds([175.813127, -20.157768], [-178. 340903, -15.449124]);\n     * let adjustedBounds = bounds.adjustAntiMeridian();\n     * // adjustedBounds will be: [[175.813127, -20.157768], [181.659097, -15.449124]]\n     * ```\n     */\n    adjustAntiMeridian(): LngLatBounds {\n        const sw = new LngLat(this._sw.lng, this._sw.lat);\n        const ne = new LngLat(this._ne.lng, this._ne.lat);\n\n        if (sw.lng > ne.lng) {\n            return new LngLatBounds(\n                sw,\n                new LngLat(ne.lng + 360, ne.lat)\n            );\n        }\n\n        return new LngLatBounds(sw, ne);\n    }\n\n}\n", "import {LngLatBounds, LngLatBoundsLike} from '../geo/lng_lat_bounds';\nimport {mercatorXfromLng, mercatorYfromLat} from '../geo/mercator_coordinate';\n\nimport type {CanonicalTileID} from './tile_id';\n\nexport class TileBounds {\n    bounds: LngLatBounds;\n    minzoom: number;\n    maxzoom: number;\n\n    constructor(bounds: [number, number, number, number], minzoom?: number | null, maxzoom?: number | null) {\n        this.bounds = LngLatBounds.convert(this.validateBounds(bounds));\n        this.minzoom = minzoom || 0;\n        this.maxzoom = maxzoom || 24;\n    }\n\n    validateBounds(bounds: [number, number, number, number]): LngLatBoundsLike {\n        // make sure the bounds property contains valid longitude and latitudes\n        if (!Array.isArray(bounds) || bounds.length !== 4) return [-180, -90, 180, 90];\n        return [Math.max(-180, bounds[0]), Math.max(-90, bounds[1]), Math.min(180, bounds[2]), Math.min(90, bounds[3])];\n    }\n\n    contains(tileID: CanonicalTileID) {\n        const worldSize = Math.pow(2, tileID.z);\n        const level = {\n            minX: Math.floor(mercatorXfromLng(this.bounds.getWest()) * worldSize),\n            minY: Math.floor(mercatorYfromLat(this.bounds.getNorth()) * worldSize),\n            maxX: Math.ceil(mercatorXfromLng(this.bounds.getEast()) * worldSize),\n            maxY: Math.ceil(mercatorYfromLat(this.bounds.getSouth()) * worldSize)\n        };\n        const hit = tileID.x >= level.minX && tileID.x < level.maxX && tileID.y >= level.minY && tileID.y < level.maxY;\n        return hit;\n    }\n}\n", "import {Event, ErrorEvent, Evented} from '../util/evented';\n\nimport {extend, pick} from '../util/util';\nimport {loadTileJson} from './load_tilejson';\nimport {TileBounds} from './tile_bounds';\nimport {ResourceType} from '../util/request_manager';\n\nimport type {Source} from './source';\nimport type {OverscaledTileID} from './tile_id';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from './tile';\nimport type {VectorSourceSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {WorkerTileResult} from './worker_source';\nimport {MessageType} from '../util/actor_messages';\n\nexport type VectorTileSourceOptions = VectorSourceSpecification & {\n    collectResourceTiming?: boolean;\n    tileSize?: number;\n}\n\n/**\n * A source containing vector tiles in [Mapbox Vector Tile format](https://docs.mapbox.com/vector-tiles/reference/).\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *     type: 'vector',\n *     url: 'https://demotiles.maplibre.org/tiles/tiles.json'\n * });\n * ```\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *     type: 'vector',\n *     tiles: ['https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt'],\n *     minzoom: 6,\n *     maxzoom: 14\n * });\n * ```\n *\n * @example\n * ```ts\n * map.getSource('some id').setUrl(\"https://demotiles.maplibre.org/tiles/tiles.json\");\n * ```\n *\n * @example\n * ```ts\n * map.getSource('some id').setTiles(['https://d25uarhxywzl1j.cloudfront.net/v0.1/{z}/{x}/{y}.mvt']);\n * ```\n * @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js/docs/examples/vector-source/)\n */\nexport class VectorTileSource extends Evented implements Source {\n    type: 'vector';\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    url: string;\n    scheme: string;\n    tileSize: number;\n    promoteId: PromoteIdSpecification;\n\n    _options: VectorSourceSpecification;\n    _collectResourceTiming: boolean;\n    dispatcher: Dispatcher;\n    map: Map;\n    bounds: [number, number, number, number];\n    tiles: Array<string>;\n    tileBounds: TileBounds;\n    reparseOverscaled: boolean;\n    isTileClipped: boolean;\n    _tileJSONRequest: AbortController;\n    _loaded: boolean;\n\n    constructor(id: string, options: VectorTileSourceOptions, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n\n        this.type = 'vector';\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.scheme = 'xyz';\n        this.tileSize = 512;\n        this.reparseOverscaled = true;\n        this.isTileClipped = true;\n        this._loaded = false;\n\n        extend(this, pick(options, ['url', 'scheme', 'tileSize', 'promoteId']));\n        this._options = extend({type: 'vector'}, options);\n\n        this._collectResourceTiming = options.collectResourceTiming;\n\n        if (this.tileSize !== 512) {\n            throw new Error('vector tile sources must have a tileSize of 512');\n        }\n\n        this.setEventedParent(eventedParent);\n    }\n\n    async load() {\n        this._loaded = false;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n        this._tileJSONRequest = new AbortController();\n        try {\n            const tileJSON = await loadTileJson(this._options, this.map._requestManager, this._tileJSONRequest);\n            this._tileJSONRequest = null;\n            this._loaded = true;\n            this.map.style.sourceCaches[this.id].clearTiles();\n            if (tileJSON) {\n                extend(this, tileJSON);\n                if (tileJSON.bounds) this.tileBounds = new TileBounds(tileJSON.bounds, this.minzoom, this.maxzoom);\n\n                // `content` is included here to prevent a race condition where `Style#_updateSources` is called\n                // before the TileJSON arrives. this makes sure the tiles needed are loaded once TileJSON arrives\n                // ref: https://github.com/mapbox/mapbox-gl-js/pull/4347#discussion_r104418088\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'metadata'}));\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'content'}));\n            }\n        } catch (err) {\n            this._tileJSONRequest = null;\n            this.fire(new ErrorEvent(err));\n        }\n    }\n\n    loaded(): boolean {\n        return this._loaded;\n    }\n\n    hasTile(tileID: OverscaledTileID) {\n        return !this.tileBounds || this.tileBounds.contains(tileID.canonical);\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    setSourceProperty(callback: Function) {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n        }\n\n        callback();\n\n        this.load();\n    }\n\n    /**\n     * Sets the source `tiles` property and re-renders the map.\n     *\n     * @param tiles - An array of one or more tile source URLs, as in the TileJSON spec.\n     */\n    setTiles(tiles: Array<string>): this {\n        this.setSourceProperty(() => {\n            this._options.tiles = tiles;\n        });\n\n        return this;\n    }\n\n    /**\n     * Sets the source `url` property and re-renders the map.\n     *\n     * @param url - A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.\n     */\n    setUrl(url: string): this {\n        this.setSourceProperty(() => {\n            this.url = url;\n            this._options.url = url;\n        });\n\n        return this;\n    }\n\n    onRemove() {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n            this._tileJSONRequest = null;\n        }\n    }\n\n    serialize(): VectorSourceSpecification {\n        return extend({}, this._options);\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        const params = {\n            request: this.map._requestManager.transformRequest(url, ResourceType.Tile),\n            uid: tile.uid,\n            tileID: tile.tileID,\n            zoom: tile.tileID.overscaledZ,\n            tileSize: this.tileSize * tile.tileID.overscaleFactor(),\n            type: this.type,\n            source: this.id,\n            pixelRatio: this.map.getPixelRatio(),\n            showCollisionBoxes: this.map.showCollisionBoxes,\n            promoteId: this.promoteId\n        };\n        params.request.collectResourceTiming = this._collectResourceTiming;\n        let messageType: MessageType.loadTile | MessageType.reloadTile = MessageType.reloadTile;\n        if (!tile.actor || tile.state === 'expired') {\n            tile.actor = this.dispatcher.getActor();\n            messageType = MessageType.loadTile;\n        } else if (tile.state === 'loading') {\n            return new Promise<void>((resolve, reject) => {\n                tile.reloadPromise = {resolve, reject};\n            });\n        }\n        tile.abortController = new AbortController();\n        try {\n            const data = await tile.actor.sendAsync({type: messageType, data: params}, tile.abortController);\n            delete tile.abortController;\n\n            if (tile.aborted) {\n                return;\n            }\n            this._afterTileLoadWorkerResponse(tile, data);\n        } catch (err) {\n            delete tile.abortController;\n\n            if (tile.aborted) {\n                return;\n            }\n            if (err && err.status !== 404) {\n                throw err;\n            }\n            this._afterTileLoadWorkerResponse(tile, null);\n        }\n    }\n\n    private _afterTileLoadWorkerResponse(tile: Tile, data: WorkerTileResult) {\n        if (data && data.resourceTiming) {\n            tile.resourceTiming = data.resourceTiming;\n        }\n\n        if (data && this.map._refreshExpiredTiles) {\n            tile.setExpiryData(data);\n        }\n        tile.loadVectorData(data, this.map.painter);\n\n        if (tile.reloadPromise) {\n            const reloadPromise = tile.reloadPromise;\n            tile.reloadPromise = null;\n            this.loadTile(tile).then(reloadPromise.resolve).catch(reloadPromise.reject);\n        }\n    }\n\n    async abortTile(tile: Tile): Promise<void> {\n        if (tile.abortController) {\n            tile.abortController.abort();\n            delete tile.abortController;\n        }\n        if (tile.actor) {\n            await tile.actor.sendAsync({\n                type: MessageType.abortTile,\n                data: {uid: tile.uid, type: this.type, source: this.id}\n            });\n        }\n    }\n\n    async unloadTile(tile: Tile): Promise<void> {\n        tile.unloadVectorData();\n        if (tile.actor) {\n            await tile.actor.sendAsync({\n                type: MessageType.removeTile,\n                data: {\n                    uid: tile.uid,\n                    type: this.type,\n                    source: this.id}\n            });\n        }\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n", "import {extend, pick} from '../util/util';\n\nimport {ImageRequest} from '../util/image_request';\n\nimport {ResourceType} from '../util/request_manager';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {loadTileJson} from './load_tilejson';\nimport {TileBounds} from './tile_bounds';\nimport {Texture} from '../render/texture';\n\nimport type {Source} from './source';\nimport type {OverscaledTileID} from './tile_id';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from './tile';\nimport type {\n    RasterSourceSpecification,\n    RasterDEMSourceSpecification\n} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A source containing raster tiles (See the [Style Specification](https://maplibre.org/maplibre-style-spec/) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('raster-source', {\n *     'type': 'raster',\n *     'tiles': ['https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.jpg'],\n *     'tileSize': 256,\n * });\n * ```\n *\n * @example\n * ```ts\n * map.addSource('wms-test-source', {\n *      'type': 'raster',\n * // use the tiles option to specify a WMS tile source URL\n *      'tiles': [\n *          'https://img.nj.gov/imagerywms/Natural2015?bbox={bbox-epsg-3857}&format=image/png&service=WMS&version=1.1.1&request=GetMap&srs=EPSG:3857&transparent=true&width=256&height=256&layers=Natural2015'\n *      ],\n *      'tileSize': 256\n * });\n * ```\n * @see [Add a raster tile source](https://maplibre.org/maplibre-gl-js/docs/examples/map-tiles/)\n * @see [Add a WMS source](https://maplibre.org/maplibre-gl-js/docs/examples/wms/)\n * @see [Display a satellite map](https://maplibre.org/maplibre-gl-js/docs/examples/satellite-map/)\n */\nexport class RasterTileSource extends Evented implements Source {\n    type: 'raster' | 'raster-dem';\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    url: string;\n    scheme: string;\n    tileSize: number;\n\n    bounds: [number, number, number, number];\n    tileBounds: TileBounds;\n    roundZoom: boolean;\n    dispatcher: Dispatcher;\n    map: Map;\n    tiles: Array<string>;\n\n    _loaded: boolean;\n    _options: RasterSourceSpecification | RasterDEMSourceSpecification;\n    _tileJSONRequest: AbortController;\n\n    constructor(id: string, options: RasterSourceSpecification | RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n        this.setEventedParent(eventedParent);\n\n        this.type = 'raster';\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.roundZoom = true;\n        this.scheme = 'xyz';\n        this.tileSize = 512;\n        this._loaded = false;\n\n        this._options = extend({type: 'raster'}, options);\n        extend(this, pick(options, ['url', 'scheme', 'tileSize']));\n    }\n\n    async load() {\n        this._loaded = false;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n        this._tileJSONRequest = new AbortController();\n        try {\n            const tileJSON = await loadTileJson(this._options, this.map._requestManager, this._tileJSONRequest);\n            this._tileJSONRequest = null;\n            this._loaded = true;\n            if (tileJSON) {\n                extend(this, tileJSON);\n                if (tileJSON.bounds) this.tileBounds = new TileBounds(tileJSON.bounds, this.minzoom, this.maxzoom);\n\n                // `content` is included here to prevent a race condition where `Style#_updateSources` is called\n                // before the TileJSON arrives. this makes sure the tiles needed are loaded once TileJSON arrives\n                // ref: https://github.com/mapbox/mapbox-gl-js/pull/4347#discussion_r104418088\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'metadata'}));\n                this.fire(new Event('data', {dataType: 'source', sourceDataType: 'content'}));\n            }\n        } catch (err) {\n            this._tileJSONRequest = null;\n            this.fire(new ErrorEvent(err));\n        }\n    }\n\n    loaded(): boolean {\n        return this._loaded;\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    onRemove() {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n            this._tileJSONRequest = null;\n        }\n    }\n\n    setSourceProperty(callback: Function) {\n        if (this._tileJSONRequest) {\n            this._tileJSONRequest.abort();\n            this._tileJSONRequest = null;\n        }\n\n        callback();\n\n        this.load();\n    }\n\n    /**\n     * Sets the source `tiles` property and re-renders the map.\n     *\n     * @param tiles - An array of one or more tile source URLs, as in the raster tiles spec (See the [Style Specification](https://maplibre.org/maplibre-style-spec/)\n     */\n    setTiles(tiles: Array<string>): this {\n        this.setSourceProperty(() => {\n            this._options.tiles = tiles;\n        });\n\n        return this;\n    }\n\n    /**\n     * Sets the source `url` property and re-renders the map.\n     *\n     * @param url - A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.\n     */\n    setUrl(url: string): this {\n        this.setSourceProperty(() => {\n            this.url = url;\n            this._options.url = url;\n        });\n\n        return this;\n    }\n\n    serialize() {\n        return extend({}, this._options);\n    }\n\n    hasTile(tileID: OverscaledTileID) {\n        return !this.tileBounds || this.tileBounds.contains(tileID.canonical);\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        tile.abortController = new AbortController();\n        try {\n            const response = await ImageRequest.getImage(this.map._requestManager.transformRequest(url, ResourceType.Tile), tile.abortController, this.map._refreshExpiredTiles);\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n                return;\n            }\n            if (response && response.data) {\n                if (this.map._refreshExpiredTiles && response.cacheControl && response.expires) {\n                    tile.setExpiryData({cacheControl: response.cacheControl, expires: response.expires});\n                }\n                const context = this.map.painter.context;\n                const gl = context.gl;\n                const img = response.data;\n                tile.texture = this.map.painter.getTileTexture(img.width);\n                if (tile.texture) {\n                    tile.texture.update(img, {useMipmap: true});\n                } else {\n                    tile.texture = new Texture(context, img, gl.RGBA, {useMipmap: true});\n                    tile.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n                }\n                tile.state = 'loaded';\n            }\n        } catch (err) {\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n            } else if (err) {\n                tile.state = 'errored';\n                throw err;\n            }\n        }\n    }\n\n    async abortTile(tile: Tile) {\n        if (tile.abortController) {\n            tile.abortController.abort();\n            delete tile.abortController;\n        }\n    }\n\n    async unloadTile(tile: Tile) {\n        if (tile.texture) {\n            this.map.painter.saveTileTexture(tile.texture);\n        }\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n", "import {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\nimport {extend, isImageBitmap, readImageUsingVideoFrame} from '../util/util';\nimport {Evented} from '../util/evented';\nimport {browser} from '../util/browser';\nimport {offscreenCanvasSupported} from '../util/offscreen_canvas_supported';\nimport {OverscaledTileID} from './tile_id';\nimport {RasterTileSource} from './raster_tile_source';\n// ensure DEMData is registered for worker transfer on main thread:\nimport '../data/dem_data';\nimport type {DEMEncoding} from '../data/dem_data';\n\nimport type {Source} from './source';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from './tile';\nimport type {RasterDEMSourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {isOffscreenCanvasDistorted} from '../util/offscreen_canvas_distorted';\nimport {RGBAImage} from '../util/image';\nimport {MessageType} from '../util/actor_messages';\n\n/**\n * A source containing raster DEM tiles (See the [Style Specification](https://maplibre.org/maplibre-style-spec/) for detailed documentation of options.)\n * This source can be used to show hillshading and 3D terrain\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('raster-dem-source', {\n *      type: 'raster-dem',\n *      url: 'https://demotiles.maplibre.org/terrain-tiles/tiles.json',\n *      tileSize: 256\n * });\n * ```\n * @see [3D Terrain](https://maplibre.org/maplibre-gl-js/docs/examples/3d-terrain/)\n */\nexport class RasterDEMTileSource extends RasterTileSource implements Source {\n    encoding: DEMEncoding;\n    redFactor?: number;\n    greenFactor?: number;\n    blueFactor?: number;\n    baseShift?: number;\n\n    constructor(id: string, options: RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super(id, options, dispatcher, eventedParent);\n        this.type = 'raster-dem';\n        this.maxzoom = 22;\n        this._options = extend({type: 'raster-dem'}, options);\n        this.encoding = options.encoding || 'mapbox';\n        this.redFactor = options.redFactor;\n        this.greenFactor = options.greenFactor;\n        this.blueFactor = options.blueFactor;\n        this.baseShift = options.baseShift;\n    }\n\n    override async loadTile(tile: Tile): Promise<void> {\n        const url = tile.tileID.canonical.url(this.tiles, this.map.getPixelRatio(), this.scheme);\n        const request = this.map._requestManager.transformRequest(url, ResourceType.Tile);\n        tile.neighboringTiles = this._getNeighboringTiles(tile.tileID);\n        tile.abortController = new AbortController();\n        try {\n            const response = await ImageRequest.getImage(request, tile.abortController, this.map._refreshExpiredTiles);\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n                return;\n            }\n            if (response && response.data) {\n                const img = response.data;\n                if (this.map._refreshExpiredTiles && response.cacheControl && response.expires) {\n                    tile.setExpiryData({cacheControl: response.cacheControl, expires: response.expires});\n                }\n                const transfer = isImageBitmap(img) && offscreenCanvasSupported();\n                const rawImageData = transfer ? img : await this.readImageNow(img);\n                const params = {\n                    type: this.type,\n                    uid: tile.uid,\n                    source: this.id,\n                    rawImageData,\n                    encoding: this.encoding,\n                    redFactor: this.redFactor,\n                    greenFactor: this.greenFactor,\n                    blueFactor: this.blueFactor,\n                    baseShift: this.baseShift\n                };\n\n                if (!tile.actor || tile.state === 'expired') {\n                    tile.actor = this.dispatcher.getActor();\n                    /* eslint-disable require-atomic-updates */\n                    const data = await tile.actor.sendAsync({type: MessageType.loadDEMTile, data: params});\n                    tile.dem = data;\n                    tile.needsHillshadePrepare = true;\n                    tile.needsTerrainPrepare = true;\n                    tile.state = 'loaded';\n                    /* eslint-enable require-atomic-updates */\n                }\n            }\n        } catch (err) {\n            delete tile.abortController;\n            if (tile.aborted) {\n                tile.state = 'unloaded';\n            } else if (err) {\n                tile.state = 'errored';\n                throw err;\n            }\n        }\n    }\n\n    async readImageNow(img: ImageBitmap | HTMLImageElement): Promise<RGBAImage | ImageData> {\n        if (typeof VideoFrame !== 'undefined' && isOffscreenCanvasDistorted()) {\n            const width = img.width + 2;\n            const height = img.height + 2;\n            try {\n                return new RGBAImage({width, height}, await readImageUsingVideoFrame(img, -1, -1, width, height));\n            } catch (e) {\n                // fall-back to browser canvas decoding\n            }\n        }\n        return browser.getImageData(img, 1);\n    }\n\n    _getNeighboringTiles(tileID: OverscaledTileID) {\n        const canonical = tileID.canonical;\n        const dim = Math.pow(2, canonical.z);\n\n        const px = (canonical.x - 1 + dim) % dim;\n        const pxw = canonical.x === 0 ? tileID.wrap - 1 : tileID.wrap;\n        const nx = (canonical.x + 1 + dim) % dim;\n        const nxw = canonical.x + 1 === dim ? tileID.wrap + 1 : tileID.wrap;\n\n        const neighboringTiles = {};\n        // add adjacent tiles\n        neighboringTiles[new OverscaledTileID(tileID.overscaledZ, pxw, canonical.z, px, canonical.y).key] = {backfilled: false};\n        neighboringTiles[new OverscaledTileID(tileID.overscaledZ, nxw, canonical.z, nx, canonical.y).key] = {backfilled: false};\n\n        // Add upper neighboringTiles\n        if (canonical.y > 0) {\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, pxw, canonical.z, px, canonical.y - 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, tileID.wrap, canonical.z, canonical.x, canonical.y - 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, nxw, canonical.z, nx, canonical.y - 1).key] = {backfilled: false};\n        }\n        // Add lower neighboringTiles\n        if (canonical.y + 1 < dim) {\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, pxw, canonical.z, px, canonical.y + 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, tileID.wrap, canonical.z, canonical.x, canonical.y + 1).key] = {backfilled: false};\n            neighboringTiles[new OverscaledTileID(tileID.overscaledZ, nxw, canonical.z, nx, canonical.y + 1).key] = {backfilled: false};\n        }\n\n        return neighboringTiles;\n    }\n\n    async unloadTile(tile: Tile) {\n        if (tile.demTexture) this.map.painter.saveTileTexture(tile.demTexture);\n        if (tile.fbo) {\n            tile.fbo.destroy();\n            delete tile.fbo;\n        }\n        if (tile.dem) delete tile.dem;\n        delete tile.neighboringTiles;\n\n        tile.state = 'unloaded';\n        if (tile.actor) {\n            await tile.actor.sendAsync({type: MessageType.removeDEMTile, data: {type: this.type, uid: tile.uid, source: this.id}});\n        }\n    }\n}\n", "import {Event, ErrorEvent, Evented} from '../util/evented';\n\nimport {extend, warnOnce} from '../util/util';\nimport {EXTENT} from '../data/extent';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\n\nimport type {Source} from './source';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from './tile';\nimport type {Actor} from '../util/actor';\nimport type {GeoJSONSourceSpecification, PromoteIdSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {GeoJSONSourceDiff} from './geojson_source_diff';\nimport type {GeoJSONWorkerOptions, LoadGeoJSONParameters} from './geojson_worker_source';\nimport {MessageType} from '../util/actor_messages';\n\n/**\n * Options object for GeoJSONSource.\n */\nexport type GeoJSONSourceOptions = GeoJSONSourceSpecification & {\n    workerOptions?: GeoJSONWorkerOptions;\n    collectResourceTiming?: boolean;\n    data: GeoJSON.GeoJSON | string;\n}\n\nexport type GeoJSONSourceInternalOptions = {\n    data?: GeoJSON.GeoJSON | string | undefined;\n    cluster?: boolean;\n    clusterMaxZoom?: number;\n    clusterRadius?: number;\n    clusterMinPoints?: number;\n    generateId?: boolean;\n}\n\n/**\n * The cluster options to set\n */\nexport type SetClusterOptions = {\n    /**\n     * Whether or not to cluster\n     */\n    cluster?: boolean;\n    /**\n     * The cluster's max zoom\n     */\n    clusterMaxZoom?: number;\n    /**\n     * The cluster's radius\n     */\n    clusterRadius?: number;\n}\n\n/**\n * A source containing GeoJSON.\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-geojson) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *     type: 'geojson',\n *     data: 'https://d2ad6b4ur7yvpq.cloudfront.net/naturalearth-3.3.0/ne_10m_ports.geojson'\n * });\n * ```\n *\n * @example\n * ```ts\n * map.addSource('some id', {\n *    type: 'geojson',\n *    data: {\n *        \"type\": \"FeatureCollection\",\n *        \"features\": [{\n *            \"type\": \"Feature\",\n *            \"properties\": {},\n *            \"geometry\": {\n *                \"type\": \"Point\",\n *                \"coordinates\": [\n *                    -76.53063297271729,\n *                    39.18174077994108\n *                ]\n *            }\n *        }]\n *    }\n * });\n * ```\n *\n * @example\n * ```ts\n * map.getSource('some id').setData({\n *   \"type\": \"FeatureCollection\",\n *   \"features\": [{\n *       \"type\": \"Feature\",\n *       \"properties\": { \"name\": \"Null Island\" },\n *       \"geometry\": {\n *           \"type\": \"Point\",\n *           \"coordinates\": [ 0, 0 ]\n *       }\n *   }]\n * });\n * ```\n * @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js/docs/examples/geojson-markers/)\n * @see [Add a GeoJSON line](https://maplibre.org/maplibre-gl-js/docs/examples/geojson-line/)\n * @see [Create a heatmap from points](https://maplibre.org/maplibre-gl-js/docs/examples/heatmap-layer/)\n * @see [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/cluster/)\n */\nexport class GeoJSONSource extends Evented implements Source {\n    type: 'geojson';\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    tileSize: number;\n    attribution: string;\n    promoteId: PromoteIdSpecification;\n\n    isTileClipped: boolean;\n    reparseOverscaled: boolean;\n    _data: GeoJSON.GeoJSON | string | undefined;\n    _options: GeoJSONSourceInternalOptions;\n    workerOptions: GeoJSONWorkerOptions;\n    map: Map;\n    actor: Actor;\n    _pendingLoads: number;\n    _collectResourceTiming: boolean;\n    _removed: boolean;\n\n    /** @internal */\n    constructor(id: string, options: GeoJSONSourceOptions, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n\n        this.id = id;\n\n        // `type` is a property rather than a constant to make it easy for 3rd\n        // parties to use GeoJSONSource to build their own source types.\n        this.type = 'geojson';\n\n        this.minzoom = 0;\n        this.maxzoom = 18;\n        this.tileSize = 512;\n        this.isTileClipped = true;\n        this.reparseOverscaled = true;\n        this._removed = false;\n        this._pendingLoads = 0;\n\n        this.actor = dispatcher.getActor();\n        this.setEventedParent(eventedParent);\n\n        this._data = (options.data as any);\n        this._options = extend({}, options);\n\n        this._collectResourceTiming = options.collectResourceTiming;\n\n        if (options.maxzoom !== undefined) this.maxzoom = options.maxzoom;\n        if (options.type) this.type = options.type;\n        if (options.attribution) this.attribution = options.attribution;\n        this.promoteId = options.promoteId;\n\n        const scale = EXTENT / this.tileSize;\n\n        if (options.clusterMaxZoom !== undefined && this.maxzoom <= options.clusterMaxZoom) {\n            warnOnce(`The maxzoom value \"${this.maxzoom}\" is expected to be greater than the clusterMaxZoom value \"${options.clusterMaxZoom}\".`);\n        }\n\n        // sent to the worker, along with `url: ...` or `data: literal geojson`,\n        // so that it can load/parse/index the geojson data\n        // extending with `options.workerOptions` helps to make it easy for\n        // third-party sources to hack/reuse GeoJSONSource.\n        this.workerOptions = extend({\n            source: this.id,\n            cluster: options.cluster || false,\n            geojsonVtOptions: {\n                buffer: (options.buffer !== undefined ? options.buffer : 128) * scale,\n                tolerance: (options.tolerance !== undefined ? options.tolerance : 0.375) * scale,\n                extent: EXTENT,\n                maxZoom: this.maxzoom,\n                lineMetrics: options.lineMetrics || false,\n                generateId: options.generateId || false\n            },\n            superclusterOptions: {\n                maxZoom: options.clusterMaxZoom !== undefined ? options.clusterMaxZoom : this.maxzoom - 1,\n                minPoints: Math.max(2, options.clusterMinPoints || 2),\n                extent: EXTENT,\n                radius: (options.clusterRadius || 50) * scale,\n                log: false,\n                generateId: options.generateId || false\n            },\n            clusterProperties: options.clusterProperties,\n            filter: options.filter\n        }, options.workerOptions);\n\n        // send the promoteId to the worker to have more flexible updates, but only if it is a string\n        if (typeof this.promoteId === 'string') {\n            this.workerOptions.promoteId = this.promoteId;\n        }\n    }\n\n    async load() {\n        await this._updateWorkerData();\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    /**\n     * Sets the GeoJSON data and re-renders the map.\n     *\n     * @param data - A GeoJSON data object or a URL to one. The latter is preferable in the case of large GeoJSON files.\n     */\n    setData(data: GeoJSON.GeoJSON | string): this {\n        this._data = data;\n        this._updateWorkerData();\n\n        return this;\n    }\n\n    /**\n     * Updates the source's GeoJSON, and re-renders the map.\n     *\n     * For sources with lots of features, this method can be used to make updates more quickly.\n     *\n     * This approach requires unique IDs for every feature in the source. The IDs can either be specified on the feature,\n     * or by using the promoteId option to specify which property should be used as the ID.\n     *\n     * It is an error to call updateData on a source that did not have unique IDs for each of its features already.\n     *\n     * Updates are applied on a best-effort basis, updating an ID that does not exist will not result in an error.\n     *\n     * @param diff - The changes that need to be applied.\n     */\n    updateData(diff: GeoJSONSourceDiff): this {\n        this._updateWorkerData(diff);\n\n        return this;\n    }\n\n    /**\n     * Allows to get the source's actual GeoJSON data.\n     *\n     * @returns a promise which resolves to the source's actual GeoJSON data\n     */\n    async getData(): Promise<GeoJSON.GeoJSON> {\n        const options: LoadGeoJSONParameters = extend({type: this.type}, this.workerOptions);\n        return this.actor.sendAsync({type: MessageType.getData, data: options});\n    }\n\n    /**\n     * To disable/enable clustering on the source options\n     * @param options - The options to set\n     * @example\n     * ```ts\n     * map.getSource('some id').setClusterOptions({cluster: false});\n     * map.getSource('some id').setClusterOptions({cluster: false, clusterRadius: 50, clusterMaxZoom: 14});\n     * ```\n     */\n    setClusterOptions(options: SetClusterOptions): this {\n        this.workerOptions.cluster = options.cluster;\n        if (options) {\n            if (options.clusterRadius !== undefined) this.workerOptions.superclusterOptions.radius = options.clusterRadius;\n            if (options.clusterMaxZoom !== undefined) this.workerOptions.superclusterOptions.maxZoom = options.clusterMaxZoom;\n        }\n        this._updateWorkerData();\n        return this;\n    }\n\n    /**\n     * For clustered sources, fetches the zoom at which the given cluster expands.\n     *\n     * @param clusterId - The value of the cluster's `cluster_id` property.\n     * @returns a promise that is resolved with the zoom number\n     */\n    getClusterExpansionZoom(clusterId: number): Promise<number> {\n        return this.actor.sendAsync({type: MessageType.getClusterExpansionZoom, data: {type: this.type, clusterId, source: this.id}});\n    }\n\n    /**\n     * For clustered sources, fetches the children of the given cluster on the next zoom level (as an array of GeoJSON features).\n     *\n     * @param clusterId - The value of the cluster's `cluster_id` property.\n     * @returns a promise that is resolved when the features are retrieved\n     */\n    getClusterChildren(clusterId: number): Promise<Array<GeoJSON.Feature>> {\n        return this.actor.sendAsync({type: MessageType.getClusterChildren, data: {type: this.type, clusterId, source: this.id}});\n    }\n\n    /**\n     * For clustered sources, fetches the original points that belong to the cluster (as an array of GeoJSON features).\n     *\n     * @param clusterId - The value of the cluster's `cluster_id` property.\n     * @param limit - The maximum number of features to return.\n     * @param offset - The number of features to skip (e.g. for pagination).\n     * @returns a promise that is resolved when the features are retrieved\n     * @example\n     * Retrieve cluster leaves on click\n     * ```ts\n     * map.on('click', 'clusters', (e) => {\n     *   let features = map.queryRenderedFeatures(e.point, {\n     *     layers: ['clusters']\n     *   });\n     *\n     *   let clusterId = features[0].properties.cluster_id;\n     *   let pointCount = features[0].properties.point_count;\n     *   let clusterSource = map.getSource('clusters');\n     *\n     *   const features = await clusterSource.getClusterLeaves(clusterId, pointCount);\n     *   // Print cluster leaves in the console\n     *   console.log('Cluster leaves:', features);\n     * });\n     * ```\n     */\n    getClusterLeaves(clusterId: number, limit: number, offset: number): Promise<Array<GeoJSON.Feature>> {\n        return this.actor.sendAsync({type: MessageType.getClusterLeaves, data: {\n            type: this.type,\n            source: this.id,\n            clusterId,\n            limit,\n            offset\n        }});\n    }\n\n    /**\n     * Responsible for invoking WorkerSource's geojson.loadData target, which\n     * handles loading the geojson data and preparing to serve it up as tiles,\n     * using geojson-vt or supercluster as appropriate.\n     * @param diff - the diff object\n     */\n    async _updateWorkerData(diff?: GeoJSONSourceDiff) {\n        const options: LoadGeoJSONParameters = extend({type: this.type}, this.workerOptions);\n        if (diff) {\n            options.dataDiff = diff;\n        } else if (typeof this._data === 'string') {\n            options.request = this.map._requestManager.transformRequest(browser.resolveURL(this._data as string), ResourceType.Source);\n            options.request.collectResourceTiming = this._collectResourceTiming;\n        } else {\n            options.data = JSON.stringify(this._data);\n        }\n        this._pendingLoads++;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n        try {\n            const result = await this.actor.sendAsync({type: MessageType.loadData, data: options});\n            this._pendingLoads--;\n            if (this._removed || result.abandoned) {\n                this.fire(new Event('dataabort', {dataType: 'source'}));\n                return;\n            }\n\n            let resourceTiming: PerformanceResourceTiming[] = null;\n            if (result.resourceTiming && result.resourceTiming[this.id]) {\n                resourceTiming = result.resourceTiming[this.id].slice(0);\n            }\n\n            const data: any = {dataType: 'source'};\n            if (this._collectResourceTiming && resourceTiming && resourceTiming.length > 0) {\n                extend(data, {resourceTiming});\n            }\n\n            // although GeoJSON sources contain no metadata, we fire this event to let the SourceCache\n            // know its ok to start requesting tiles.\n            this.fire(new Event('data', {...data, sourceDataType: 'metadata'}));\n            this.fire(new Event('data', {...data, sourceDataType: 'content'}));\n        } catch (err) {\n            this._pendingLoads--;\n            if (this._removed) {\n                this.fire(new Event('dataabort', {dataType: 'source'}));\n                return;\n            }\n            this.fire(new ErrorEvent(err));\n        }\n    }\n\n    loaded(): boolean {\n        return this._pendingLoads === 0;\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        const message = !tile.actor ?  MessageType.loadTile :  MessageType.reloadTile;\n        tile.actor = this.actor;\n        const params = {\n            type: this.type,\n            uid: tile.uid,\n            tileID: tile.tileID,\n            zoom: tile.tileID.overscaledZ,\n            maxZoom: this.maxzoom,\n            tileSize: this.tileSize,\n            source: this.id,\n            pixelRatio: this.map.getPixelRatio(),\n            showCollisionBoxes: this.map.showCollisionBoxes,\n            promoteId: this.promoteId\n        };\n\n        tile.abortController = new AbortController();\n        const data = await this.actor.sendAsync({type: message, data: params}, tile.abortController);\n        delete tile.abortController;\n        tile.unloadVectorData();\n\n        if (!tile.aborted) {\n            tile.loadVectorData(data, this.map.painter, message ===  MessageType.reloadTile);\n        }\n    }\n\n    async abortTile(tile: Tile) {\n        if (tile.abortController) {\n            tile.abortController.abort();\n            delete tile.abortController;\n        }\n        tile.aborted = true;\n    }\n\n    async unloadTile(tile: Tile) {\n        tile.unloadVectorData();\n        await this.actor.sendAsync({type: MessageType.removeTile, data: {uid: tile.uid, type: this.type, source: this.id}});\n    }\n\n    onRemove() {\n        this._removed = true;\n        this.actor.sendAsync({type: MessageType.removeSource, data: {type: this.type, source: this.id}});\n    }\n\n    serialize(): GeoJSONSourceSpecification {\n        return extend({}, this._options, {\n            type: this.type,\n            data: this._data\n        });\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n", "import {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos', type: 'Int16', components: 2},\n    {name: 'a_texture_pos', type: 'Int16', components: 2}\n]);\n", "import {CanonicalTileID} from './tile_id';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {ImageRequest} from '../util/image_request';\nimport {ResourceType} from '../util/request_manager';\nimport {EXTENT} from '../data/extent';\nimport {RasterBoundsArray} from '../data/array_types.g';\nimport rasterBoundsAttributes from '../data/raster_bounds_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {Texture} from '../render/texture';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\n\nimport type {Source} from './source';\nimport type {CanvasSourceSpecification} from './canvas_source';\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Tile} from './tile';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {\n    ImageSourceSpecification,\n    VideoSourceSpecification\n} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * Four geographical coordinates,\n * represented as arrays of longitude and latitude numbers, which define the corners of the image.\n * The coordinates start at the top left corner of the image and proceed in clockwise order.\n * They do not have to represent a rectangle.\n */\nexport type Coordinates = [[number, number], [number, number], [number, number], [number, number]];\n\n/**\n * The options object for the {@link ImageSource#updateImage} method\n */\nexport type UpdateImageOptions = {\n    /**\n     * Required image URL.\n     */\n    url: string;\n    /**\n     * The image coordinates\n     */\n    coordinates?: Coordinates;\n}\n\n/**\n * A data source containing an image.\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-image) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * // add to map\n * map.addSource('some id', {\n *    type: 'image',\n *    url: 'https://www.maplibre.org/images/foo.png',\n *    coordinates: [\n *        [-76.54, 39.18],\n *        [-76.52, 39.18],\n *        [-76.52, 39.17],\n *        [-76.54, 39.17]\n *    ]\n * });\n *\n * // update coordinates\n * let mySource = map.getSource('some id');\n * mySource.setCoordinates([\n *     [-76.54335737228394, 39.18579907229748],\n *     [-76.52803659439087, 39.1838364847587],\n *     [-76.5295386314392, 39.17683392507606],\n *     [-76.54520273208618, 39.17876344106642]\n * ]);\n *\n * // update url and coordinates simultaneously\n * mySource.updateImage({\n *    url: 'https://www.maplibre.org/images/bar.png',\n *    coordinates: [\n *        [-76.54335737228394, 39.18579907229748],\n *        [-76.52803659439087, 39.1838364847587],\n *        [-76.5295386314392, 39.17683392507606],\n *        [-76.54520273208618, 39.17876344106642]\n *    ]\n * })\n *\n * map.removeSource('some id');  // remove\n * ```\n */\nexport class ImageSource extends Evented implements Source {\n    type: string;\n    id: string;\n    minzoom: number;\n    maxzoom: number;\n    tileSize: number;\n    url: string;\n\n    coordinates: Coordinates;\n    tiles: {[_: string]: Tile};\n    options: any;\n    dispatcher: Dispatcher;\n    map: Map;\n    texture: Texture | null;\n    image: HTMLImageElement | ImageBitmap;\n    tileID: CanonicalTileID;\n    _boundsArray: RasterBoundsArray;\n    boundsBuffer: VertexBuffer;\n    boundsSegments: SegmentVector;\n    _loaded: boolean;\n    _request: AbortController;\n\n    /** @internal */\n    constructor(id: string, options: ImageSourceSpecification | VideoSourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n        this.coordinates = options.coordinates;\n\n        this.type = 'image';\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.tileSize = 512;\n        this.tiles = {};\n        this._loaded = false;\n\n        this.setEventedParent(eventedParent);\n\n        this.options = options;\n    }\n\n    async load(newCoordinates?: Coordinates): Promise<void> {\n        this._loaded = false;\n        this.fire(new Event('dataloading', {dataType: 'source'}));\n\n        this.url = this.options.url;\n\n        this._request = new AbortController();\n        try {\n            const image = await ImageRequest.getImage(this.map._requestManager.transformRequest(this.url, ResourceType.Image), this._request);\n            this._request = null;\n            this._loaded = true;\n\n            if (image && image.data) {\n                this.image = image.data;\n                if (newCoordinates) {\n                    this.coordinates = newCoordinates;\n                }\n                this._finishLoading();\n            }\n        } catch (err) {\n            this._request = null;\n            this._loaded = true;\n            this.fire(new ErrorEvent(err));\n        }\n    }\n\n    loaded(): boolean {\n        return this._loaded;\n    }\n\n    /**\n     * Updates the image URL and, optionally, the coordinates. To avoid having the image flash after changing,\n     * set the `raster-fade-duration` paint property on the raster layer to 0.\n     *\n     * @param options - The options object.\n     */\n    updateImage(options: UpdateImageOptions): this {\n        if (!options.url) {\n            return this;\n        }\n\n        if (this._request) {\n            this._request.abort();\n            this._request = null;\n        }\n\n        this.options.url = options.url;\n        this.load(options.coordinates).finally(() => { this.texture = null; });\n        return this;\n    }\n\n    _finishLoading() {\n        if (this.map) {\n            this.setCoordinates(this.coordinates);\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'metadata'}));\n        }\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n    }\n\n    onRemove() {\n        if (this._request) {\n            this._request.abort();\n            this._request = null;\n        }\n    }\n\n    /**\n     * Sets the image's coordinates and re-renders the map.\n     *\n     * @param coordinates - Four geographical coordinates,\n     * represented as arrays of longitude and latitude numbers, which define the corners of the image.\n     * The coordinates start at the top left corner of the image and proceed in clockwise order.\n     * They do not have to represent a rectangle.\n     */\n    setCoordinates(coordinates: Coordinates): this {\n        this.coordinates = coordinates;\n\n        // Calculate which mercator tile is suitable for rendering the video in\n        // and create a buffer with the corner coordinates. These coordinates\n        // may be outside the tile, because raster tiles aren't clipped when rendering.\n\n        // transform the geo coordinates into (zoom 0) tile space coordinates\n        const cornerCoords = coordinates.map(MercatorCoordinate.fromLngLat);\n\n        // Compute the coordinates of the tile we'll use to hold this image's\n        // render data\n        this.tileID = getCoordinatesCenterTileID(cornerCoords);\n\n        // Constrain min/max zoom to our tile's zoom level in order to force\n        // SourceCache to request this tile (no matter what the map's zoom\n        // level)\n        this.minzoom = this.maxzoom = this.tileID.z;\n\n        // Transform the corner coordinates into the coordinate space of our\n        // tile.\n        const tileCoords = cornerCoords.map((coord) => this.tileID.getTilePoint(coord)._round());\n\n        this._boundsArray = new RasterBoundsArray();\n        this._boundsArray.emplaceBack(tileCoords[0].x, tileCoords[0].y, 0, 0);\n        this._boundsArray.emplaceBack(tileCoords[1].x, tileCoords[1].y, EXTENT, 0);\n        this._boundsArray.emplaceBack(tileCoords[3].x, tileCoords[3].y, 0, EXTENT);\n        this._boundsArray.emplaceBack(tileCoords[2].x, tileCoords[2].y, EXTENT, EXTENT);\n\n        if (this.boundsBuffer) {\n            this.boundsBuffer.destroy();\n            delete this.boundsBuffer;\n        }\n\n        this.fire(new Event('data', {dataType: 'source', sourceDataType: 'content'}));\n        return this;\n    }\n\n    prepare() {\n        if (Object.keys(this.tiles).length === 0 || !this.image) {\n            return;\n        }\n\n        const context = this.map.painter.context;\n        const gl = context.gl;\n\n        if (!this.boundsBuffer) {\n            this.boundsBuffer = context.createVertexBuffer(this._boundsArray, rasterBoundsAttributes.members);\n        }\n\n        if (!this.boundsSegments) {\n            this.boundsSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n        }\n\n        if (!this.texture) {\n            this.texture = new Texture(context, this.image, gl.RGBA);\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        }\n\n        let newTilesLoaded = false;\n        for (const w in this.tiles) {\n            const tile = this.tiles[w];\n            if (tile.state !== 'loaded') {\n                tile.state = 'loaded';\n                tile.texture = this.texture;\n                newTilesLoaded = true;\n            }\n        }\n\n        if (newTilesLoaded) {\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'idle', sourceId: this.id}));\n        }\n    }\n\n    async loadTile(tile: Tile): Promise<void> {\n        // We have a single tile -- whose coordinates are this.tileID -- that\n        // covers the image we want to render.  If that's the one being\n        // requested, set it up with the image; otherwise, mark the tile as\n        // `errored` to indicate that we have no data for it.\n        // If the world wraps, we may have multiple \"wrapped\" copies of the\n        // single tile.\n        if (this.tileID && this.tileID.equals(tile.tileID.canonical)) {\n            this.tiles[String(tile.tileID.wrap)] = tile;\n            tile.buckets = {};\n        } else {\n            tile.state = 'errored';\n        }\n    }\n\n    serialize(): ImageSourceSpecification | VideoSourceSpecification | CanvasSourceSpecification {\n        return {\n            type: 'image',\n            url: this.options.url,\n            coordinates: this.coordinates\n        };\n    }\n\n    hasTransition() {\n        return false;\n    }\n}\n\n/**\n * Given a list of coordinates, get their center as a coordinate.\n *\n * @returns centerpoint\n * @internal\n */\nexport function getCoordinatesCenterTileID(coords: Array<MercatorCoordinate>) {\n    let minX = Infinity;\n    let minY = Infinity;\n    let maxX = -Infinity;\n    let maxY = -Infinity;\n\n    for (const coord of coords) {\n        minX = Math.min(minX, coord.x);\n        minY = Math.min(minY, coord.y);\n        maxX = Math.max(maxX, coord.x);\n        maxY = Math.max(maxY, coord.y);\n    }\n\n    const dx = maxX - minX;\n    const dy = maxY - minY;\n    const dMax = Math.max(dx, dy);\n    const zoom = Math.max(0, Math.floor(-Math.log(dMax) / Math.LN2));\n    const tilesAtZoom = Math.pow(2, zoom);\n\n    return new CanonicalTileID(\n        zoom,\n        Math.floor((minX + maxX) / 2 * tilesAtZoom),\n        Math.floor((minY + maxY) / 2 * tilesAtZoom));\n}\n", "import {getVideo} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\n\nimport {ImageSource} from './image_source';\nimport rasterBoundsAttributes from '../data/raster_bounds_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {Texture} from '../render/texture';\nimport {Event, ErrorEvent} from '../util/evented';\nimport {ValidationError} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Evented} from '../util/evented';\nimport type {VideoSourceSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A data source containing video.\n * (See the [Style Specification](https://maplibre.org/maplibre-style-spec/#sources-video) for detailed documentation of options.)\n *\n * @group Sources\n *\n * @example\n * ```ts\n * // add to map\n * map.addSource('some id', {\n *    type: 'video',\n *    url: [\n *        'https://www.mapbox.com/blog/assets/baltimore-smoke.mp4',\n *        'https://www.mapbox.com/blog/assets/baltimore-smoke.webm'\n *    ],\n *    coordinates: [\n *        [-76.54, 39.18],\n *        [-76.52, 39.18],\n *        [-76.52, 39.17],\n *        [-76.54, 39.17]\n *    ]\n * });\n *\n * // update\n * let mySource = map.getSource('some id');\n * mySource.setCoordinates([\n *     [-76.54335737228394, 39.18579907229748],\n *     [-76.52803659439087, 39.1838364847587],\n *     [-76.5295386314392, 39.17683392507606],\n *     [-76.54520273208618, 39.17876344106642]\n * ]);\n *\n * map.removeSource('some id');  // remove\n * ```\n * @see [Add a video](https://maplibre.org/maplibre-gl-js/docs/examples/video-on-a-map/)\n *\n * Note that when rendered as a raster layer, the layer's `raster-fade-duration` property will cause the video to fade in.\n * This happens when playback is started, paused and resumed, or when the video's coordinates are updated. To avoid this behavior,\n * set the layer's `raster-fade-duration` property to `0`.\n */\nexport class VideoSource extends ImageSource {\n    options: VideoSourceSpecification;\n    urls: Array<string>;\n    video: HTMLVideoElement;\n    roundZoom: boolean;\n\n    constructor(id: string, options: VideoSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super(id, options, dispatcher, eventedParent);\n        this.roundZoom = true;\n        this.type = 'video';\n        this.options = options;\n    }\n\n    async load() {\n        this._loaded = false;\n        const options = this.options;\n\n        this.urls = [];\n        for (const url of options.urls) {\n            this.urls.push(this.map._requestManager.transformRequest(url, ResourceType.Source).url);\n        }\n        try {\n            const video = await getVideo(this.urls);\n            this._loaded = true;\n            if (!video) {\n                return;\n            }\n            this.video = video;\n            this.video.loop = true;\n\n            // Start repainting when video starts playing. hasTransition() will then return\n            // true to trigger additional frames as long as the videos continues playing.\n            this.video.addEventListener('playing', () => {\n                this.map.triggerRepaint();\n            });\n\n            if (this.map) {\n                this.video.play();\n            }\n\n            this._finishLoading();\n        } catch (err) {\n            this.fire(new ErrorEvent(err));\n        }\n    }\n\n    /**\n     * Pauses the video.\n     */\n    pause() {\n        if (this.video) {\n            this.video.pause();\n        }\n    }\n\n    /**\n     * Plays the video.\n     */\n    play() {\n        if (this.video) {\n            this.video.play();\n        }\n    }\n\n    /**\n     * Sets playback to a timestamp, in seconds.\n     */\n    seek(seconds: number) {\n        if (this.video) {\n            const seekableRange = this.video.seekable;\n            if (seconds < seekableRange.start(0) || seconds > seekableRange.end(0)) {\n                this.fire(new ErrorEvent(new ValidationError(`sources.${this.id}`, null, `Playback for this video can be set only between the ${seekableRange.start(0)} and ${seekableRange.end(0)}-second mark.`)));\n            } else this.video.currentTime = seconds;\n        }\n    }\n\n    /**\n     * Returns the HTML `video` element.\n     *\n     * @returns The HTML `video` element.\n     */\n    getVideo(): HTMLVideoElement {\n        return this.video;\n    }\n\n    onAdd(map: Map) {\n        if (this.map) return;\n        this.map = map;\n        this.load();\n        if (this.video) {\n            this.video.play();\n            this.setCoordinates(this.coordinates);\n        }\n    }\n\n    /**\n     * Sets the video's coordinates and re-renders the map.\n     */\n    prepare(): this {\n        if (Object.keys(this.tiles).length === 0 || this.video.readyState < 2) {\n            return; // not enough data for current position\n        }\n\n        const context = this.map.painter.context;\n        const gl = context.gl;\n\n        if (!this.boundsBuffer) {\n            this.boundsBuffer = context.createVertexBuffer(this._boundsArray, rasterBoundsAttributes.members);\n        }\n\n        if (!this.boundsSegments) {\n            this.boundsSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n        }\n\n        if (!this.texture) {\n            this.texture = new Texture(context, this.video, gl.RGBA);\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n        } else if (!this.video.paused) {\n            this.texture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl.RGBA, gl.UNSIGNED_BYTE, this.video);\n        }\n\n        let newTilesLoaded = false;\n        for (const w in this.tiles) {\n            const tile = this.tiles[w];\n            if (tile.state !== 'loaded') {\n                tile.state = 'loaded';\n                tile.texture = this.texture;\n                newTilesLoaded = true;\n            }\n        }\n\n        if (newTilesLoaded) {\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'idle', sourceId: this.id}));\n        }\n    }\n\n    serialize(): VideoSourceSpecification {\n        return {\n            type: 'video',\n            urls: this.urls,\n            coordinates: this.coordinates\n        };\n    }\n\n    hasTransition() {\n        return this.video && !this.video.paused;\n    }\n}\n", "import {ImageSource} from './image_source';\n\nimport rasterBoundsAttributes from '../data/raster_bounds_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {Texture} from '../render/texture';\nimport {Event, ErrorEvent} from '../util/evented';\nimport {ValidationError} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {Map} from '../ui/map';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Evented} from '../util/evented';\n\n/**\n * Options to add a canvas source type to the map.\n */\nexport type CanvasSourceSpecification = {\n    /**\n     * Source type. Must be `\"canvas\"`.\n     */\n    type: 'canvas';\n    /**\n     * Four geographical coordinates denoting where to place the corners of the canvas, specified in `[longitude, latitude]` pairs.\n     */\n    coordinates: [[number, number], [number, number], [number, number], [number, number]];\n    /**\n     * Whether the canvas source is animated. If the canvas is static (i.e. pixels do not need to be re-read on every frame), `animate` should be set to `false` to improve performance.\n     * @defaultValue true\n     */\n    animate?: boolean;\n    /**\n     * Canvas source from which to read pixels. Can be a string representing the ID of the canvas element, or the `HTMLCanvasElement` itself.\n     */\n    canvas?: string | HTMLCanvasElement;\n};\n\n/**\n * A data source containing the contents of an HTML canvas. See {@link CanvasSourceSpecification} for detailed documentation of options.\n *\n * @group Sources\n *\n * @example\n * ```ts\n * // add to map\n * map.addSource('some id', {\n *    type: 'canvas',\n *    canvas: 'idOfMyHTMLCanvas',\n *    animate: true,\n *    coordinates: [\n *        [-76.54, 39.18],\n *        [-76.52, 39.18],\n *        [-76.52, 39.17],\n *        [-76.54, 39.17]\n *    ]\n * });\n *\n * // update\n * let mySource = map.getSource('some id');\n * mySource.setCoordinates([\n *     [-76.54335737228394, 39.18579907229748],\n *     [-76.52803659439087, 39.1838364847587],\n *     [-76.5295386314392, 39.17683392507606],\n *     [-76.54520273208618, 39.17876344106642]\n * ]);\n *\n * map.removeSource('some id');  // remove\n * ```\n */\nexport class CanvasSource extends ImageSource {\n    options: CanvasSourceSpecification;\n    animate: boolean;\n    canvas: HTMLCanvasElement;\n    width: number;\n    height: number;\n    /**\n     * Enables animation. The image will be copied from the canvas to the map on each frame.\n     */\n    play: () => void;\n    /**\n     * Disables animation. The map will display a static copy of the canvas image.\n     */\n    pause: () => void;\n    _playing: boolean;\n\n    /** @internal */\n    constructor(id: string, options: CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented) {\n        super(id, options, dispatcher, eventedParent);\n\n        // We build in some validation here, since canvas sources aren't included in the style spec:\n        if (!options.coordinates) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, 'missing required property \"coordinates\"')));\n        } else if (!Array.isArray(options.coordinates) || options.coordinates.length !== 4 ||\n                options.coordinates.some(c => !Array.isArray(c) || c.length !== 2 || c.some(l => typeof l !== 'number'))) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, '\"coordinates\" property must be an array of 4 longitude/latitude array pairs')));\n        }\n\n        if (options.animate && typeof options.animate !== 'boolean') {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, 'optional \"animate\" property must be a boolean value')));\n        }\n\n        if (!options.canvas) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, 'missing required property \"canvas\"')));\n        } else if (typeof options.canvas !== 'string' && !(options.canvas instanceof HTMLCanvasElement)) {\n            this.fire(new ErrorEvent(new ValidationError(`sources.${id}`, null, '\"canvas\" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance')));\n        }\n\n        this.options = options;\n        this.animate = options.animate !== undefined ? options.animate : true;\n    }\n\n    async load() {\n        this._loaded = true;\n        if (!this.canvas) {\n            this.canvas = (this.options.canvas instanceof HTMLCanvasElement) ?\n                this.options.canvas :\n                document.getElementById(this.options.canvas) as HTMLCanvasElement;\n            // cast to HTMLCanvasElement in else of ternary\n            // should we do a safety check and throw if it's not actually HTMLCanvasElement?\n        }\n        this.width = this.canvas.width;\n        this.height = this.canvas.height;\n\n        if (this._hasInvalidDimensions()) {\n            this.fire(new ErrorEvent(new Error('Canvas dimensions cannot be less than or equal to zero.')));\n            return;\n        }\n\n        this.play = function() {\n            this._playing = true;\n            this.map.triggerRepaint();\n        };\n\n        this.pause = function() {\n            if (this._playing) {\n                this.prepare();\n                this._playing = false;\n            }\n        };\n\n        this._finishLoading();\n    }\n\n    /**\n     * Returns the HTML `canvas` element.\n     *\n     * @returns The HTML `canvas` element.\n     */\n    getCanvas(): HTMLCanvasElement {\n        return this.canvas;\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this.load();\n        if (this.canvas) {\n            if (this.animate) this.play();\n        }\n    }\n\n    onRemove() {\n        this.pause();\n    }\n\n    prepare() {\n        let resize = false;\n        if (this.canvas.width !== this.width) {\n            this.width = this.canvas.width;\n            resize = true;\n        }\n        if (this.canvas.height !== this.height) {\n            this.height = this.canvas.height;\n            resize = true;\n        }\n\n        if (this._hasInvalidDimensions()) return;\n\n        if (Object.keys(this.tiles).length === 0) return; // not enough data for current position\n\n        const context = this.map.painter.context;\n        const gl = context.gl;\n\n        if (!this.boundsBuffer) {\n            this.boundsBuffer = context.createVertexBuffer(this._boundsArray, rasterBoundsAttributes.members);\n        }\n\n        if (!this.boundsSegments) {\n            this.boundsSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n        }\n\n        if (!this.texture) {\n            this.texture = new Texture(context, this.canvas, gl.RGBA, {premultiply: true});\n        } else if (resize || this._playing) {\n            this.texture.update(this.canvas, {premultiply: true});\n        }\n\n        let newTilesLoaded = false;\n        for (const w in this.tiles) {\n            const tile = this.tiles[w];\n            if (tile.state !== 'loaded') {\n                tile.state = 'loaded';\n                tile.texture = this.texture;\n                newTilesLoaded = true;\n            }\n        }\n\n        if (newTilesLoaded) {\n            this.fire(new Event('data', {dataType: 'source', sourceDataType: 'idle', sourceId: this.id}));\n        }\n    }\n\n    serialize(): CanvasSourceSpecification {\n        return {\n            type: 'canvas',\n            coordinates: this.coordinates\n        };\n    }\n\n    hasTransition() {\n        return this._playing;\n    }\n\n    _hasInvalidDimensions() {\n        for (const x of [this.canvas.width, this.canvas.height]) {\n            if (isNaN(x) || x <= 0) return true;\n        }\n        return false;\n    }\n}\n", "import {VectorTileSource} from '../source/vector_tile_source';\nimport {RasterTileSource} from '../source/raster_tile_source';\nimport {RasterDEMTileSource} from '../source/raster_dem_tile_source';\nimport {GeoJSONSource} from '../source/geojson_source';\nimport {VideoSource} from '../source/video_source';\nimport {ImageSource} from '../source/image_source';\nimport {CanvasSource} from '../source/canvas_source';\nimport {Dispatcher} from '../util/dispatcher';\n\nimport type {SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Event, Evented} from '../util/evented';\nimport type {Map} from '../ui/map';\nimport type {Tile} from './tile';\nimport type {OverscaledTileID, CanonicalTileID} from './tile_id';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\n\nconst registeredSources = {} as {[key:string]: SourceClass};\n\n/**\n * The `Source` interface must be implemented by each source type, including \"core\" types (`vector`, `raster`,\n * `video`, etc.) and all custom, third-party types.\n *\n * **Event** `data` - Fired with `{dataType: 'source', sourceDataType: 'metadata'}` to indicate that any necessary metadata\n * has been loaded so that it's okay to call `loadTile`; and with `{dataType: 'source', sourceDataType: 'content'}`\n * to indicate that the source data has changed, so that any current caches should be flushed.\n *\n * @group Sources\n */\nexport interface Source {\n    readonly type: string;\n    /**\n     * The id for the source. Must not be used by any existing source.\n     */\n    id: string;\n    /**\n     * The minimum zoom level for the source.\n     */\n    minzoom: number;\n    /**\n     * The maximum zoom level for the source.\n     */\n    maxzoom: number;\n    /**\n     * The tile size for the source.\n     */\n    tileSize: number;\n    /**\n     * The attribution for the source.\n     */\n    attribution?: string;\n    /**\n     * `true` if zoom levels are rounded to the nearest integer in the source data, `false` if they are floor-ed to the nearest integer.\n     */\n    roundZoom?: boolean;\n    /**\n     * `false` if tiles can be drawn outside their boundaries, `true` if they cannot.\n     */\n    isTileClipped?: boolean;\n    tileID?: CanonicalTileID;\n    /**\n     * `true` if tiles should be sent back to the worker for each overzoomed zoom level, `false` if not.\n     */\n    reparseOverscaled?: boolean;\n    vectorLayerIds?: Array<string>;\n    /**\n     * True if the source has transition, false otherwise.\n     */\n    hasTransition(): boolean;\n    /**\n     * True if the source is loaded, false otherwise.\n     */\n    loaded(): boolean;\n    /**\n     * An ability to fire an event to all the listeners, see {@link Evented}\n     * @param event - The event to fire\n     */\n    fire(event: Event): unknown;\n    /**\n     * This method is called when the source is added to the map.\n     * @param map - The map instance\n     */\n    onAdd?(map: Map): void;\n    /**\n     * This method is called when the source is removed from the map.\n     * @param map - The map instance\n     */\n    onRemove?(map: Map): void;\n    /**\n     * This method does the heavy lifting of loading a tile.\n     * In most cases it will defer the work to the relevant worker source.\n     * @param tile - The tile to load\n     */\n    loadTile(tile: Tile): Promise<void>;\n    /**\n     * True is the tile is part of the source, false otherwise.\n     * @param tileID - The tile ID\n     */\n    hasTile?(tileID: OverscaledTileID): boolean;\n    /**\n     * Allows to abort a tile loading.\n     * @param tile - The tile to abort\n     */\n    abortTile?(tile: Tile): Promise<void>;\n    /**\n     * Allows to unload a tile.\n     * @param tile - The tile to unload\n     */\n    unloadTile?(tile: Tile): Promise<void>;\n    /**\n     * @returns A plain (stringifiable) JS object representing the current state of the source.\n     * Creating a source using the returned object as the `options` should result in a Source that is\n     * equivalent to this one.\n     */\n    serialize(): any;\n    /**\n     * Allows to execute a prepare step before the source is used.\n     */\n    prepare?(): void;\n}\n\n/**\n * A general definition of a {@link Source} class for factory usage\n */\nexport type SourceClass = {\n    new (id: string, specification: SourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented): Source;\n}\n\n/**\n * Creates a tiled data source instance given an options object.\n *\n * @param id - The id for the source. Must not be used by any existing source.\n * @param specification - Source options, specific to the source type (except for `options.type`, which is always required).\n * @param source - A source definition object compliant with\n * [`maplibre-gl-style-spec`](https://maplibre.org/maplibre-style-spec/#sources) or, for a third-party source type,\n  * with that type's requirements.\n * @param dispatcher - A {@link Dispatcher} instance, which can be used to send messages to the workers.\n * @returns a newly created source\n */\nexport const create = (id: string, specification: SourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented): Source => {\n\n    const Class = getSourceType(specification.type);\n    const source = new Class(id, specification, dispatcher, eventedParent);\n\n    if (source.id !== id) {\n        throw new Error(`Expected Source id to be ${id} instead of ${source.id}`);\n    }\n\n    return source;\n};\n\nconst getSourceType = (name: string): SourceClass => {\n    switch (name) {\n        case 'geojson':\n            return GeoJSONSource;\n        case 'image':\n            return ImageSource;\n        case 'raster':\n            return RasterTileSource;\n        case 'raster-dem':\n            return RasterDEMTileSource;\n        case 'vector':\n            return VectorTileSource;\n        case 'video':\n            return VideoSource;\n        case 'canvas':\n            return CanvasSource;\n    }\n    return registeredSources[name];\n};\n\nconst setSourceType = (name: string, type: SourceClass) => {\n    registeredSources[name] = type;\n};\n\n/**\n * Adds a custom source type, making it available for use with {@link Map#addSource}.\n * @param name - The name of the source type; source definition objects use this name in the `{type: ...}` field.\n * @param SourceType - A {@link SourceClass} - which is a constructor for the `Source` interface.\n * @returns a promise that is resolved when the source type is ready or rejected with an error.\n */\nexport const addSourceType = async (name: string, SourceType: SourceClass): Promise<void> => {\n    if (getSourceType(name)) {\n        throw new Error(`A source type called \"${name}\" already exists.`);\n    }\n    setSourceType(name, SourceType);\n};\n", "/**\n * The possible option of the plugin's status\n *\n * `unavailable`: Not loaded.\n *\n * `deferred`: The plugin URL has been specified, but loading has been deferred.\n *\n * `requested`: at least one tile needs RTL to render, but the plugin has not been set\n *\n * `loading`: RTL is in the process of being loaded by worker.\n *\n * `loaded`: The plugin is now loaded\n *\n *  `error`: The plugin failed to load\n */\nexport type RTLPluginStatus =\n                'unavailable' |\n                'deferred' |\n                'requested' |\n                'loading' |\n                'loaded' |\n                'error';\n\n/**\n * The RTL plugin state\n */\nexport type PluginState = {\n    pluginStatus: RTLPluginStatus;\n    pluginURL: string;\n};\n\nexport const RTLPluginLoadedEventName = 'RTLPluginLoaded';\n\n", "\nimport {browser} from '../util/browser';\nimport {Event, Evented} from '../util/evented';\nimport {RTLPluginStatus, RTLPluginLoadedEventName, PluginState} from './rtl_text_plugin_status';\nimport {Dispatcher, getGlobalDispatcher} from '../util/dispatcher';\nimport {MessageType} from '../util/actor_messages';\n\nclass RTLMainThreadPlugin extends Evented {\n    status: RTLPluginStatus = 'unavailable';\n    url: string = null;\n    dispatcher: Dispatcher = getGlobalDispatcher();\n\n    /** Sync RTL plugin state by broadcasting a message to the worker */\n    _syncState(statusToSend: RTLPluginStatus): Promise<PluginState[]> {\n        this.status = statusToSend;\n        return this.dispatcher.broadcast(MessageType.syncRTLPluginState, {pluginStatus: statusToSend, pluginURL: this.url})\n            .catch((e: any) => {\n                this.status = 'error';\n                throw e;\n            });\n    }\n\n    /** This one is exposed to outside */\n    getRTLTextPluginStatus(): RTLPluginStatus {\n        return this.status;\n    }\n\n    clearRTLTextPlugin(): void {\n        this.status = 'unavailable';\n        this.url = null;\n    }\n\n    async setRTLTextPlugin(url: string, deferred: boolean = false): Promise<void> {\n        if (this.url) {\n            // error\n            throw new Error('setRTLTextPlugin cannot be called multiple times.');\n        }\n\n        this.url = browser.resolveURL(url);\n        if (!this.url) {\n            throw new Error(`requested url ${url} is invalid`);\n        }\n        if (this.status === 'unavailable') {\n\n            // from initial state:\n            if (deferred) {\n\n                this.status = 'deferred';\n                // fire and forget: in this case it does not need wait for the broadcasting result\n                // it is important to sync the deferred status once because\n                // symbol_bucket will be checking it in worker\n                this._syncState(this.status);\n\n            } else {\n                return this._requestImport();\n            }\n\n        } else if (this.status === 'requested') {\n            return this._requestImport();\n        }\n    }\n\n    /** Send a message to worker which will import the RTL plugin script */\n    async _requestImport() : Promise<void> {\n\n        // all errors/exceptions will be handled by _syncState\n        await this._syncState('loading');\n        this.status = 'loaded';\n        this.fire(new Event(RTLPluginLoadedEventName));\n    }\n\n    /** Start a lazy loading process of RTL plugin */\n    lazyLoad(): void {\n        if (this.status === 'unavailable') {\n            this.status = 'requested';\n        } else if (this.status === 'deferred') {\n            this._requestImport();\n        }\n    }\n}\n\nlet rtlMainThreadPlugin: RTLMainThreadPlugin = null;\n\nexport function rtlMainThreadPluginFactory(): RTLMainThreadPlugin {\n    if (!rtlMainThreadPlugin) {\n        rtlMainThreadPlugin = new RTLMainThreadPlugin();\n    }\n    return rtlMainThreadPlugin;\n}\n", "import {uniqueId, parseCacheControl} from '../util/util';\nimport {deserialize as deserializeBucket} from '../data/bucket';\nimport '../data/feature_index';\nimport type {FeatureIndex} from '../data/feature_index';\nimport {GeoJSONFeature} from '../util/vectortile_to_geojson';\nimport {featureFilter} from '@maplibre/maplibre-gl-style-spec';\nimport {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {CollisionBoxArray} from '../data/array_types.g';\nimport {Texture} from '../render/texture';\nimport {browser} from '../util/browser';\nimport {toEvaluationFeature} from '../data/evaluation_feature';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {SourceFeatureState} from '../source/source_state';\nimport {rtlMainThreadPluginFactory} from './rtl_text_plugin_main_thread';\n\nconst CLOCK_SKEW_RETRY_TIMEOUT = 30000;\n\nimport type {Bucket} from '../data/bucket';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {WorkerTileResult} from './worker_source';\nimport type {Actor} from '../util/actor';\nimport type {DEMData} from '../data/dem_data';\nimport type {AlphaImage} from '../util/image';\nimport type {ImageAtlas} from '../render/image_atlas';\nimport type {ImageManager} from '../render/image_manager';\nimport type {Context} from '../gl/context';\nimport type {OverscaledTileID} from './tile_id';\nimport type {Framebuffer} from '../gl/framebuffer';\nimport type {Transform} from '../geo/transform';\nimport type {LayerFeatureStates} from './source_state';\nimport type {FilterSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type Point from '@mapbox/point-geometry';\nimport {mat4} from 'gl-matrix';\nimport type {VectorTileLayer} from '@mapbox/vector-tile';\nimport {ExpiryData} from '../util/ajax';\n\n/**\n * The tile's state, can be:\n *\n * - `loading` Tile data is in the process of loading.\n * - `loaded` Tile data has been loaded. Tile can be rendered.\n * - `reloading` Tile data has been loaded and is being updated. Tile can be rendered.\n * - `unloaded` Tile data has been deleted.\n * - `errored` Tile data was not loaded because of an error.\n * - `expired` Tile data was previously loaded, but has expired per its HTTP headers and is in the process of refreshing.\n */\nexport type TileState = 'loading' | 'loaded' | 'reloading' | 'unloaded' | 'errored' | 'expired';\n\n/**\n * A tile object is the combination of a Coordinate, which defines\n * its place, as well as a unique ID and data tracking for its content\n */\nexport class Tile {\n    tileID: OverscaledTileID;\n    uid: number;\n    uses: number;\n    tileSize: number;\n    buckets: {[_: string]: Bucket};\n    latestFeatureIndex: FeatureIndex;\n    latestRawTileData: ArrayBuffer;\n    imageAtlas: ImageAtlas;\n    imageAtlasTexture: Texture;\n    glyphAtlasImage: AlphaImage;\n    glyphAtlasTexture: Texture;\n    expirationTime: any;\n    expiredRequestCount: number;\n    state: TileState;\n    timeAdded: number = 0;\n    fadeEndTime: number = 0;\n    collisionBoxArray: CollisionBoxArray;\n    redoWhenDone: boolean;\n    showCollisionBoxes: boolean;\n    placementSource: any;\n    actor: Actor;\n    vtLayers: {[_: string]: VectorTileLayer};\n\n    neighboringTiles: any;\n    dem: DEMData;\n    demMatrix: mat4;\n    aborted: boolean;\n    needsHillshadePrepare: boolean;\n    needsTerrainPrepare: boolean;\n    abortController: AbortController;\n    texture: any;\n    fbo: Framebuffer;\n    demTexture: Texture;\n    refreshedUponExpiration: boolean;\n    reloadPromise: {resolve: () => void; reject: () => void};\n    resourceTiming: Array<PerformanceResourceTiming>;\n    queryPadding: number;\n\n    symbolFadeHoldUntil: number;\n    hasSymbolBuckets: boolean;\n    hasRTLText: boolean;\n    dependencies: any;\n    rtt: Array<{id: number; stamp: number}>;\n    rttCoords: {[_:string]: string};\n\n    /**\n     * @param tileID - the tile ID\n     * @param size - The tile size\n     */\n    constructor(tileID: OverscaledTileID, size: number) {\n        this.tileID = tileID;\n        this.uid = uniqueId();\n        this.uses = 0;\n        this.tileSize = size;\n        this.buckets = {};\n        this.expirationTime = null;\n        this.queryPadding = 0;\n        this.hasSymbolBuckets = false;\n        this.hasRTLText = false;\n        this.dependencies = {};\n        this.rtt = [];\n        this.rttCoords = {};\n\n        // Counts the number of times a response was already expired when\n        // received. We're using this to add a delay when making a new request\n        // so we don't have to keep retrying immediately in case of a server\n        // serving expired tiles.\n        this.expiredRequestCount = 0;\n\n        this.state = 'loading';\n    }\n\n    registerFadeDuration(duration: number) {\n        const fadeEndTime = duration + this.timeAdded;\n\n        if (fadeEndTime < this.fadeEndTime) {\n            return;\n        }\n\n        this.fadeEndTime = fadeEndTime;\n    }\n\n    wasRequested() {\n        return this.state === 'errored' || this.state === 'loaded' || this.state === 'reloading';\n    }\n\n    clearTextures(painter: any) {\n        if (this.demTexture) painter.saveTileTexture(this.demTexture);\n        this.demTexture = null;\n    }\n\n    /**\n     * Given a data object with a 'buffers' property, load it into\n     * this tile's elementGroups and buffers properties and set loaded\n     * to true. If the data is null, like in the case of an empty\n     * GeoJSON tile, no-op but still set loaded to true.\n     * @param data - The data from the worker\n     * @param painter - the painter\n     * @param justReloaded - `true` to just reload\n     */\n    loadVectorData(data: WorkerTileResult, painter: any, justReloaded?: boolean | null) {\n        if (this.hasData()) {\n            this.unloadVectorData();\n        }\n\n        this.state = 'loaded';\n\n        // empty GeoJSON tile\n        if (!data) {\n            this.collisionBoxArray = new CollisionBoxArray();\n            return;\n        }\n\n        if (data.featureIndex) {\n            this.latestFeatureIndex = data.featureIndex;\n            if (data.rawTileData) {\n                // Only vector tiles have rawTileData, and they won't update it for\n                // 'reloadTile'\n                this.latestRawTileData = data.rawTileData;\n                this.latestFeatureIndex.rawTileData = data.rawTileData;\n            } else if (this.latestRawTileData) {\n                // If rawTileData hasn't updated, hold onto a pointer to the last\n                // one we received\n                this.latestFeatureIndex.rawTileData = this.latestRawTileData;\n            }\n        }\n        this.collisionBoxArray = data.collisionBoxArray;\n        this.buckets = deserializeBucket(data.buckets, painter.style);\n\n        this.hasSymbolBuckets = false;\n        for (const id in this.buckets) {\n            const bucket = this.buckets[id];\n            if (bucket instanceof SymbolBucket) {\n                this.hasSymbolBuckets = true;\n                if (justReloaded) {\n                    bucket.justReloaded = true;\n                } else {\n                    break;\n                }\n            }\n        }\n\n        this.hasRTLText = false;\n        if (this.hasSymbolBuckets) {\n            for (const id in this.buckets) {\n                const bucket = this.buckets[id];\n                if (bucket instanceof SymbolBucket) {\n                    if (bucket.hasRTLText) {\n                        this.hasRTLText = true;\n                        rtlMainThreadPluginFactory().lazyLoad();\n                        break;\n                    }\n                }\n            }\n        }\n\n        this.queryPadding = 0;\n        for (const id in this.buckets) {\n            const bucket = this.buckets[id];\n            this.queryPadding = Math.max(this.queryPadding, painter.style.getLayer(id).queryRadius(bucket));\n        }\n\n        if (data.imageAtlas) {\n            this.imageAtlas = data.imageAtlas;\n        }\n        if (data.glyphAtlasImage) {\n            this.glyphAtlasImage = data.glyphAtlasImage;\n        }\n    }\n\n    /**\n     * Release any data or WebGL resources referenced by this tile.\n     */\n    unloadVectorData() {\n        for (const id in this.buckets) {\n            this.buckets[id].destroy();\n        }\n        this.buckets = {};\n\n        if (this.imageAtlasTexture) {\n            this.imageAtlasTexture.destroy();\n        }\n\n        if (this.imageAtlas) {\n            this.imageAtlas = null;\n        }\n\n        if (this.glyphAtlasTexture) {\n            this.glyphAtlasTexture.destroy();\n        }\n\n        this.latestFeatureIndex = null;\n        this.state = 'unloaded';\n    }\n\n    getBucket(layer: StyleLayer) {\n        return this.buckets[layer.id];\n    }\n\n    upload(context: Context) {\n        for (const id in this.buckets) {\n            const bucket = this.buckets[id];\n            if (bucket.uploadPending()) {\n                bucket.upload(context);\n            }\n        }\n\n        const gl = context.gl;\n        if (this.imageAtlas && !this.imageAtlas.uploaded) {\n            this.imageAtlasTexture = new Texture(context, this.imageAtlas.image, gl.RGBA);\n            this.imageAtlas.uploaded = true;\n        }\n\n        if (this.glyphAtlasImage) {\n            this.glyphAtlasTexture = new Texture(context, this.glyphAtlasImage, gl.ALPHA);\n            this.glyphAtlasImage = null;\n        }\n    }\n\n    prepare(imageManager: ImageManager) {\n        if (this.imageAtlas) {\n            this.imageAtlas.patchUpdatedImages(imageManager, this.imageAtlasTexture);\n        }\n    }\n\n    // Queries non-symbol features rendered for this tile.\n    // Symbol features are queried globally\n    queryRenderedFeatures(\n        layers: {[_: string]: StyleLayer},\n        serializedLayers: {[_: string]: any},\n        sourceFeatureState: SourceFeatureState,\n        queryGeometry: Array<Point>,\n        cameraQueryGeometry: Array<Point>,\n        scale: number,\n        params: {\n            filter: FilterSpecification;\n            layers: Array<string>;\n            availableImages: Array<string>;\n        },\n        transform: Transform,\n        maxPitchScaleFactor: number,\n        pixelPosMatrix: mat4\n    ): {[_: string]: Array<{featureIndex: number; feature: GeoJSONFeature}>} {\n        if (!this.latestFeatureIndex || !this.latestFeatureIndex.rawTileData)\n            return {};\n\n        return this.latestFeatureIndex.query({\n            queryGeometry,\n            cameraQueryGeometry,\n            scale,\n            tileSize: this.tileSize,\n            pixelPosMatrix,\n            transform,\n            params,\n            queryPadding: this.queryPadding * maxPitchScaleFactor\n        }, layers, serializedLayers, sourceFeatureState);\n    }\n\n    querySourceFeatures(result: Array<GeoJSONFeature>, params?: {\n        sourceLayer?: string;\n        filter?: FilterSpecification;\n        validate?: boolean;\n    }) {\n        const featureIndex = this.latestFeatureIndex;\n        if (!featureIndex || !featureIndex.rawTileData) return;\n\n        const vtLayers = featureIndex.loadVTLayers();\n\n        const sourceLayer = params && params.sourceLayer ? params.sourceLayer : '';\n        const layer = vtLayers._geojsonTileLayer || vtLayers[sourceLayer];\n\n        if (!layer) return;\n\n        const filter = featureFilter(params && params.filter);\n        const {z, x, y} = this.tileID.canonical;\n        const coord = {z, x, y};\n\n        for (let i = 0; i < layer.length; i++) {\n            const feature = layer.feature(i);\n            if (filter.needGeometry) {\n                const evaluationFeature = toEvaluationFeature(feature, true);\n                if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), evaluationFeature, this.tileID.canonical)) continue;\n            } else if (!filter.filter(new EvaluationParameters(this.tileID.overscaledZ), feature)) {\n                continue;\n            }\n            const id = featureIndex.getId(feature, sourceLayer);\n            const geojsonFeature = new GeoJSONFeature(feature, z, x, y, id);\n            (geojsonFeature as any).tile = coord;\n            result.push(geojsonFeature);\n        }\n    }\n\n    hasData() {\n        return this.state === 'loaded' || this.state === 'reloading' || this.state === 'expired';\n    }\n\n    patternsLoaded() {\n        return this.imageAtlas && !!Object.keys(this.imageAtlas.patternPositions).length;\n    }\n\n    setExpiryData(data: ExpiryData) {\n        const prior = this.expirationTime;\n\n        if (data.cacheControl) {\n            const parsedCC = parseCacheControl(data.cacheControl);\n            if (parsedCC['max-age']) this.expirationTime = Date.now() + parsedCC['max-age'] * 1000;\n        } else if (data.expires) {\n            this.expirationTime = new Date(data.expires).getTime();\n        }\n\n        if (this.expirationTime) {\n            const now = Date.now();\n            let isExpired = false;\n\n            if (this.expirationTime > now) {\n                isExpired = false;\n            } else if (!prior) {\n                isExpired = true;\n            } else if (this.expirationTime < prior) {\n                // Expiring date is going backwards:\n                // fall back to exponential backoff\n                isExpired = true;\n\n            } else {\n                const delta = this.expirationTime - prior;\n\n                if (!delta) {\n                    // Server is serving the same expired resource over and over: fall\n                    // back to exponential backoff.\n                    isExpired = true;\n\n                } else {\n                    // Assume that either the client or the server clock is wrong and\n                    // try to interpolate a valid expiration date (from the client POV)\n                    // observing a minimum timeout.\n                    this.expirationTime = now + Math.max(delta, CLOCK_SKEW_RETRY_TIMEOUT);\n\n                }\n            }\n\n            if (isExpired) {\n                this.expiredRequestCount++;\n                this.state = 'expired';\n            } else {\n                this.expiredRequestCount = 0;\n            }\n        }\n    }\n\n    getExpiryTimeout() {\n        if (this.expirationTime) {\n            if (this.expiredRequestCount) {\n                return 1000 * (1 << Math.min(this.expiredRequestCount - 1, 31));\n            } else {\n                // Max value for `setTimeout` implementations is a 32 bit integer; cap this accordingly\n                return Math.min(this.expirationTime - new Date().getTime(), Math.pow(2, 31) - 1);\n            }\n        }\n    }\n\n    setFeatureState(states: LayerFeatureStates, painter: any) {\n        if (!this.latestFeatureIndex ||\n            !this.latestFeatureIndex.rawTileData ||\n            Object.keys(states).length === 0) {\n            return;\n        }\n\n        const vtLayers = this.latestFeatureIndex.loadVTLayers();\n\n        for (const id in this.buckets) {\n            if (!painter.style.hasLayer(id)) continue;\n\n            const bucket = this.buckets[id];\n            // Buckets are grouped by common source-layer\n            const sourceLayerId = bucket.layers[0]['sourceLayer'] || '_geojsonTileLayer';\n            const sourceLayer = vtLayers[sourceLayerId];\n            const sourceLayerStates = states[sourceLayerId];\n            if (!sourceLayer || !sourceLayerStates || Object.keys(sourceLayerStates).length === 0) continue;\n\n            bucket.update(sourceLayerStates, sourceLayer, this.imageAtlas && this.imageAtlas.patternPositions || {});\n            const layer = painter && painter.style && painter.style.getLayer(id);\n            if (layer) {\n                this.queryPadding = Math.max(this.queryPadding, layer.queryRadius(bucket));\n            }\n        }\n    }\n\n    holdingForFade(): boolean {\n        return this.symbolFadeHoldUntil !== undefined;\n    }\n\n    symbolFadeFinished(): boolean {\n        return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < browser.now();\n    }\n\n    clearFadeHold() {\n        this.symbolFadeHoldUntil = undefined;\n    }\n\n    setHoldDuration(duration: number) {\n        this.symbolFadeHoldUntil = browser.now() + duration;\n    }\n\n    setDependencies(namespace: string, dependencies: Array<string>) {\n        const index = {};\n        for (const dep of dependencies) {\n            index[dep] = true;\n        }\n        this.dependencies[namespace] = index;\n    }\n\n    hasDependency(namespaces: Array<string>, keys: Array<string>) {\n        for (const namespace of namespaces) {\n            const dependencies = this.dependencies[namespace];\n            if (dependencies) {\n                for (const key of keys) {\n                    if (dependencies[key]) {\n                        return true;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n}\n", "import type {CollisionBoxArray} from './array_types.g';\nimport type {Style} from '../style/style';\nimport type {TypedStyleLayer} from '../style/style_layer/typed_style_layer';\nimport type {FeatureIndex} from './feature_index';\nimport type {Context} from '../gl/context';\nimport type {FeatureStates} from '../source/source_state';\nimport type {ImagePosition} from '../render/image_atlas';\nimport type {CanonicalTileID} from '../source/tile_id';\nimport type {VectorTileFeature, VectorTileLayer} from '@mapbox/vector-tile';\nimport Point from '@mapbox/point-geometry';\n\nexport type BucketParameters<Layer extends TypedStyleLayer> = {\n    index: number;\n    layers: Array<Layer>;\n    zoom: number;\n    pixelRatio: number;\n    overscaling: number;\n    collisionBoxArray: CollisionBoxArray;\n    sourceLayerIndex: number;\n    sourceID: string;\n};\n\nexport type PopulateParameters = {\n    featureIndex: FeatureIndex;\n    iconDependencies: {};\n    patternDependencies: {};\n    glyphDependencies: {};\n    availableImages: Array<string>;\n};\n\nexport type IndexedFeature = {\n    feature: VectorTileFeature;\n    id: number | string;\n    index: number;\n    sourceLayerIndex: number;\n};\n\nexport type BucketFeature = {\n    index: number;\n    sourceLayerIndex: number;\n    geometry: Array<Array<Point>>;\n    properties: any;\n    type: 0 | 1 | 2 | 3;\n    id?: any;\n    readonly patterns: {\n        [_: string]: {\n            'min': string;\n            'mid': string;\n            'max': string;\n        };\n    };\n    sortKey?: number;\n};\n\n/**\n * The `Bucket` interface is the single point of knowledge about turning vector\n * tiles into WebGL buffers.\n *\n * `Bucket` is an abstract interface. An implementation exists for each style layer type.\n * Create a bucket via the `StyleLayer#createBucket` method.\n *\n * The concrete bucket types, using layout options from the style layer,\n * transform feature geometries into vertex and index data for use by the\n * vertex shader.  They also (via `ProgramConfiguration`) use feature\n * properties and the zoom level to populate the attributes needed for\n * data-driven styling.\n *\n * Buckets are designed to be built on a worker thread and then serialized and\n * transferred back to the main thread for rendering.  On the worker side, a\n * bucket's vertex, index, and attribute data is stored in `bucket.arrays: ArrayGroup`.\n * When a bucket's data is serialized and sent back to the main thread,\n * is gets deserialized (using `new Bucket(serializedBucketData)`, with\n * the array data now stored in `bucket.buffers: BufferGroup`. BufferGroups\n * hold the same data as ArrayGroups, but are tuned for consumption by WebGL.\n */\nexport interface Bucket {\n    layerIds: Array<string>;\n    hasPattern: boolean;\n    readonly layers: Array<any>;\n    readonly stateDependentLayers: Array<any>;\n    readonly stateDependentLayerIds: Array<string>;\n    populate(features: Array<IndexedFeature>, options: PopulateParameters, canonical: CanonicalTileID): void;\n    update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}): void;\n    isEmpty(): boolean;\n    upload(context: Context): void;\n    uploadPending(): boolean;\n    /**\n     * Release the WebGL resources associated with the buffers. Note that because\n     * buckets are shared between layers having the same layout properties, they\n     * must be destroyed in groups (all buckets for a tile, or all symbol buckets).\n     */\n    destroy(): void;\n}\n\nexport function deserialize(input: Array<Bucket>, style: Style): {[_: string]: Bucket} {\n    const output = {};\n\n    // Guard against the case where the map's style has been set to null while\n    // this bucket has been parsing.\n    if (!style) return output;\n\n    for (const bucket of input) {\n        const layers = bucket.layerIds\n            .map((id) => style.getLayer(id))\n            .filter(Boolean);\n\n        if (layers.length === 0) {\n            continue;\n        }\n\n        // look up StyleLayer objects from layer ids (since we don't\n        // want to waste time serializing/copying them from the worker)\n        (bucket as any).layers = layers;\n        if (bucket.stateDependentLayerIds) {\n            (bucket as any).stateDependentLayers = bucket.stateDependentLayerIds.map((lId) => layers.filter((l) => l.id === lId)[0]);\n        }\n        for (const layer of layers) {\n            output[layer.id] = bucket;\n        }\n    }\n\n    return output;\n}\n", "import {OverscaledTileID} from './tile_id';\nimport type {Tile} from './tile';\n\n/**\n * @internal\n * A [least-recently-used cache](https://en.wikipedia.org/wiki/Cache_algorithms)\n * with hash lookup made possible by keeping a list of keys in parallel to\n * an array of dictionary of values\n */\nexport class TileCache {\n    max: number;\n    data: {\n        [key: string]: Array<{\n            value: Tile;\n            timeout: ReturnType<typeof setTimeout>;\n        }>;\n    };\n    order: Array<string>;\n    onRemove: (element: Tile) => void;\n    /**\n     * @param max - number of permitted values\n     * @param onRemove - callback called with items when they expire\n     */\n    constructor(max: number, onRemove: (element: Tile) => void) {\n        this.max = max;\n        this.onRemove = onRemove;\n        this.reset();\n    }\n\n    /**\n     * Clear the cache\n     *\n     * @returns this cache\n     */\n    reset() {\n        for (const key in this.data) {\n            for (const removedData of this.data[key]) {\n                if (removedData.timeout) clearTimeout(removedData.timeout);\n                this.onRemove(removedData.value);\n            }\n        }\n\n        this.data = {};\n        this.order = [];\n\n        return this;\n    }\n\n    /**\n     * Add a key, value combination to the cache, trimming its size if this pushes\n     * it over max length.\n     *\n     * @param tileID - lookup key for the item\n     * @param data - tile data\n     *\n     * @returns this cache\n     */\n    add(tileID: OverscaledTileID, data: Tile, expiryTimeout: number | void) {\n        const key = tileID.wrapped().key;\n        if (this.data[key] === undefined) {\n            this.data[key] = [];\n        }\n\n        const dataWrapper = {\n            value: data,\n            timeout: undefined\n        };\n\n        if (expiryTimeout !== undefined) {\n            dataWrapper.timeout = setTimeout(() => {\n                this.remove(tileID, dataWrapper);\n            }, expiryTimeout as number);\n        }\n\n        this.data[key].push(dataWrapper);\n        this.order.push(key);\n\n        if (this.order.length > this.max) {\n            const removedData = this._getAndRemoveByKey(this.order[0]);\n            if (removedData) this.onRemove(removedData);\n        }\n\n        return this;\n    }\n\n    /**\n     * Determine whether the value attached to `key` is present\n     *\n     * @param tileID - the key to be looked-up\n     * @returns whether the cache has this value\n     */\n    has(tileID: OverscaledTileID): boolean {\n        return tileID.wrapped().key in this.data;\n    }\n\n    /**\n     * Get the value attached to a specific key and remove data from cache.\n     * If the key is not found, returns `null`\n     *\n     * @param tileID - the key to look up\n     * @returns the tile data, or null if it isn't found\n     */\n    getAndRemove(tileID: OverscaledTileID): Tile {\n        if (!this.has(tileID)) { return null; }\n        return this._getAndRemoveByKey(tileID.wrapped().key);\n    }\n\n    /*\n     * Get and remove the value with the specified key.\n     */\n    _getAndRemoveByKey(key: string): Tile {\n        const data = this.data[key].shift();\n        if (data.timeout) clearTimeout(data.timeout);\n\n        if (this.data[key].length === 0) {\n            delete this.data[key];\n        }\n        this.order.splice(this.order.indexOf(key), 1);\n\n        return data.value;\n    }\n\n    /*\n     * Get the value with the specified (wrapped tile) key.\n     */\n    getByKey(key: string): Tile {\n        const data = this.data[key];\n        return data ? data[0].value : null;\n    }\n\n    /**\n     * Get the value attached to a specific key without removing data\n     * from the cache. If the key is not found, returns `null`\n     *\n     * @param tileID - the key to look up\n     * @returns the tile data, or null if it isn't found\n     */\n    get(tileID: OverscaledTileID): Tile {\n        if (!this.has(tileID)) { return null; }\n\n        const data = this.data[tileID.wrapped().key][0];\n        return data.value;\n    }\n\n    /**\n     * Remove a key/value combination from the cache.\n     *\n     * @param tileID - the key for the pair to delete\n     * @param value - If a value is provided, remove that exact version of the value.\n     * @returns this cache\n     */\n    remove(tileID: OverscaledTileID, value?: {\n        value: Tile;\n        timeout: ReturnType<typeof setTimeout>;\n    }) {\n        if (!this.has(tileID)) { return this; }\n        const key = tileID.wrapped().key;\n\n        const dataIndex = value === undefined ? 0 : this.data[key].indexOf(value);\n        const data = this.data[key][dataIndex];\n        this.data[key].splice(dataIndex, 1);\n        if (data.timeout) clearTimeout(data.timeout);\n        if (this.data[key].length === 0) {\n            delete this.data[key];\n        }\n        this.onRemove(data.value);\n        this.order.splice(this.order.indexOf(key), 1);\n\n        return this;\n    }\n\n    /**\n     * Change the max size of the cache.\n     *\n     * @param max - the max size of the cache\n     * @returns this cache\n     */\n    setMaxSize(max: number): TileCache {\n        this.max = max;\n\n        while (this.order.length > this.max) {\n            const removedData = this._getAndRemoveByKey(this.order[0]);\n            if (removedData) this.onRemove(removedData);\n        }\n\n        return this;\n    }\n\n    /**\n     * Remove entries that do not pass a filter function. Used for removing\n     * stale tiles from the cache.\n     *\n     * @param filterFn - Determines whether the tile is filtered. If the supplied function returns false, the tile will be filtered out.\n     */\n    filter(filterFn: (tile: Tile) => boolean) {\n        const removed = [];\n        for (const key in this.data) {\n            for (const entry of this.data[key]) {\n                if (!filterFn(entry.value)) {\n                    removed.push(entry);\n                }\n            }\n        }\n        for (const r of removed) {\n            this.remove(r.value.tileID, r);\n        }\n    }\n}\n", "import {extend} from '../util/util';\nimport {Tile} from './tile';\nimport type {FeatureState} from '@maplibre/maplibre-gl-style-spec';\n\nexport type FeatureStates = {[featureId: string]: FeatureState};\nexport type LayerFeatureStates = {[layer: string]: FeatureStates};\n\n/**\n * @internal\n * SourceFeatureState manages the state and pending changes\n * to features in a source, separated by source layer.\n * stateChanges and deletedStates batch all changes to the tile (updates and removes, respectively)\n * between coalesce() events. addFeatureState() and removeFeatureState() also update their counterpart's\n * list of changes, such that coalesce() can apply the proper state changes while agnostic to the order of operations.\n * In deletedStates, all null's denote complete removal of state at that scope\n*/\nexport class SourceFeatureState {\n    state: LayerFeatureStates;\n    stateChanges: LayerFeatureStates;\n    deletedStates: {};\n\n    constructor() {\n        this.state = {};\n        this.stateChanges = {};\n        this.deletedStates = {};\n    }\n\n    updateState(sourceLayer: string, featureId: number | string, newState: any) {\n        const feature = String(featureId);\n        this.stateChanges[sourceLayer] = this.stateChanges[sourceLayer] || {};\n        this.stateChanges[sourceLayer][feature] = this.stateChanges[sourceLayer][feature] || {};\n        extend(this.stateChanges[sourceLayer][feature], newState);\n\n        if (this.deletedStates[sourceLayer] === null) {\n            this.deletedStates[sourceLayer] = {};\n            for (const ft in this.state[sourceLayer]) {\n                if (ft !== feature) this.deletedStates[sourceLayer][ft] = null;\n            }\n        } else {\n            const featureDeletionQueued = this.deletedStates[sourceLayer] && this.deletedStates[sourceLayer][feature] === null;\n            if (featureDeletionQueued) {\n                this.deletedStates[sourceLayer][feature] = {};\n                for (const prop in this.state[sourceLayer][feature]) {\n                    if (!newState[prop]) this.deletedStates[sourceLayer][feature][prop] = null;\n                }\n            } else {\n                for (const key in newState) {\n                    const deletionInQueue = this.deletedStates[sourceLayer] && this.deletedStates[sourceLayer][feature] && this.deletedStates[sourceLayer][feature][key] === null;\n                    if (deletionInQueue) delete this.deletedStates[sourceLayer][feature][key];\n                }\n            }\n        }\n    }\n\n    removeFeatureState(sourceLayer: string, featureId?: number | string, key?: string) {\n        const sourceLayerDeleted = this.deletedStates[sourceLayer] === null;\n        if (sourceLayerDeleted) return;\n\n        const feature = String(featureId);\n\n        this.deletedStates[sourceLayer] = this.deletedStates[sourceLayer] || {};\n\n        if (key && featureId !== undefined) {\n            if (this.deletedStates[sourceLayer][feature] !== null) {\n                this.deletedStates[sourceLayer][feature] = this.deletedStates[sourceLayer][feature] || {};\n                this.deletedStates[sourceLayer][feature][key] = null;\n            }\n        } else if (featureId !== undefined) {\n            const updateInQueue = this.stateChanges[sourceLayer] && this.stateChanges[sourceLayer][feature];\n            if (updateInQueue) {\n                this.deletedStates[sourceLayer][feature] = {};\n                for (key in this.stateChanges[sourceLayer][feature]) this.deletedStates[sourceLayer][feature][key] = null;\n\n            } else {\n                this.deletedStates[sourceLayer][feature] = null;\n            }\n        } else {\n            this.deletedStates[sourceLayer] = null;\n        }\n\n    }\n\n    getState(sourceLayer: string, featureId: number | string) {\n        const feature = String(featureId);\n        const base = this.state[sourceLayer] || {};\n        const changes = this.stateChanges[sourceLayer] || {};\n\n        const reconciledState = extend({}, base[feature], changes[feature]);\n\n        //return empty object if the whole source layer is awaiting deletion\n        if (this.deletedStates[sourceLayer] === null) return {};\n        else if (this.deletedStates[sourceLayer]) {\n            const featureDeletions = this.deletedStates[sourceLayer][featureId];\n            if (featureDeletions === null) return {};\n            for (const prop in featureDeletions) delete reconciledState[prop];\n        }\n        return reconciledState;\n    }\n\n    initializeTileState(tile: Tile, painter: any) {\n        tile.setFeatureState(this.state, painter);\n    }\n\n    coalesceChanges(tiles: {\n        [_ in any]: Tile;\n    }, painter: any) {\n        //track changes with full state objects, but only for features that got modified\n        const featuresChanged: LayerFeatureStates = {};\n\n        for (const sourceLayer in this.stateChanges) {\n            this.state[sourceLayer]  = this.state[sourceLayer] || {};\n            const layerStates = {};\n            for (const feature in this.stateChanges[sourceLayer]) {\n                if (!this.state[sourceLayer][feature]) this.state[sourceLayer][feature] = {};\n                extend(this.state[sourceLayer][feature], this.stateChanges[sourceLayer][feature]);\n                layerStates[feature] = this.state[sourceLayer][feature];\n            }\n            featuresChanged[sourceLayer] = layerStates;\n        }\n\n        for (const sourceLayer in this.deletedStates) {\n            this.state[sourceLayer]  = this.state[sourceLayer] || {};\n            const layerStates = {};\n\n            if (this.deletedStates[sourceLayer] === null) {\n                for (const ft in this.state[sourceLayer]) {\n                    layerStates[ft] = {};\n                    this.state[sourceLayer][ft] = {};\n                }\n            } else {\n                for (const feature in this.deletedStates[sourceLayer]) {\n                    const deleteWholeFeatureState = this.deletedStates[sourceLayer][feature] === null;\n                    if (deleteWholeFeatureState) this.state[sourceLayer][feature] = {};\n                    else {\n                        for (const key of Object.keys(this.deletedStates[sourceLayer][feature])) {\n                            delete this.state[sourceLayer][feature][key];\n                        }\n                    }\n                    layerStates[feature] = this.state[sourceLayer][feature];\n                }\n            }\n\n            featuresChanged[sourceLayer] = featuresChanged[sourceLayer] || {};\n            extend(featuresChanged[sourceLayer], layerStates);\n        }\n\n        this.stateChanges = {};\n        this.deletedStates = {};\n\n        if (Object.keys(featuresChanged).length === 0) return;\n\n        for (const id in tiles) {\n            const tile = tiles[id];\n            tile.setFeatureState(featuresChanged, painter);\n        }\n    }\n}\n", "import {create as createSource} from './source';\n\nimport {Tile} from './tile';\nimport {Event, ErrorEvent, Evented} from '../util/evented';\nimport {TileCache} from './tile_cache';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {keysDifference} from '../util/util';\nimport {EXTENT} from '../data/extent';\nimport {Context} from '../gl/context';\nimport Point from '@mapbox/point-geometry';\nimport {browser} from '../util/browser';\nimport {OverscaledTileID} from './tile_id';\nimport {SourceFeatureState} from './source_state';\nimport {config} from '../util/config';\n\nimport type {Source} from './source';\nimport type {Map} from '../ui/map';\nimport type {Style} from '../style/style';\nimport type {Dispatcher} from '../util/dispatcher';\nimport type {Transform} from '../geo/transform';\nimport type {TileState} from './tile';\nimport type {SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {MapSourceDataEvent} from '../ui/events';\nimport type {Terrain} from '../render/terrain';\nimport type {CanvasSourceSpecification} from './canvas_source';\n\n/**\n * @internal\n * `SourceCache` is responsible for\n *\n *  - creating an instance of `Source`\n *  - forwarding events from `Source`\n *  - caching tiles loaded from an instance of `Source`\n *  - loading the tiles needed to render a given viewport\n *  - unloading the cached tiles not needed to render a given viewport\n */\nexport class SourceCache extends Evented {\n    id: string;\n    dispatcher: Dispatcher;\n    map: Map;\n    style: Style;\n\n    _source: Source;\n\n    /**\n     * @internal\n     * signifies that the TileJSON is loaded if applicable.\n     * if the source type does not come with a TileJSON, the flag signifies the\n     * source data has loaded (i.e geojson has been tiled on the worker and is ready)\n     */\n    _sourceLoaded: boolean;\n\n    _sourceErrored: boolean;\n    _tiles: {[_: string]: Tile};\n    _prevLng: number;\n    _cache: TileCache;\n    _timers: {\n        [_ in any]: ReturnType<typeof setTimeout>;\n    };\n    _cacheTimers: {\n        [_ in any]: ReturnType<typeof setTimeout>;\n    };\n    _maxTileCacheSize: number;\n    _maxTileCacheZoomLevels: number;\n    _paused: boolean;\n    _shouldReloadOnResume: boolean;\n    _coveredTiles: {[_: string]: boolean};\n    transform: Transform;\n    terrain: Terrain;\n    used: boolean;\n    usedForTerrain: boolean;\n    tileSize: number;\n    _state: SourceFeatureState;\n    _loadedParentTiles: {[_: string]: Tile};\n    _loadedSiblingTiles: {[_: string]: Tile};\n    _didEmitContent: boolean;\n    _updated: boolean;\n\n    static maxUnderzooming: number;\n    static maxOverzooming: number;\n\n    constructor(id: string, options: SourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher) {\n        super();\n        this.id = id;\n        this.dispatcher = dispatcher;\n\n        this.on('data', (e: MapSourceDataEvent) => this._dataHandler(e));\n\n        this.on('dataloading', () => {\n            this._sourceErrored = false;\n        });\n\n        this.on('error', () => {\n            // Only set _sourceErrored if the source does not have pending loads.\n            this._sourceErrored = this._source.loaded();\n        });\n\n        this._source = createSource(id, options, dispatcher, this);\n\n        this._tiles = {};\n        this._cache = new TileCache(0, (tile) => this._unloadTile(tile));\n        this._timers = {};\n        this._cacheTimers = {};\n        this._maxTileCacheSize = null;\n        this._maxTileCacheZoomLevels = null;\n        this._loadedParentTiles = {};\n\n        this._coveredTiles = {};\n        this._state = new SourceFeatureState();\n        this._didEmitContent = false;\n        this._updated = false;\n    }\n\n    onAdd(map: Map) {\n        this.map = map;\n        this._maxTileCacheSize = map ? map._maxTileCacheSize : null;\n        this._maxTileCacheZoomLevels = map ? map._maxTileCacheZoomLevels : null;\n        if (this._source && this._source.onAdd) {\n            this._source.onAdd(map);\n        }\n    }\n\n    onRemove(map: Map) {\n        this.clearTiles();\n        if (this._source && this._source.onRemove) {\n            this._source.onRemove(map);\n        }\n    }\n\n    /**\n     * Return true if no tile data is pending, tiles will not change unless\n     * an additional API call is received.\n     */\n    loaded(): boolean {\n        if (this._sourceErrored) { return true; }\n        if (!this._sourceLoaded) { return false; }\n        if (!this._source.loaded()) { return false; }\n        if ((this.used !== undefined || this.usedForTerrain !== undefined) && !this.used && !this.usedForTerrain) { return true; }\n        // do not consider as loaded if the update hasn't been called yet (we do not know if we will have any tiles to fetch)\n        if (!this._updated) { return false; }\n\n        for (const t in this._tiles) {\n            const tile = this._tiles[t];\n            if (tile.state !== 'loaded' && tile.state !== 'errored')\n                return false;\n        }\n        return true;\n    }\n\n    getSource(): Source {\n        return this._source;\n    }\n\n    pause() {\n        this._paused = true;\n    }\n\n    resume() {\n        if (!this._paused) return;\n        const shouldReload = this._shouldReloadOnResume;\n        this._paused = false;\n        this._shouldReloadOnResume = false;\n        if (shouldReload) this.reload();\n        if (this.transform) this.update(this.transform, this.terrain);\n    }\n\n    async _loadTile(tile: Tile, id: string, state: TileState): Promise<void> {\n        try {\n            await this._source.loadTile(tile);\n            this._tileLoaded(tile, id, state);\n        } catch (err) {\n            tile.state = 'errored';\n            if ((err as any).status !== 404) {\n                this._source.fire(new ErrorEvent(err, {tile}));\n            } else {\n                // continue to try loading parent/children tiles if a tile doesn't exist (404)\n                this.update(this.transform, this.terrain);\n            }\n        }\n    }\n\n    _unloadTile(tile: Tile) {\n        if (this._source.unloadTile)\n            this._source.unloadTile(tile);\n    }\n\n    _abortTile(tile: Tile) {\n        if (this._source.abortTile)\n            this._source.abortTile(tile);\n\n        this._source.fire(new Event('dataabort', {tile, coord: tile.tileID, dataType: 'source'}));\n    }\n\n    serialize() {\n        return this._source.serialize();\n    }\n\n    prepare(context: Context) {\n        if  (this._source.prepare) {\n            this._source.prepare();\n        }\n\n        this._state.coalesceChanges(this._tiles, this.map ? this.map.painter : null);\n        for (const i in this._tiles) {\n            const tile = this._tiles[i];\n            tile.upload(context);\n            tile.prepare(this.map.style.imageManager);\n        }\n    }\n\n    /**\n     * Return all tile ids ordered with z-order, and cast to numbers\n     */\n    getIds(): Array<string> {\n        return (Object.values(this._tiles) as any).map((tile: Tile) => tile.tileID).sort(compareTileId).map(id => id.key);\n    }\n\n    getRenderableIds(symbolLayer?: boolean): Array<string> {\n        const renderables: Array<Tile> = [];\n        for (const id in this._tiles) {\n            if (this._isIdRenderable(id, symbolLayer)) renderables.push(this._tiles[id]);\n        }\n        if (symbolLayer) {\n            return renderables.sort((a_: Tile, b_: Tile) => {\n                const a = a_.tileID;\n                const b = b_.tileID;\n                const rotatedA = (new Point(a.canonical.x, a.canonical.y))._rotate(this.transform.angle);\n                const rotatedB = (new Point(b.canonical.x, b.canonical.y))._rotate(this.transform.angle);\n                return a.overscaledZ - b.overscaledZ || rotatedB.y - rotatedA.y || rotatedB.x - rotatedA.x;\n            }).map(tile => tile.tileID.key);\n        }\n        return renderables.map(tile => tile.tileID).sort(compareTileId).map(id => id.key);\n    }\n\n    hasRenderableParent(tileID: OverscaledTileID) {\n        const parentTile = this.findLoadedParent(tileID, 0);\n        if (parentTile) {\n            return this._isIdRenderable(parentTile.tileID.key);\n        }\n        return false;\n    }\n\n    _isIdRenderable(id: string, symbolLayer?: boolean) {\n        return this._tiles[id] && this._tiles[id].hasData() &&\n            !this._coveredTiles[id] && (symbolLayer || !this._tiles[id].holdingForFade());\n    }\n\n    reload() {\n        if (this._paused) {\n            this._shouldReloadOnResume = true;\n            return;\n        }\n\n        this._cache.reset();\n\n        for (const i in this._tiles) {\n            if (this._tiles[i].state !== 'errored') this._reloadTile(i, 'reloading');\n        }\n    }\n\n    async _reloadTile(id: string, state: TileState) {\n        const tile = this._tiles[id];\n\n        // this potentially does not address all underlying\n        // issues https://github.com/mapbox/mapbox-gl-js/issues/4252\n        // - hard to tell without repro steps\n        if (!tile) return;\n\n        // The difference between \"loading\" tiles and \"reloading\" or \"expired\"\n        // tiles is that \"reloading\"/\"expired\" tiles are \"renderable\".\n        // Therefore, a \"loading\" tile cannot become a \"reloading\" tile without\n        // first becoming a \"loaded\" tile.\n        if (tile.state !== 'loading') {\n            tile.state = state;\n        }\n        await this._loadTile(tile, id, state);\n    }\n\n    _tileLoaded(tile: Tile, id: string, previousState: TileState) {\n        tile.timeAdded = browser.now();\n        if (previousState === 'expired') tile.refreshedUponExpiration = true;\n        this._setTileReloadTimer(id, tile);\n        if (this.getSource().type === 'raster-dem' && tile.dem) this._backfillDEM(tile);\n        this._state.initializeTileState(tile, this.map ? this.map.painter : null);\n\n        if (!tile.aborted) {\n            this._source.fire(new Event('data', {dataType: 'source', tile, coord: tile.tileID}));\n        }\n    }\n\n    /**\n     * For raster terrain source, backfill DEM to eliminate visible tile boundaries\n     */\n    _backfillDEM(tile: Tile) {\n        const renderables = this.getRenderableIds();\n        for (let i = 0; i < renderables.length; i++) {\n            const borderId = renderables[i];\n            if (tile.neighboringTiles && tile.neighboringTiles[borderId]) {\n                const borderTile = this.getTileByID(borderId);\n                fillBorder(tile, borderTile);\n                fillBorder(borderTile, tile);\n            }\n        }\n\n        function fillBorder(tile, borderTile) {\n            tile.needsHillshadePrepare = true;\n            tile.needsTerrainPrepare = true;\n            let dx = borderTile.tileID.canonical.x - tile.tileID.canonical.x;\n            const dy = borderTile.tileID.canonical.y - tile.tileID.canonical.y;\n            const dim = Math.pow(2, tile.tileID.canonical.z);\n            const borderId = borderTile.tileID.key;\n            if (dx === 0 && dy === 0) return;\n\n            if (Math.abs(dy) > 1) {\n                return;\n            }\n            if (Math.abs(dx) > 1) {\n                // Adjust the delta coordinate for world wraparound.\n                if (Math.abs(dx + dim) === 1) {\n                    dx += dim;\n                } else if (Math.abs(dx - dim) === 1) {\n                    dx -= dim;\n                }\n            }\n            if (!borderTile.dem || !tile.dem) return;\n            tile.dem.backfillBorder(borderTile.dem, dx, dy);\n            if (tile.neighboringTiles && tile.neighboringTiles[borderId])\n                tile.neighboringTiles[borderId].backfilled = true;\n        }\n    }\n    /**\n     * Get a specific tile by TileID\n     */\n    getTile(tileID: OverscaledTileID): Tile {\n        return this.getTileByID(tileID.key);\n    }\n\n    /**\n     * Get a specific tile by id\n     */\n    getTileByID(id: string): Tile {\n        return this._tiles[id];\n    }\n\n    /**\n     * For a given set of tiles, retain children that are loaded and have a zoom\n     * between `zoom` (exclusive) and `maxCoveringZoom` (inclusive)\n     */\n    _retainLoadedChildren(\n        idealTiles: {\n            [_ in any]: OverscaledTileID;\n        },\n        zoom: number,\n        maxCoveringZoom: number,\n        retain: {\n            [_ in any]: OverscaledTileID;\n        }\n    ) {\n        for (const id in this._tiles) {\n            let tile = this._tiles[id];\n\n            // only consider renderable tiles up to maxCoveringZoom\n            if (retain[id] ||\n                !tile.hasData() ||\n                tile.tileID.overscaledZ <= zoom ||\n                tile.tileID.overscaledZ > maxCoveringZoom\n            ) continue;\n\n            // loop through parents and retain the topmost loaded one if found\n            let topmostLoadedID = tile.tileID;\n            while (tile && tile.tileID.overscaledZ > zoom + 1) {\n                const parentID = tile.tileID.scaledTo(tile.tileID.overscaledZ - 1);\n\n                tile = this._tiles[parentID.key];\n\n                if (tile && tile.hasData()) {\n                    topmostLoadedID = parentID;\n                }\n            }\n\n            // loop through ancestors of the topmost loaded child to see if there's one that needed it\n            let tileID = topmostLoadedID;\n            while (tileID.overscaledZ > zoom) {\n                tileID = tileID.scaledTo(tileID.overscaledZ - 1);\n\n                if (idealTiles[tileID.key]) {\n                    // found a parent that needed a loaded child; retain that child\n                    retain[topmostLoadedID.key] = topmostLoadedID;\n                    break;\n                }\n            }\n        }\n    }\n\n    /**\n     * Find a loaded parent of the given tile (up to minCoveringZoom)\n     */\n    findLoadedParent(tileID: OverscaledTileID, minCoveringZoom: number): Tile {\n        if (tileID.key in this._loadedParentTiles) {\n            const parent = this._loadedParentTiles[tileID.key];\n            if (parent && parent.tileID.overscaledZ >= minCoveringZoom) {\n                return parent;\n            } else {\n                return null;\n            }\n        }\n        for (let z = tileID.overscaledZ - 1; z >= minCoveringZoom; z--) {\n            const parentTileID = tileID.scaledTo(z);\n            const tile = this._getLoadedTile(parentTileID);\n            if (tile) {\n                return tile;\n            }\n        }\n    }\n\n    /**\n     * Find a loaded sibling of the given tile\n     */\n    findLoadedSibling(tileID: OverscaledTileID): Tile {\n        // If a tile with this ID already exists, return it\n        return this._getLoadedTile(tileID);\n    }\n\n    _getLoadedTile(tileID: OverscaledTileID): Tile {\n        const tile = this._tiles[tileID.key];\n        if (tile && tile.hasData()) {\n            return tile;\n        }\n        // TileCache ignores wrap in lookup.\n        const cachedTile = this._cache.getByKey(tileID.wrapped().key);\n        return cachedTile;\n    }\n\n    /**\n     * Resizes the tile cache based on the current viewport's size\n     * or the maxTileCacheSize option passed during map creation\n     *\n     * Larger viewports use more tiles and need larger caches. Larger viewports\n     * are more likely to be found on devices with more memory and on pages where\n     * the map is more important.\n     */\n    updateCacheSize(transform: Transform) {\n        const widthInTiles = Math.ceil(transform.width / this._source.tileSize) + 1;\n        const heightInTiles = Math.ceil(transform.height / this._source.tileSize) + 1;\n        const approxTilesInView = widthInTiles * heightInTiles;\n        const commonZoomRange = this._maxTileCacheZoomLevels === null ?\n            config.MAX_TILE_CACHE_ZOOM_LEVELS : this._maxTileCacheZoomLevels;\n        const viewDependentMaxSize = Math.floor(approxTilesInView * commonZoomRange);\n        const maxSize = typeof this._maxTileCacheSize === 'number' ?\n            Math.min(this._maxTileCacheSize, viewDependentMaxSize) : viewDependentMaxSize;\n\n        this._cache.setMaxSize(maxSize);\n    }\n\n    handleWrapJump(lng: number) {\n        // On top of the regular z/x/y values, TileIDs have a `wrap` value that specify\n        // which copy of the world the tile belongs to. For example, at `lng: 10` you\n        // might render z/x/y/0 while at `lng: 370` you would render z/x/y/1.\n        //\n        // When lng values get wrapped (going from `lng: 370` to `long: 10`) you expect\n        // to see the same thing on the screen (370 degrees and 10 degrees is the same\n        // place in the world) but all the TileIDs will have different wrap values.\n        //\n        // In order to make this transition seamless, we calculate the rounded difference of\n        // \"worlds\" between the last frame and the current frame. If the map panned by\n        // a world, then we can assign all the tiles new TileIDs with updated wrap values.\n        // For example, assign z/x/y/1 a new id: z/x/y/0. It is the same tile, just rendered\n        // in a different position.\n        //\n        // This enables us to reuse the tiles at more ideal locations and prevent flickering.\n        const prevLng = this._prevLng === undefined ? lng : this._prevLng;\n        const lngDifference = lng - prevLng;\n        const worldDifference = lngDifference / 360;\n        const wrapDelta = Math.round(worldDifference);\n        this._prevLng = lng;\n\n        if (wrapDelta) {\n            const tiles: {[_: string]: Tile} = {};\n            for (const key in this._tiles) {\n                const tile = this._tiles[key];\n                tile.tileID = tile.tileID.unwrapTo(tile.tileID.wrap + wrapDelta);\n                tiles[tile.tileID.key] = tile;\n            }\n            this._tiles = tiles;\n\n            // Reset tile reload timers\n            for (const id in this._timers) {\n                clearTimeout(this._timers[id]);\n                delete this._timers[id];\n            }\n            for (const id in this._tiles) {\n                const tile = this._tiles[id];\n                this._setTileReloadTimer(id, tile);\n            }\n        }\n    }\n\n    _updateCoveredAndRetainedTiles(\n        retain: { [_: string]: OverscaledTileID },\n        minCoveringZoom: number,\n        maxCoveringZoom: number,\n        zoom: number,\n        idealTileIDs: OverscaledTileID[],\n        terrain?: Terrain\n    ) {\n        const tilesForFading: { [_: string]: OverscaledTileID } = {};\n        const fadingTiles = {};\n        const ids = Object.keys(retain);\n        const now = browser.now();\n        for (const id of ids) {\n            const tileID = retain[id];\n\n            const tile = this._tiles[id];\n\n            // when fadeEndTime is 0, the tile is created but registerFadeDuration\n            // has not been called, therefore must be kept in fadingTiles dictionary\n            // for next round of rendering\n            if (!tile || (tile.fadeEndTime !== 0 && tile.fadeEndTime <= now)) {\n                continue;\n            }\n\n            // if the tile is loaded but still fading in, find parents to cross-fade with it\n            const parentTile = this.findLoadedParent(tileID, minCoveringZoom);\n            const siblingTile = this.findLoadedSibling(tileID);\n            const fadeTileRef = parentTile || siblingTile || null;\n            if (fadeTileRef) {\n                this._addTile(fadeTileRef.tileID);\n                tilesForFading[fadeTileRef.tileID.key] = fadeTileRef.tileID;\n            }\n\n            fadingTiles[id] = tileID;\n        }\n\n        // for tiles that are still fading in, also find children to cross-fade with\n        this._retainLoadedChildren(fadingTiles, zoom, maxCoveringZoom, retain);\n\n        for (const id in tilesForFading) {\n            if (!retain[id]) {\n                // If a tile is only needed for fading, mark it as covered so that it isn't rendered on it's own.\n                this._coveredTiles[id] = true;\n                retain[id] = tilesForFading[id];\n            }\n        }\n\n        // disable fading logic in terrain3D mode to avoid rendering two tiles on the same place\n        if (terrain) {\n            const idealRasterTileIDs: { [_: string]: OverscaledTileID } = {};\n            const missingTileIDs: { [_: string]: OverscaledTileID } = {};\n            for (const tileID of idealTileIDs) {\n                if (this._tiles[tileID.key].hasData())\n                    idealRasterTileIDs[tileID.key] = tileID;\n                else\n                    missingTileIDs[tileID.key] = tileID;\n            }\n            // search for a complete set of children for each missing tile\n            for (const key in missingTileIDs) {\n                const children = missingTileIDs[key].children(this._source.maxzoom);\n                if (this._tiles[children[0].key] && this._tiles[children[1].key] && this._tiles[children[2].key] && this._tiles[children[3].key]) {\n                    idealRasterTileIDs[children[0].key] = retain[children[0].key] = children[0];\n                    idealRasterTileIDs[children[1].key] = retain[children[1].key] = children[1];\n                    idealRasterTileIDs[children[2].key] = retain[children[2].key] = children[2];\n                    idealRasterTileIDs[children[3].key] = retain[children[3].key] = children[3];\n                    delete missingTileIDs[key];\n                }\n            }\n            // search for parent or sibling for each missing tile\n            for (const key in missingTileIDs) {\n                const tileID = missingTileIDs[key];\n                const parentTile = this.findLoadedParent(tileID, this._source.minzoom);\n                const siblingTile = this.findLoadedSibling(tileID);\n                const fadeTileRef = parentTile || siblingTile || null;\n                if (fadeTileRef) {\n                    idealRasterTileIDs[fadeTileRef.tileID.key] = retain[fadeTileRef.tileID.key] = fadeTileRef.tileID;\n                    // remove idealTiles which would be rendered twice\n                    for (const key in idealRasterTileIDs) {\n                        if (idealRasterTileIDs[key].isChildOf(fadeTileRef.tileID)) delete idealRasterTileIDs[key];\n                    }\n                }\n            }\n            // cover all tiles which are not needed\n            for (const key in this._tiles) {\n                if (!idealRasterTileIDs[key]) this._coveredTiles[key] = true;\n            }\n        }\n    }\n\n    /**\n     * Removes tiles that are outside the viewport and adds new tiles that\n     * are inside the viewport.\n     */\n    update(transform: Transform, terrain?: Terrain) {\n        if (!this._sourceLoaded || this._paused) {\n            return;\n        }\n        this.transform = transform;\n        this.terrain = terrain;\n\n        this.updateCacheSize(transform);\n        this.handleWrapJump(this.transform.center.lng);\n\n        // Covered is a list of retained tiles who's areas are fully covered by other,\n        // better, retained tiles. They are not drawn separately.\n        this._coveredTiles = {};\n\n        let idealTileIDs: OverscaledTileID[];\n\n        if (!this.used && !this.usedForTerrain) {\n            idealTileIDs = [];\n        } else if (this._source.tileID) {\n            idealTileIDs = transform.getVisibleUnwrappedCoordinates(this._source.tileID)\n                .map((unwrapped) => new OverscaledTileID(unwrapped.canonical.z, unwrapped.wrap, unwrapped.canonical.z, unwrapped.canonical.x, unwrapped.canonical.y));\n        } else {\n            idealTileIDs = transform.coveringTiles({\n                tileSize: this.usedForTerrain ? this.tileSize : this._source.tileSize,\n                minzoom: this._source.minzoom,\n                maxzoom: this._source.maxzoom,\n                roundZoom: this.usedForTerrain ? false : this._source.roundZoom,\n                reparseOverscaled: this._source.reparseOverscaled,\n                terrain\n            });\n\n            if (this._source.hasTile) {\n                idealTileIDs = idealTileIDs.filter((coord) => (this._source.hasTile as any)(coord));\n            }\n        }\n\n        // Determine the overzooming/underzooming amounts.\n        const zoom = transform.coveringZoomLevel(this._source);\n        const minCoveringZoom = Math.max(zoom - SourceCache.maxOverzooming, this._source.minzoom);\n        const maxCoveringZoom = Math.max(zoom + SourceCache.maxUnderzooming,  this._source.minzoom);\n\n        // When sourcecache is used for terrain also load parent tiles to avoid flickering when zooming out\n        if (this.usedForTerrain) {\n            const parents = {};\n            for (const tileID of idealTileIDs) {\n                if (tileID.canonical.z > this._source.minzoom) {\n                    const parent = tileID.scaledTo(tileID.canonical.z - 1);\n                    parents[parent.key] = parent;\n                    // load very low zoom to calculate tile visibility in transform.coveringTiles and high zoomlevels correct\n                    const parent2 = tileID.scaledTo(Math.max(this._source.minzoom, Math.min(tileID.canonical.z, 5)));\n                    parents[parent2.key] = parent2;\n                }\n            }\n            idealTileIDs = idealTileIDs.concat(Object.values(parents));\n        }\n\n        const noPendingDataEmissions = idealTileIDs.length === 0 && !this._updated && this._didEmitContent;\n        this._updated = true;\n        // if we won't have any tiles to fetch and content is already emitted\n        // there will be no more data emissions, so we need to emit the event with isSourceLoaded = true\n        if (noPendingDataEmissions) {\n            this.fire(new Event('data', {sourceDataType: 'idle', dataType: 'source', sourceId: this.id}));\n        }\n\n        // Retain is a list of tiles that we shouldn't delete, even if they are not\n        // the most ideal tile for the current viewport. This may include tiles like\n        // parent or child tiles that are *already* loaded.\n        const retain = this._updateRetainedTiles(idealTileIDs, zoom);\n\n        if (isRasterType(this._source.type)) {\n            this._updateCoveredAndRetainedTiles(retain, minCoveringZoom, maxCoveringZoom, zoom, idealTileIDs, terrain);\n        }\n\n        for (const retainedId in retain) {\n            // Make sure retained tiles always clear any existing fade holds\n            // so that if they're removed again their fade timer starts fresh.\n            this._tiles[retainedId].clearFadeHold();\n        }\n\n        // Remove the tiles we don't need anymore.\n        const remove = keysDifference(this._tiles, retain);\n        for (const tileID of remove) {\n            const tile = this._tiles[tileID];\n            if (tile.hasSymbolBuckets && !tile.holdingForFade()) {\n                tile.setHoldDuration(this.map._fadeDuration);\n            } else if (!tile.hasSymbolBuckets || tile.symbolFadeFinished()) {\n                this._removeTile(tileID);\n            }\n        }\n\n        // Construct caches of loaded parents & siblings\n        this._updateLoadedParentTileCache();\n        this._updateLoadedSiblingTileCache();\n    }\n\n    releaseSymbolFadeTiles() {\n        for (const id in this._tiles) {\n            if (this._tiles[id].holdingForFade()) {\n                this._removeTile(id);\n            }\n        }\n    }\n\n    _updateRetainedTiles(idealTileIDs: Array<OverscaledTileID>, zoom: number): {[_: string]: OverscaledTileID} {\n        const retain: {[_: string]: OverscaledTileID} = {};\n        const checked: {[_: string]: boolean} = {};\n        const minCoveringZoom = Math.max(zoom - SourceCache.maxOverzooming, this._source.minzoom);\n        const maxCoveringZoom = Math.max(zoom + SourceCache.maxUnderzooming,  this._source.minzoom);\n\n        const missingTiles = {};\n        for (const tileID of idealTileIDs) {\n            const tile = this._addTile(tileID);\n\n            // retain the tile even if it's not loaded because it's an ideal tile.\n            retain[tileID.key] = tileID;\n\n            if (tile.hasData()) continue;\n\n            if (zoom < this._source.maxzoom) {\n                // save missing tiles that potentially have loaded children\n                missingTiles[tileID.key] = tileID;\n            }\n        }\n\n        // retain any loaded children of ideal tiles up to maxCoveringZoom\n        this._retainLoadedChildren(missingTiles, zoom, maxCoveringZoom, retain);\n\n        for (const tileID of idealTileIDs) {\n            let tile = this._tiles[tileID.key];\n\n            if (tile.hasData()) continue;\n\n            // The tile we require is not yet loaded or does not exist;\n            // Attempt to find children that fully cover it.\n\n            if (zoom + 1 > this._source.maxzoom) {\n                // We're looking for an overzoomed child tile.\n                const childCoord = tileID.children(this._source.maxzoom)[0];\n                const childTile = this.getTile(childCoord);\n                if (!!childTile && childTile.hasData()) {\n                    retain[childCoord.key] = childCoord;\n                    continue; // tile is covered by overzoomed child\n                }\n            } else {\n                // check if all 4 immediate children are loaded (i.e. the missing ideal tile is covered)\n                const children = tileID.children(this._source.maxzoom);\n\n                if (retain[children[0].key] &&\n                    retain[children[1].key] &&\n                    retain[children[2].key] &&\n                    retain[children[3].key]) continue; // tile is covered by children\n            }\n\n            // We couldn't find child tiles that entirely cover the ideal tile; look for parents now.\n\n            // As we ascend up the tile pyramid of the ideal tile, we check whether the parent\n            // tile has been previously requested (and errored because we only loop over tiles with no data)\n            // in order to determine if we need to request its parent.\n            let parentWasRequested = tile.wasRequested();\n\n            for (let overscaledZ = tileID.overscaledZ - 1; overscaledZ >= minCoveringZoom; --overscaledZ) {\n                const parentId = tileID.scaledTo(overscaledZ);\n\n                // Break parent tile ascent if this route has been previously checked by another child.\n                if (checked[parentId.key]) break;\n                checked[parentId.key] = true;\n\n                tile = this.getTile(parentId);\n                if (!tile && parentWasRequested) {\n                    tile = this._addTile(parentId);\n                }\n                if (tile) {\n                    const hasData = tile.hasData();\n                    if (hasData || !this.map?.cancelPendingTileRequestsWhileZooming || parentWasRequested) {\n                        retain[parentId.key] = parentId;\n                    }\n                    // Save the current values, since they're the parent of the next iteration\n                    // of the parent tile ascent loop.\n                    parentWasRequested = tile.wasRequested();\n                    if (hasData) break;\n                }\n            }\n        }\n\n        return retain;\n    }\n\n    _updateLoadedParentTileCache() {\n        this._loadedParentTiles = {};\n\n        for (const tileKey in this._tiles) {\n            const path = [];\n            let parentTile: Tile;\n            let currentId = this._tiles[tileKey].tileID;\n\n            // Find the closest loaded ancestor by traversing the tile tree towards the root and\n            // caching results along the way\n            while (currentId.overscaledZ > 0) {\n\n                // Do we have a cached result from previous traversals?\n                if (currentId.key in this._loadedParentTiles) {\n                    parentTile = this._loadedParentTiles[currentId.key];\n                    break;\n                }\n\n                path.push(currentId.key);\n\n                // Is the parent loaded?\n                const parentId = currentId.scaledTo(currentId.overscaledZ - 1);\n                parentTile = this._getLoadedTile(parentId);\n                if (parentTile) {\n                    break;\n                }\n\n                currentId = parentId;\n            }\n\n            // Cache the result of this traversal to all newly visited tiles\n            for (const key of path) {\n                this._loadedParentTiles[key] = parentTile;\n            }\n        }\n    }\n\n    /**\n     * Update the cache of loaded sibling tiles\n     *\n     * Sibling tiles are tiles that share the same zoom level and\n     * x/y position but have different wrap values\n     * Maintaining sibling tile cache allows fading from old to new tiles\n     * of the same position and zoom level\n     */\n    _updateLoadedSiblingTileCache() {\n        this._loadedSiblingTiles = {};\n\n        for (const tileKey in this._tiles) {\n            const currentId = this._tiles[tileKey].tileID;\n            const siblingTile: Tile = this._getLoadedTile(currentId);\n            this._loadedSiblingTiles[currentId.key] = siblingTile;\n        }\n    }\n\n    /**\n     * Add a tile, given its coordinate, to the pyramid.\n     */\n    _addTile(tileID: OverscaledTileID): Tile {\n        let tile = this._tiles[tileID.key];\n        if (tile)\n            return tile;\n\n        tile = this._cache.getAndRemove(tileID);\n        if (tile) {\n            this._setTileReloadTimer(tileID.key, tile);\n            // set the tileID because the cached tile could have had a different wrap value\n            tile.tileID = tileID;\n            this._state.initializeTileState(tile, this.map ? this.map.painter : null);\n            if (this._cacheTimers[tileID.key]) {\n                clearTimeout(this._cacheTimers[tileID.key]);\n                delete this._cacheTimers[tileID.key];\n                this._setTileReloadTimer(tileID.key, tile);\n            }\n        }\n\n        const cached = tile;\n\n        if (!tile) {\n            tile = new Tile(tileID, this._source.tileSize * tileID.overscaleFactor());\n            this._loadTile(tile, tileID.key, tile.state);\n        }\n\n        tile.uses++;\n        this._tiles[tileID.key] = tile;\n        if (!cached) {\n            this._source.fire(new Event('dataloading', {tile, coord: tile.tileID, dataType: 'source'}));\n        }\n\n        return tile;\n    }\n\n    _setTileReloadTimer(id: string, tile: Tile) {\n        if (id in this._timers) {\n            clearTimeout(this._timers[id]);\n            delete this._timers[id];\n        }\n\n        const expiryTimeout = tile.getExpiryTimeout();\n        if (expiryTimeout) {\n            this._timers[id] = setTimeout(() => {\n                this._reloadTile(id, 'expired');\n                delete this._timers[id];\n            }, expiryTimeout);\n        }\n    }\n\n    /**\n     * Remove a tile, given its id, from the pyramid\n     */\n    _removeTile(id: string) {\n        const tile = this._tiles[id];\n        if (!tile)\n            return;\n\n        tile.uses--;\n        delete this._tiles[id];\n        if (this._timers[id]) {\n            clearTimeout(this._timers[id]);\n            delete this._timers[id];\n        }\n\n        if (tile.uses > 0)\n            return;\n\n        if (tile.hasData() && tile.state !== 'reloading') {\n            this._cache.add(tile.tileID, tile, tile.getExpiryTimeout());\n        } else {\n            tile.aborted = true;\n            this._abortTile(tile);\n            this._unloadTile(tile);\n        }\n    }\n\n    /** @internal */\n    private _dataHandler(e: MapSourceDataEvent) {\n\n        const eventSourceDataType = e.sourceDataType;\n        if (e.dataType === 'source' && eventSourceDataType === 'metadata') {\n            this._sourceLoaded = true;\n        }\n\n        // for sources with mutable data, this event fires when the underlying data\n        // to a source is changed. (i.e. GeoJSONSource#setData and ImageSource#serCoordinates)\n        if (this._sourceLoaded && !this._paused && e.dataType === 'source' && eventSourceDataType === 'content') {\n            this.reload();\n            if (this.transform) {\n                this.update(this.transform, this.terrain);\n            }\n\n            this._didEmitContent = true;\n        }\n    }\n\n    /**\n     * Remove all tiles from this pyramid\n     */\n    clearTiles() {\n        this._shouldReloadOnResume = false;\n        this._paused = false;\n\n        for (const id in this._tiles)\n            this._removeTile(id);\n\n        this._cache.reset();\n    }\n\n    /**\n     * Search through our current tiles and attempt to find the tiles that\n     * cover the given bounds.\n     * @param pointQueryGeometry - coordinates of the corners of bounding rectangle\n     * @returns result items have `{tile, minX, maxX, minY, maxY}`, where min/max bounding values are the given bounds transformed in into the coordinate space of this tile.\n     */\n    tilesIn(pointQueryGeometry: Array<Point>, maxPitchScaleFactor: number, has3DLayer: boolean): any[] {\n\n        const tileResults = [];\n\n        const transform = this.transform;\n        if (!transform) return tileResults;\n\n        const cameraPointQueryGeometry = has3DLayer ?\n            transform.getCameraQueryGeometry(pointQueryGeometry) :\n            pointQueryGeometry;\n\n        const queryGeometry = pointQueryGeometry.map((p: Point) => transform.pointCoordinate(p, this.terrain));\n        const cameraQueryGeometry = cameraPointQueryGeometry.map((p: Point) => transform.pointCoordinate(p, this.terrain));\n\n        const ids = this.getIds();\n\n        let minX = Infinity;\n        let minY = Infinity;\n        let maxX = -Infinity;\n        let maxY = -Infinity;\n\n        for (const p of cameraQueryGeometry) {\n            minX = Math.min(minX, p.x);\n            minY = Math.min(minY, p.y);\n            maxX = Math.max(maxX, p.x);\n            maxY = Math.max(maxY, p.y);\n        }\n\n        for (let i = 0; i < ids.length; i++) {\n            const tile = this._tiles[ids[i]];\n            if (tile.holdingForFade()) {\n                // Tiles held for fading are covered by tiles that are closer to ideal\n                continue;\n            }\n            const tileID = tile.tileID;\n            const scale = Math.pow(2, transform.zoom - tile.tileID.overscaledZ);\n            const queryPadding = maxPitchScaleFactor * tile.queryPadding * EXTENT / tile.tileSize / scale;\n\n            const tileSpaceBounds = [\n                tileID.getTilePoint(new MercatorCoordinate(minX, minY)),\n                tileID.getTilePoint(new MercatorCoordinate(maxX, maxY))\n            ];\n\n            if (tileSpaceBounds[0].x - queryPadding < EXTENT && tileSpaceBounds[0].y - queryPadding < EXTENT &&\n                tileSpaceBounds[1].x + queryPadding >= 0 && tileSpaceBounds[1].y + queryPadding >= 0) {\n\n                const tileSpaceQueryGeometry: Array<Point> = queryGeometry.map((c) => tileID.getTilePoint(c));\n                const tileSpaceCameraQueryGeometry = cameraQueryGeometry.map((c) => tileID.getTilePoint(c));\n\n                tileResults.push({\n                    tile,\n                    tileID,\n                    queryGeometry: tileSpaceQueryGeometry,\n                    cameraQueryGeometry: tileSpaceCameraQueryGeometry,\n                    scale\n                });\n            }\n        }\n\n        return tileResults;\n    }\n\n    getVisibleCoordinates(symbolLayer?: boolean): Array<OverscaledTileID> {\n        const coords = this.getRenderableIds(symbolLayer).map((id) => this._tiles[id].tileID);\n        for (const coord of coords) {\n            coord.posMatrix = this.transform.calculatePosMatrix(coord.toUnwrapped());\n        }\n        return coords;\n    }\n\n    hasTransition() {\n        if (this._source.hasTransition()) {\n            return true;\n        }\n\n        if (isRasterType(this._source.type)) {\n            const now = browser.now();\n            for (const id in this._tiles) {\n                const tile = this._tiles[id];\n                if (tile.fadeEndTime >= now) {\n                    return true;\n                }\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Set the value of a particular state for a feature\n     */\n    setFeatureState(sourceLayer: string, featureId: number | string, state: any) {\n        sourceLayer = sourceLayer || '_geojsonTileLayer';\n        this._state.updateState(sourceLayer, featureId, state);\n    }\n\n    /**\n     * Resets the value of a particular state key for a feature\n     */\n    removeFeatureState(sourceLayer?: string, featureId?: number | string, key?: string) {\n        sourceLayer = sourceLayer || '_geojsonTileLayer';\n        this._state.removeFeatureState(sourceLayer, featureId, key);\n    }\n\n    /**\n     * Get the entire state object for a feature\n     */\n    getFeatureState(sourceLayer: string, featureId: number | string) {\n        sourceLayer = sourceLayer || '_geojsonTileLayer';\n        return this._state.getState(sourceLayer, featureId);\n    }\n\n    /**\n     * Sets the set of keys that the tile depends on. This allows tiles to\n     * be reloaded when their dependencies change.\n     */\n    setDependencies(tileKey: string, namespace: string, dependencies: Array<string>) {\n        const tile = this._tiles[tileKey];\n        if (tile) {\n            tile.setDependencies(namespace, dependencies);\n        }\n    }\n\n    /**\n     * Reloads all tiles that depend on the given keys.\n     */\n    reloadTilesForDependencies(namespaces: Array<string>, keys: Array<string>) {\n        for (const id in this._tiles) {\n            const tile = this._tiles[id];\n            if (tile.hasDependency(namespaces, keys)) {\n                this._reloadTile(id, 'reloading');\n            }\n        }\n        this._cache.filter(tile => !tile.hasDependency(namespaces, keys));\n    }\n}\n\nSourceCache.maxOverzooming = 10;\nSourceCache.maxUnderzooming = 3;\n\nfunction compareTileId(a: OverscaledTileID, b: OverscaledTileID): number {\n    // Different copies of the world are sorted based on their distance to the center.\n    // Wrap values are converted to unsigned distances by reserving odd number for copies\n    // with negative wrap and even numbers for copies with positive wrap.\n    const aWrap = Math.abs(a.wrap * 2) - +(a.wrap < 0);\n    const bWrap = Math.abs(b.wrap * 2) - +(b.wrap < 0);\n    return a.overscaledZ - b.overscaledZ || bWrap - aWrap || b.canonical.y - a.canonical.y || b.canonical.x - a.canonical.x;\n}\n\nfunction isRasterType(type) {\n    return type === 'raster' || type === 'image' || type === 'video';\n}\n", "import {clamp} from '../util/util';\nimport Point from '@mapbox/point-geometry';\n\nexport class PathInterpolator {\n    points: Array<Point>;\n    length: number;\n    paddedLength: number;\n    padding: number;\n    _distances: Array<number>;\n\n    constructor(points_?: Array<Point> | null, padding_?: number | null) {\n        this.reset(points_, padding_);\n    }\n\n    reset(points_?: Array<Point> | null, padding_?: number | null) {\n        this.points = points_ || [];\n\n        // Compute cumulative distance from first point to every other point in the segment.\n        // Last entry in the array is total length of the path\n        this._distances = [0.0];\n\n        for (let i = 1; i < this.points.length; i++) {\n            this._distances[i] = this._distances[i - 1] + this.points[i].dist(this.points[i - 1]);\n        }\n\n        this.length = this._distances[this._distances.length - 1];\n        this.padding = Math.min(padding_ || 0, this.length * 0.5);\n        this.paddedLength = this.length - this.padding * 2.0;\n    }\n\n    lerp(t: number): Point {\n        if (this.points.length === 1) {\n            return this.points[0];\n        }\n\n        t = clamp(t, 0, 1);\n\n        // Find the correct segment [p0, p1] where p0 <= x < p1\n        let currentIndex = 1;\n        let distOfCurrentIdx = this._distances[currentIndex];\n        const distToTarget = t * this.paddedLength + this.padding;\n\n        while (distOfCurrentIdx < distToTarget && currentIndex < this._distances.length) {\n            distOfCurrentIdx = this._distances[++currentIndex];\n        }\n\n        // Interpolate between the two points of the segment\n        const idxOfPrevPoint = currentIndex - 1;\n        const distOfPrevIdx = this._distances[idxOfPrevPoint];\n        const segmentLength = distOfCurrentIdx - distOfPrevIdx;\n        const segmentT = segmentLength > 0 ? (distToTarget - distOfPrevIdx) / segmentLength : 0;\n\n        return this.points[idxOfPrevPoint].mult(1.0 - segmentT).add(this.points[currentIndex].mult(segmentT));\n    }\n}\n", "import type {OverlapMode} from '../style/style_layer/overlap_mode';\n\ntype QueryArgs = {\n    hitTest: boolean;\n    overlapMode?: OverlapMode;\n    circle?: {\n        x: number;\n        y: number;\n        radius: number;\n    };\n    seenUids: {\n        box: {\n            [_: number]: boolean;\n        };\n        circle: {\n            [_: number]: boolean;\n        };\n    };\n};\n\ntype QueryResult<T> = {\n    key: T;\n    x1: number;\n    y1: number;\n    x2: number;\n    y2: number;\n};\n\n/**\n * A key for the grid\n */\nexport type GridKey = {\n    overlapMode?: OverlapMode;\n}\n\nfunction overlapAllowed(overlapA: OverlapMode, overlapB: OverlapMode): boolean {\n    let allowed = true;\n\n    if (overlapA === 'always') {\n        // symbol A using 'always' overlap - allowed to overlap anything.\n    } else if (overlapA === 'never' || overlapB === 'never') {\n        // symbol A using 'never' overlap - can't overlap anything\n        // symbol A using 'cooperative' overlap - can overlap 'always' or 'cooperative' symbol; can't overlap 'never'\n        allowed = false;\n    }\n\n    return allowed;\n}\n\n/**\n * @internal\n * GridIndex is a data structure for testing the intersection of\n * circles and rectangles in a 2d plane.\n * It is optimized for rapid insertion and querying.\n * GridIndex splits the plane into a set of \"cells\" and keeps track\n * of which geometries intersect with each cell. At query time,\n * full geometry comparisons are only done for items that share\n * at least one cell. As long as the geometries are relatively\n * uniformly distributed across the plane, this greatly reduces\n * the number of comparisons necessary.\n */\nexport class GridIndex<T extends GridKey> {\n    circleKeys: Array<T>;\n    boxKeys: Array<T>;\n    boxCells: Array<Array<number>>;\n    circleCells: Array<Array<number>>;\n    bboxes: Array<number>;\n    circles: Array<number>;\n    xCellCount: number;\n    yCellCount: number;\n    width: number;\n    height: number;\n    xScale: number;\n    yScale: number;\n    boxUid: number;\n    circleUid: number;\n\n    constructor (width: number, height: number, cellSize: number) {\n        const boxCells = this.boxCells = [];\n        const circleCells = this.circleCells = [];\n\n        // More cells -> fewer geometries to check per cell, but items tend\n        // to be split across more cells.\n        // Sweet spot allows most small items to fit in one cell\n        this.xCellCount = Math.ceil(width / cellSize);\n        this.yCellCount = Math.ceil(height / cellSize);\n\n        for (let i = 0; i < this.xCellCount * this.yCellCount; i++) {\n            boxCells.push([]);\n            circleCells.push([]);\n        }\n        this.circleKeys = [];\n        this.boxKeys = [];\n        this.bboxes = [];\n        this.circles = [];\n\n        this.width = width;\n        this.height = height;\n        this.xScale = this.xCellCount / width;\n        this.yScale = this.yCellCount / height;\n        this.boxUid = 0;\n        this.circleUid = 0;\n    }\n\n    keysLength() {\n        return this.boxKeys.length + this.circleKeys.length;\n    }\n\n    insert(key: T, x1: number, y1: number, x2: number, y2: number) {\n        this._forEachCell(x1, y1, x2, y2, this._insertBoxCell, this.boxUid++);\n        this.boxKeys.push(key);\n        this.bboxes.push(x1);\n        this.bboxes.push(y1);\n        this.bboxes.push(x2);\n        this.bboxes.push(y2);\n    }\n\n    insertCircle(key: T, x: number, y: number, radius: number) {\n        // Insert circle into grid for all cells in the circumscribing square\n        // It's more than necessary (by a factor of 4/PI), but fast to insert\n        this._forEachCell(x - radius, y - radius, x + radius, y + radius, this._insertCircleCell, this.circleUid++);\n        this.circleKeys.push(key);\n        this.circles.push(x);\n        this.circles.push(y);\n        this.circles.push(radius);\n    }\n\n    private _insertBoxCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number) {\n        this.boxCells[cellIndex].push(uid);\n    }\n\n    private _insertCircleCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, uid: number)  {\n        this.circleCells[cellIndex].push(uid);\n    }\n\n    private _query(x1: number, y1: number, x2: number, y2: number, hitTest: boolean, overlapMode: OverlapMode, predicate?: (key: T) => boolean): Array<QueryResult<T>> {\n        if (x2 < 0 || x1 > this.width || y2 < 0 || y1 > this.height) {\n            return [];\n        }\n        const result: Array<QueryResult<T>> = [];\n        if (x1 <= 0 && y1 <= 0 && this.width <= x2 && this.height <= y2) {\n            if (hitTest) {\n                // Covers the entire grid, so collides with everything\n                return [{\n                    key: null,\n                    x1,\n                    y1,\n                    x2,\n                    y2\n                }];\n            }\n            for (let boxUid = 0; boxUid < this.boxKeys.length; boxUid++) {\n                result.push({\n                    key: this.boxKeys[boxUid],\n                    x1: this.bboxes[boxUid * 4],\n                    y1: this.bboxes[boxUid * 4 + 1],\n                    x2: this.bboxes[boxUid * 4 + 2],\n                    y2: this.bboxes[boxUid * 4 + 3]\n                });\n            }\n            for (let circleUid = 0; circleUid < this.circleKeys.length; circleUid++) {\n                const x = this.circles[circleUid * 3];\n                const y = this.circles[circleUid * 3 + 1];\n                const radius = this.circles[circleUid * 3 + 2];\n                result.push({\n                    key: this.circleKeys[circleUid],\n                    x1: x - radius,\n                    y1: y - radius,\n                    x2: x + radius,\n                    y2: y + radius\n                });\n            }\n        } else {\n            const queryArgs: QueryArgs = {\n                hitTest,\n                overlapMode,\n                seenUids: {box: {}, circle: {}}\n            };\n            this._forEachCell(x1, y1, x2, y2, this._queryCell, result, queryArgs, predicate);\n        }\n\n        return result;\n    }\n\n    query(x1: number, y1: number, x2: number, y2: number): Array<QueryResult<T>> {\n        return this._query(x1, y1, x2, y2, false, null);\n    }\n\n    hitTest(x1: number, y1: number, x2: number, y2: number, overlapMode: OverlapMode, predicate?: (key: T) => boolean): boolean {\n        return this._query(x1, y1, x2, y2, true, overlapMode, predicate).length > 0;\n    }\n\n    hitTestCircle(x: number, y: number, radius: number, overlapMode: OverlapMode, predicate?: (key: T) => boolean): boolean {\n        // Insert circle into grid for all cells in the circumscribing square\n        // It's more than necessary (by a factor of 4/PI), but fast to insert\n        const x1 = x - radius;\n        const x2 = x + radius;\n        const y1 = y - radius;\n        const y2 = y + radius;\n        if (x2 < 0 || x1 > this.width || y2 < 0 || y1 > this.height) {\n            return false;\n        }\n\n        // Box query early exits if the bounding box is larger than the grid, but we don't do\n        // the equivalent calculation for circle queries because early exit is less likely\n        // and the calculation is more expensive\n        const result: boolean[] = [];\n        const queryArgs: QueryArgs = {\n            hitTest: true,\n            overlapMode,\n            circle: {x, y, radius},\n            seenUids: {box: {}, circle: {}}\n        };\n        this._forEachCell(x1, y1, x2, y2, this._queryCellCircle, result, queryArgs, predicate);\n        return result.length > 0;\n    }\n\n    private _queryCell(x1: number, y1: number, x2: number, y2: number, cellIndex: number, result: Array<QueryResult<T>>, queryArgs: QueryArgs, predicate?: (key: T) => boolean): boolean {\n        const {seenUids, hitTest, overlapMode} = queryArgs;\n        const boxCell = this.boxCells[cellIndex];\n\n        if (boxCell !== null) {\n            const bboxes = this.bboxes;\n            for (const boxUid of boxCell) {\n                if (!seenUids.box[boxUid]) {\n                    seenUids.box[boxUid] = true;\n                    const offset = boxUid * 4;\n                    const key = this.boxKeys[boxUid];\n\n                    if ((x1 <= bboxes[offset + 2]) &&\n                        (y1 <= bboxes[offset + 3]) &&\n                        (x2 >= bboxes[offset + 0]) &&\n                        (y2 >= bboxes[offset + 1]) &&\n                        (!predicate || predicate(key))) {\n                        if (!hitTest || !overlapAllowed(overlapMode, key.overlapMode)) {\n                            result.push({\n                                key,\n                                x1: bboxes[offset],\n                                y1: bboxes[offset + 1],\n                                x2: bboxes[offset + 2],\n                                y2: bboxes[offset + 3]\n                            });\n                            if (hitTest) {\n                                // true return value stops the query after first match\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n        const circleCell = this.circleCells[cellIndex];\n        if (circleCell !== null) {\n            const circles = this.circles;\n            for (const circleUid of circleCell) {\n                if (!seenUids.circle[circleUid]) {\n                    seenUids.circle[circleUid] = true;\n                    const offset = circleUid * 3;\n                    const key = this.circleKeys[circleUid];\n\n                    if (this._circleAndRectCollide(\n                        circles[offset],\n                        circles[offset + 1],\n                        circles[offset + 2],\n                        x1,\n                        y1,\n                        x2,\n                        y2) &&\n                        (!predicate || predicate(key))) {\n                        if (!hitTest || !overlapAllowed(overlapMode, key.overlapMode)) {\n                            const x = circles[offset];\n                            const y = circles[offset + 1];\n                            const radius = circles[offset + 2];\n                            result.push({\n                                key,\n                                x1: x - radius,\n                                y1: y - radius,\n                                x2: x + radius,\n                                y2: y + radius\n                            });\n                            if (hitTest) {\n                                // true return value stops the query after first match\n                                return true;\n                            }\n                        }\n                    }\n                }\n            }\n        }\n\n        // false return to continue query\n        return false;\n    }\n\n    private _queryCellCircle(x1: number, y1: number, x2: number, y2: number, cellIndex: number, result: Array<boolean>, queryArgs: QueryArgs, predicate?: (key: T) => boolean): boolean {\n        const {circle, seenUids, overlapMode} = queryArgs;\n        const boxCell = this.boxCells[cellIndex];\n\n        if (boxCell !== null) {\n            const bboxes = this.bboxes;\n            for (const boxUid of boxCell) {\n                if (!seenUids.box[boxUid]) {\n                    seenUids.box[boxUid] = true;\n                    const offset = boxUid * 4;\n                    const key = this.boxKeys[boxUid];\n                    if (this._circleAndRectCollide(\n                        circle.x,\n                        circle.y,\n                        circle.radius,\n                        bboxes[offset + 0],\n                        bboxes[offset + 1],\n                        bboxes[offset + 2],\n                        bboxes[offset + 3]) &&\n                        (!predicate || predicate(key)) &&\n                        !overlapAllowed(overlapMode, key.overlapMode)) {\n                        result.push(true);\n                        return true;\n                    }\n                }\n            }\n        }\n\n        const circleCell = this.circleCells[cellIndex];\n        if (circleCell !== null) {\n            const circles = this.circles;\n            for (const circleUid of circleCell) {\n                if (!seenUids.circle[circleUid]) {\n                    seenUids.circle[circleUid] = true;\n                    const offset = circleUid * 3;\n                    const key = this.circleKeys[circleUid];\n                    if (this._circlesCollide(\n                        circles[offset],\n                        circles[offset + 1],\n                        circles[offset + 2],\n                        circle.x,\n                        circle.y,\n                        circle.radius) &&\n                        (!predicate || predicate(key)) &&\n                        !overlapAllowed(overlapMode, key.overlapMode)) {\n                        result.push(true);\n                        return true;\n                    }\n                }\n            }\n        }\n    }\n\n    private _forEachCell<TArg>(\n        x1: number,\n        y1: number,\n        x2: number,\n        y2: number,\n        fn: (x1: number, y1: number, x2: number, y2: number, cellIndex: number, arg1: TArg, arg2?: QueryArgs, predicate?: (key: T) => boolean) => boolean | void,\n        arg1: TArg,\n        arg2?: QueryArgs,\n        predicate?: (key: T) => boolean) {\n        const cx1 = this._convertToXCellCoord(x1);\n        const cy1 = this._convertToYCellCoord(y1);\n        const cx2 = this._convertToXCellCoord(x2);\n        const cy2 = this._convertToYCellCoord(y2);\n\n        for (let x = cx1; x <= cx2; x++) {\n            for (let y = cy1; y <= cy2; y++) {\n                const cellIndex = this.xCellCount * y + x;\n                if (fn.call(this, x1, y1, x2, y2, cellIndex, arg1, arg2, predicate)) return;\n            }\n        }\n    }\n\n    private _convertToXCellCoord(x: number) {\n        return Math.max(0, Math.min(this.xCellCount - 1, Math.floor(x * this.xScale)));\n    }\n\n    private _convertToYCellCoord(y: number) {\n        return Math.max(0, Math.min(this.yCellCount - 1, Math.floor(y * this.yScale)));\n    }\n\n    private _circlesCollide(x1: number, y1: number, r1: number, x2: number, y2: number, r2: number): boolean {\n        const dx = x2 - x1;\n        const dy = y2 - y1;\n        const bothRadii = r1 + r2;\n        return (bothRadii * bothRadii) > (dx * dx + dy * dy);\n    }\n\n    private _circleAndRectCollide(\n        circleX: number,\n        circleY: number,\n        radius: number,\n        x1: number,\n        y1: number,\n        x2: number,\n        y2: number\n    ): boolean {\n        const halfRectWidth = (x2 - x1) / 2;\n        const distX = Math.abs(circleX - (x1 + halfRectWidth));\n        if (distX > (halfRectWidth + radius)) {\n            return false;\n        }\n\n        const halfRectHeight = (y2 - y1) / 2;\n        const distY = Math.abs(circleY - (y1 + halfRectHeight));\n        if (distY > (halfRectHeight + radius)) {\n            return false;\n        }\n\n        if (distX <= halfRectWidth || distY <= halfRectHeight) {\n            return true;\n        }\n\n        const dx = distX - halfRectWidth;\n        const dy = distY - halfRectHeight;\n        return (dx * dx + dy * dy <= (radius * radius));\n    }\n}\n", "import Point from '@mapbox/point-geometry';\n\nimport {mat4, vec4} from 'gl-matrix';\nimport * as symbolSize from './symbol_size';\nimport {addDynamicAttributes} from '../data/bucket/symbol_bucket';\n\nimport type {Painter} from '../render/painter';\nimport type {Transform} from '../geo/transform';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport type {\n    GlyphOffsetArray,\n    SymbolLineVertexArray,\n    SymbolDynamicLayoutArray\n} from '../data/array_types.g';\nimport {WritingMode} from '../symbol/shaping';\nimport {findLineIntersection} from '../util/util';\nimport {UnwrappedTileID} from '../source/tile_id';\nimport {Projection} from '../geo/projection/projection';\n\nexport {\n    updateLineLabels,\n    hideGlyphs,\n    getLabelPlaneMatrix,\n    getGlCoordMatrix,\n    project,\n    getPerspectiveRatio,\n    placeFirstAndLastGlyph,\n    placeGlyphAlongLine,\n    xyTransformMat4,\n    projectLineVertexToViewport as projectVertexToViewport,\n    projectTileCoordinatesToViewport,\n    findOffsetIntersectionPoint,\n    transformToOffsetNormal,\n};\n\n/**\n * The result of projecting a point to the screen, with some additional information about the projection.\n */\nexport type PointProjection = {\n    /**\n     * The projected point.\n     */\n    point: Point;\n    /**\n     * The original W component of the projection.\n     */\n    signedDistanceFromCamera: number;\n    /**\n     * For complex projections (such as globe), true if the point is occluded by the projection, such as by being on the backfacing side of the globe.\n     */\n    isOccluded: boolean;\n};\n\n/*\n * # Overview of coordinate spaces\n *\n * ## Tile coordinate spaces\n * Each label has an anchor. Some labels have corresponding line geometries.\n * The points for both anchors and lines are stored in tile units. Each tile has it's own\n * coordinate space going from (0, 0) at the top left to (EXTENT, EXTENT) at the bottom right.\n *\n * ## Clip space (GL coordinate space)\n * At the end of everything, the vertex shader needs to produce a position in clip space,\n * which is (-1, 1) at the top left and (1, -1) in the bottom right.\n * In the depth buffer, values are between 0 (near plane) to 1 (far plane).\n *\n * ## Map pixel coordinate spaces\n * Each tile has a pixel coordinate space. It's just the tile units scaled so that one unit is\n * whatever counts as 1 pixel at the current zoom.\n * This space is used for pitch-alignment=map, rotation-alignment=map\n *\n * ## Rotated map pixel coordinate spaces\n * Like the above, but rotated so axis of the space are aligned with the viewport instead of the tile.\n * This space is used for pitch-alignment=map, rotation-alignment=viewport\n *\n * ## Viewport pixel coordinate space\n * (0, 0) is at the top left of the canvas and (pixelWidth, pixelHeight) is at the bottom right corner\n * of the canvas. This space is used for pitch-alignment=viewport\n *\n *\n * # Vertex projection\n * It goes roughly like this:\n * 1. project the anchor and line from tile units into the correct label coordinate space\n *      - map pixel space           pitch-alignment=map         rotation-alignment=map\n *      - rotated map pixel space   pitch-alignment=map         rotation-alignment=viewport\n *      - viewport pixel space      pitch-alignment=viewport    rotation-alignment=*\n * 2. if the label follows a line, find the point along the line that is the correct distance from the anchor.\n * 3. add the glyph's corner offset to the point from step 3\n * 4. convert from the label coordinate space to clip space\n *\n * For horizontal labels we want to do step 1 in the shader for performance reasons (no cpu work).\n *      This is what `u_label_plane_matrix` is used for.\n * For labels aligned with lines we have to steps 1 and 2 on the cpu since we need access to the line geometry.\n *      This is what `updateLineLabels(...)` does.\n *      Since the conversion is handled on the cpu we just set `u_label_plane_matrix` to an identity matrix.\n *\n * Steps 3 and 4 are done in the shaders for all labels.\n */\n\n/*\n * Returns a matrix for converting from tile units to the correct label coordinate space.\n */\nfunction getLabelPlaneMatrix(posMatrix: mat4,\n    pitchWithMap: boolean,\n    rotateWithMap: boolean,\n    transform: Transform,\n    pixelsToTileUnits: number) {\n    const m = mat4.create();\n    if (pitchWithMap) {\n        mat4.scale(m, m, [1 / pixelsToTileUnits, 1 / pixelsToTileUnits, 1]);\n        if (!rotateWithMap) {\n            mat4.rotateZ(m, m, transform.angle);\n        }\n    } else {\n        mat4.multiply(m, transform.labelPlaneMatrix, posMatrix);\n    }\n    return m;\n}\n\n/*\n * Returns a matrix for converting from the correct label coordinate space to clip space.\n */\nfunction getGlCoordMatrix(posMatrix: mat4,\n    pitchWithMap: boolean,\n    rotateWithMap: boolean,\n    transform: Transform,\n    pixelsToTileUnits: number) {\n    if (pitchWithMap) {\n        const m = mat4.clone(posMatrix);\n        mat4.scale(m, m, [pixelsToTileUnits, pixelsToTileUnits, 1]);\n        if (!rotateWithMap) {\n            mat4.rotateZ(m, m, -transform.angle);\n        }\n        return m;\n    } else {\n        return transform.glCoordMatrix;\n    }\n}\n\nfunction project(x: number, y: number, matrix: mat4, getElevation?: (x: number, y: number) => number): PointProjection {\n    let pos;\n    if (getElevation) { // slow because of handle z-index\n        pos = [x, y, getElevation(x, y), 1] as vec4;\n        vec4.transformMat4(pos, pos, matrix);\n    } else { // fast because of ignore z-index\n        pos = [x, y, 0, 1] as vec4;\n        xyTransformMat4(pos, pos, matrix);\n    }\n    const w = pos[3];\n    return {\n        point: new Point(pos[0] / w, pos[1] / w),\n        signedDistanceFromCamera: w,\n        isOccluded: false\n    };\n}\n\nfunction getPerspectiveRatio(cameraToCenterDistance: number, signedDistanceFromCamera: number): number {\n    return 0.5 + 0.5 * (cameraToCenterDistance / signedDistanceFromCamera);\n}\n\nfunction isVisible(p: Point,\n    clippingBuffer: [number, number]) {\n    const inPaddedViewport = (\n        p.x >= -clippingBuffer[0] &&\n        p.x <= clippingBuffer[0] &&\n        p.y >= -clippingBuffer[1] &&\n        p.y <= clippingBuffer[1]);\n    return inPaddedViewport;\n}\n\n/*\n *  Update the `dynamicLayoutVertexBuffer` for the buffer with the correct glyph positions for the current map view.\n *  This is only run on labels that are aligned with lines. Horizontal labels are handled entirely in the shader.\n */\nfunction updateLineLabels(bucket: SymbolBucket,\n    posMatrix: mat4,\n    painter: Painter,\n    isText: boolean,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    pitchWithMap: boolean,\n    keepUpright: boolean,\n    rotateToLine: boolean,\n    projection: Projection,\n    unwrappedTileID: UnwrappedTileID,\n    viewportWidth: number,\n    viewportHeight: number,\n    translation: [number, number],\n    getElevation: (x: number, y: number) => number) {\n\n    const sizeData = isText ? bucket.textSizeData : bucket.iconSizeData;\n    const partiallyEvaluatedSize = symbolSize.evaluateSizeForZoom(sizeData, painter.transform.zoom);\n\n    const clippingBuffer: [number, number] = [256 / painter.width * 2 + 1, 256 / painter.height * 2 + 1];\n\n    const dynamicLayoutVertexArray = isText ?\n        bucket.text.dynamicLayoutVertexArray :\n        bucket.icon.dynamicLayoutVertexArray;\n    dynamicLayoutVertexArray.clear();\n\n    const lineVertexArray = bucket.lineVertexArray;\n    const placedSymbols = isText ? bucket.text.placedSymbolArray : bucket.icon.placedSymbolArray;\n\n    const aspectRatio = painter.transform.width / painter.transform.height;\n\n    let useVertical = false;\n\n    for (let s = 0; s < placedSymbols.length; s++) {\n        const symbol = placedSymbols.get(s);\n\n        // Don't do calculations for vertical glyphs unless the previous symbol was horizontal\n        // and we determined that vertical glyphs were necessary.\n        // Also don't do calculations for symbols that are collided and fully faded out\n        if (symbol.hidden || symbol.writingMode === WritingMode.vertical && !useVertical) {\n            hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n            continue;\n        }\n        // Awkward... but we're counting on the paired \"vertical\" symbol coming immediately after its horizontal counterpart\n        useVertical = false;\n\n        const anchorPos = project(symbol.anchorX, symbol.anchorY, posMatrix, getElevation);\n\n        // Don't bother calculating the correct point for invisible labels.\n        if (!isVisible(anchorPos.point, clippingBuffer)) {\n            hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n            continue;\n        }\n\n        const cameraToAnchorDistance = anchorPos.signedDistanceFromCamera;\n        const perspectiveRatio = getPerspectiveRatio(painter.transform.cameraToCenterDistance, cameraToAnchorDistance);\n\n        const fontSize = symbolSize.evaluateSizeForFeature(sizeData, partiallyEvaluatedSize, symbol);\n        const pitchScaledFontSize = pitchWithMap ? fontSize / perspectiveRatio : fontSize * perspectiveRatio;\n\n        const tileAnchorPoint = new Point(symbol.anchorX, symbol.anchorY);\n        const projectionCache: ProjectionCache = {projections: {}, offsets: {}, cachedAnchorPoint: undefined, anyProjectionOccluded: false};\n\n        const projectionContext: SymbolProjectionContext = {\n            getElevation,\n            labelPlaneMatrix,\n            lineVertexArray,\n            pitchWithMap,\n            projectionCache,\n            projection,\n            tileAnchorPoint,\n            unwrappedTileID,\n            width: viewportWidth,\n            height: viewportHeight,\n            translation\n        };\n\n        const placeUnflipped: any = placeGlyphsAlongLine(projectionContext, symbol, pitchScaledFontSize, false /*unflipped*/, keepUpright, posMatrix, glCoordMatrix,\n            bucket.glyphOffsetArray, dynamicLayoutVertexArray, aspectRatio, rotateToLine);\n\n        useVertical = placeUnflipped.useVertical;\n\n        if (placeUnflipped.notEnoughRoom || useVertical ||\n            (placeUnflipped.needsFlipping &&\n             (placeGlyphsAlongLine(projectionContext, symbol, pitchScaledFontSize, true /*flipped*/, keepUpright, posMatrix, glCoordMatrix,\n                 bucket.glyphOffsetArray, dynamicLayoutVertexArray, aspectRatio, rotateToLine) as any).notEnoughRoom)) {\n            hideGlyphs(symbol.numGlyphs, dynamicLayoutVertexArray);\n        }\n    }\n\n    if (isText) {\n        bucket.text.dynamicLayoutVertexBuffer.updateData(dynamicLayoutVertexArray);\n    } else {\n        bucket.icon.dynamicLayoutVertexBuffer.updateData(dynamicLayoutVertexArray);\n    }\n}\n\ntype FirstAndLastGlyphPlacement = {\n    first: PlacedGlyph;\n    last: PlacedGlyph;\n} | null;\n\n/*\n * Place the first and last glyph of a line label, projected to the label plane.\n * This function is called both during collision detection (to determine the label's size)\n * and during line label rendering (to make sure the label fits on the line geometry with\n * the current camera position, which may differ from the position used during collision detection).\n *\n * Calling this function has the effect of populating the \"projectionCache\" with all projected\n * vertex locations the label will need, making future calls to placeGlyphAlongLine (for all the\n * intermediate glyphs) much cheaper.\n *\n * Returns null if the label can't fit on the geometry\n */\nfunction placeFirstAndLastGlyph(\n    fontScale: number,\n    glyphOffsetArray: GlyphOffsetArray,\n    lineOffsetX: number,\n    lineOffsetY: number,\n    flip: boolean,\n    symbol: any,\n    rotateToLine: boolean,\n    projectionContext: SymbolProjectionContext): FirstAndLastGlyphPlacement {\n    const glyphEndIndex = symbol.glyphStartIndex + symbol.numGlyphs;\n    const lineStartIndex = symbol.lineStartIndex;\n    const lineEndIndex = symbol.lineStartIndex + symbol.lineLength;\n\n    const firstGlyphOffset = glyphOffsetArray.getoffsetX(symbol.glyphStartIndex);\n    const lastGlyphOffset = glyphOffsetArray.getoffsetX(glyphEndIndex - 1);\n\n    const firstPlacedGlyph = placeGlyphAlongLine(fontScale * firstGlyphOffset, lineOffsetX, lineOffsetY, flip, symbol.segment,\n        lineStartIndex, lineEndIndex, projectionContext, rotateToLine);\n    if (!firstPlacedGlyph)\n        return null;\n\n    const lastPlacedGlyph = placeGlyphAlongLine(fontScale * lastGlyphOffset, lineOffsetX, lineOffsetY, flip, symbol.segment,\n        lineStartIndex, lineEndIndex, projectionContext, rotateToLine);\n    if (!lastPlacedGlyph)\n        return null;\n\n    if (projectionContext.projectionCache.anyProjectionOccluded) {\n        return null;\n    }\n\n    return {first: firstPlacedGlyph, last: lastPlacedGlyph};\n}\n\nfunction requiresOrientationChange(writingMode, firstPoint, lastPoint, aspectRatio) {\n    if (writingMode === WritingMode.horizontal) {\n        // On top of choosing whether to flip, choose whether to render this version of the glyphs or the alternate\n        // vertical glyphs. We can't just filter out vertical glyphs in the horizontal range because the horizontal\n        // and vertical versions can have slightly different projections which could lead to angles where both or\n        // neither showed.\n        const rise = Math.abs(lastPoint.y - firstPoint.y);\n        const run = Math.abs(lastPoint.x - firstPoint.x) * aspectRatio;\n        if (rise > run) {\n            return {useVertical: true};\n        }\n    }\n\n    if (writingMode === WritingMode.vertical ? firstPoint.y < lastPoint.y : firstPoint.x > lastPoint.x) {\n        // Includes \"horizontalOnly\" case for labels without vertical glyphs\n        return {needsFlipping: true};\n    }\n\n    return null;\n}\n\n/*\n* Place first and last glyph along the line projected to label plane, and if they fit\n* iterate through all the intermediate glyphs, calculating their label plane positions\n* from the projected line.\n*\n* Finally, add resulting glyph position calculations to dynamicLayoutVertexArray for\n* upload to the GPU\n*/\nfunction placeGlyphsAlongLine(projectionContext: SymbolProjectionContext, symbol, fontSize, flip, keepUpright, posMatrix, glCoordMatrix, glyphOffsetArray, dynamicLayoutVertexArray, aspectRatio, rotateToLine) {\n    const fontScale = fontSize / 24;\n    const lineOffsetX = symbol.lineOffsetX * fontScale;\n    const lineOffsetY = symbol.lineOffsetY * fontScale;\n\n    let placedGlyphs;\n    if (symbol.numGlyphs > 1) {\n        const glyphEndIndex = symbol.glyphStartIndex + symbol.numGlyphs;\n        const lineStartIndex = symbol.lineStartIndex;\n        const lineEndIndex = symbol.lineStartIndex + symbol.lineLength;\n\n        // Place the first and the last glyph in the label first, so we can figure out\n        // the overall orientation of the label and determine whether it needs to be flipped in keepUpright mode\n        const firstAndLastGlyph = placeFirstAndLastGlyph(fontScale, glyphOffsetArray, lineOffsetX, lineOffsetY, flip, symbol, rotateToLine, projectionContext);\n        if (!firstAndLastGlyph) {\n            return {notEnoughRoom: true};\n        }\n        const firstPoint = project(firstAndLastGlyph.first.point.x, firstAndLastGlyph.first.point.y, glCoordMatrix, projectionContext.getElevation).point;\n        const lastPoint = project(firstAndLastGlyph.last.point.x, firstAndLastGlyph.last.point.y, glCoordMatrix, projectionContext.getElevation).point;\n\n        if (keepUpright && !flip) {\n            const orientationChange = requiresOrientationChange(symbol.writingMode, firstPoint, lastPoint, aspectRatio);\n            if (orientationChange) {\n                return orientationChange;\n            }\n        }\n\n        placedGlyphs = [firstAndLastGlyph.first];\n        for (let glyphIndex = symbol.glyphStartIndex + 1; glyphIndex < glyphEndIndex - 1; glyphIndex++) {\n            // Since first and last glyph fit on the line, we're sure that the rest of the glyphs can be placed\n            placedGlyphs.push(placeGlyphAlongLine(fontScale * glyphOffsetArray.getoffsetX(glyphIndex), lineOffsetX, lineOffsetY, flip, symbol.segment,\n                lineStartIndex, lineEndIndex, projectionContext, rotateToLine));\n        }\n        placedGlyphs.push(firstAndLastGlyph.last);\n    } else {\n        // Only a single glyph to place\n        // So, determine whether to flip based on projected angle of the line segment it's on\n        if (keepUpright && !flip) {\n            const a = project(projectionContext.tileAnchorPoint.x, projectionContext.tileAnchorPoint.y, posMatrix, projectionContext.getElevation).point;\n            const tileVertexIndex = (symbol.lineStartIndex + symbol.segment + 1);\n            const tileSegmentEnd = new Point(projectionContext.lineVertexArray.getx(tileVertexIndex), projectionContext.lineVertexArray.gety(tileVertexIndex));\n            const projectedVertex = project(tileSegmentEnd.x, tileSegmentEnd.y, posMatrix, projectionContext.getElevation);\n            // We know the anchor will be in the viewport, but the end of the line segment may be\n            // behind the plane of the camera, in which case we can use a point at any arbitrary (closer)\n            // point on the segment.\n            const b = (projectedVertex.signedDistanceFromCamera > 0) ?\n                projectedVertex.point :\n                projectTruncatedLineSegmentToLabelPlane(projectionContext.tileAnchorPoint, tileSegmentEnd, a, 1, posMatrix, projectionContext);\n\n            const orientationChange = requiresOrientationChange(symbol.writingMode, a, b, aspectRatio);\n            if (orientationChange) {\n                return orientationChange;\n            }\n        }\n        const singleGlyph = placeGlyphAlongLine(fontScale * glyphOffsetArray.getoffsetX(symbol.glyphStartIndex), lineOffsetX, lineOffsetY, flip, symbol.segment,\n            symbol.lineStartIndex, symbol.lineStartIndex + symbol.lineLength, projectionContext, rotateToLine);\n        if (!singleGlyph || projectionContext.projectionCache.anyProjectionOccluded)\n            return {notEnoughRoom: true};\n\n        placedGlyphs = [singleGlyph];\n    }\n\n    for (const glyph of placedGlyphs) {\n        addDynamicAttributes(dynamicLayoutVertexArray, glyph.point, glyph.angle);\n    }\n    return {};\n}\n\n/**\n * Takes a line and direction from `previousTilePoint` to `currentTilePoint`,\n * projects it to *label plane*,\n * and returns a projected point along this projected line that is `minimumLength` distance away from `previousProjectedPoint`.\n * @param previousTilePoint - Line start point, in tile coordinates.\n * @param currentTilePoint - Line end point, in tile coordinates.\n * @param previousProjectedPoint - Projection of `previousTilePoint` into *label plane*.\n * @param minimumLength - Distance in the projected space along the line for the returned point.\n * @param projectionMatrix - Matrix to use during projection.\n * @param projectionContext - Projection context, used only for terrain's `getElevation`.\n */\nfunction projectTruncatedLineSegmentToLabelPlane(previousTilePoint: Point, currentTilePoint: Point, previousProjectedPoint: Point, minimumLength: number, projectionMatrix: mat4, projectionContext: SymbolProjectionContext) {\n    return _projectTruncatedLineSegment(previousTilePoint, currentTilePoint, previousProjectedPoint, minimumLength, projectionMatrix, projectionContext);\n}\n\n/**\n * Takes a line and direction from `previousTilePoint` to `currentTilePoint`,\n * projects it to *viewport*,\n * and returns a projected point along this projected line that is `minimumLength` distance away from `previousProjectedPoint`.\n * @param previousTilePoint - Line start point, in tile coordinates.\n * @param currentTilePoint - Line end point, in tile coordinates.\n * @param previousProjectedPoint - Projection of `previousTilePoint` into *viewport*.\n * @param minimumLength - Distance in the projected space along the line for the returned point.\n * @param projectionContext - Projection context, used for terrain's `getElevation`, and either the `labelPlaneMatrix` or the map's special projection (mostly for globe).\n */\nfunction projectTruncatedLineSegmentToViewport(previousTilePoint: Point, currentTilePoint: Point, previousProjectedPoint: Point, minimumLength: number, projectionContext: SymbolProjectionContext) {\n    return _projectTruncatedLineSegment(previousTilePoint, currentTilePoint, previousProjectedPoint, minimumLength, undefined, projectionContext);\n}\n\n/**\n * Do not use directly, use {@link projectTruncatedLineSegmentToLabelPlane} or {@link projectTruncatedLineSegmentToViewport} instead,\n * depending on the target space.\n *\n * Projects a \"virtual\" vertex along a line segment.\n * If `projectionMatrix` is not undefined, does a simple projection using this matrix.\n * Otherwise, either projects to label plane using the `labelPlaneMatrix`\n * or projects to viewport using the special map projection (mostly for globe) by calling {@link projectTileCoordinatesToViewport}.\n */\nfunction _projectTruncatedLineSegment(previousTilePoint: Point, currentTilePoint: Point, previousProjectedPoint: Point, minimumLength: number, projectionMatrix: mat4 | undefined, projectionContext: SymbolProjectionContext) {\n    // We are assuming \"previousTilePoint\" won't project to a point within one unit of the camera plane\n    // If it did, that would mean our label extended all the way out from within the viewport to a (very distant)\n    // point near the plane of the camera. We wouldn't be able to render the label anyway once it crossed the\n    // plane of the camera.\n    const unitVertexToBeProjected = previousTilePoint.add(previousTilePoint.sub(currentTilePoint)._unit());\n    const projectedUnitVertex = projectionMatrix !== undefined ?\n        project(unitVertexToBeProjected.x, unitVertexToBeProjected.y, projectionMatrix, projectionContext.getElevation).point :\n        projectTileCoordinatesToViewport(unitVertexToBeProjected.x, unitVertexToBeProjected.y, projectionContext).point;\n    const projectedUnitSegment = previousProjectedPoint.sub(projectedUnitVertex);\n    return previousProjectedPoint.add(projectedUnitSegment._mult(minimumLength / projectedUnitSegment.mag()));\n}\n\ntype IndexToPointCache = { [lineIndex: number]: Point };\n\n/**\n * @internal\n * We calculate label-plane projected points for line vertices as we place glyphs along the line\n * Since we will use the same vertices for potentially many glyphs, cache the results for this bucket\n * over the course of the render. Each vertex location also potentially has one offset equivalent\n * for us to hold onto. The vertex indices are per-symbol-bucket.\n */\ntype ProjectionCache = {\n    /**\n     * tile-unit vertices projected into label-plane units\n     */\n    projections: IndexToPointCache;\n    /**\n     * label-plane vertices which have been shifted to follow an offset line\n     */\n    offsets: IndexToPointCache;\n    /**\n     * Cached projected anchor point.\n     */\n    cachedAnchorPoint: Point | undefined;\n    /**\n     * Was any projected point occluded by the map itself (eg. occluded by the planet when using globe projection).\n     *\n     * Viewport-pitched line-following texts where *any* of the line points is hidden behind the planet curve becomes entirely hidden.\n     * This is perhaps not the most ideal behavior, but it works, it is simple and planetary-scale texts such as this seem to be a rare edge case.\n     */\n    anyProjectionOccluded: boolean;\n};\n\n/**\n * @internal\n * Arguments necessary to project a vertex to the label plane\n */\nexport type SymbolProjectionContext = {\n    /**\n     * Used to cache results, save cost if projecting the same vertex multiple times\n     */\n    projectionCache: ProjectionCache;\n    /**\n     * The array of tile-unit vertices transferred from worker\n     */\n    lineVertexArray: SymbolLineVertexArray;\n    /**\n     * Label plane projection matrix\n     */\n    labelPlaneMatrix: mat4;\n    /**\n     * Function to get elevation at a point\n     * @param x - the x coordinate\n     * @param y - the y coordinate\n    */\n    getElevation: (x: number, y: number) => number;\n    /**\n     * Only for creating synthetic vertices if vertex would otherwise project behind plane of camera,\n     * but still convenient to pass it inside this type.\n     */\n    tileAnchorPoint: Point;\n    /**\n     * True when line glyphs are projected onto the map, instead of onto the viewport.\n     */\n    pitchWithMap: boolean;\n    projection: Projection;\n    unwrappedTileID: UnwrappedTileID;\n    /**\n     * Viewport width.\n     */\n    width: number;\n    /**\n     * Viewport height.\n     */\n    height: number;\n    /**\n     * Translation in tile units, computed using text-translate and text-translate-anchor paint style properties.\n     */\n    translation: [number, number];\n};\n\n/**\n * Only for creating synthetic vertices if vertex would otherwise project behind plane of camera\n */\nexport type ProjectionSyntheticVertexArgs = {\n    distanceFromAnchor: number;\n    previousVertex: Point;\n    direction: number;\n    absOffsetX: number;\n};\n\n/**\n * Transform a vertex from tile coordinates to label plane coordinates\n * @param index - index of vertex to project\n * @param projectionContext - necessary data to project a vertex\n * @returns the vertex projected to the label plane\n */\nfunction projectLineVertexToViewport(index: number, projectionContext: SymbolProjectionContext, syntheticVertexArgs: ProjectionSyntheticVertexArgs): Point {\n    const cache = projectionContext.projectionCache;\n\n    if (cache.projections[index]) {\n        return cache.projections[index];\n    }\n    const currentVertex = new Point(\n        projectionContext.lineVertexArray.getx(index),\n        projectionContext.lineVertexArray.gety(index));\n\n    const projection = projectTileCoordinatesToViewport(currentVertex.x, currentVertex.y, projectionContext);\n\n    if (projection.signedDistanceFromCamera > 0) {\n        cache.projections[index] = projection.point;\n        cache.anyProjectionOccluded = cache.anyProjectionOccluded || projection.isOccluded;\n        return projection.point;\n    }\n\n    // The vertex is behind the plane of the camera, so we can't project it\n    // Instead, we'll create a vertex along the line that's far enough to include the glyph\n    const previousLineVertexIndex = index - syntheticVertexArgs.direction;\n    const previousTilePoint = syntheticVertexArgs.distanceFromAnchor === 0 ?\n        projectionContext.tileAnchorPoint :\n        new Point(projectionContext.lineVertexArray.getx(previousLineVertexIndex), projectionContext.lineVertexArray.gety(previousLineVertexIndex));\n\n    // Don't cache because the new vertex might not be far enough out for future glyphs on the same segment\n    const minimumLength = syntheticVertexArgs.absOffsetX - syntheticVertexArgs.distanceFromAnchor + 1;\n    return projectTruncatedLineSegmentToViewport(previousTilePoint, currentVertex, syntheticVertexArgs.previousVertex, minimumLength, projectionContext);\n}\n\nfunction projectTileCoordinatesToViewport(x: number, y: number, projectionContext: SymbolProjectionContext): PointProjection {\n    const translatedX = x + projectionContext.translation[0];\n    const translatedY = y + projectionContext.translation[1];\n    let projection;\n    if (!projectionContext.pitchWithMap && projectionContext.projection.useSpecialProjectionForSymbols) {\n        projection = projectionContext.projection.projectTileCoordinates(translatedX, translatedY, projectionContext.unwrappedTileID, projectionContext.getElevation);\n        projection.point.x = (projection.point.x * 0.5 + 0.5) * projectionContext.width;\n        projection.point.y = (-projection.point.y * 0.5 + 0.5) * projectionContext.height;\n    } else {\n        projection = project(translatedX, translatedY, projectionContext.labelPlaneMatrix, projectionContext.getElevation);\n        projection.isOccluded = false;\n    }\n    return projection;\n}\n\n/**\n * Calculate the normal vector for a line segment\n * @param segmentVector - will be mutated as a tiny optimization\n * @param offset - magnitude of resulting vector\n * @param direction - direction of line traversal\n * @returns a normal vector from the segment, with magnitude equal to offset amount\n */\nfunction transformToOffsetNormal(segmentVector: Point, offset: number, direction: number): Point {\n    return segmentVector._unit()._perp()._mult(offset * direction);\n}\n\n/**\n * Construct offset line segments for the current segment and the next segment, then extend/shrink\n * the segments until they intersect. If the segments are parallel, then they will touch with no modification.\n *\n * @param index - Index of the current vertex\n * @param prevToCurrentOffsetNormal - Normal vector of the line segment from the previous vertex to the current vertex\n * @param currentVertex - Current (non-offset) vertex projected to the label plane\n * @param lineStartIndex - Beginning index for the line this label is on\n * @param lineEndIndex - End index for the line this label is on\n * @param offsetPreviousVertex - The previous vertex projected to the label plane, and then offset along the previous segments normal\n * @param lineOffsetY - Magnitude of the offset\n * @param projectionContext - Necessary data for tile-to-label-plane projection\n * @returns The point at which the current and next line segments intersect, once offset and extended/shrunk to their meeting point\n */\nfunction findOffsetIntersectionPoint(\n    index: number,\n    prevToCurrentOffsetNormal: Point,\n    currentVertex: Point,\n    lineStartIndex: number,\n    lineEndIndex: number,\n    offsetPreviousVertex: Point,\n    lineOffsetY: number,\n    projectionContext: SymbolProjectionContext,\n    syntheticVertexArgs: ProjectionSyntheticVertexArgs) {\n    if (projectionContext.projectionCache.offsets[index]) {\n        return projectionContext.projectionCache.offsets[index];\n    }\n\n    const offsetCurrentVertex = currentVertex.add(prevToCurrentOffsetNormal);\n\n    if (index + syntheticVertexArgs.direction < lineStartIndex || index + syntheticVertexArgs.direction >= lineEndIndex) {\n        // This is the end of the line, no intersection to calculate\n        projectionContext.projectionCache.offsets[index] = offsetCurrentVertex;\n        return offsetCurrentVertex;\n    }\n    // Offset the vertices for the next segment\n    const nextVertex = projectLineVertexToViewport(index + syntheticVertexArgs.direction, projectionContext, syntheticVertexArgs);\n    const currentToNextOffsetNormal = transformToOffsetNormal(nextVertex.sub(currentVertex), lineOffsetY, syntheticVertexArgs.direction);\n    const offsetNextSegmentBegin = currentVertex.add(currentToNextOffsetNormal);\n    const offsetNextSegmentEnd = nextVertex.add(currentToNextOffsetNormal);\n\n    // find the intersection of these two lines\n    // if the lines are parallel, offsetCurrent/offsetNextBegin will touch\n    projectionContext.projectionCache.offsets[index] = findLineIntersection(offsetPreviousVertex, offsetCurrentVertex, offsetNextSegmentBegin, offsetNextSegmentEnd) || offsetCurrentVertex;\n\n    return projectionContext.projectionCache.offsets[index];\n}\n\n/**\n * Placed Glyph type\n */\ntype PlacedGlyph = {\n    /**\n     * The point at which the glyph should be placed, in label plane coordinates\n     */\n    point: Point;\n    /**\n     * The angle at which the glyph should be placed\n     */\n    angle: number;\n    /**\n     * The label-plane path used to reach this glyph: used only for collision detection\n     */\n    path: Array<Point>;\n};\n\n/*\n * Place a single glyph along its line, projected into the label plane, by iterating outward\n * from the anchor point until the distance traversed in the label plane equals the glyph's\n * offsetX. Returns null if the glyph can't fit on the line geometry.\n */\nfunction placeGlyphAlongLine(\n    offsetX: number,\n    lineOffsetX: number,\n    lineOffsetY: number,\n    flip: boolean,\n    anchorSegment: number,\n    lineStartIndex: number,\n    lineEndIndex: number,\n    projectionContext: SymbolProjectionContext,\n    rotateToLine: boolean): PlacedGlyph | null {\n\n    const combinedOffsetX = flip ?\n        offsetX - lineOffsetX :\n        offsetX + lineOffsetX;\n\n    let direction = combinedOffsetX > 0 ? 1 : -1;\n\n    let angle = 0;\n    if (flip) {\n        // The label needs to be flipped to keep text upright.\n        // Iterate in the reverse direction.\n        direction *= -1;\n        angle = Math.PI;\n    }\n\n    if (direction < 0) angle += Math.PI;\n\n    let currentIndex = direction > 0 ?\n        lineStartIndex + anchorSegment :\n        lineStartIndex + anchorSegment + 1;\n\n    // Project anchor point to proper label plane and cache it\n    let anchorPoint: Point;\n\n    if (projectionContext.projectionCache.cachedAnchorPoint) {\n        anchorPoint = projectionContext.projectionCache.cachedAnchorPoint;\n    } else {\n        anchorPoint = projectTileCoordinatesToViewport(projectionContext.tileAnchorPoint.x, projectionContext.tileAnchorPoint.y, projectionContext).point;\n        projectionContext.projectionCache.cachedAnchorPoint = anchorPoint;\n    }\n\n    let currentVertex = anchorPoint;\n    let previousVertex = anchorPoint;\n\n    // offsetPrev and intersectionPoint are analogous to previousVertex and currentVertex\n    // but if there's a line offset they are calculated in parallel as projection happens\n    let offsetIntersectionPoint: Point;\n    let offsetPreviousVertex: Point;\n\n    let distanceFromAnchor = 0;\n    let currentSegmentDistance = 0;\n    const absOffsetX = Math.abs(combinedOffsetX);\n    const pathVertices: Array<Point> = [];\n\n    let currentLineSegment: Point;\n    while (distanceFromAnchor + currentSegmentDistance <= absOffsetX) {\n        currentIndex += direction;\n\n        // offset does not fit on the projected line\n        if (currentIndex < lineStartIndex || currentIndex >= lineEndIndex)\n            return null;\n\n        // accumulate values from last iteration\n        distanceFromAnchor += currentSegmentDistance;\n        previousVertex = currentVertex;\n        offsetPreviousVertex = offsetIntersectionPoint;\n\n        const syntheticVertexArgs: ProjectionSyntheticVertexArgs = {\n            absOffsetX,\n            direction,\n            distanceFromAnchor,\n            previousVertex\n        };\n\n        // find next vertex in viewport space\n        currentVertex = projectLineVertexToViewport(currentIndex, projectionContext, syntheticVertexArgs);\n        if (lineOffsetY === 0) {\n            // Store vertices for collision detection and update current segment geometry\n            pathVertices.push(previousVertex);\n            currentLineSegment = currentVertex.sub(previousVertex);\n        } else {\n            // Calculate the offset for this section\n            let prevToCurrentOffsetNormal;\n            const prevToCurrent = currentVertex.sub(previousVertex);\n            if (prevToCurrent.mag() === 0) {\n                // We are starting with our anchor point directly on the vertex, so look one vertex ahead\n                // to calculate a normal\n                const nextVertex = projectLineVertexToViewport(currentIndex + direction, projectionContext, syntheticVertexArgs);\n                prevToCurrentOffsetNormal = transformToOffsetNormal(nextVertex.sub(currentVertex), lineOffsetY, direction);\n            } else {\n                prevToCurrentOffsetNormal = transformToOffsetNormal(prevToCurrent, lineOffsetY, direction);\n            }\n            // Initialize offsetPrev on our first iteration, after that it will be pre-calculated\n            if (!offsetPreviousVertex)\n                offsetPreviousVertex = previousVertex.add(prevToCurrentOffsetNormal);\n\n            offsetIntersectionPoint = findOffsetIntersectionPoint(currentIndex, prevToCurrentOffsetNormal, currentVertex, lineStartIndex, lineEndIndex, offsetPreviousVertex, lineOffsetY, projectionContext, syntheticVertexArgs);\n\n            pathVertices.push(offsetPreviousVertex);\n            currentLineSegment = offsetIntersectionPoint.sub(offsetPreviousVertex);\n        }\n        currentSegmentDistance = currentLineSegment.mag();\n    }\n\n    // The point is on the current segment. Interpolate to find it.\n    const segmentInterpolationT = (absOffsetX - distanceFromAnchor) / currentSegmentDistance;\n    const p = currentLineSegment._mult(segmentInterpolationT)._add(offsetPreviousVertex || previousVertex);\n\n    const segmentAngle = angle + Math.atan2(currentVertex.y - previousVertex.y, currentVertex.x - previousVertex.x);\n\n    pathVertices.push(p);\n\n    return {\n        point: p,\n        angle: rotateToLine ? segmentAngle : 0.0,\n        path: pathVertices\n    };\n}\n\nconst hiddenGlyphAttributes = new Float32Array([-Infinity, -Infinity, 0, -Infinity, -Infinity, 0, -Infinity, -Infinity, 0, -Infinity, -Infinity, 0]);\n\n// Hide them by moving them offscreen. We still need to add them to the buffer\n// because the dynamic buffer is paired with a static buffer that doesn't get updated.\nfunction hideGlyphs(num: number, dynamicLayoutVertexArray: SymbolDynamicLayoutArray) {\n    for (let i = 0; i < num; i++) {\n        const offset = dynamicLayoutVertexArray.length;\n        dynamicLayoutVertexArray.resize(offset + 4);\n        // Since all hidden glyphs have the same attributes, we can build up the array faster with a single call to Float32Array.set\n        // for each set of four vertices, instead of calling addDynamicAttributes for each vertex.\n        dynamicLayoutVertexArray.float32.set(hiddenGlyphAttributes, offset * 3);\n    }\n}\n\n// For line label layout, we're not using z output and our w input is always 1\n// This custom matrix transformation ignores those components to make projection faster\nfunction xyTransformMat4(out: vec4, a: vec4, m: mat4) {\n    const x = a[0], y = a[1];\n    out[0] = m[0] * x + m[4] * y + m[12];\n    out[1] = m[1] * x + m[5] * y + m[13];\n    out[3] = m[3] * x + m[7] * y + m[15];\n    return out;\n}\n", "import Point from '@mapbox/point-geometry';\nimport {clipLine} from './clip_line';\nimport {PathInterpolator} from './path_interpolator';\n\nimport * as intersectionTests from '../util/intersection_tests';\nimport {GridIndex} from './grid_index';\nimport {mat4, vec4} from 'gl-matrix';\nimport ONE_EM from '../symbol/one_em';\n\nimport * as projection from '../symbol/projection';\n\nimport type {Transform} from '../geo/transform';\nimport type {SingleCollisionBox} from '../data/bucket/symbol_bucket';\nimport type {\n    GlyphOffsetArray,\n    SymbolLineVertexArray\n} from '../data/array_types.g';\nimport type {OverlapMode} from '../style/style_layer/overlap_mode';\nimport {UnwrappedTileID} from '../source/tile_id';\nimport {SymbolProjectionContext} from '../symbol/projection';\nimport {Projection} from '../geo/projection/projection';\nimport {clamp, getAABB} from '../util/util';\n\n// When a symbol crosses the edge that causes it to be included in\n// collision detection, it will cause changes in the symbols around\n// it. This constant specifies how many pixels to pad the edge of\n// the viewport for collision detection so that the bulk of the changes\n// occur offscreen. Making this constant greater increases label\n// stability, but it's expensive.\nexport const viewportPadding = 100;\n\nexport type PlacedCircles = {\n    circles: Array<number>;\n    offscreen: boolean;\n    collisionDetected: boolean;\n};\n\nexport type PlacedBox = {\n    box: Array<number>;\n    placeable: boolean;\n    offscreen: boolean;\n};\n\nexport type FeatureKey = {\n    bucketInstanceId: number;\n    featureIndex: number;\n    collisionGroupID: number;\n    overlapMode: OverlapMode;\n};\n\ntype ProjectedBox = {\n    /**\n     * The AABB in the format [minX, minY, maxX, maxY].\n     */\n    box: [number, number, number, number];\n    allPointsOccluded: boolean;\n};\n\n/**\n * @internal\n * A collision index used to prevent symbols from overlapping. It keep tracks of\n * where previous symbols have been placed and is used to check if a new\n * symbol overlaps with any previously added symbols.\n *\n * There are two steps to insertion: first placeCollisionBox/Circles checks if\n * there's room for a symbol, then insertCollisionBox/Circles actually puts the\n * symbol in the index. The two step process allows paired symbols to be inserted\n * together even if they overlap.\n */\nexport class CollisionIndex {\n    grid: GridIndex<FeatureKey>;\n    ignoredGrid: GridIndex<FeatureKey>;\n    transform: Transform;\n    pitchFactor: number;\n    screenRightBoundary: number;\n    screenBottomBoundary: number;\n    gridRightBoundary: number;\n    gridBottomBoundary: number;\n    mapProjection: Projection;\n\n    // With perspectiveRatio the fontsize is calculated for tilted maps (near = bigger, far = smaller).\n    // The cutoff defines a threshold to no longer render labels near the horizon.\n    perspectiveRatioCutoff: number;\n\n    constructor(\n        transform: Transform,\n        projection: Projection,\n        grid = new GridIndex<FeatureKey>(transform.width + 2 * viewportPadding, transform.height + 2 * viewportPadding, 25),\n        ignoredGrid = new GridIndex<FeatureKey>(transform.width + 2 * viewportPadding, transform.height + 2 * viewportPadding, 25)\n    ) {\n        this.transform = transform;\n        this.mapProjection = projection;\n\n        this.grid = grid;\n        this.ignoredGrid = ignoredGrid;\n        this.pitchFactor = Math.cos(transform._pitch) * transform.cameraToCenterDistance;\n\n        this.screenRightBoundary = transform.width + viewportPadding;\n        this.screenBottomBoundary = transform.height + viewportPadding;\n        this.gridRightBoundary = transform.width + 2 * viewportPadding;\n        this.gridBottomBoundary = transform.height + 2 * viewportPadding;\n\n        this.perspectiveRatioCutoff = 0.6;\n    }\n\n    placeCollisionBox(\n        collisionBox: SingleCollisionBox,\n        overlapMode: OverlapMode,\n        textPixelRatio: number,\n        posMatrix: mat4,\n        unwrappedTileID: UnwrappedTileID,\n        pitchWithMap: boolean,\n        rotateWithMap: boolean,\n        translation: [number, number],\n        collisionGroupPredicate?: (key: FeatureKey) => boolean,\n        getElevation?: (x: number, y: number) => number,\n        shift?: Point\n    ): PlacedBox {\n        const x = collisionBox.anchorPointX + translation[0];\n        const y = collisionBox.anchorPointY + translation[1];\n        const projectedPoint = this.projectAndGetPerspectiveRatio(\n            posMatrix,\n            x,\n            y,\n            unwrappedTileID,\n            getElevation\n        );\n\n        const tileToViewport = textPixelRatio * projectedPoint.perspectiveRatio;\n\n        let projectedBox: ProjectedBox;\n\n        if (!pitchWithMap && !rotateWithMap) {\n            // Fast path for common symbols\n            const pointX = projectedPoint.point.x + (shift ? shift.x * tileToViewport : 0);\n            const pointY = projectedPoint.point.y + (shift ? shift.y * tileToViewport : 0);\n            projectedBox = {\n                allPointsOccluded: false,\n                box: [\n                    pointX + collisionBox.x1 * tileToViewport,\n                    pointY + collisionBox.y1 * tileToViewport,\n                    pointX + collisionBox.x2 * tileToViewport,\n                    pointY + collisionBox.y2 * tileToViewport,\n                ]\n            };\n        } else {\n            projectedBox = this._projectCollisionBox(\n                collisionBox,\n                tileToViewport,\n                posMatrix,\n                unwrappedTileID,\n                pitchWithMap,\n                rotateWithMap,\n                translation,\n                projectedPoint,\n                getElevation,\n                shift\n            );\n        }\n\n        const [tlX, tlY, brX, brY] = projectedBox.box;\n\n        const projectionOccluded = this.mapProjection.useSpecialProjectionForSymbols ? (pitchWithMap ? projectedBox.allPointsOccluded : this.mapProjection.isOccluded(x, y, unwrappedTileID)) : false;\n\n        if (projectionOccluded || projectedPoint.perspectiveRatio < this.perspectiveRatioCutoff || !this.isInsideGrid(tlX, tlY, brX, brY) ||\n            (overlapMode !== 'always' && this.grid.hitTest(tlX, tlY, brX, brY, overlapMode, collisionGroupPredicate))) {\n            return {\n                box: [tlX, tlY, brX, brY],\n                placeable: false,\n                offscreen: false\n            };\n        }\n\n        return {\n            box: [tlX, tlY, brX, brY],\n            placeable: true,\n            offscreen: this.isOffscreen(tlX, tlY, brX, brY)\n        };\n    }\n\n    placeCollisionCircles(\n        overlapMode: OverlapMode,\n        symbol: any,\n        lineVertexArray: SymbolLineVertexArray,\n        glyphOffsetArray: GlyphOffsetArray,\n        fontSize: number,\n        posMatrix: mat4,\n        unwrappedTileID: UnwrappedTileID,\n        labelPlaneMatrix: mat4,\n        labelToScreenMatrix: mat4,\n        showCollisionCircles: boolean,\n        pitchWithMap: boolean,\n        collisionGroupPredicate: (key: FeatureKey) => boolean,\n        circlePixelDiameter: number,\n        textPixelPadding: number,\n        translation: [number, number],\n        getElevation: (x: number, y: number) => number\n    ): PlacedCircles {\n        const placedCollisionCircles = [];\n\n        const tileUnitAnchorPoint = new Point(symbol.anchorX, symbol.anchorY);\n        const perspectiveRatio = this.getPerspectiveRatio(posMatrix, tileUnitAnchorPoint.x, tileUnitAnchorPoint.y, unwrappedTileID, getElevation);\n        const labelPlaneFontSize = pitchWithMap ? fontSize / perspectiveRatio : fontSize * perspectiveRatio;\n        const labelPlaneFontScale = labelPlaneFontSize / ONE_EM;\n\n        const projectionCache = {projections: {}, offsets: {}, cachedAnchorPoint: undefined, anyProjectionOccluded: false};\n        const lineOffsetX = symbol.lineOffsetX * labelPlaneFontScale;\n        const lineOffsetY = symbol.lineOffsetY * labelPlaneFontScale;\n\n        const projectionContext: SymbolProjectionContext = {\n            getElevation,\n            labelPlaneMatrix,\n            lineVertexArray,\n            pitchWithMap,\n            projectionCache,\n            projection: this.mapProjection,\n            tileAnchorPoint: tileUnitAnchorPoint,\n            unwrappedTileID,\n            width: this.transform.width,\n            height: this.transform.height,\n            translation\n        };\n\n        const firstAndLastGlyph = projection.placeFirstAndLastGlyph(\n            labelPlaneFontScale,\n            glyphOffsetArray,\n            lineOffsetX,\n            lineOffsetY,\n            /*flip*/ false,\n            symbol,\n            false,\n            projectionContext);\n\n        let collisionDetected = false;\n        let inGrid = false;\n        let entirelyOffscreen = true;\n\n        if (firstAndLastGlyph) {\n            const radius = circlePixelDiameter * 0.5 * perspectiveRatio + textPixelPadding;\n            const screenPlaneMin = new Point(-viewportPadding, -viewportPadding);\n            const screenPlaneMax = new Point(this.screenRightBoundary, this.screenBottomBoundary);\n            const interpolator = new PathInterpolator();\n\n            // Construct a projected path from projected line vertices. Anchor points are ignored and removed\n            const first = firstAndLastGlyph.first;\n            const last = firstAndLastGlyph.last;\n\n            let projectedPath: Array<Point> = [];\n            for (let i = first.path.length - 1; i >= 1; i--) {\n                projectedPath.push(first.path[i]);\n            }\n            for (let i = 1; i < last.path.length; i++) {\n                projectedPath.push(last.path[i]);\n            }\n\n            // Tolerate a slightly longer distance than one diameter between two adjacent circles\n            const circleDist = radius * 2.5;\n\n            // The path might need to be converted into screen space if a pitched map is used as the label space\n            if (labelToScreenMatrix) {\n                const screenSpacePath = this.projectPathToScreenSpace(projectedPath, projectionContext, labelToScreenMatrix);\n                // Do not try to place collision circles if even one of the points is behind the camera.\n                // This is a plausible scenario with big camera pitch angles\n                if (screenSpacePath.some(point => point.signedDistanceFromCamera <= 0)) {\n                    projectedPath = [];\n                } else {\n                    projectedPath = screenSpacePath.map(p => p.point);\n                }\n            }\n\n            let segments = [];\n\n            if (projectedPath.length > 0) {\n                // Quickly check if the path is fully inside or outside of the padded collision region.\n                // For overlapping paths we'll only create collision circles for the visible segments\n                const minPoint = projectedPath[0].clone();\n                const maxPoint = projectedPath[0].clone();\n\n                for (let i = 1; i < projectedPath.length; i++) {\n                    minPoint.x = Math.min(minPoint.x, projectedPath[i].x);\n                    minPoint.y = Math.min(minPoint.y, projectedPath[i].y);\n                    maxPoint.x = Math.max(maxPoint.x, projectedPath[i].x);\n                    maxPoint.y = Math.max(maxPoint.y, projectedPath[i].y);\n                }\n\n                if (minPoint.x >= screenPlaneMin.x && maxPoint.x <= screenPlaneMax.x &&\n                    minPoint.y >= screenPlaneMin.y && maxPoint.y <= screenPlaneMax.y) {\n                    // Quad fully visible\n                    segments = [projectedPath];\n                } else if (maxPoint.x < screenPlaneMin.x || minPoint.x > screenPlaneMax.x ||\n                    maxPoint.y < screenPlaneMin.y || minPoint.y > screenPlaneMax.y) {\n                    // Not visible\n                    segments = [];\n                } else {\n                    segments = clipLine([projectedPath], screenPlaneMin.x, screenPlaneMin.y, screenPlaneMax.x, screenPlaneMax.y);\n                }\n            }\n\n            for (const seg of segments) {\n                // interpolate positions for collision circles. Add a small padding to both ends of the segment\n                interpolator.reset(seg, radius * 0.25);\n\n                let numCircles = 0;\n\n                if (interpolator.length <= 0.5 * radius) {\n                    numCircles = 1;\n                } else {\n                    numCircles = Math.ceil(interpolator.paddedLength / circleDist) + 1;\n                }\n\n                for (let i = 0; i < numCircles; i++) {\n                    const t = i / Math.max(numCircles - 1, 1);\n                    const circlePosition = interpolator.lerp(t);\n\n                    // add viewport padding to the position and perform initial collision check\n                    const centerX = circlePosition.x + viewportPadding;\n                    const centerY = circlePosition.y + viewportPadding;\n\n                    placedCollisionCircles.push(centerX, centerY, radius, 0);\n\n                    const x1 = centerX - radius;\n                    const y1 = centerY - radius;\n                    const x2 = centerX + radius;\n                    const y2 = centerY + radius;\n\n                    entirelyOffscreen = entirelyOffscreen && this.isOffscreen(x1, y1, x2, y2);\n                    inGrid = inGrid || this.isInsideGrid(x1, y1, x2, y2);\n\n                    if (overlapMode !== 'always' && this.grid.hitTestCircle(centerX, centerY, radius, overlapMode, collisionGroupPredicate)) {\n                        // Don't early exit if we're showing the debug circles because we still want to calculate\n                        // which circles are in use\n                        collisionDetected = true;\n                        if (!showCollisionCircles) {\n                            return {\n                                circles: [],\n                                offscreen: false,\n                                collisionDetected\n                            };\n                        }\n                    }\n                }\n            }\n        }\n\n        return {\n            circles: ((!showCollisionCircles && collisionDetected) || !inGrid || perspectiveRatio < this.perspectiveRatioCutoff) ? [] : placedCollisionCircles,\n            offscreen: entirelyOffscreen,\n            collisionDetected\n        };\n    }\n\n    projectPathToScreenSpace(projectedPath: Array<Point>, projectionContext: SymbolProjectionContext, labelToScreenMatrix: mat4) {\n        return projectedPath.map(p => projection.project(p.x, p.y, labelToScreenMatrix, projectionContext.getElevation));\n    }\n\n    /**\n     * Because the geometries in the CollisionIndex are an approximation of the shape of\n     * symbols on the map, we use the CollisionIndex to look up the symbol part of\n     * `queryRenderedFeatures`.\n     */\n    queryRenderedSymbols(viewportQueryGeometry: Array<Point>) {\n        if (viewportQueryGeometry.length === 0 || (this.grid.keysLength() === 0 && this.ignoredGrid.keysLength() === 0)) {\n            return {};\n        }\n\n        const query = [];\n        let minX = Infinity;\n        let minY = Infinity;\n        let maxX = -Infinity;\n        let maxY = -Infinity;\n        for (const point of viewportQueryGeometry) {\n            const gridPoint = new Point(point.x + viewportPadding, point.y + viewportPadding);\n            minX = Math.min(minX, gridPoint.x);\n            minY = Math.min(minY, gridPoint.y);\n            maxX = Math.max(maxX, gridPoint.x);\n            maxY = Math.max(maxY, gridPoint.y);\n            query.push(gridPoint);\n        }\n\n        const features = this.grid.query(minX, minY, maxX, maxY)\n            .concat(this.ignoredGrid.query(minX, minY, maxX, maxY));\n\n        const seenFeatures = {};\n        const result = {};\n\n        for (const feature of features) {\n            const featureKey = feature.key;\n            // Skip already seen features.\n            if (seenFeatures[featureKey.bucketInstanceId] === undefined) {\n                seenFeatures[featureKey.bucketInstanceId] = {};\n            }\n            if (seenFeatures[featureKey.bucketInstanceId][featureKey.featureIndex]) {\n                continue;\n            }\n\n            // Check if query intersects with the feature box\n            // \"Collision Circles\" for line labels are treated as boxes here\n            // Since there's no actual collision taking place, the circle vs. square\n            // distinction doesn't matter as much, and box geometry is easier\n            // to work with.\n            const bbox = [\n                new Point(feature.x1, feature.y1),\n                new Point(feature.x2, feature.y1),\n                new Point(feature.x2, feature.y2),\n                new Point(feature.x1, feature.y2)\n            ];\n            if (!intersectionTests.polygonIntersectsPolygon(query, bbox)) {\n                continue;\n            }\n\n            seenFeatures[featureKey.bucketInstanceId][featureKey.featureIndex] = true;\n            if (result[featureKey.bucketInstanceId] === undefined) {\n                result[featureKey.bucketInstanceId] = [];\n            }\n            result[featureKey.bucketInstanceId].push(featureKey.featureIndex);\n        }\n\n        return result;\n    }\n\n    insertCollisionBox(collisionBox: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number) {\n        const grid = ignorePlacement ? this.ignoredGrid : this.grid;\n\n        const key = {bucketInstanceId, featureIndex, collisionGroupID, overlapMode};\n        grid.insert(key, collisionBox[0], collisionBox[1], collisionBox[2], collisionBox[3]);\n    }\n\n    insertCollisionCircles(collisionCircles: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number) {\n        const grid = ignorePlacement ? this.ignoredGrid : this.grid;\n\n        const key = {bucketInstanceId, featureIndex, collisionGroupID, overlapMode};\n        for (let k = 0; k < collisionCircles.length; k += 4) {\n            grid.insertCircle(key, collisionCircles[k], collisionCircles[k + 1], collisionCircles[k + 2]);\n        }\n    }\n\n    projectAndGetPerspectiveRatio(posMatrix: mat4, x: number, y: number, _unwrappedTileID: UnwrappedTileID, getElevation?: (x: number, y: number) => number) {\n        // The code here is duplicated from \"projection.ts\" for performance.\n        // Code here is subject to change once globe is merged.\n        let pos;\n        if (getElevation) { // slow because of handle z-index\n            pos = [x, y, getElevation(x, y), 1] as vec4;\n            vec4.transformMat4(pos, pos, posMatrix);\n        } else { // fast because of ignore z-index\n            pos = [x, y, 0, 1] as vec4;\n            projection.xyTransformMat4(pos, pos, posMatrix);\n        }\n        const w = pos[3];\n        return {\n            point: new Point(\n                (((pos[0] / w + 1) / 2) * this.transform.width) + viewportPadding,\n                (((-pos[1] / w + 1) / 2) * this.transform.height) + viewportPadding\n            ),\n            // See perspective ratio comment in symbol_sdf.vertex\n            // We're doing collision detection in viewport space so we need\n            // to scale down boxes in the distance\n            perspectiveRatio: 0.5 + 0.5 * (this.transform.cameraToCenterDistance / w),\n            isOccluded: false,\n            signedDistanceFromCamera: w\n        };\n    }\n\n    getPerspectiveRatio(posMatrix: mat4, x: number, y: number, unwrappedTileID: UnwrappedTileID, getElevation?: (x: number, y: number) => number): number {\n        // We don't care about the actual projected point, just its W component.\n        const projected = this.mapProjection.useSpecialProjectionForSymbols ?\n            this.mapProjection.projectTileCoordinates(x, y, unwrappedTileID, getElevation) :\n            projection.project(x, y, posMatrix, getElevation);\n        return 0.5 + 0.5 * (this.transform.cameraToCenterDistance / projected.signedDistanceFromCamera);\n    }\n\n    isOffscreen(x1: number, y1: number, x2: number, y2: number) {\n        return x2 < viewportPadding || x1 >= this.screenRightBoundary || y2 < viewportPadding || y1 > this.screenBottomBoundary;\n    }\n\n    isInsideGrid(x1: number, y1: number, x2: number, y2: number) {\n        return x2 >= 0 && x1 < this.gridRightBoundary && y2 >= 0 && y1 < this.gridBottomBoundary;\n    }\n\n    /*\n    * Returns a matrix for transforming collision shapes to viewport coordinate space.\n    * Use this function to render e.g. collision circles on the screen.\n    *   example transformation: clipPos = glCoordMatrix * viewportMatrix * circle_pos\n    */\n    getViewportMatrix() {\n        const m = mat4.identity([] as any);\n        mat4.translate(m, m, [-viewportPadding, -viewportPadding, 0.0]);\n        return m;\n    }\n\n    /**\n     * Applies all layout+paint properties of the given box in order to find as good approximation of its screen-space bounding box as possible.\n     */\n    private _projectCollisionBox(\n        collisionBox: SingleCollisionBox,\n        tileToViewport: number,\n        posMatrix: mat4,\n        unwrappedTileID: UnwrappedTileID,\n        pitchWithMap: boolean,\n        rotateWithMap: boolean,\n        translation: [number, number],\n        projectedPoint: {point: Point; perspectiveRatio: number; signedDistanceFromCamera: number},\n        getElevation?: (x: number, y: number) => number,\n        shift?: Point\n    ): ProjectedBox {\n\n        // These vectors are valid both for screen space viewport-rotation-aligned texts and for pitch-align: map texts that are map-rotation-aligned.\n        let vecEast = new Point(1, 0);\n        let vecSouth = new Point(0, 1);\n\n        const translatedAnchor = new Point(collisionBox.anchorPointX + translation[0], collisionBox.anchorPointY + translation[1]);\n\n        if (rotateWithMap && !pitchWithMap) {\n            // Handles screen space texts that are always aligned east-west.\n            const projectedEast = this.projectAndGetPerspectiveRatio(\n                posMatrix,\n                translatedAnchor.x + 1,\n                translatedAnchor.y,\n                unwrappedTileID,\n                getElevation\n            ).point;\n            const toEast = projectedEast.sub(projectedPoint.point).unit();\n            const angle = Math.atan(toEast.y / toEast.x) + (toEast.x < 0 ? Math.PI : 0);\n            const sin = Math.sin(angle);\n            const cos = Math.cos(angle);\n            vecEast = new Point(cos, sin);\n            vecSouth = new Point(-sin, cos);\n        } else if (!rotateWithMap && pitchWithMap) {\n            // Handles pitch-align: map texts that are always aligned with the viewport's X axis.\n            const angle = -this.transform.angle;\n            const sin = Math.sin(angle);\n            const cos = Math.cos(angle);\n            vecEast = new Point(cos, sin);\n            vecSouth = new Point(-sin, cos);\n        }\n\n        // Configuration for screen space offsets\n        let basePoint = projectedPoint.point;\n        let distanceMultiplier = tileToViewport;\n\n        if (pitchWithMap) {\n            // Configuration for tile space (map-pitch-aligned) offsets\n            basePoint = translatedAnchor;\n\n            const zoomFraction = this.transform.zoom - Math.floor(this.transform.zoom);\n            distanceMultiplier = Math.pow(2, -zoomFraction);\n            distanceMultiplier *= this.mapProjection.getPitchedTextCorrection(this.transform, translatedAnchor, unwrappedTileID);\n\n            // This next correction can't be applied when variable anchors are in use.\n            if (!shift) {\n                // Shader applies a perspective size correction, we need to apply the same correction.\n                // For non-pitchWithMap texts, this is handled above by multiplying `textPixelRatio` with `projectedPoint.perspectiveRatio`,\n                // which is equivalent to the non-pitchWithMap branch of the GLSL code.\n                // Here, we compute and apply the pitchWithMap branch.\n                // See the computation of `perspective_ratio` in the symbol vertex shaders for the GLSL code.\n                const distanceRatio = projectedPoint.signedDistanceFromCamera / this.transform.cameraToCenterDistance;\n                const perspectiveRatio = clamp(0.5 + 0.5 * distanceRatio, 0.0, 4.0); // Same clamp as what is used in the shader.\n                distanceMultiplier *= perspectiveRatio;\n            }\n        }\n\n        if (shift) {\n            // Variable anchors are in use\n            basePoint = basePoint.add(vecEast.mult(shift.x * distanceMultiplier)).add(vecSouth.mult(shift.y * distanceMultiplier));\n        }\n\n        const offsetXmin = collisionBox.x1 * distanceMultiplier;\n        const offsetXmax = collisionBox.x2 * distanceMultiplier;\n        const offsetXhalf = (offsetXmin + offsetXmax) / 2;\n        const offsetYmin = collisionBox.y1 * distanceMultiplier;\n        const offsetYmax = collisionBox.y2 * distanceMultiplier;\n        const offsetYhalf = (offsetYmin + offsetYmax) / 2;\n\n        // 0--1--2\n        // |     |\n        // 7     3\n        // |     |\n        // 6--5--4\n        const offsetsArray: Array<{offsetX: number; offsetY: number}> = [\n            {offsetX: offsetXmin,  offsetY: offsetYmin},\n            {offsetX: offsetXhalf, offsetY: offsetYmin},\n            {offsetX: offsetXmax,  offsetY: offsetYmin},\n            {offsetX: offsetXmax,  offsetY: offsetYhalf},\n            {offsetX: offsetXmax,  offsetY: offsetYmax},\n            {offsetX: offsetXhalf, offsetY: offsetYmax},\n            {offsetX: offsetXmin,  offsetY: offsetYmax},\n            {offsetX: offsetXmin,  offsetY: offsetYhalf}\n        ];\n\n        let points: Array<Point> = [];\n\n        for (const {offsetX, offsetY} of offsetsArray) {\n            points.push(new Point(\n                basePoint.x + vecEast.x * offsetX + vecSouth.x * offsetY,\n                basePoint.y + vecEast.y * offsetX + vecSouth.y * offsetY\n            ));\n        }\n\n        // Is any point of the collision shape visible on the globe (on beyond horizon)?\n        let anyPointVisible = false;\n\n        if (pitchWithMap) {\n            const projected = points.map(p => this.projectAndGetPerspectiveRatio(posMatrix, p.x, p.y, unwrappedTileID, getElevation));\n\n            // Is at least one of the projected points NOT behind the horizon?\n            anyPointVisible = projected.some(p => !p.isOccluded);\n\n            points = projected.map(p => p.point);\n        } else {\n            // Labels that are not pitchWithMap cannot ever hide behind the horizon.\n            anyPointVisible = true;\n        }\n\n        return {\n            box: getAABB(points),\n            allPointsOccluded: !anyPointVisible\n        };\n    }\n}\n", "import {EXTENT} from '../data/extent';\n\nimport type {OverscaledTileID} from './tile_id';\n\n/**\n * Converts a pixel value at a the given zoom level to tile units.\n *\n * The shaders mostly calculate everything in tile units so style\n * properties need to be converted from pixels to tile units using this.\n *\n * For example, a translation by 30 pixels at zoom 6.5 will be a\n * translation by pixelsToTileUnits(30, 6.5) tile units.\n *\n * @returns value in tile units\n */\nexport function pixelsToTileUnits(\n    tile: {\n        tileID: OverscaledTileID;\n        tileSize: number;\n    },\n    pixelValue: number,\n    z: number\n): number {\n    return pixelValue * (EXTENT / (tile.tileSize * Math.pow(2, z - tile.tileID.overscaledZ)));\n}\n", "import {CollisionIndex, viewportPadding} from './collision_index';\nimport type {FeatureKey, PlacedBox, PlacedCircles} from './collision_index';\nimport {EXTENT} from '../data/extent';\nimport * as symbolSize from './symbol_size';\nimport * as projection from './projection';\nimport {getAnchorJustification} from './symbol_layout';\nimport {getAnchorAlignment, WritingMode} from './shaping';\nimport {mat4} from 'gl-matrix';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport Point from '@mapbox/point-geometry';\nimport type {Transform} from '../geo/transform';\nimport type {StyleLayer} from '../style/style_layer';\nimport {PossiblyEvaluated} from '../style/properties';\nimport type {SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated} from '../style/style_layer/symbol_style_layer_properties.g';\nimport {getOverlapMode, OverlapMode} from '../style/style_layer/overlap_mode';\n\nimport type {Tile} from '../source/tile';\nimport {SymbolBucket, CollisionArrays, SingleCollisionBox} from '../data/bucket/symbol_bucket';\n\nimport type {CollisionBoxArray, CollisionVertexArray, SymbolInstance, TextAnchorOffset} from '../data/array_types.g';\nimport type {FeatureIndex} from '../data/feature_index';\nimport type {OverscaledTileID, UnwrappedTileID} from '../source/tile_id';\nimport {Terrain} from '../render/terrain';\nimport {warnOnce} from '../util/util';\nimport {TextAnchor, TextAnchorEnum} from '../style/style_layer/variable_text_anchor';\nimport {Projection} from '../geo/projection/projection';\n\nclass OpacityState {\n    opacity: number;\n    placed: boolean;\n    constructor(prevState: OpacityState, increment: number, placed: boolean, skipFade?: boolean | null) {\n        if (prevState) {\n            this.opacity = Math.max(0, Math.min(1, prevState.opacity + (prevState.placed ? increment : -increment)));\n        } else {\n            this.opacity = (skipFade && placed) ? 1 : 0;\n        }\n        this.placed = placed;\n    }\n    isHidden() {\n        return this.opacity === 0 && !this.placed;\n    }\n}\n\nclass JointOpacityState {\n    text: OpacityState;\n    icon: OpacityState;\n    constructor(prevState: JointOpacityState, increment: number, placedText: boolean, placedIcon: boolean, skipFade?: boolean | null) {\n        this.text = new OpacityState(prevState ? prevState.text : null, increment, placedText, skipFade);\n        this.icon = new OpacityState(prevState ? prevState.icon : null, increment, placedIcon, skipFade);\n    }\n    isHidden() {\n        return this.text.isHidden() && this.icon.isHidden();\n    }\n}\n\nclass JointPlacement {\n    text: boolean;\n    icon: boolean;\n    // skipFade = outside viewport, but within CollisionIndex::viewportPadding px of the edge\n    // Because these symbols aren't onscreen yet, we can skip the \"fade in\" animation,\n    // and if a subsequent viewport change brings them into view, they'll be fully\n    // visible right away.\n    skipFade: boolean;\n    constructor(text: boolean, icon: boolean, skipFade: boolean) {\n        this.text = text;\n        this.icon = icon;\n        this.skipFade = skipFade;\n    }\n}\n\nclass CollisionCircleArray {\n    // Stores collision circles and placement matrices of a bucket for debug rendering.\n    invProjMatrix: mat4;\n    viewportMatrix: mat4;\n    circles: Array<number>;\n\n    constructor() {\n        this.invProjMatrix = mat4.create();\n        this.viewportMatrix = mat4.create();\n        this.circles = [];\n    }\n}\n\nexport class RetainedQueryData {\n    bucketInstanceId: number;\n    featureIndex: FeatureIndex;\n    sourceLayerIndex: number;\n    bucketIndex: number;\n    tileID: OverscaledTileID;\n    featureSortOrder: Array<number>;\n    constructor(bucketInstanceId: number,\n        featureIndex: FeatureIndex,\n        sourceLayerIndex: number,\n        bucketIndex: number,\n        tileID: OverscaledTileID) {\n        this.bucketInstanceId = bucketInstanceId;\n        this.featureIndex = featureIndex;\n        this.sourceLayerIndex = sourceLayerIndex;\n        this.bucketIndex = bucketIndex;\n        this.tileID = tileID;\n    }\n}\n\ntype CollisionGroup = {\n    ID: number;\n    predicate?: (key: FeatureKey) => boolean;\n};\n\nclass CollisionGroups {\n    collisionGroups: {[groupName: string]: CollisionGroup};\n    maxGroupID: number;\n    crossSourceCollisions: boolean;\n\n    constructor(crossSourceCollisions: boolean) {\n        this.crossSourceCollisions = crossSourceCollisions;\n        this.maxGroupID = 0;\n        this.collisionGroups = {};\n    }\n\n    get(sourceID: string) {\n        // The predicate/groupID mechanism allows for arbitrary grouping,\n        // but the current interface defines one source == one group when\n        // crossSourceCollisions == true.\n        if (!this.crossSourceCollisions) {\n            if (!this.collisionGroups[sourceID]) {\n                const nextGroupID = ++this.maxGroupID;\n                this.collisionGroups[sourceID] = {\n                    ID: nextGroupID,\n                    predicate: (key) => {\n                        return key.collisionGroupID === nextGroupID;\n                    }\n                };\n            }\n            return this.collisionGroups[sourceID];\n        } else {\n            return {ID: 0, predicate: null};\n        }\n    }\n}\n\nfunction calculateVariableLayoutShift(\n    anchor: TextAnchor,\n    width: number,\n    height: number,\n    textOffset: [number, number],\n    textBoxScale: number\n): Point {\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(anchor);\n    const shiftX = -(horizontalAlign - 0.5) * width;\n    const shiftY = -(verticalAlign - 0.5) * height;\n    return new Point(\n        shiftX + textOffset[0] * textBoxScale,\n        shiftY + textOffset[1] * textBoxScale\n    );\n}\n\nexport type VariableOffset = {\n    textOffset: [number, number];\n    width: number;\n    height: number;\n    anchor: TextAnchor;\n    textBoxScale: number;\n    prevAnchor?: TextAnchor;\n};\n\ntype TileLayerParameters = {\n    bucket: SymbolBucket;\n    layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>;\n    translationText: [number, number];\n    translationIcon: [number, number];\n    unwrappedTileID: UnwrappedTileID;\n    posMatrix: mat4;\n    textLabelPlaneMatrix: mat4;\n    labelToScreenMatrix: mat4;\n    scale: number;\n    textPixelRatio: number;\n    holdingForFade: boolean;\n    collisionBoxArray: CollisionBoxArray;\n    partiallyEvaluatedTextSize: {\n        uSize: number;\n        uSizeT: number;\n    };\n    collisionGroup: CollisionGroup;\n};\n\nexport type BucketPart = {\n    sortKey?: number | void;\n    symbolInstanceStart: number;\n    symbolInstanceEnd: number;\n    parameters: TileLayerParameters;\n};\n\nexport type CrossTileID = string | number;\n\nexport class Placement {\n    transform: Transform;\n    terrain: Terrain;\n    collisionIndex: CollisionIndex;\n    placements: {\n        [_ in CrossTileID]: JointPlacement;\n    };\n    opacities: {\n        [_ in CrossTileID]: JointOpacityState;\n    };\n    variableOffsets: {\n        [_ in CrossTileID]: VariableOffset;\n    };\n    placedOrientations: {\n        [_ in CrossTileID]: number;\n    };\n    commitTime: number;\n    prevZoomAdjustment: number;\n    lastPlacementChangeTime: number;\n    stale: boolean;\n    fadeDuration: number;\n    retainedQueryData: {\n        [_: number]: RetainedQueryData;\n    };\n    collisionGroups: CollisionGroups;\n    prevPlacement: Placement;\n    zoomAtLastRecencyCheck: number;\n    collisionCircleArrays: {\n        [k in any]: CollisionCircleArray;\n    };\n    collisionBoxArrays: Map<number, Map<number, {\n        text: number[];\n        icon: number[];\n    }>>;\n\n    constructor(transform: Transform, projection: Projection, terrain: Terrain, fadeDuration: number, crossSourceCollisions: boolean, prevPlacement?: Placement) {\n        this.transform = transform.clone();\n        this.terrain = terrain;\n        this.collisionIndex = new CollisionIndex(this.transform, projection);\n        this.placements = {};\n        this.opacities = {};\n        this.variableOffsets = {};\n        this.stale = false;\n        this.commitTime = 0;\n        this.fadeDuration = fadeDuration;\n        this.retainedQueryData = {};\n        this.collisionGroups = new CollisionGroups(crossSourceCollisions);\n        this.collisionCircleArrays = {};\n        this.collisionBoxArrays = new Map<number, Map<number, {\n            text: number[];\n            icon: number[];\n        }>>();\n\n        this.prevPlacement = prevPlacement;\n        if (prevPlacement) {\n            prevPlacement.prevPlacement = undefined; // Only hold on to one placement back\n        }\n\n        this.placedOrientations = {};\n    }\n\n    private _getTerrainElevationFunc(tileID: OverscaledTileID) {\n        const terrain = this.terrain;\n        return terrain ? (x: number, y: number) => terrain.getElevation(tileID, x, y) : null;\n    }\n\n    getBucketParts(results: Array<BucketPart>, styleLayer: StyleLayer, tile: Tile, sortAcrossTiles: boolean) {\n        const symbolBucket = (tile.getBucket(styleLayer) as SymbolBucket);\n        const bucketFeatureIndex = tile.latestFeatureIndex;\n        if (!symbolBucket || !bucketFeatureIndex || styleLayer.id !== symbolBucket.layerIds[0])\n            return;\n\n        const collisionBoxArray = tile.collisionBoxArray;\n\n        const layout = symbolBucket.layers[0].layout;\n        const paint = symbolBucket.layers[0].paint;\n\n        const scale = Math.pow(2, this.transform.zoom - tile.tileID.overscaledZ);\n        const textPixelRatio = tile.tileSize / EXTENT;\n\n        const unwrappedTileID = tile.tileID.toUnwrapped();\n\n        const posMatrix = this.transform.calculatePosMatrix(unwrappedTileID);\n\n        const pitchWithMap = layout.get('text-pitch-alignment') === 'map';\n        const rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pixelsToTiles = pixelsToTileUnits(tile, 1, this.transform.zoom);\n\n        const translationText = this.collisionIndex.mapProjection.translatePosition(\n            this.transform,\n            tile,\n            paint.get('text-translate'),\n            paint.get('text-translate-anchor'),);\n\n        const translationIcon = this.collisionIndex.mapProjection.translatePosition(\n            this.transform,\n            tile,\n            paint.get('icon-translate'),\n            paint.get('icon-translate-anchor'),);\n\n        const textLabelPlaneMatrix = projection.getLabelPlaneMatrix(posMatrix,\n            pitchWithMap,\n            rotateWithMap,\n            this.transform,\n            pixelsToTiles);\n\n        let labelToScreenMatrix = null;\n\n        if (pitchWithMap) {\n            const glMatrix = projection.getGlCoordMatrix(\n                posMatrix,\n                pitchWithMap,\n                rotateWithMap,\n                this.transform,\n                pixelsToTiles);\n\n            labelToScreenMatrix = mat4.multiply([] as any, this.transform.labelPlaneMatrix, glMatrix);\n        }\n\n        // As long as this placement lives, we have to hold onto this bucket's\n        // matching FeatureIndex/data for querying purposes\n        this.retainedQueryData[symbolBucket.bucketInstanceId] = new RetainedQueryData(\n            symbolBucket.bucketInstanceId,\n            bucketFeatureIndex,\n            symbolBucket.sourceLayerIndex,\n            symbolBucket.index,\n            tile.tileID\n        );\n\n        const parameters: TileLayerParameters = {\n            bucket: symbolBucket,\n            layout,\n            translationText,\n            translationIcon,\n            posMatrix,\n            unwrappedTileID,\n            textLabelPlaneMatrix,\n            labelToScreenMatrix,\n            scale,\n            textPixelRatio,\n            holdingForFade: tile.holdingForFade(),\n            collisionBoxArray,\n            partiallyEvaluatedTextSize: symbolSize.evaluateSizeForZoom(symbolBucket.textSizeData, this.transform.zoom),\n            collisionGroup: this.collisionGroups.get(symbolBucket.sourceID)\n        };\n\n        if (sortAcrossTiles) {\n            for (const range of symbolBucket.sortKeyRanges) {\n                const {sortKey, symbolInstanceStart, symbolInstanceEnd} = range;\n                results.push({sortKey, symbolInstanceStart, symbolInstanceEnd, parameters});\n            }\n        } else {\n            results.push({\n                symbolInstanceStart: 0,\n                symbolInstanceEnd: symbolBucket.symbolInstances.length,\n                parameters\n            });\n        }\n    }\n\n    attemptAnchorPlacement(\n        textAnchorOffset: TextAnchorOffset,\n        textBox: SingleCollisionBox,\n        width: number,\n        height: number,\n        textBoxScale: number,\n        rotateWithMap: boolean,\n        pitchWithMap: boolean,\n        textPixelRatio: number,\n        posMatrix: mat4,\n        unwrappedTileID,\n        collisionGroup: CollisionGroup,\n        textOverlapMode: OverlapMode,\n        symbolInstance: SymbolInstance,\n        bucket: SymbolBucket,\n        orientation: number,\n        translationText: [number, number],\n        translationIcon: [number, number],\n        iconBox?: SingleCollisionBox | null,\n        getElevation?: (x: number, y: number) => number\n    ): {\n            shift: Point;\n            placedGlyphBoxes: PlacedBox;\n        } {\n\n        const anchor = TextAnchorEnum[textAnchorOffset.textAnchor] as TextAnchor;\n        const textOffset = [textAnchorOffset.textOffset0, textAnchorOffset.textOffset1] as [number, number];\n        const shift = calculateVariableLayoutShift(anchor, width, height, textOffset, textBoxScale);\n\n        const placedGlyphBoxes = this.collisionIndex.placeCollisionBox(\n            textBox,\n            textOverlapMode,\n            textPixelRatio,\n            posMatrix,\n            unwrappedTileID,\n            pitchWithMap,\n            rotateWithMap,\n            translationText,\n            collisionGroup.predicate,\n            getElevation,\n            shift\n        );\n\n        if (iconBox) {\n            const placedIconBoxes = this.collisionIndex.placeCollisionBox(\n                iconBox,\n                textOverlapMode,\n                textPixelRatio,\n                posMatrix,\n                unwrappedTileID,\n                pitchWithMap,\n                rotateWithMap,\n                translationIcon,\n                collisionGroup.predicate,\n                getElevation,\n                shift\n            );\n            if (!placedIconBoxes.placeable) return;\n        }\n\n        if (placedGlyphBoxes.placeable) {\n            let prevAnchor;\n            // If this label was placed in the previous placement, record the anchor position\n            // to allow us to animate the transition\n            if (this.prevPlacement &&\n                this.prevPlacement.variableOffsets[symbolInstance.crossTileID] &&\n                this.prevPlacement.placements[symbolInstance.crossTileID] &&\n                this.prevPlacement.placements[symbolInstance.crossTileID].text) {\n                prevAnchor = this.prevPlacement.variableOffsets[symbolInstance.crossTileID].anchor;\n            }\n            if (symbolInstance.crossTileID === 0) throw new Error('symbolInstance.crossTileID can\\'t be 0');\n            this.variableOffsets[symbolInstance.crossTileID] = {\n                textOffset,\n                width,\n                height,\n                anchor,\n                textBoxScale,\n                prevAnchor\n            };\n            this.markUsedJustification(bucket, anchor, symbolInstance, orientation);\n\n            if (bucket.allowVerticalPlacement) {\n                this.markUsedOrientation(bucket, orientation, symbolInstance);\n                this.placedOrientations[symbolInstance.crossTileID] = orientation;\n            }\n\n            return {shift, placedGlyphBoxes};\n        }\n    }\n\n    placeLayerBucketPart(bucketPart: BucketPart, seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    }, showCollisionBoxes: boolean) {\n\n        const {\n            bucket,\n            layout,\n            translationText,\n            translationIcon,\n            posMatrix,\n            unwrappedTileID,\n            textLabelPlaneMatrix,\n            labelToScreenMatrix,\n            textPixelRatio,\n            holdingForFade,\n            collisionBoxArray,\n            partiallyEvaluatedTextSize,\n            collisionGroup\n        } = bucketPart.parameters;\n\n        const textOptional = layout.get('text-optional');\n        const iconOptional = layout.get('icon-optional');\n        const textOverlapMode = getOverlapMode(layout, 'text-overlap', 'text-allow-overlap');\n        const textAlwaysOverlap = textOverlapMode === 'always';\n        const iconOverlapMode = getOverlapMode(layout, 'icon-overlap', 'icon-allow-overlap');\n        const iconAlwaysOverlap = iconOverlapMode === 'always';\n        const rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pitchWithMap = layout.get('text-pitch-alignment') === 'map';\n        const hasIconTextFit = layout.get('icon-text-fit') !== 'none';\n        const zOrderByViewportY = layout.get('symbol-z-order') === 'viewport-y';\n\n        // This logic is similar to the \"defaultOpacityState\" logic below in updateBucketOpacities\n        // If we know a symbol is always supposed to show, force it to be marked visible even if\n        // it wasn't placed into the collision index (because some or all of it was outside the range\n        // of the collision grid).\n        // There is a subtle edge case here we're accepting:\n        //  Symbol A has text-allow-overlap: true, icon-allow-overlap: true, icon-optional: false\n        //  A's icon is outside the grid, so doesn't get placed\n        //  A's text would be inside grid, but doesn't get placed because of icon-optional: false\n        //  We still show A because of the allow-overlap settings.\n        //  Symbol B has allow-overlap: false, and gets placed where A's text would be\n        //  On panning in, there is a short period when Symbol B and Symbol A will overlap\n        //  This is the reverse of our normal policy of \"fade in on pan\", but should look like any other\n        //  collision and hopefully not be too noticeable.\n        // See https://github.com/mapbox/mapbox-gl-js/issues/7172\n        const alwaysShowText = textAlwaysOverlap && (iconAlwaysOverlap || !bucket.hasIconData() || iconOptional);\n        const alwaysShowIcon = iconAlwaysOverlap && (textAlwaysOverlap || !bucket.hasTextData() || textOptional);\n\n        if (!bucket.collisionArrays && collisionBoxArray) {\n            bucket.deserializeCollisionBoxes(collisionBoxArray);\n        }\n\n        const tileID = this.retainedQueryData[bucket.bucketInstanceId].tileID;\n        const getElevation = this._getTerrainElevationFunc(tileID);\n\n        const placeSymbol = (symbolInstance: SymbolInstance, collisionArrays: CollisionArrays, symbolIndex: number) => {\n            if (seenCrossTileIDs[symbolInstance.crossTileID]) return;\n            if (holdingForFade) {\n                // Mark all symbols from this tile as \"not placed\", but don't add to seenCrossTileIDs, because we don't\n                // know yet if we have a duplicate in a parent tile that _should_ be placed.\n                this.placements[symbolInstance.crossTileID] = new JointPlacement(false, false, false);\n                return;\n            }\n\n            let placeText = false;\n            let placeIcon = false;\n            let offscreen = true;\n            let shift = null;\n\n            let placed: PlacedBox = {box: null, placeable: false, offscreen: null};\n            let placedVerticalText = {box: null, placeable: false, offscreen: null};\n\n            let placedGlyphBoxes: PlacedBox = null;\n            let placedGlyphCircles: PlacedCircles = null;\n            let placedIconBoxes: PlacedBox = null;\n            let textFeatureIndex = 0;\n            let verticalTextFeatureIndex = 0;\n            let iconFeatureIndex = 0;\n\n            if (collisionArrays.textFeatureIndex) {\n                textFeatureIndex = collisionArrays.textFeatureIndex;\n            } else if (symbolInstance.useRuntimeCollisionCircles) {\n                textFeatureIndex = symbolInstance.featureIndex;\n            }\n            if (collisionArrays.verticalTextFeatureIndex) {\n                verticalTextFeatureIndex = collisionArrays.verticalTextFeatureIndex;\n            }\n\n            const textBox = collisionArrays.textBox;\n            if (textBox) {\n\n                const updatePreviousOrientationIfNotPlaced = (isPlaced) => {\n                    let previousOrientation = WritingMode.horizontal;\n                    if (bucket.allowVerticalPlacement && !isPlaced && this.prevPlacement) {\n                        const prevPlacedOrientation = this.prevPlacement.placedOrientations[symbolInstance.crossTileID];\n                        if (prevPlacedOrientation) {\n                            this.placedOrientations[symbolInstance.crossTileID] = prevPlacedOrientation;\n                            previousOrientation = prevPlacedOrientation;\n                            this.markUsedOrientation(bucket, previousOrientation, symbolInstance);\n                        }\n                    }\n                    return previousOrientation;\n                };\n\n                const placeTextForPlacementModes = (placeHorizontalFn, placeVerticalFn) => {\n                    if (bucket.allowVerticalPlacement && symbolInstance.numVerticalGlyphVertices > 0 && collisionArrays.verticalTextBox) {\n                        for (const placementMode of bucket.writingModes) {\n                            if (placementMode === WritingMode.vertical) {\n                                placed = placeVerticalFn();\n                                placedVerticalText = placed;\n                            } else {\n                                placed = placeHorizontalFn();\n                            }\n                            if (placed && placed.placeable) break;\n                        }\n                    } else {\n                        placed = placeHorizontalFn();\n                    }\n                };\n\n                const textAnchorOffsetStart = symbolInstance.textAnchorOffsetStartIndex;\n                const textAnchorOffsetEnd = symbolInstance.textAnchorOffsetEndIndex;\n\n                // If start+end indices match, text-variable-anchor is not in play.\n                if (textAnchorOffsetEnd === textAnchorOffsetStart) {\n                    const placeBox = (collisionTextBox, orientation) => {\n                        const placedFeature = this.collisionIndex.placeCollisionBox(\n                            collisionTextBox,\n                            textOverlapMode,\n                            textPixelRatio,\n                            posMatrix,\n                            unwrappedTileID,\n                            pitchWithMap,\n                            rotateWithMap,\n                            translationText,\n                            collisionGroup.predicate,\n                            getElevation\n                        );\n                        if (placedFeature && placedFeature.placeable) {\n                            this.markUsedOrientation(bucket, orientation, symbolInstance);\n                            this.placedOrientations[symbolInstance.crossTileID] = orientation;\n                        }\n                        return placedFeature;\n                    };\n\n                    const placeHorizontal = () => {\n                        return placeBox(textBox, WritingMode.horizontal);\n                    };\n\n                    const placeVertical = () => {\n                        const verticalTextBox = collisionArrays.verticalTextBox;\n                        if (bucket.allowVerticalPlacement && symbolInstance.numVerticalGlyphVertices > 0 && verticalTextBox) {\n                            return placeBox(verticalTextBox, WritingMode.vertical);\n                        }\n                        return {box: null, offscreen: null};\n                    };\n\n                    placeTextForPlacementModes(placeHorizontal, placeVertical);\n                    updatePreviousOrientationIfNotPlaced(placed && placed.placeable);\n\n                } else {\n                    // If this symbol was in the last placement, prefer placement using same anchor, if it's still available\n                    let prevAnchor = TextAnchorEnum[this.prevPlacement?.variableOffsets[symbolInstance.crossTileID]?.anchor];\n\n                    const placeBoxForVariableAnchors = (collisionTextBox, collisionIconBox, orientation) => {\n                        const width = collisionTextBox.x2 - collisionTextBox.x1;\n                        const height = collisionTextBox.y2 - collisionTextBox.y1;\n                        const textBoxScale = symbolInstance.textBoxScale;\n                        const variableIconBox = hasIconTextFit && (iconOverlapMode === 'never') ? collisionIconBox : null;\n\n                        let placedBox: PlacedBox = null;\n                        let placementPasses = (textOverlapMode === 'never') ? 1 : 2;\n                        let overlapMode: OverlapMode = 'never';\n\n                        if (prevAnchor) {\n                            placementPasses++;\n                        }\n\n                        for (let pass = 0; pass < placementPasses; pass++) {\n                            for (let i = textAnchorOffsetStart; i < textAnchorOffsetEnd; i++) {\n                                const textAnchorOffset = bucket.textAnchorOffsets.get(i);\n\n                                if (prevAnchor && textAnchorOffset.textAnchor !== prevAnchor) {\n                                    continue;\n                                }\n\n                                const result = this.attemptAnchorPlacement(\n                                    textAnchorOffset, collisionTextBox, width, height,\n                                    textBoxScale, rotateWithMap, pitchWithMap, textPixelRatio, posMatrix, unwrappedTileID,\n                                    collisionGroup, overlapMode, symbolInstance, bucket, orientation, translationText, translationIcon, variableIconBox, getElevation);\n\n                                if (result) {\n                                    placedBox = result.placedGlyphBoxes;\n                                    if (placedBox && placedBox.placeable) {\n                                        placeText = true;\n                                        shift = result.shift;\n                                        return placedBox;\n                                    }\n                                }\n                            }\n\n                            if (prevAnchor) {\n                                prevAnchor = null;\n                            } else {\n                                overlapMode = textOverlapMode;\n                            }\n                        }\n\n                        if (showCollisionBoxes && !placedBox) {\n                            // No box was successfully placed\n                            // Generate bounds for a fake centered box, so that we can at least display something for collision debug.\n                            const placedFakeGlyphBox = this.collisionIndex.placeCollisionBox(\n                                textBox,\n                                'always', // Skips expensive collision check with already placed boxes\n                                textPixelRatio,\n                                posMatrix,\n                                unwrappedTileID,\n                                pitchWithMap,\n                                rotateWithMap,\n                                translationText,\n                                collisionGroup.predicate,\n                                getElevation,\n                                new Point(0, 0)\n                            );\n                            placedBox = {\n                                box: placedFakeGlyphBox.box,\n                                offscreen: false,\n                                placeable: false\n                            };\n                        }\n\n                        return placedBox;\n                    };\n\n                    const placeHorizontal = () => {\n                        return placeBoxForVariableAnchors(textBox, collisionArrays.iconBox, WritingMode.horizontal);\n                    };\n\n                    const placeVertical = () => {\n                        const verticalTextBox = collisionArrays.verticalTextBox;\n                        const wasPlaced = placed && placed.placeable;\n                        if (bucket.allowVerticalPlacement && !wasPlaced && symbolInstance.numVerticalGlyphVertices > 0 && verticalTextBox) {\n                            return placeBoxForVariableAnchors(verticalTextBox, collisionArrays.verticalIconBox, WritingMode.vertical);\n                        }\n                        return {box: null, occluded: true, offscreen: null};\n                    };\n\n                    placeTextForPlacementModes(placeHorizontal, placeVertical);\n\n                    if (placed) {\n                        placeText = placed.placeable;\n                        offscreen = placed.offscreen;\n                    }\n\n                    const prevOrientation = updatePreviousOrientationIfNotPlaced(placed && placed.placeable);\n\n                    // If we didn't get placed, we still need to copy our position from the last placement for\n                    // fade animations\n                    if (!placeText && this.prevPlacement) {\n                        const prevOffset = this.prevPlacement.variableOffsets[symbolInstance.crossTileID];\n                        if (prevOffset) {\n                            this.variableOffsets[symbolInstance.crossTileID] = prevOffset;\n                            this.markUsedJustification(bucket, prevOffset.anchor, symbolInstance, prevOrientation);\n                        }\n                    }\n\n                }\n            }\n\n            placedGlyphBoxes = placed;\n            placeText = placedGlyphBoxes && placedGlyphBoxes.placeable;\n\n            offscreen = placedGlyphBoxes && placedGlyphBoxes.offscreen;\n\n            if (symbolInstance.useRuntimeCollisionCircles) {\n                const placedSymbol = bucket.text.placedSymbolArray.get(symbolInstance.centerJustifiedTextSymbolIndex);\n                const fontSize = symbolSize.evaluateSizeForFeature(bucket.textSizeData, partiallyEvaluatedTextSize, placedSymbol);\n\n                const textPixelPadding = layout.get('text-padding');\n                const circlePixelDiameter = symbolInstance.collisionCircleDiameter;\n\n                placedGlyphCircles = this.collisionIndex.placeCollisionCircles(\n                    textOverlapMode,\n                    placedSymbol,\n                    bucket.lineVertexArray,\n                    bucket.glyphOffsetArray,\n                    fontSize,\n                    posMatrix,\n                    unwrappedTileID,\n                    textLabelPlaneMatrix,\n                    labelToScreenMatrix,\n                    showCollisionBoxes,\n                    pitchWithMap,\n                    collisionGroup.predicate,\n                    circlePixelDiameter,\n                    textPixelPadding,\n                    translationText,\n                    getElevation\n                );\n\n                if (placedGlyphCircles.circles.length && placedGlyphCircles.collisionDetected && !showCollisionBoxes) {\n                    warnOnce('Collisions detected, but collision boxes are not shown');\n                }\n\n                // If text-overlap is set to 'always', force \"placedCircles\" to true\n                // In theory there should always be at least one circle placed\n                // in this case, but for now quirks in text-anchor\n                // and text-offset may prevent that from being true.\n                placeText = textAlwaysOverlap || (placedGlyphCircles.circles.length > 0 && !placedGlyphCircles.collisionDetected);\n                offscreen = offscreen && placedGlyphCircles.offscreen;\n            }\n\n            if (collisionArrays.iconFeatureIndex) {\n                iconFeatureIndex = collisionArrays.iconFeatureIndex;\n            }\n\n            if (collisionArrays.iconBox) {\n                const placeIconFeature = iconBox => {\n                    return this.collisionIndex.placeCollisionBox(\n                        iconBox,\n                        iconOverlapMode,\n                        textPixelRatio,\n                        posMatrix,\n                        unwrappedTileID,\n                        pitchWithMap,\n                        rotateWithMap,\n                        translationIcon,\n                        collisionGroup.predicate,\n                        getElevation,\n                        (hasIconTextFit && shift) ? shift : undefined,\n                    );\n                };\n\n                if (placedVerticalText && placedVerticalText.placeable && collisionArrays.verticalIconBox) {\n                    placedIconBoxes = placeIconFeature(collisionArrays.verticalIconBox);\n                    placeIcon = placedIconBoxes.placeable;\n                } else {\n                    placedIconBoxes = placeIconFeature(collisionArrays.iconBox);\n                    placeIcon = placedIconBoxes.placeable;\n                }\n                offscreen = offscreen && placedIconBoxes.offscreen;\n            }\n\n            const iconWithoutText = textOptional ||\n                (symbolInstance.numHorizontalGlyphVertices === 0 && symbolInstance.numVerticalGlyphVertices === 0);\n            const textWithoutIcon = iconOptional || symbolInstance.numIconVertices === 0;\n\n            // Combine the scales for icons and text.\n            if (!iconWithoutText && !textWithoutIcon) {\n                placeIcon = placeText = placeIcon && placeText;\n            } else if (!textWithoutIcon) {\n                placeText = placeIcon && placeText;\n            } else if (!iconWithoutText) {\n                placeIcon = placeIcon && placeText;\n            }\n\n            const hasTextBox = placeText && placedGlyphBoxes.placeable;\n            const hasIconBox = placeIcon && placedIconBoxes.placeable;\n\n            if (hasTextBox) {\n                if (placedVerticalText && placedVerticalText.placeable && verticalTextFeatureIndex) {\n                    this.collisionIndex.insertCollisionBox(\n                        placedGlyphBoxes.box,\n                        textOverlapMode,\n                        layout.get('text-ignore-placement'),\n                        bucket.bucketInstanceId,\n                        verticalTextFeatureIndex,\n                        collisionGroup.ID);\n                } else {\n                    this.collisionIndex.insertCollisionBox(\n                        placedGlyphBoxes.box,\n                        textOverlapMode,\n                        layout.get('text-ignore-placement'),\n                        bucket.bucketInstanceId,\n                        textFeatureIndex,\n                        collisionGroup.ID);\n                }\n\n            }\n            if (hasIconBox) {\n                this.collisionIndex.insertCollisionBox(\n                    placedIconBoxes.box,\n                    iconOverlapMode,\n                    layout.get('icon-ignore-placement'),\n                    bucket.bucketInstanceId,\n                    iconFeatureIndex,\n                    collisionGroup.ID);\n            }\n            if (placedGlyphCircles) {\n                if (placeText) {\n                    this.collisionIndex.insertCollisionCircles(\n                        placedGlyphCircles.circles,\n                        textOverlapMode,\n                        layout.get('text-ignore-placement'),\n                        bucket.bucketInstanceId,\n                        textFeatureIndex,\n                        collisionGroup.ID);\n                }\n            }\n\n            if (showCollisionBoxes) {\n                this.storeCollisionData(bucket.bucketInstanceId, symbolIndex, collisionArrays, placedGlyphBoxes, placedIconBoxes, placedGlyphCircles);\n            }\n\n            if (symbolInstance.crossTileID === 0) throw new Error('symbolInstance.crossTileID can\\'t be 0');\n            if (bucket.bucketInstanceId === 0) throw new Error('bucket.bucketInstanceId can\\'t be 0');\n\n            this.placements[symbolInstance.crossTileID] = new JointPlacement(placeText || alwaysShowText, placeIcon || alwaysShowIcon, offscreen || bucket.justReloaded);\n            seenCrossTileIDs[symbolInstance.crossTileID] = true;\n        };\n\n        if (zOrderByViewportY) {\n            if (bucketPart.symbolInstanceStart !== 0) throw new Error('bucket.bucketInstanceId should be 0');\n            const symbolIndexes = bucket.getSortedSymbolIndexes(this.transform.angle);\n            for (let i = symbolIndexes.length - 1; i >= 0; --i) {\n                const symbolIndex = symbolIndexes[i];\n                placeSymbol(bucket.symbolInstances.get(symbolIndex), bucket.collisionArrays[symbolIndex], symbolIndex);\n            }\n        } else {\n            for (let i = bucketPart.symbolInstanceStart; i < bucketPart.symbolInstanceEnd; i++) {\n                placeSymbol(bucket.symbolInstances.get(i), bucket.collisionArrays[i], i);\n            }\n        }\n\n        if (showCollisionBoxes && bucket.bucketInstanceId in this.collisionCircleArrays) {\n            const circleArray = this.collisionCircleArrays[bucket.bucketInstanceId];\n\n            // Store viewport and inverse projection matrices per bucket\n            mat4.invert(circleArray.invProjMatrix, posMatrix);\n            circleArray.viewportMatrix = this.collisionIndex.getViewportMatrix();\n        }\n\n        bucket.justReloaded = false;\n    }\n\n    storeCollisionData(bucketInstanceId: number, symbolIndex: number, collisionArrays: CollisionArrays, placedGlyphBoxes: PlacedBox, placedIconBoxes: PlacedBox, placedGlyphCircles: PlacedCircles): void {\n        if (collisionArrays.textBox || collisionArrays.iconBox) {\n            // Store the actually used collision box for debug draw\n            let boxArray: Map<number, {\n                text: number[];\n                icon: number[];\n            }>;\n\n            if (this.collisionBoxArrays.has(bucketInstanceId)) {\n                boxArray = this.collisionBoxArrays.get(bucketInstanceId);\n            } else {\n                boxArray = new Map<number, {\n                    text: number[];\n                    icon: number[];\n                }>();\n                this.collisionBoxArrays.set(bucketInstanceId, boxArray);\n            }\n            let realCollisionBox: {\n                text: number[];\n                icon: number[];\n            };\n\n            if (boxArray.has(symbolIndex)) {\n                realCollisionBox = boxArray.get(symbolIndex);\n            } else {\n                realCollisionBox = {\n                    text: null,\n                    icon: null\n                };\n                boxArray.set(symbolIndex, realCollisionBox);\n            }\n\n            if (collisionArrays.textBox) {\n                realCollisionBox.text = placedGlyphBoxes.box;\n            }\n            if (collisionArrays.iconBox) {\n                realCollisionBox.icon = placedIconBoxes.box;\n            }\n        }\n\n        if (placedGlyphCircles) {\n            let circleArray = this.collisionCircleArrays[bucketInstanceId];\n\n            // Group collision circles together by bucket. Circles can't be pushed forward for rendering yet as the symbol placement\n            // for a bucket is not guaranteed to be complete before the commit-function has been called\n            if (circleArray === undefined)\n                circleArray = this.collisionCircleArrays[bucketInstanceId] = new CollisionCircleArray();\n\n            for (let i = 0; i < placedGlyphCircles.circles.length; i += 4) {\n                circleArray.circles.push(placedGlyphCircles.circles[i + 0]);              // x\n                circleArray.circles.push(placedGlyphCircles.circles[i + 1]);              // y\n                circleArray.circles.push(placedGlyphCircles.circles[i + 2]);              // radius\n                circleArray.circles.push(placedGlyphCircles.collisionDetected ? 1 : 0);   // collisionDetected-flag\n            }\n        }\n    }\n\n    markUsedJustification(bucket: SymbolBucket, placedAnchor: TextAnchor, symbolInstance: SymbolInstance, orientation: number) {\n        const justifications = {\n            'left': symbolInstance.leftJustifiedTextSymbolIndex,\n            'center': symbolInstance.centerJustifiedTextSymbolIndex,\n            'right': symbolInstance.rightJustifiedTextSymbolIndex\n        };\n\n        let autoIndex;\n        if (orientation === WritingMode.vertical) {\n            autoIndex = symbolInstance.verticalPlacedTextSymbolIndex;\n        } else {\n            autoIndex = justifications[getAnchorJustification(placedAnchor)];\n        }\n\n        const indexes = [\n            symbolInstance.leftJustifiedTextSymbolIndex,\n            symbolInstance.centerJustifiedTextSymbolIndex,\n            symbolInstance.rightJustifiedTextSymbolIndex,\n            symbolInstance.verticalPlacedTextSymbolIndex\n        ];\n\n        for (const index of indexes) {\n            if (index >= 0) {\n                if (autoIndex >= 0 && index !== autoIndex) {\n                    // There are multiple justifications and this one isn't it: shift offscreen\n                    bucket.text.placedSymbolArray.get(index).crossTileID = 0;\n                } else {\n                    // Either this is the chosen justification or the justification is hardwired: use this one\n                    bucket.text.placedSymbolArray.get(index).crossTileID = symbolInstance.crossTileID;\n                }\n            }\n        }\n    }\n\n    markUsedOrientation(bucket: SymbolBucket, orientation: number, symbolInstance: SymbolInstance) {\n        const horizontal = (orientation === WritingMode.horizontal || orientation === WritingMode.horizontalOnly) ? orientation : 0;\n        const vertical = orientation === WritingMode.vertical ? orientation : 0;\n\n        const horizontalIndexes = [\n            symbolInstance.leftJustifiedTextSymbolIndex,\n            symbolInstance.centerJustifiedTextSymbolIndex,\n            symbolInstance.rightJustifiedTextSymbolIndex\n        ];\n\n        for (const index of horizontalIndexes) {\n            bucket.text.placedSymbolArray.get(index).placedOrientation = horizontal;\n        }\n\n        if (symbolInstance.verticalPlacedTextSymbolIndex) {\n            bucket.text.placedSymbolArray.get(symbolInstance.verticalPlacedTextSymbolIndex).placedOrientation = vertical;\n        }\n    }\n\n    commit(now: number): void {\n        this.commitTime = now;\n        this.zoomAtLastRecencyCheck = this.transform.zoom;\n\n        const prevPlacement = this.prevPlacement;\n        let placementChanged = false;\n\n        this.prevZoomAdjustment = prevPlacement ? prevPlacement.zoomAdjustment(this.transform.zoom) : 0;\n        const increment = prevPlacement ? prevPlacement.symbolFadeChange(now) : 1;\n\n        const prevOpacities = prevPlacement ? prevPlacement.opacities : {};\n        const prevOffsets = prevPlacement ? prevPlacement.variableOffsets : {};\n        const prevOrientations = prevPlacement ? prevPlacement.placedOrientations : {};\n\n        // add the opacities from the current placement, and copy their current values from the previous placement\n        for (const crossTileID in this.placements) {\n            const jointPlacement = this.placements[crossTileID];\n            const prevOpacity = prevOpacities[crossTileID];\n            if (prevOpacity) {\n                this.opacities[crossTileID] = new JointOpacityState(prevOpacity, increment, jointPlacement.text, jointPlacement.icon);\n                placementChanged = placementChanged ||\n                    jointPlacement.text !== prevOpacity.text.placed ||\n                    jointPlacement.icon !== prevOpacity.icon.placed;\n            } else {\n                this.opacities[crossTileID] = new JointOpacityState(null, increment, jointPlacement.text, jointPlacement.icon, jointPlacement.skipFade);\n                placementChanged = placementChanged || jointPlacement.text || jointPlacement.icon;\n            }\n        }\n\n        // copy and update values from the previous placement that aren't in the current placement but haven't finished fading\n        for (const crossTileID in prevOpacities) {\n            const prevOpacity = prevOpacities[crossTileID];\n            if (!this.opacities[crossTileID]) {\n                const jointOpacity = new JointOpacityState(prevOpacity, increment, false, false);\n                if (!jointOpacity.isHidden()) {\n                    this.opacities[crossTileID] = jointOpacity;\n                    placementChanged = placementChanged || prevOpacity.text.placed || prevOpacity.icon.placed;\n                }\n            }\n        }\n        for (const crossTileID in prevOffsets) {\n            if (!this.variableOffsets[crossTileID] && this.opacities[crossTileID] && !this.opacities[crossTileID].isHidden()) {\n                this.variableOffsets[crossTileID] = prevOffsets[crossTileID];\n            }\n        }\n\n        for (const crossTileID in prevOrientations) {\n            if (!this.placedOrientations[crossTileID] && this.opacities[crossTileID] && !this.opacities[crossTileID].isHidden()) {\n                this.placedOrientations[crossTileID] = prevOrientations[crossTileID];\n            }\n        }\n\n        // this.lastPlacementChangeTime is the time of the last commit() that\n        // resulted in a placement change -- in other words, the start time of\n        // the last symbol fade animation\n        if (prevPlacement && prevPlacement.lastPlacementChangeTime === undefined) {\n            throw new Error('Last placement time for previous placement is not defined');\n        }\n        if (placementChanged) {\n            this.lastPlacementChangeTime = now;\n        } else if (typeof this.lastPlacementChangeTime !== 'number') {\n            this.lastPlacementChangeTime = prevPlacement ? prevPlacement.lastPlacementChangeTime : now;\n        }\n    }\n\n    updateLayerOpacities(styleLayer: StyleLayer, tiles: Array<Tile>) {\n        const seenCrossTileIDs = {};\n        for (const tile of tiles) {\n            const symbolBucket = tile.getBucket(styleLayer) as SymbolBucket;\n            if (symbolBucket && tile.latestFeatureIndex && styleLayer.id === symbolBucket.layerIds[0]) {\n                this.updateBucketOpacities(symbolBucket, tile.tileID, seenCrossTileIDs, tile.collisionBoxArray);\n            }\n        }\n    }\n\n    updateBucketOpacities(bucket: SymbolBucket, tileID: OverscaledTileID, seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    }, collisionBoxArray?: CollisionBoxArray | null) {\n        if (bucket.hasTextData()) {\n            bucket.text.opacityVertexArray.clear();\n            bucket.text.hasVisibleVertices = false;\n        }\n        if (bucket.hasIconData()) {\n            bucket.icon.opacityVertexArray.clear();\n            bucket.icon.hasVisibleVertices = false;\n        }\n        if (bucket.hasIconCollisionBoxData()) bucket.iconCollisionBox.collisionVertexArray.clear();\n        if (bucket.hasTextCollisionBoxData()) bucket.textCollisionBox.collisionVertexArray.clear();\n\n        const layer = bucket.layers[0];\n        const layout = layer.layout;\n        const duplicateOpacityState = new JointOpacityState(null, 0, false, false, true);\n        const textAllowOverlap = layout.get('text-allow-overlap');\n        const iconAllowOverlap = layout.get('icon-allow-overlap');\n        const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n        const rotateWithMap = layout.get('text-rotation-alignment') === 'map';\n        const pitchWithMap = layout.get('text-pitch-alignment') === 'map';\n        const hasIconTextFit = layout.get('icon-text-fit') !== 'none';\n        // If allow-overlap is true, we can show symbols before placement runs on them\n        // But we have to wait for placement if we potentially depend on a paired icon/text\n        // with allow-overlap: false.\n        // See https://github.com/mapbox/mapbox-gl-js/issues/7032\n        const defaultOpacityState = new JointOpacityState(null, 0,\n            textAllowOverlap && (iconAllowOverlap || !bucket.hasIconData() || layout.get('icon-optional')),\n            iconAllowOverlap && (textAllowOverlap || !bucket.hasTextData() || layout.get('text-optional')),\n            true);\n\n        if (!bucket.collisionArrays && collisionBoxArray && ((bucket.hasIconCollisionBoxData() || bucket.hasTextCollisionBoxData()))) {\n            bucket.deserializeCollisionBoxes(collisionBoxArray);\n        }\n\n        const addOpacities = (iconOrText, numVertices: number, opacity: number) => {\n            for (let i = 0; i < numVertices / 4; i++) {\n                iconOrText.opacityVertexArray.emplaceBack(opacity);\n            }\n            iconOrText.hasVisibleVertices = iconOrText.hasVisibleVertices || (opacity !== PACKED_HIDDEN_OPACITY);\n        };\n\n        const boxArrays = this.collisionBoxArrays.get(bucket.bucketInstanceId);\n\n        for (let s = 0; s < bucket.symbolInstances.length; s++) {\n            const symbolInstance = bucket.symbolInstances.get(s);\n            const {\n                numHorizontalGlyphVertices,\n                numVerticalGlyphVertices,\n                crossTileID\n            } = symbolInstance;\n\n            const isDuplicate = seenCrossTileIDs[crossTileID];\n\n            let opacityState = this.opacities[crossTileID];\n            if (isDuplicate) {\n                opacityState = duplicateOpacityState;\n            } else if (!opacityState) {\n                opacityState = defaultOpacityState;\n                // store the state so that future placements use it as a starting point\n                this.opacities[crossTileID] = opacityState;\n            }\n\n            seenCrossTileIDs[crossTileID] = true;\n\n            const hasText = numHorizontalGlyphVertices > 0 || numVerticalGlyphVertices > 0;\n            const hasIcon = symbolInstance.numIconVertices > 0;\n\n            const placedOrientation = this.placedOrientations[symbolInstance.crossTileID];\n            const horizontalHidden = placedOrientation === WritingMode.vertical;\n            const verticalHidden = placedOrientation === WritingMode.horizontal || placedOrientation === WritingMode.horizontalOnly;\n\n            if (hasText) {\n                const packedOpacity = packOpacity(opacityState.text);\n                // Vertical text fades in/out on collision the same way as corresponding\n                // horizontal text. Switch between vertical/horizontal should be instantaneous\n                const horizontalOpacity = horizontalHidden ? PACKED_HIDDEN_OPACITY : packedOpacity;\n                addOpacities(bucket.text, numHorizontalGlyphVertices, horizontalOpacity);\n                const verticalOpacity = verticalHidden ? PACKED_HIDDEN_OPACITY : packedOpacity;\n                addOpacities(bucket.text, numVerticalGlyphVertices, verticalOpacity);\n\n                // If this label is completely faded, mark it so that we don't have to calculate\n                // its position at render time. If this layer has variable placement, shift the various\n                // symbol instances appropriately so that symbols from buckets that have yet to be placed\n                // offset appropriately.\n                const symbolHidden = opacityState.text.isHidden();\n                [\n                    symbolInstance.rightJustifiedTextSymbolIndex,\n                    symbolInstance.centerJustifiedTextSymbolIndex,\n                    symbolInstance.leftJustifiedTextSymbolIndex\n                ].forEach(index => {\n                    if (index >= 0) {\n                        bucket.text.placedSymbolArray.get(index).hidden = symbolHidden || horizontalHidden ? 1 : 0;\n                    }\n                });\n\n                if (symbolInstance.verticalPlacedTextSymbolIndex >= 0) {\n                    bucket.text.placedSymbolArray.get(symbolInstance.verticalPlacedTextSymbolIndex).hidden = symbolHidden || verticalHidden ? 1 : 0;\n                }\n\n                const prevOffset = this.variableOffsets[symbolInstance.crossTileID];\n                if (prevOffset) {\n                    this.markUsedJustification(bucket, prevOffset.anchor, symbolInstance, placedOrientation);\n                }\n\n                const prevOrientation = this.placedOrientations[symbolInstance.crossTileID];\n                if (prevOrientation) {\n                    this.markUsedJustification(bucket, 'left', symbolInstance, prevOrientation);\n                    this.markUsedOrientation(bucket, prevOrientation, symbolInstance);\n                }\n            }\n\n            if (hasIcon) {\n                const packedOpacity = packOpacity(opacityState.icon);\n\n                const useHorizontal = !(hasIconTextFit && symbolInstance.verticalPlacedIconSymbolIndex && horizontalHidden);\n\n                if (symbolInstance.placedIconSymbolIndex >= 0) {\n                    const horizontalOpacity = useHorizontal ? packedOpacity : PACKED_HIDDEN_OPACITY;\n                    addOpacities(bucket.icon, symbolInstance.numIconVertices, horizontalOpacity);\n                    bucket.icon.placedSymbolArray.get(symbolInstance.placedIconSymbolIndex).hidden =\n                        (opacityState.icon.isHidden() as any);\n                }\n\n                if (symbolInstance.verticalPlacedIconSymbolIndex >= 0) {\n                    const verticalOpacity = !useHorizontal ? packedOpacity : PACKED_HIDDEN_OPACITY;\n                    addOpacities(bucket.icon, symbolInstance.numVerticalIconVertices, verticalOpacity);\n                    bucket.icon.placedSymbolArray.get(symbolInstance.verticalPlacedIconSymbolIndex).hidden =\n                        (opacityState.icon.isHidden() as any);\n                }\n            }\n\n            const realBoxes = (boxArrays && boxArrays.has(s)) ? boxArrays.get(s) : {\n                text: null,\n                icon: null\n            };\n\n            if (bucket.hasIconCollisionBoxData() || bucket.hasTextCollisionBoxData()) {\n                const collisionArrays = bucket.collisionArrays[s];\n                if (collisionArrays) {\n                    let shift = new Point(0, 0);\n                    if (collisionArrays.textBox || collisionArrays.verticalTextBox) {\n                        let used = true;\n                        if (hasVariablePlacement) {\n                            const variableOffset = this.variableOffsets[crossTileID];\n                            if (variableOffset) {\n                                // This will show either the currently placed position or the last\n                                // successfully placed position (so you can visualize what collision\n                                // just made the symbol disappear, and the most likely place for the\n                                // symbol to come back)\n                                shift = calculateVariableLayoutShift(variableOffset.anchor,\n                                    variableOffset.width,\n                                    variableOffset.height,\n                                    variableOffset.textOffset,\n                                    variableOffset.textBoxScale);\n                                if (rotateWithMap) {\n                                    shift._rotate(pitchWithMap ? this.transform.angle : -this.transform.angle);\n                                }\n                            } else {\n                                // No offset -> this symbol hasn't been placed since coming on-screen\n                                // No single box is particularly meaningful and all of them would be too noisy\n                                // Use the center box just to show something's there, but mark it \"not used\"\n                                used = false;\n                            }\n                        }\n\n                        if (collisionArrays.textBox || collisionArrays.verticalTextBox) {\n                            let hidden: boolean;\n                            if (collisionArrays.textBox) {\n                                hidden = horizontalHidden;\n                            }\n                            if (collisionArrays.verticalTextBox) {\n                                hidden = verticalHidden;\n                            }\n                            updateCollisionVertices(bucket.textCollisionBox.collisionVertexArray, opacityState.text.placed, !used || hidden, realBoxes.text, shift.x, shift.y);\n                        }\n                    }\n\n                    if (collisionArrays.iconBox || collisionArrays.verticalIconBox) {\n                        const verticalIconUsed = Boolean(!verticalHidden && collisionArrays.verticalIconBox);\n                        let hidden: boolean;\n                        if (collisionArrays.iconBox) {\n                            hidden = verticalIconUsed;\n                        }\n                        if (collisionArrays.verticalIconBox) {\n                            hidden = !verticalIconUsed;\n                        }\n                        updateCollisionVertices(bucket.iconCollisionBox.collisionVertexArray, opacityState.icon.placed, hidden, realBoxes.icon,\n                            hasIconTextFit ? shift.x : 0,\n                            hasIconTextFit ? shift.y : 0);\n                    }\n                }\n            }\n        }\n\n        bucket.sortFeatures(this.transform.angle);\n        if (this.retainedQueryData[bucket.bucketInstanceId]) {\n            this.retainedQueryData[bucket.bucketInstanceId].featureSortOrder = bucket.featureSortOrder;\n        }\n\n        if (bucket.hasTextData() && bucket.text.opacityVertexBuffer) {\n            bucket.text.opacityVertexBuffer.updateData(bucket.text.opacityVertexArray);\n        }\n        if (bucket.hasIconData() && bucket.icon.opacityVertexBuffer) {\n            bucket.icon.opacityVertexBuffer.updateData(bucket.icon.opacityVertexArray);\n        }\n        if (bucket.hasIconCollisionBoxData() && bucket.iconCollisionBox.collisionVertexBuffer) {\n            bucket.iconCollisionBox.collisionVertexBuffer.updateData(bucket.iconCollisionBox.collisionVertexArray);\n        }\n        if (bucket.hasTextCollisionBoxData() && bucket.textCollisionBox.collisionVertexBuffer) {\n            bucket.textCollisionBox.collisionVertexBuffer.updateData(bucket.textCollisionBox.collisionVertexArray);\n        }\n\n        if (bucket.text.opacityVertexArray.length !== bucket.text.layoutVertexArray.length / 4) throw new Error(`bucket.text.opacityVertexArray.length (= ${bucket.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${bucket.text.layoutVertexArray.length}) / 4`);\n        if (bucket.icon.opacityVertexArray.length !== bucket.icon.layoutVertexArray.length / 4) throw new Error(`bucket.icon.opacityVertexArray.length (= ${bucket.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${bucket.icon.layoutVertexArray.length}) / 4`);\n\n        // Push generated collision circles to the bucket for debug rendering\n        if (bucket.bucketInstanceId in this.collisionCircleArrays) {\n            const instance = this.collisionCircleArrays[bucket.bucketInstanceId];\n\n            bucket.placementInvProjMatrix = instance.invProjMatrix;\n            bucket.placementViewportMatrix = instance.viewportMatrix;\n            bucket.collisionCircleArray = instance.circles;\n\n            delete this.collisionCircleArrays[bucket.bucketInstanceId];\n        }\n    }\n\n    symbolFadeChange(now: number) {\n        return this.fadeDuration === 0 ?\n            1 :\n            ((now - this.commitTime) / this.fadeDuration + this.prevZoomAdjustment);\n    }\n\n    zoomAdjustment(zoom: number) {\n        // When zooming out quickly, labels can overlap each other. This\n        // adjustment is used to reduce the interval between placement calculations\n        // and to reduce the fade duration when zooming out quickly. Discovering the\n        // collisions more quickly and fading them more quickly reduces the unwanted effect.\n        return Math.max(0, (this.transform.zoom - zoom) / 1.5);\n    }\n\n    hasTransitions(now: number) {\n        return this.stale ||\n            now - this.lastPlacementChangeTime < this.fadeDuration;\n    }\n\n    stillRecent(now: number, zoom: number) {\n        // The adjustment makes placement more frequent when zooming.\n        // This condition applies the adjustment only after the map has\n        // stopped zooming. This avoids adding extra jank while zooming.\n        const durationAdjustment = this.zoomAtLastRecencyCheck === zoom ?\n            (1 - this.zoomAdjustment(zoom)) :\n            1;\n        this.zoomAtLastRecencyCheck = zoom;\n\n        return this.commitTime + this.fadeDuration * durationAdjustment > now;\n    }\n\n    setStale() {\n        this.stale = true;\n    }\n}\n\nfunction updateCollisionVertices(collisionVertexArray: CollisionVertexArray, placed: boolean, notUsed: boolean | number, realBox: Array<number>, shiftX?: number, shiftY?: number) {\n    if (!realBox || realBox.length === 0) {\n        realBox = [0, 0, 0, 0];\n    }\n\n    const tlX = realBox[0] - viewportPadding;\n    const tlY = realBox[1] - viewportPadding;\n    const brX = realBox[2] - viewportPadding;\n    const brY = realBox[3] - viewportPadding;\n\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, tlX, tlY);\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, brX, tlY);\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, brX, brY);\n    collisionVertexArray.emplaceBack(placed ? 1 : 0, notUsed ? 1 : 0, shiftX || 0, shiftY || 0, tlX, brY);\n}\n\n// All four vertices for a glyph will have the same opacity state\n// So we pack the opacity into a uint8, and then repeat it four times\n// to make a single uint32 that we can upload for each glyph in the\n// label.\nconst shift25 = Math.pow(2, 25);\nconst shift24 = Math.pow(2, 24);\nconst shift17 = Math.pow(2, 17);\nconst shift16 = Math.pow(2, 16);\nconst shift9 = Math.pow(2, 9);\nconst shift8 = Math.pow(2, 8);\nconst shift1 = Math.pow(2, 1);\nfunction packOpacity(opacityState: OpacityState): number {\n    if (opacityState.opacity === 0 && !opacityState.placed) {\n        return 0;\n    } else if (opacityState.opacity === 1 && opacityState.placed) {\n        return 4294967295;\n    }\n    const targetBit = opacityState.placed ? 1 : 0;\n    const opacityBits = Math.floor(opacityState.opacity * 127);\n    return opacityBits * shift25 + targetBit * shift24 +\n        opacityBits * shift17 + targetBit * shift16 +\n        opacityBits * shift9 + targetBit * shift8 +\n        opacityBits * shift1 + targetBit;\n}\n\nconst PACKED_HIDDEN_OPACITY = 0;\n", "import type {Tile} from '../../source/tile';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\nimport type {PointProjection} from '../../symbol/projection';\n\n/**\n * A greatly reduced version of the `Projection` interface from the globe branch,\n * used to port symbol bugfixes over to the main branch. Will be replaced with\n * the proper interface once globe is merged.\n */\nexport type Projection = {\n    useSpecialProjectionForSymbols: boolean;\n    isOccluded(_x, _y, _t): boolean;\n    projectTileCoordinates(_x, _y, _t, _ele): PointProjection;\n    getPitchedTextCorrection(_transform, _anchor, _tile): number;\n    translatePosition(transform: { angle: number; zoom: number }, tile: Tile, translate: [number, number], translateAnchor: 'map' | 'viewport'): [number, number];\n    getCircleRadiusCorrection(tr: any): number;\n};\n\nexport function createProjection(): Projection {\n    return {\n        isOccluded(_x: any, _y: any, _t: any) {\n            return false;\n        },\n        getPitchedTextCorrection(_transform: any, _anchor: any, _tile: any) {\n            return 1.0;\n        },\n        get useSpecialProjectionForSymbols() { return false; },\n        projectTileCoordinates(_x, _y, _t, _ele) {\n            // This function should only be used when useSpecialProjectionForSymbols is set to true.\n            throw new Error('Not implemented.');\n        },\n        translatePosition(transform, tile, translate, translateAnchor) {\n            return translatePosition(transform, tile, translate, translateAnchor);\n        },\n        getCircleRadiusCorrection(_: any) {\n            return 1.0;\n        }\n    };\n}\n\n/**\n * Returns a translation in tile units that correctly incorporates the view angle and the *-translate and *-translate-anchor properties.\n * @param inViewportPixelUnitsUnits - True when the units accepted by the matrix are in viewport pixels instead of tile units.\n *\n * Temporarily imported from globe branch.\n */\nfunction translatePosition(\n    transform: { angle: number; zoom: number },\n    tile: Tile,\n    translate: [number, number],\n    translateAnchor: 'map' | 'viewport',\n    inViewportPixelUnitsUnits: boolean = false\n): [number, number] {\n    if (!translate[0] && !translate[1]) return [0, 0];\n\n    const angle = inViewportPixelUnitsUnits ?\n        (translateAnchor === 'map' ? transform.angle : 0) :\n        (translateAnchor === 'viewport' ? -transform.angle : 0);\n\n    if (angle) {\n        const sinA = Math.sin(angle);\n        const cosA = Math.cos(angle);\n        translate = [\n            translate[0] * cosA - translate[1] * sinA,\n            translate[0] * sinA + translate[1] * cosA\n        ];\n    }\n\n    return [\n        inViewportPixelUnitsUnits ? translate[0] : pixelsToTileUnits(tile, translate[0], transform.zoom),\n        inViewportPixelUnitsUnits ? translate[1] : pixelsToTileUnits(tile, translate[1], transform.zoom)];\n}\n", "import {browser} from '../util/browser';\n\nimport {Placement} from '../symbol/placement';\n\nimport type {Transform} from '../geo/transform';\nimport type {StyleLayer} from './style_layer';\nimport type {SymbolStyleLayer} from './style_layer/symbol_style_layer';\nimport type {Tile} from '../source/tile';\nimport type {BucketPart} from '../symbol/placement';\nimport {Terrain} from '../render/terrain';\nimport {createProjection} from '../geo/projection/projection';\n\nclass LayerPlacement {\n    _sortAcrossTiles: boolean;\n    _currentTileIndex: number;\n    _currentPartIndex: number;\n    _seenCrossTileIDs: {\n        [k in string | number]: boolean;\n    };\n    _bucketParts: Array<BucketPart>;\n\n    constructor(styleLayer: SymbolStyleLayer) {\n        this._sortAcrossTiles = styleLayer.layout.get('symbol-z-order') !== 'viewport-y' &&\n            !styleLayer.layout.get('symbol-sort-key').isConstant();\n\n        this._currentTileIndex = 0;\n        this._currentPartIndex = 0;\n        this._seenCrossTileIDs = {};\n        this._bucketParts = [];\n    }\n\n    continuePlacement(tiles: Array<Tile>, placement: Placement, showCollisionBoxes: boolean, styleLayer: StyleLayer, shouldPausePlacement: () => boolean) {\n\n        const bucketParts = this._bucketParts;\n\n        while (this._currentTileIndex < tiles.length) {\n            const tile = tiles[this._currentTileIndex];\n            placement.getBucketParts(bucketParts, styleLayer, tile, this._sortAcrossTiles);\n\n            this._currentTileIndex++;\n            if (shouldPausePlacement()) {\n                return true;\n            }\n        }\n\n        if (this._sortAcrossTiles) {\n            this._sortAcrossTiles = false;\n            bucketParts.sort((a, b) => (a.sortKey as any as number) - (b.sortKey as any as number));\n        }\n\n        while (this._currentPartIndex < bucketParts.length) {\n            const bucketPart = bucketParts[this._currentPartIndex];\n            placement.placeLayerBucketPart(bucketPart, this._seenCrossTileIDs, showCollisionBoxes);\n\n            this._currentPartIndex++;\n            if (shouldPausePlacement()) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n\nexport class PauseablePlacement {\n    placement: Placement;\n    _done: boolean;\n    _currentPlacementIndex: number;\n    _forceFullPlacement: boolean;\n    _showCollisionBoxes: boolean;\n    _inProgressLayer: LayerPlacement;\n\n    constructor(\n        transform: Transform,\n        terrain: Terrain,\n        order: Array<string>,\n        forceFullPlacement: boolean,\n        showCollisionBoxes: boolean,\n        fadeDuration: number,\n        crossSourceCollisions: boolean,\n        prevPlacement?: Placement\n    ) {\n        this.placement = new Placement(transform, createProjection(), terrain, fadeDuration, crossSourceCollisions, prevPlacement);\n        this._currentPlacementIndex = order.length - 1;\n        this._forceFullPlacement = forceFullPlacement;\n        this._showCollisionBoxes = showCollisionBoxes;\n        this._done = false;\n    }\n\n    isDone() {\n        return this._done;\n    }\n\n    continuePlacement(\n        order: Array<string>,\n        layers: {[_: string]: StyleLayer},\n        layerTiles: {[_: string]: Array<Tile>}\n    ) {\n        const startTime = browser.now();\n\n        const shouldPausePlacement = () => {\n            return this._forceFullPlacement ? false : (browser.now() - startTime) > 2;\n        };\n\n        while (this._currentPlacementIndex >= 0) {\n            const layerId = order[this._currentPlacementIndex];\n            const layer = layers[layerId];\n            const placementZoom = this.placement.collisionIndex.transform.zoom;\n            if (layer.type === 'symbol' &&\n                (!layer.minzoom || layer.minzoom <= placementZoom) &&\n                (!layer.maxzoom || layer.maxzoom > placementZoom)) {\n\n                if (!this._inProgressLayer) {\n                    this._inProgressLayer = new LayerPlacement(layer as any as SymbolStyleLayer);\n                }\n\n                const pausePlacement = this._inProgressLayer.continuePlacement(layerTiles[layer.source], this.placement, this._showCollisionBoxes, layer, shouldPausePlacement);\n\n                if (pausePlacement) {\n                    // We didn't finish placing all layers within 2ms,\n                    // but we can keep rendering with a partial placement\n                    // We'll resume here on the next frame\n                    return;\n                }\n\n                delete this._inProgressLayer;\n            }\n\n            this._currentPlacementIndex--;\n        }\n\n        this._done = true;\n    }\n\n    commit(now: number) {\n        this.placement.commit(now);\n        return this.placement;\n    }\n}\n", "import KDBush from 'kdbush';\nimport {EXTENT} from '../data/extent';\n\nimport {SymbolInstanceArray} from '../data/array_types.g';\n\nimport type {SymbolInstance} from '../data/array_types.g';\nimport type {OverscaledTileID} from '../source/tile_id';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {Tile} from '../source/tile';\n\n/*\n    The CrossTileSymbolIndex generally works on the assumption that\n    a conceptual \"unique symbol\" can be identified by the text of\n    the label combined with the anchor point. The goal is to assign\n    these conceptual \"unique symbols\" a shared crossTileID that can be\n    used by Placement to keep fading opacity states consistent and to\n    deduplicate labels.\n\n    The CrossTileSymbolIndex indexes all the current symbol instances and\n    their crossTileIDs. When a symbol bucket gets added or updated, the\n    index assigns a crossTileID to each of it's symbol instances by either\n    matching it with an existing id or assigning a new one.\n*/\n\n// Round anchor positions to roughly 4 pixel grid\nconst roundingFactor = 512 / EXTENT / 2;\n\nexport const KDBUSH_THRESHHOLD = 128;\n\ninterface SymbolsByKeyEntry {\n    index?: KDBush;\n    positions?: {x: number; y: number}[];\n    crossTileIDs: number[];\n}\n\nclass TileLayerIndex {\n    _symbolsByKey: Record<number, SymbolsByKeyEntry> = {};\n\n    constructor(public tileID: OverscaledTileID, symbolInstances: SymbolInstanceArray, public bucketInstanceId: number) {\n        // group the symbolInstances by key\n        const symbolInstancesByKey = new Map<number, SymbolInstance[]>();\n        for (let i = 0; i < symbolInstances.length; i++) {\n            const symbolInstance = symbolInstances.get(i);\n            const key = symbolInstance.key;\n            const instances = symbolInstancesByKey.get(key);\n            if (instances) {\n                // This tile may have multiple symbol instances with the same key\n                // Store each one along with its coordinates\n                instances.push(symbolInstance);\n            } else {\n                symbolInstancesByKey.set(key, [symbolInstance]);\n            }\n        }\n\n        // index the SymbolInstances in this each bucket\n        for (const [key, symbols] of symbolInstancesByKey) {\n            const positions = symbols.map(symbolInstance => ({x: Math.floor(symbolInstance.anchorX * roundingFactor), y: Math.floor(symbolInstance.anchorY * roundingFactor)}));\n            const crossTileIDs = symbols.map(v => v.crossTileID);\n            const entry: SymbolsByKeyEntry = {positions, crossTileIDs};\n\n            // once we get too many symbols for a given key, it becomes much faster to index it before queries\n            if (entry.positions.length > KDBUSH_THRESHHOLD) {\n\n                const index = new KDBush(entry.positions.length, 16, Uint16Array);\n                for (const {x, y} of entry.positions) index.add(x, y);\n                index.finish();\n\n                // clear all references to the original positions data\n                delete entry.positions;\n                entry.index = index;\n            }\n\n            this._symbolsByKey[key] = entry;\n        }\n    }\n\n    // Converts the coordinates of the input symbol instance into coordinates that be can compared\n    // against other symbols in this index. Coordinates are:\n    // (1) local-tile-based (so after correction we get x,y values relative to our local anchorX/Y)\n    // (2) converted to the z-scale of this TileLayerIndex\n    // (3) down-sampled by \"roundingFactor\" from tile coordinate precision in order to be\n    //     more tolerant of small differences between tiles.\n    getScaledCoordinates(symbolInstance: SymbolInstance, childTileID: OverscaledTileID): {x: number; y: number} {\n        const {x: localX, y: localY, z: localZ} = this.tileID.canonical;\n        const {x, y, z} = childTileID.canonical;\n\n        const zDifference = z - localZ;\n        const scale = roundingFactor / Math.pow(2, zDifference);\n        const xWorld = (x * EXTENT + symbolInstance.anchorX) * scale;\n        const yWorld = (y * EXTENT + symbolInstance.anchorY) * scale;\n        const xOffset = localX * EXTENT * roundingFactor;\n        const yOffset = localY * EXTENT * roundingFactor;\n        const result =  {\n            x: Math.floor(xWorld - xOffset),\n            y: Math.floor(yWorld - yOffset)\n        };\n\n        return result;\n    }\n\n    findMatches(symbolInstances: SymbolInstanceArray, newTileID: OverscaledTileID, zoomCrossTileIDs: {\n        [crossTileID: number]: boolean;\n    }) {\n        const tolerance = this.tileID.canonical.z < newTileID.canonical.z ? 1 : Math.pow(2, this.tileID.canonical.z - newTileID.canonical.z);\n\n        for (let i = 0; i < symbolInstances.length; i++) {\n            const symbolInstance = symbolInstances.get(i);\n            if (symbolInstance.crossTileID) {\n                // already has a match, skip\n                continue;\n            }\n\n            const entry = this._symbolsByKey[symbolInstance.key];\n            if (!entry) {\n                // No symbol with this key in this bucket\n                continue;\n            }\n\n            const scaledSymbolCoord = this.getScaledCoordinates(symbolInstance, newTileID);\n\n            if (entry.index) {\n                // Return any symbol with the same keys whose coordinates are within 1\n                // grid unit. (with a 4px grid, this covers a 12px by 12px area)\n                const indexes = entry.index.range(\n                    scaledSymbolCoord.x - tolerance,\n                    scaledSymbolCoord.y - tolerance,\n                    scaledSymbolCoord.x + tolerance,\n                    scaledSymbolCoord.y + tolerance).sort();\n\n                for (const i of indexes) {\n                    const crossTileID = entry.crossTileIDs[i];\n\n                    if (!zoomCrossTileIDs[crossTileID]) {\n                        // Once we've marked ourselves duplicate against this parent symbol,\n                        // don't let any other symbols at the same zoom level duplicate against\n                        // the same parent (see issue #5993)\n                        zoomCrossTileIDs[crossTileID] = true;\n                        symbolInstance.crossTileID = crossTileID;\n                        break;\n                    }\n                }\n            } else if (entry.positions) {\n                for (let i = 0; i < entry.positions.length; i++) {\n                    const thisTileSymbol = entry.positions[i];\n                    const crossTileID = entry.crossTileIDs[i];\n\n                    // Return any symbol with the same keys whose coordinates are within 1\n                    // grid unit. (with a 4px grid, this covers a 12px by 12px area)\n                    if (Math.abs(thisTileSymbol.x - scaledSymbolCoord.x) <= tolerance &&\n                        Math.abs(thisTileSymbol.y - scaledSymbolCoord.y) <= tolerance &&\n                        !zoomCrossTileIDs[crossTileID]) {\n                        // Once we've marked ourselves duplicate against this parent symbol,\n                        // don't let any other symbols at the same zoom level duplicate against\n                        // the same parent (see issue #5993)\n                        zoomCrossTileIDs[crossTileID] = true;\n                        symbolInstance.crossTileID = crossTileID;\n                        break;\n                    }\n                }\n            }\n        }\n    }\n\n    getCrossTileIDsLists() {\n        return Object.values(this._symbolsByKey).map(({crossTileIDs}) => crossTileIDs);\n    }\n}\n\nclass CrossTileIDs {\n    maxCrossTileID: number;\n    constructor() {\n        this.maxCrossTileID = 0;\n    }\n    generate() {\n        return ++this.maxCrossTileID;\n    }\n}\n\nclass CrossTileSymbolLayerIndex {\n    indexes: {\n        [zoom in string | number]: {\n            [tileId in string | number]: TileLayerIndex;\n        };\n    };\n    usedCrossTileIDs: {\n        [zoom in string | number]: {\n            [crossTileID: number]: boolean;\n        };\n    };\n    lng: number;\n\n    constructor() {\n        this.indexes = {};\n        this.usedCrossTileIDs = {};\n        this.lng = 0;\n    }\n\n    /*\n     * Sometimes when a user pans across the antimeridian the longitude value gets wrapped.\n     * To prevent labels from flashing out and in we adjust the tileID values in the indexes\n     * so that they match the new wrapped version of the map.\n     */\n    handleWrapJump(lng: number) {\n        const wrapDelta = Math.round((lng - this.lng) / 360);\n        if (wrapDelta !== 0) {\n            for (const zoom in this.indexes) {\n                const zoomIndexes = this.indexes[zoom];\n                const newZoomIndex = {};\n                for (const key in zoomIndexes) {\n                    // change the tileID's wrap and add it to a new index\n                    const index = zoomIndexes[key];\n                    index.tileID = index.tileID.unwrapTo(index.tileID.wrap + wrapDelta);\n                    newZoomIndex[index.tileID.key] = index;\n                }\n                this.indexes[zoom] = newZoomIndex;\n            }\n        }\n        this.lng = lng;\n    }\n\n    addBucket(tileID: OverscaledTileID, bucket: SymbolBucket, crossTileIDs: CrossTileIDs) {\n        if (this.indexes[tileID.overscaledZ] &&\n            this.indexes[tileID.overscaledZ][tileID.key]) {\n            if (this.indexes[tileID.overscaledZ][tileID.key].bucketInstanceId ===\n                bucket.bucketInstanceId) {\n                return false;\n            } else {\n                // We're replacing this bucket with an updated version\n                // Remove the old bucket's \"used crossTileIDs\" now so that\n                // the new bucket can claim them.\n                // The old index entries themselves stick around until\n                // 'removeStaleBuckets' is called.\n                this.removeBucketCrossTileIDs(tileID.overscaledZ,\n                    this.indexes[tileID.overscaledZ][tileID.key]);\n            }\n        }\n\n        for (let i = 0; i < bucket.symbolInstances.length; i++) {\n            const symbolInstance = bucket.symbolInstances.get(i);\n            symbolInstance.crossTileID = 0;\n        }\n\n        if (!this.usedCrossTileIDs[tileID.overscaledZ]) {\n            this.usedCrossTileIDs[tileID.overscaledZ] = {};\n        }\n        const zoomCrossTileIDs = this.usedCrossTileIDs[tileID.overscaledZ];\n\n        for (const zoom in this.indexes) {\n            const zoomIndexes = this.indexes[zoom];\n            if (Number(zoom) > tileID.overscaledZ) {\n                for (const id in zoomIndexes) {\n                    const childIndex = zoomIndexes[id];\n                    if (childIndex.tileID.isChildOf(tileID)) {\n                        childIndex.findMatches(bucket.symbolInstances, tileID, zoomCrossTileIDs);\n                    }\n                }\n            } else {\n                const parentCoord = tileID.scaledTo(Number(zoom));\n                const parentIndex = zoomIndexes[parentCoord.key];\n                if (parentIndex) {\n                    parentIndex.findMatches(bucket.symbolInstances, tileID, zoomCrossTileIDs);\n                }\n            }\n        }\n\n        for (let i = 0; i < bucket.symbolInstances.length; i++) {\n            const symbolInstance = bucket.symbolInstances.get(i);\n            if (!symbolInstance.crossTileID) {\n                // symbol did not match any known symbol, assign a new id\n                symbolInstance.crossTileID = crossTileIDs.generate();\n                zoomCrossTileIDs[symbolInstance.crossTileID] = true;\n            }\n        }\n\n        if (this.indexes[tileID.overscaledZ] === undefined) {\n            this.indexes[tileID.overscaledZ] = {};\n        }\n        this.indexes[tileID.overscaledZ][tileID.key] = new TileLayerIndex(tileID, bucket.symbolInstances, bucket.bucketInstanceId);\n\n        return true;\n    }\n\n    removeBucketCrossTileIDs(zoom: string | number, removedBucket: TileLayerIndex) {\n        for (const crossTileIDs of removedBucket.getCrossTileIDsLists()) {\n            for (const crossTileID of crossTileIDs) {\n                delete this.usedCrossTileIDs[zoom][crossTileID];\n            }\n        }\n    }\n\n    removeStaleBuckets(currentIDs: {\n        [k in string | number]: boolean;\n    }) {\n        let tilesChanged = false;\n        for (const z in this.indexes) {\n            const zoomIndexes = this.indexes[z];\n            for (const tileKey in zoomIndexes) {\n                if (!currentIDs[zoomIndexes[tileKey].bucketInstanceId]) {\n                    this.removeBucketCrossTileIDs(z, zoomIndexes[tileKey]);\n                    delete zoomIndexes[tileKey];\n                    tilesChanged = true;\n                }\n            }\n        }\n        return tilesChanged;\n    }\n}\n\nexport class CrossTileSymbolIndex {\n    layerIndexes: {[layerId: string]: CrossTileSymbolLayerIndex};\n    crossTileIDs: CrossTileIDs;\n    maxBucketInstanceId: number;\n    bucketsInCurrentPlacement: {[_: number]: boolean};\n\n    constructor() {\n        this.layerIndexes = {};\n        this.crossTileIDs = new CrossTileIDs();\n        this.maxBucketInstanceId = 0;\n        this.bucketsInCurrentPlacement = {};\n    }\n\n    addLayer(styleLayer: StyleLayer, tiles: Array<Tile>, lng: number) {\n        let layerIndex = this.layerIndexes[styleLayer.id];\n        if (layerIndex === undefined) {\n            layerIndex = this.layerIndexes[styleLayer.id] = new CrossTileSymbolLayerIndex();\n        }\n\n        let symbolBucketsChanged = false;\n        const currentBucketIDs = {};\n\n        layerIndex.handleWrapJump(lng);\n\n        for (const tile of tiles) {\n            const symbolBucket = (tile.getBucket(styleLayer) as any as SymbolBucket);\n            if (!symbolBucket || styleLayer.id !== symbolBucket.layerIds[0])\n                continue;\n\n            if (!symbolBucket.bucketInstanceId) {\n                symbolBucket.bucketInstanceId = ++this.maxBucketInstanceId;\n            }\n\n            if (layerIndex.addBucket(tile.tileID, symbolBucket, this.crossTileIDs)) {\n                symbolBucketsChanged = true;\n            }\n            currentBucketIDs[symbolBucket.bucketInstanceId] = true;\n        }\n\n        if (layerIndex.removeStaleBuckets(currentBucketIDs)) {\n            symbolBucketsChanged = true;\n        }\n\n        return symbolBucketsChanged;\n    }\n\n    pruneUnusedLayers(usedLayers: Array<string>) {\n        const usedLayerMap = {};\n        usedLayers.forEach((usedLayer) => {\n            usedLayerMap[usedLayer] = true;\n        });\n        for (const layerId in this.layerIndexes) {\n            if (!usedLayerMap[layerId]) {\n                delete this.layerIndexes[layerId];\n            }\n        }\n    }\n}\n", "import {Event, ErrorEvent, Evented} from '../util/evented';\nimport {StyleLayer} from './style_layer';\nimport {createStyleLayer} from './create_style_layer';\nimport {loadSprite} from './load_sprite';\nimport {ImageManager} from '../render/image_manager';\nimport {GlyphManager} from '../render/glyph_manager';\nimport {Light} from './light';\nimport {Sky} from './sky';\nimport {LineAtlas} from '../render/line_atlas';\nimport {clone, extend, deepEqual, filterObject, mapObject} from '../util/util';\nimport {coerceSpriteToArray} from '../util/style';\nimport {getJSON, getReferrer} from '../util/ajax';\nimport {ResourceType} from '../util/request_manager';\nimport {browser} from '../util/browser';\nimport {Dispatcher} from '../util/dispatcher';\nimport {validateStyle, emitValidationErrors as _emitValidationErrors} from './validate_style';\nimport {Source} from '../source/source';\nimport {QueryRenderedFeaturesOptions, QuerySourceFeatureOptions, queryRenderedFeatures, queryRenderedSymbols, querySourceFeatures} from '../source/query_features';\nimport {SourceCache} from '../source/source_cache';\nimport {GeoJSONSource} from '../source/geojson_source';\nimport {latest as styleSpec, derefLayers as deref, emptyStyle, diff as diffStyles, DiffCommand} from '@maplibre/maplibre-gl-style-spec';\nimport {getGlobalWorkerPool} from '../util/global_worker_pool';\nimport {rtlMainThreadPluginFactory} from '../source/rtl_text_plugin_main_thread';\nimport {RTLPluginLoadedEventName} from '../source/rtl_text_plugin_status';\nimport {PauseablePlacement} from './pauseable_placement';\nimport {ZoomHistory} from './zoom_history';\nimport {CrossTileSymbolIndex} from '../symbol/cross_tile_symbol_index';\nimport {validateCustomStyleLayer} from './style_layer/custom_style_layer';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\n\n// We're skipping validation errors with the `source.canvas` identifier in order\n// to continue to allow canvas sources to be added at runtime/updated in\n// smart setStyle (see https://github.com/mapbox/mapbox-gl-js/pull/6424):\nconst emitValidationErrors = (evented: Evented, errors?: ReadonlyArray<{\n    message: string;\n    identifier?: string;\n}> | null) =>\n    _emitValidationErrors(evented, errors && errors.filter(error => error.identifier !== 'source.canvas'));\n\nimport type {Map} from '../ui/map';\nimport type {Transform} from '../geo/transform';\nimport type {StyleImage} from './style_image';\nimport type {EvaluationParameters} from './evaluation_parameters';\nimport type {Placement} from '../symbol/placement';\nimport type {\n    LayerSpecification,\n    FilterSpecification,\n    StyleSpecification,\n    LightSpecification,\n    SourceSpecification,\n    SpriteSpecification,\n    DiffOperations,\n    SkySpecification\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport type {CustomLayerInterface} from './style_layer/custom_style_layer';\nimport type {Validator} from './validate_style';\nimport {\n    MessageType,\n    type GetGlyphsParameters,\n    type GetGlyphsResponse,\n    type GetImagesParameters,\n    type GetImagesResponse\n} from '../util/actor_messages';\n\nconst empty = emptyStyle() as StyleSpecification;\n/**\n * A feature identifier that is bound to a source\n */\nexport type FeatureIdentifier = {\n    /**\n     * Unique id of the feature.\n     */\n    id?: string | number | undefined;\n    /**\n     * The id of the vector or GeoJSON source for the feature.\n     */\n    source: string;\n    /**\n     * *For vector tile sources, `sourceLayer` is required.*\n     */\n    sourceLayer?: string | undefined;\n};\n\n/**\n * The options object related to the {@link Map}'s style related methods\n */\nexport type StyleOptions = {\n    /**\n     * If false, style validation will be skipped. Useful in production environment.\n     */\n    validate?: boolean;\n    /**\n     * Defines a CSS\n     * font-family for locally overriding generation of Chinese, Japanese, and Korean characters.\n     * For these characters, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).\n     * Set to `false`, to enable font settings from the map's style for these glyph ranges.\n     * Forces a full update.\n     */\n    localIdeographFontFamily?: string | false;\n};\n\n/**\n * Supporting type to add validation to another style related type\n */\nexport type StyleSetterOptions = {\n    /**\n     * Whether to check if the filter conforms to the MapLibre Style Specification. Disabling validation is a performance optimization that should only be used if you have previously validated the values you will be passing to this function.\n     */\n    validate?: boolean;\n};\n\n/**\n * Part of {@link Map#setStyle} options, transformStyle is a convenience function that allows to modify a style after it is fetched but before it is committed to the map state.\n *\n * This function exposes previous and next styles, it can be commonly used to support a range of functionalities like:\n *\n * - when previous style carries certain 'state' that needs to be carried over to a new style gracefully;\n * - when a desired style is a certain combination of previous and incoming style;\n * - when an incoming style requires modification based on external state.\n *\n * @param previous - The current style.\n * @param next - The next style.\n * @returns resulting style that will to be applied to the map\n *\n * @example\n * ```ts\n * map.setStyle('https://demotiles.maplibre.org/style.json', {\n *   transformStyle: (previousStyle, nextStyle) => ({\n *       ...nextStyle,\n *       sources: {\n *           ...nextStyle.sources,\n *           // copy a source from previous style\n *           'osm': previousStyle.sources.osm\n *       },\n *       layers: [\n *           // background layer\n *           nextStyle.layers[0],\n *           // copy a layer from previous style\n *           previousStyle.layers[0],\n *           // other layers from the next style\n *           ...nextStyle.layers.slice(1).map(layer => {\n *               // hide the layers we don't need from demotiles style\n *               if (layer.id.startsWith('geolines')) {\n *                   layer.layout = {...layer.layout || {}, visibility: 'none'};\n *               // filter out US polygons\n *               } else if (layer.id.startsWith('coastline') || layer.id.startsWith('countries')) {\n *                   layer.filter = ['!=', ['get', 'ADM0_A3'], 'USA'];\n *               }\n *               return layer;\n *           })\n *       ]\n *   })\n * });\n * ```\n */\nexport type TransformStyleFunction = (previous: StyleSpecification | undefined, next: StyleSpecification) => StyleSpecification;\n\n/**\n * The options object related to the {@link Map}'s style related methods\n */\nexport type StyleSwapOptions = {\n    /**\n     * If false, force a 'full' update, removing the current style\n     * and building the given one instead of attempting a diff-based update.\n     */\n    diff?: boolean;\n    /**\n     * TransformStyleFunction is a convenience function\n     * that allows to modify a style after it is fetched but before it is committed to the map state. Refer to {@link TransformStyleFunction}.\n     */\n    transformStyle?: TransformStyleFunction;\n}\n\n/**\n * Specifies a layer to be added to a {@link Style}. In addition to a standard {@link LayerSpecification}\n * or a {@link CustomLayerInterface}, a {@link LayerSpecification} with an embedded {@link SourceSpecification} can also be provided.\n */\nexport type AddLayerObject = LayerSpecification | (Omit<LayerSpecification, 'source'> & {source: SourceSpecification}) | CustomLayerInterface;\n\n/**\n * The Style base class\n */\nexport class Style extends Evented {\n    map: Map;\n    stylesheet: StyleSpecification;\n    dispatcher: Dispatcher;\n    imageManager: ImageManager;\n    glyphManager: GlyphManager;\n    lineAtlas: LineAtlas;\n    light: Light;\n    sky: Sky;\n\n    _frameRequest: AbortController;\n    _loadStyleRequest: AbortController;\n    _spriteRequest: AbortController;\n    _layers: {[_: string]: StyleLayer};\n    _serializedLayers: {[_: string]: LayerSpecification};\n    _order: Array<string>;\n    sourceCaches: {[_: string]: SourceCache};\n    zoomHistory: ZoomHistory;\n    _loaded: boolean;\n    _changed: boolean;\n    _updatedSources: {[_: string]: 'clear' | 'reload'};\n    _updatedLayers: {[_: string]: true};\n    _removedLayers: {[_: string]: StyleLayer};\n    _changedImages: {[_: string]: true};\n    _glyphsDidChange: boolean;\n    _updatedPaintProps: {[layer: string]: true};\n    _layerOrderChanged: boolean;\n    // image ids of images loaded from style's sprite\n    _spritesImagesIds: {[spriteId: string]: string[]};\n    // image ids of all images loaded (sprite + user)\n    _availableImages: Array<string>;\n\n    crossTileSymbolIndex: CrossTileSymbolIndex;\n    pauseablePlacement: PauseablePlacement;\n    placement: Placement;\n    z: number;\n\n    constructor(map: Map, options: StyleOptions = {}) {\n        super();\n\n        this.map = map;\n        this.dispatcher = new Dispatcher(getGlobalWorkerPool(), map._getMapId());\n        this.dispatcher.registerMessageHandler(MessageType.getGlyphs, (mapId, params) => {\n            return this.getGlyphs(mapId, params);\n        });\n        this.dispatcher.registerMessageHandler(MessageType.getImages, (mapId, params) => {\n            return this.getImages(mapId, params);\n        });\n        this.imageManager = new ImageManager();\n        this.imageManager.setEventedParent(this);\n        this.glyphManager = new GlyphManager(map._requestManager, options.localIdeographFontFamily);\n        this.lineAtlas = new LineAtlas(256, 512);\n        this.crossTileSymbolIndex = new CrossTileSymbolIndex();\n\n        this._spritesImagesIds = {};\n        this._layers = {};\n\n        this._order = [];\n        this.sourceCaches = {};\n        this.zoomHistory = new ZoomHistory();\n        this._loaded = false;\n        this._availableImages = [];\n\n        this._resetUpdates();\n\n        this.dispatcher.broadcast(MessageType.setReferrer, getReferrer());\n        rtlMainThreadPluginFactory().on(RTLPluginLoadedEventName, this._rtlPluginLoaded);\n\n        this.on('data', (event) => {\n            if (event.dataType !== 'source' || event.sourceDataType !== 'metadata') {\n                return;\n            }\n\n            const sourceCache = this.sourceCaches[event.sourceId];\n            if (!sourceCache) {\n                return;\n            }\n\n            const source = sourceCache.getSource();\n            if (!source || !source.vectorLayerIds) {\n                return;\n            }\n\n            for (const layerId in this._layers) {\n                const layer = this._layers[layerId];\n                if (layer.source === source.id) {\n                    this._validateLayer(layer);\n                }\n            }\n        });\n    }\n\n    _rtlPluginLoaded = () => {\n        for (const id in this.sourceCaches) {\n            const sourceType = this.sourceCaches[id].getSource().type;\n            if (sourceType === 'vector' || sourceType === 'geojson') {\n                // Non-vector sources don't have any symbols buckets to reload when the RTL text plugin loads\n                // They also load more quickly, so they're more likely to have already displaying tiles\n                // that would be unnecessarily booted by the plugin load event\n                this.sourceCaches[id].reload(); // Should be a no-op if the plugin loads before any tiles load\n            }\n        }\n    };\n\n    loadURL(url: string, options: StyleSwapOptions & StyleSetterOptions = {}, previousStyle?: StyleSpecification) {\n        this.fire(new Event('dataloading', {dataType: 'style'}));\n\n        options.validate = typeof options.validate === 'boolean' ?\n            options.validate : true;\n\n        const request = this.map._requestManager.transformRequest(url, ResourceType.Style);\n        this._loadStyleRequest = new AbortController();\n        const abortController = this._loadStyleRequest;\n        getJSON<StyleSpecification>(request, this._loadStyleRequest).then((response) => {\n            this._loadStyleRequest = null;\n            this._load(response.data, options, previousStyle);\n        }).catch((error) => {\n            this._loadStyleRequest = null;\n            if (error && !abortController.signal.aborted) { // ignore abort\n                this.fire(new ErrorEvent(error));\n            }\n        });\n    }\n\n    loadJSON(json: StyleSpecification, options: StyleSetterOptions & StyleSwapOptions = {}, previousStyle?: StyleSpecification) {\n        this.fire(new Event('dataloading', {dataType: 'style'}));\n\n        this._frameRequest = new AbortController();\n        browser.frameAsync(this._frameRequest).then(() => {\n            this._frameRequest = null;\n            options.validate = options.validate !== false;\n            this._load(json, options, previousStyle);\n        }).catch(() => {}); // ignore abort\n    }\n\n    loadEmpty() {\n        this.fire(new Event('dataloading', {dataType: 'style'}));\n        this._load(empty, {validate: false});\n    }\n\n    _load(json: StyleSpecification, options: StyleSwapOptions & StyleSetterOptions, previousStyle?: StyleSpecification) {\n        const nextState = options.transformStyle ? options.transformStyle(previousStyle, json) : json;\n        if (options.validate && emitValidationErrors(this, validateStyle(nextState))) {\n            return;\n        }\n\n        this._loaded = true;\n        this.stylesheet = nextState;\n\n        for (const id in nextState.sources) {\n            this.addSource(id, nextState.sources[id], {validate: false});\n        }\n\n        if (nextState.sprite) {\n            this._loadSprite(nextState.sprite);\n        } else {\n            this.imageManager.setLoaded(true);\n        }\n\n        this.glyphManager.setURL(nextState.glyphs);\n        this._createLayers();\n\n        this.light = new Light(this.stylesheet.light);\n        this.sky = new Sky(this.stylesheet.sky);\n\n        this.map.setTerrain(this.stylesheet.terrain ?? null);\n\n        this.fire(new Event('data', {dataType: 'style'}));\n        this.fire(new Event('style.load'));\n    }\n\n    private _createLayers() {\n        const dereferencedLayers = deref(this.stylesheet.layers);\n\n        // Broadcast layers to workers first, so that expensive style processing (createStyleLayer)\n        // can happen in parallel on both main and worker threads.\n        this.dispatcher.broadcast(MessageType.setLayers, dereferencedLayers);\n\n        this._order = dereferencedLayers.map((layer) => layer.id);\n        this._layers = {};\n\n        // reset serialization field, to be populated only when needed\n        this._serializedLayers = null;\n        for (const layer of dereferencedLayers) {\n            const styledLayer = createStyleLayer(layer);\n            styledLayer.setEventedParent(this, {layer: {id: layer.id}});\n            this._layers[layer.id] = styledLayer;\n        }\n    }\n\n    _loadSprite(sprite: SpriteSpecification, isUpdate: boolean = false, completion: (err: Error) => void = undefined) {\n        this.imageManager.setLoaded(false);\n\n        this._spriteRequest = new AbortController();\n        let err: Error;\n        loadSprite(sprite, this.map._requestManager, this.map.getPixelRatio(), this._spriteRequest).then((images) => {\n            this._spriteRequest = null;\n            if (images) {\n                for (const spriteId in images) {\n                    this._spritesImagesIds[spriteId] = [];\n\n                    // remove old sprite's loaded images (for the same sprite id) that are not in new sprite\n                    const imagesToRemove = this._spritesImagesIds[spriteId] ? this._spritesImagesIds[spriteId].filter(id => !(id in images)) : [];\n                    for (const id of imagesToRemove) {\n                        this.imageManager.removeImage(id);\n                        this._changedImages[id] = true;\n                    }\n\n                    for (const id in images[spriteId]) {\n                        // don't prefix images of the \"default\" sprite\n                        const imageId = spriteId === 'default' ? id : `${spriteId}:${id}`;\n                        // save all the sprite's images' ids to be able to delete them in `removeSprite`\n                        this._spritesImagesIds[spriteId].push(imageId);\n                        if (imageId in this.imageManager.images) {\n                            this.imageManager.updateImage(imageId, images[spriteId][id], false);\n                        } else {\n                            this.imageManager.addImage(imageId, images[spriteId][id]);\n                        }\n\n                        if (isUpdate) {\n                            this._changedImages[imageId] = true;\n                        }\n                    }\n                }\n            }\n        }).catch((error) => {\n            this._spriteRequest = null;\n            err = error;\n            this.fire(new ErrorEvent(err));\n        }).finally(() => {\n            this.imageManager.setLoaded(true);\n            this._availableImages = this.imageManager.listImages();\n\n            if (isUpdate) {\n                this._changed = true;\n            }\n\n            this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n            this.fire(new Event('data', {dataType: 'style'}));\n\n            if (completion) {\n                completion(err);\n            }\n        });\n    }\n\n    _unloadSprite() {\n        for (const id of Object.values(this._spritesImagesIds).flat()) {\n            this.imageManager.removeImage(id);\n            this._changedImages[id] = true;\n        }\n\n        this._spritesImagesIds = {};\n        this._availableImages = this.imageManager.listImages();\n        this._changed = true;\n        this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n        this.fire(new Event('data', {dataType: 'style'}));\n    }\n\n    _validateLayer(layer: StyleLayer) {\n        const sourceCache = this.sourceCaches[layer.source];\n        if (!sourceCache) {\n            return;\n        }\n\n        const sourceLayer = layer.sourceLayer;\n        if (!sourceLayer) {\n            return;\n        }\n\n        const source = sourceCache.getSource();\n        if (source.type === 'geojson' || (source.vectorLayerIds && source.vectorLayerIds.indexOf(sourceLayer) === -1)) {\n            this.fire(new ErrorEvent(new Error(\n                `Source layer \"${sourceLayer}\" ` +\n                `does not exist on source \"${source.id}\" ` +\n                `as specified by style layer \"${layer.id}\".`\n            )));\n        }\n    }\n\n    loaded() {\n        if (!this._loaded)\n            return false;\n\n        if (Object.keys(this._updatedSources).length)\n            return false;\n\n        for (const id in this.sourceCaches)\n            if (!this.sourceCaches[id].loaded())\n                return false;\n\n        if (!this.imageManager.isLoaded())\n            return false;\n\n        return true;\n    }\n\n    /**\n     * @hidden\n     * take an array of string IDs, and based on this._layers, generate an array of LayerSpecification\n     * @param ids - an array of string IDs, for which serialized layers will be generated. If omitted, all serialized layers will be returned\n     * @param returnClose - if true, return a clone of the layer object\n     * @returns generated result\n     */\n    private _serializeByIds(ids: Array<string>, returnClone: boolean = false): Array<LayerSpecification> {\n\n        const serializedLayersDictionary = this._serializedAllLayers();\n        if (!ids || ids.length === 0) {\n            return returnClone ? Object.values(clone(serializedLayersDictionary)) : Object.values(serializedLayersDictionary);\n        }\n\n        const serializedLayers = [];\n        for (const id of ids) {\n            // this check will skip all custom layers\n            if (serializedLayersDictionary[id]) {\n                const toPush = returnClone ? clone(serializedLayersDictionary[id]) : serializedLayersDictionary[id];\n                serializedLayers.push(toPush);\n            }\n        }\n\n        return serializedLayers;\n    }\n\n    /**\n     * @hidden\n     * Lazy initialization of this._serializedLayers dictionary and return it\n     * @returns this._serializedLayers dictionary\n     */\n    private _serializedAllLayers(): {[_: string]: LayerSpecification} {\n        let serializedLayers = this._serializedLayers;\n        if (serializedLayers) {\n            return serializedLayers;\n        }\n\n        serializedLayers = this._serializedLayers = {};\n        const allLayerIds: string [] = Object.keys(this._layers);\n        for (const layerId of allLayerIds) {\n            const layer = this._layers[layerId];\n            if (layer.type !== 'custom') {\n                serializedLayers[layerId] = layer.serialize();\n            }\n        }\n\n        return serializedLayers;\n    }\n\n    hasTransitions() {\n        if (this.light && this.light.hasTransition()) {\n            return true;\n        }\n\n        if (this.sky && this.sky.hasTransition()) {\n            return true;\n        }\n\n        for (const id in this.sourceCaches) {\n            if (this.sourceCaches[id].hasTransition()) {\n                return true;\n            }\n        }\n\n        for (const id in this._layers) {\n            if (this._layers[id].hasTransition()) {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    _checkLoaded() {\n        if (!this._loaded) {\n            throw new Error('Style is not done loading.');\n        }\n    }\n\n    /**\n     * @internal\n     * Apply queued style updates in a batch and recalculate zoom-dependent paint properties.\n     */\n    update(parameters: EvaluationParameters) {\n        if (!this._loaded) {\n            return;\n        }\n\n        const changed = this._changed;\n        if (changed) {\n            const updatedIds = Object.keys(this._updatedLayers);\n            const removedIds = Object.keys(this._removedLayers);\n\n            if (updatedIds.length || removedIds.length) {\n                this._updateWorkerLayers(updatedIds, removedIds);\n            }\n            for (const id in this._updatedSources) {\n                const action = this._updatedSources[id];\n\n                if (action === 'reload') {\n                    this._reloadSource(id);\n                } else if (action === 'clear') {\n                    this._clearSource(id);\n                } else {\n                    throw new Error(`Invalid action ${action}`);\n                }\n            }\n\n            this._updateTilesForChangedImages();\n            this._updateTilesForChangedGlyphs();\n\n            for (const id in this._updatedPaintProps) {\n                this._layers[id].updateTransitions(parameters);\n            }\n\n            this.light.updateTransitions(parameters);\n            this.sky.updateTransitions(parameters);\n\n            this._resetUpdates();\n        }\n\n        const sourcesUsedBefore = {};\n\n        // save 'used' status to sourcesUsedBefore object and reset all sourceCaches 'used' field to false\n        for (const sourceCacheId in this.sourceCaches) {\n            const sourceCache = this.sourceCaches[sourceCacheId];\n\n            // sourceCache.used could be undefined, and sourcesUsedBefore[sourceCacheId] is also 'undefined'\n            sourcesUsedBefore[sourceCacheId] = sourceCache.used;\n            sourceCache.used = false;\n        }\n\n        // loop all layers and find layers that are not hidden at parameters.zoom\n        // and set used to true in sourceCaches dictionary for the sources of these layers\n        for (const layerId of this._order) {\n            const layer = this._layers[layerId];\n\n            layer.recalculate(parameters, this._availableImages);\n            if (!layer.isHidden(parameters.zoom) && layer.source) {\n                this.sourceCaches[layer.source].used = true;\n            }\n        }\n\n        // cross check sourcesUsedBefore against updated this.sourceCaches dictionary\n        // if \"used\" field is different fire visibility event\n        for (const sourcesUsedBeforeId in sourcesUsedBefore) {\n            const sourceCache = this.sourceCaches[sourcesUsedBeforeId];\n\n            // (undefine !== false) will evaluate to true and fire an useless visibility event\n            // need force \"falsy\" values to boolean to avoid the case above\n            if (!!sourcesUsedBefore[sourcesUsedBeforeId] !== !!sourceCache.used) {\n                sourceCache.fire(new Event('data',\n                    {\n                        sourceDataType: 'visibility',\n                        dataType: 'source',\n                        sourceId: sourcesUsedBeforeId\n                    }));\n            }\n        }\n\n        this.light.recalculate(parameters);\n        this.sky.recalculate(parameters);\n        this.z = parameters.zoom;\n\n        if (changed) {\n            this.fire(new Event('data', {dataType: 'style'}));\n        }\n    }\n\n    /*\n     * Apply any queued image changes.\n     */\n    _updateTilesForChangedImages() {\n        const changedImages = Object.keys(this._changedImages);\n        if (changedImages.length) {\n            for (const name in this.sourceCaches) {\n                this.sourceCaches[name].reloadTilesForDependencies(['icons', 'patterns'], changedImages);\n            }\n            this._changedImages = {};\n        }\n    }\n\n    _updateTilesForChangedGlyphs() {\n        if (this._glyphsDidChange) {\n            for (const name in this.sourceCaches) {\n                this.sourceCaches[name].reloadTilesForDependencies(['glyphs'], ['']);\n            }\n            this._glyphsDidChange = false;\n        }\n    }\n\n    _updateWorkerLayers(updatedIds: Array<string>, removedIds: Array<string>) {\n        this.dispatcher.broadcast(MessageType.updateLayers, {\n            layers: this._serializeByIds(updatedIds, false),\n            removedIds\n        });\n    }\n\n    _resetUpdates() {\n        this._changed = false;\n\n        this._updatedLayers = {};\n        this._removedLayers = {};\n\n        this._updatedSources = {};\n        this._updatedPaintProps = {};\n\n        this._changedImages = {};\n        this._glyphsDidChange = false;\n    }\n\n    /**\n     * Update this style's state to match the given style JSON, performing only\n     * the necessary mutations.\n     *\n     * May throw an Error ('Unimplemented: METHOD') if the mapbox-gl-style-spec\n     * diff algorithm produces an operation that is not supported.\n     *\n     * @returns true if any changes were made; false otherwise\n     */\n    setState(nextState: StyleSpecification, options: StyleSwapOptions & StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const serializedStyle =  this.serialize();\n        nextState = options.transformStyle ? options.transformStyle(serializedStyle, nextState) : nextState;\n        const validate = options.validate ?? true;\n        if (validate && emitValidationErrors(this, validateStyle(nextState))) return false;\n\n        nextState = clone(nextState);\n        nextState.layers = deref(nextState.layers);\n\n        const changes = diffStyles(serializedStyle, nextState);\n        const operations = this._getOperationsToPerform(changes);\n\n        if (operations.unimplemented.length > 0) {\n            throw new Error(`Unimplemented: ${operations.unimplemented.join(', ')}.`);\n        }\n\n        if (operations.operations.length === 0) {\n            return false;\n        }\n\n        for (const styleChangeOperation of operations.operations) {\n            styleChangeOperation();\n        }\n\n        this.stylesheet = nextState;\n\n        // reset serialization field, to be populated only when needed\n        this._serializedLayers = null;\n\n        return true;\n    }\n\n    _getOperationsToPerform(diff: DiffCommand<DiffOperations>[]) {\n        const operations: Function[] = [];\n        const unimplemented: string[] = [];\n        for (const op of diff) {\n            switch (op.command) {\n                case 'setCenter':\n                case 'setZoom':\n                case 'setBearing':\n                case 'setPitch':\n                    continue;\n                case 'addLayer':\n                    operations.push(() => this.addLayer.apply(this, op.args));\n                    break;\n                case 'removeLayer':\n                    operations.push(() => this.removeLayer.apply(this, op.args));\n                    break;\n                case 'setPaintProperty':\n                    operations.push(() => this.setPaintProperty.apply(this, op.args));\n                    break;\n                case 'setLayoutProperty':\n                    operations.push(() => this.setLayoutProperty.apply(this, op.args));\n                    break;\n                case 'setFilter':\n                    operations.push(() => this.setFilter.apply(this, op.args));\n                    break;\n                case 'addSource':\n                    operations.push(() => this.addSource.apply(this, op.args));\n                    break;\n                case 'removeSource':\n                    operations.push(() => this.removeSource.apply(this, op.args));\n                    break;\n                case 'setLayerZoomRange':\n                    operations.push(() => this.setLayerZoomRange.apply(this, op.args));\n                    break;\n                case 'setLight':\n                    operations.push(() => this.setLight.apply(this, op.args));\n                    break;\n                case 'setGeoJSONSourceData':\n                    operations.push(() => this.setGeoJSONSourceData.apply(this, op.args));\n                    break;\n                case 'setGlyphs':\n                    operations.push(() => this.setGlyphs.apply(this, op.args));\n                    break;\n                case 'setSprite':\n                    operations.push(() => this.setSprite.apply(this, op.args));\n                    break;\n                case 'setSky':\n                    operations.push(() => this.setSky.apply(this, op.args));\n                    break;\n                case 'setTerrain':\n                    operations.push(() => this.map.setTerrain.apply(this, op.args));\n                    break;\n                case 'setTransition':\n                    operations.push(() => {});\n                    break;\n                default:\n                    unimplemented.push(op.command);\n                    break;\n            }\n        }\n        return {\n            operations,\n            unimplemented\n        };\n    }\n\n    addImage(id: string, image: StyleImage) {\n        if (this.getImage(id)) {\n            return this.fire(new ErrorEvent(new Error(`An image named \"${id}\" already exists.`)));\n        }\n        this.imageManager.addImage(id, image);\n        this._afterImageUpdated(id);\n    }\n\n    updateImage(id: string, image: StyleImage) {\n        this.imageManager.updateImage(id, image);\n    }\n\n    getImage(id: string): StyleImage {\n        return this.imageManager.getImage(id);\n    }\n\n    removeImage(id: string) {\n        if (!this.getImage(id)) {\n            return this.fire(new ErrorEvent(new Error(`An image named \"${id}\" does not exist.`)));\n        }\n        this.imageManager.removeImage(id);\n        this._afterImageUpdated(id);\n    }\n\n    _afterImageUpdated(id: string) {\n        this._availableImages = this.imageManager.listImages();\n        this._changedImages[id] = true;\n        this._changed = true;\n        this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n        this.fire(new Event('data', {dataType: 'style'}));\n    }\n\n    listImages() {\n        this._checkLoaded();\n\n        return this.imageManager.listImages();\n    }\n\n    addSource(id: string, source: SourceSpecification | CanvasSourceSpecification, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        if (this.sourceCaches[id] !== undefined) {\n            throw new Error(`Source \"${id}\" already exists.`);\n        }\n\n        if (!source.type) {\n            throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(source).join(', ')}.`);\n        }\n\n        const builtIns = ['vector', 'raster', 'geojson', 'video', 'image'];\n        const shouldValidate = builtIns.indexOf(source.type) >= 0;\n        if (shouldValidate && this._validate(validateStyle.source, `sources.${id}`, source, null, options)) return;\n        if (this.map && this.map._collectResourceTiming) (source as any).collectResourceTiming = true;\n        const sourceCache = this.sourceCaches[id] = new SourceCache(id, source, this.dispatcher);\n        sourceCache.style = this;\n        sourceCache.setEventedParent(this, () => ({\n            isSourceLoaded: sourceCache.loaded(),\n            source: sourceCache.serialize(),\n            sourceId: id\n        }));\n\n        sourceCache.onAdd(this.map);\n        this._changed = true;\n    }\n\n    /**\n     * Remove a source from this stylesheet, given its id.\n     * @param id - id of the source to remove\n     * @throws if no source is found with the given ID\n     */\n    removeSource(id: string): this {\n        this._checkLoaded();\n\n        if (this.sourceCaches[id] === undefined) {\n            throw new Error('There is no source with this ID');\n        }\n        for (const layerId in this._layers) {\n            if (this._layers[layerId].source === id) {\n                return this.fire(new ErrorEvent(new Error(`Source \"${id}\" cannot be removed while layer \"${layerId}\" is using it.`)));\n            }\n        }\n\n        const sourceCache = this.sourceCaches[id];\n        delete this.sourceCaches[id];\n        delete this._updatedSources[id];\n        sourceCache.fire(new Event('data', {sourceDataType: 'metadata', dataType: 'source', sourceId: id}));\n        sourceCache.setEventedParent(null);\n        sourceCache.onRemove(this.map);\n        this._changed = true;\n    }\n\n    /**\n     * Set the data of a GeoJSON source, given its id.\n     * @param id - id of the source\n     * @param data - GeoJSON source\n     */\n    setGeoJSONSourceData(id: string, data: GeoJSON.GeoJSON | string) {\n        this._checkLoaded();\n\n        if (this.sourceCaches[id] === undefined) throw new Error(`There is no source with this ID=${id}`);\n        const geojsonSource: GeoJSONSource = (this.sourceCaches[id].getSource() as any);\n        if (geojsonSource.type !== 'geojson') throw new Error(`geojsonSource.type is ${geojsonSource.type}, which is !== 'geojson`);\n\n        geojsonSource.setData(data);\n        this._changed = true;\n    }\n\n    /**\n     * Get a source by ID.\n     * @param id - ID of the desired source\n     * @returns source\n     */\n    getSource(id: string): Source | undefined {\n        return this.sourceCaches[id] && this.sourceCaches[id].getSource();\n    }\n\n    /**\n     * Add a layer to the map style. The layer will be inserted before the layer with\n     * ID `before`, or appended if `before` is omitted.\n     * @param layerObject - The style layer to add.\n     * @param before - ID of an existing layer to insert before\n     * @param options - Style setter options.\n     */\n    addLayer(layerObject: AddLayerObject, before?: string, options: StyleSetterOptions = {}): this {\n        this._checkLoaded();\n\n        const id = layerObject.id;\n\n        if (this.getLayer(id)) {\n            this.fire(new ErrorEvent(new Error(`Layer \"${id}\" already exists on this map.`)));\n            return;\n        }\n\n        let layer: ReturnType<typeof createStyleLayer>;\n        if (layerObject.type === 'custom') {\n\n            if (emitValidationErrors(this, validateCustomStyleLayer(layerObject))) return;\n\n            layer = createStyleLayer(layerObject);\n\n        } else {\n            if ('source' in layerObject && typeof layerObject.source === 'object') {\n                this.addSource(id, layerObject.source);\n                layerObject = clone(layerObject);\n                layerObject = extend(layerObject, {source: id});\n            }\n\n            // this layer is not in the style.layers array, so we pass an impossible array index\n            if (this._validate(validateStyle.layer,\n                `layers.${id}`, layerObject, {arrayIndex: -1}, options)) return;\n\n            layer = createStyleLayer(layerObject as LayerSpecification | CustomLayerInterface);\n            this._validateLayer(layer);\n\n            layer.setEventedParent(this, {layer: {id}});\n        }\n\n        const index = before ? this._order.indexOf(before) : this._order.length;\n        if (before && index === -1) {\n            this.fire(new ErrorEvent(new Error(`Cannot add layer \"${id}\" before non-existing layer \"${before}\".`)));\n            return;\n        }\n\n        this._order.splice(index, 0, id);\n        this._layerOrderChanged = true;\n\n        this._layers[id] = layer;\n\n        if (this._removedLayers[id] && layer.source && layer.type !== 'custom') {\n            // If, in the current batch, we have already removed this layer\n            // and we are now re-adding it with a different `type`, then we\n            // need to clear (rather than just reload) the underlying source's\n            // tiles.  Otherwise, tiles marked 'reloading' will have buckets /\n            // buffers that are set up for the _previous_ version of this\n            // layer, causing, e.g.:\n            // https://github.com/mapbox/mapbox-gl-js/issues/3633\n            const removed = this._removedLayers[id];\n            delete this._removedLayers[id];\n            if (removed.type !== layer.type) {\n                this._updatedSources[layer.source] = 'clear';\n            } else {\n                this._updatedSources[layer.source] = 'reload';\n                this.sourceCaches[layer.source].pause();\n            }\n        }\n        this._updateLayer(layer);\n\n        if (layer.onAdd) {\n            layer.onAdd(this.map);\n        }\n    }\n\n    /**\n     * Moves a layer to a different z-position. The layer will be inserted before the layer with\n     * ID `before`, or appended if `before` is omitted.\n     * @param id - ID of the layer to move\n     * @param before - ID of an existing layer to insert before\n     */\n    moveLayer(id: string, before?: string) {\n        this._checkLoaded();\n        this._changed = true;\n\n        const layer = this._layers[id];\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`The layer '${id}' does not exist in the map's style and cannot be moved.`)));\n            return;\n        }\n\n        if (id === before) {\n            return;\n        }\n\n        const index = this._order.indexOf(id);\n        this._order.splice(index, 1);\n\n        const newIndex = before ? this._order.indexOf(before) : this._order.length;\n        if (before && newIndex === -1) {\n            this.fire(new ErrorEvent(new Error(`Cannot move layer \"${id}\" before non-existing layer \"${before}\".`)));\n            return;\n        }\n        this._order.splice(newIndex, 0, id);\n\n        this._layerOrderChanged = true;\n    }\n\n    /**\n     * Remove the layer with the given id from the style.\n     * A {@link ErrorEvent} event will be fired if no such layer exists.\n     *\n     * @param id - id of the layer to remove\n     */\n    removeLayer(id: string) {\n        this._checkLoaded();\n\n        const layer = this._layers[id];\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot remove non-existing layer \"${id}\".`)));\n            return;\n        }\n\n        layer.setEventedParent(null);\n\n        const index = this._order.indexOf(id);\n        this._order.splice(index, 1);\n\n        this._layerOrderChanged = true;\n        this._changed = true;\n        this._removedLayers[id] = layer;\n        delete this._layers[id];\n\n        if (this._serializedLayers) {\n            delete this._serializedLayers[id];\n        }\n        delete this._updatedLayers[id];\n        delete this._updatedPaintProps[id];\n\n        if (layer.onRemove) {\n            layer.onRemove(this.map);\n        }\n    }\n\n    /**\n     * Return the style layer object with the given `id`.\n     *\n     * @param id - id of the desired layer\n     * @returns a layer, if one with the given `id` exists\n     */\n    getLayer(id: string): StyleLayer | undefined {\n        return this._layers[id];\n    }\n\n    /**\n     * Return the ids of all layers currently in the style, including custom layers, in order.\n     *\n     * @returns ids of layers, in order\n     */\n    getLayersOrder(): string[] {\n        return [...this._order];\n    }\n\n    /**\n     * Checks if a specific layer is present within the style.\n     *\n     * @param id - the id of the desired layer\n     * @returns a boolean specifying if the given layer is present\n     */\n    hasLayer(id: string): boolean {\n        return id in this._layers;\n    }\n\n    setLayerZoomRange(layerId: string, minzoom?: number | null, maxzoom?: number | null) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (layer.minzoom === minzoom && layer.maxzoom === maxzoom) return;\n\n        if (minzoom != null) {\n            layer.minzoom = minzoom;\n        }\n        if (maxzoom != null) {\n            layer.maxzoom = maxzoom;\n        }\n        this._updateLayer(layer);\n    }\n\n    setFilter(layerId: string, filter?: FilterSpecification | null,  options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot filter non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (deepEqual(layer.filter, filter)) {\n            return;\n        }\n\n        if (filter === null || filter === undefined) {\n            layer.filter = undefined;\n            this._updateLayer(layer);\n            return;\n        }\n\n        if (this._validate(validateStyle.filter, `layers.${layer.id}.filter`, filter, null, options)) {\n            return;\n        }\n\n        layer.filter = clone(filter);\n        this._updateLayer(layer);\n    }\n\n    /**\n     * Get a layer's filter object\n     * @param layer - the layer to inspect\n     * @returns the layer's filter, if any\n     */\n    getFilter(layer: string): FilterSpecification | void {\n        return clone(this.getLayer(layer).filter);\n    }\n\n    setLayoutProperty(layerId: string, name: string, value: any,  options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot style non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (deepEqual(layer.getLayoutProperty(name), value)) return;\n\n        layer.setLayoutProperty(name, value, options);\n        this._updateLayer(layer);\n    }\n\n    /**\n     * Get a layout property's value from a given layer\n     * @param layerId - the layer to inspect\n     * @param name - the name of the layout property\n     * @returns the property value\n     */\n    getLayoutProperty(layerId: string, name: string) {\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot get style of non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        return layer.getLayoutProperty(name);\n    }\n\n    setPaintProperty(layerId: string, name: string, value: any, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const layer = this.getLayer(layerId);\n        if (!layer) {\n            this.fire(new ErrorEvent(new Error(`Cannot style non-existing layer \"${layerId}\".`)));\n            return;\n        }\n\n        if (deepEqual(layer.getPaintProperty(name), value)) return;\n\n        const requiresRelayout = layer.setPaintProperty(name, value, options);\n        if (requiresRelayout) {\n            this._updateLayer(layer);\n        }\n\n        this._changed = true;\n        this._updatedPaintProps[layerId] = true;\n        // reset serialization field, to be populated only when needed\n        this._serializedLayers = null;\n    }\n\n    getPaintProperty(layer: string, name: string) {\n        return this.getLayer(layer).getPaintProperty(name);\n    }\n\n    setFeatureState(target: FeatureIdentifier, state: any) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const sourceLayer = target.sourceLayer;\n        const sourceCache = this.sourceCaches[sourceId];\n\n        if (sourceCache === undefined) {\n            this.fire(new ErrorEvent(new Error(`The source '${sourceId}' does not exist in the map's style.`)));\n            return;\n        }\n        const sourceType = sourceCache.getSource().type;\n        if (sourceType === 'geojson' && sourceLayer) {\n            this.fire(new ErrorEvent(new Error('GeoJSON sources cannot have a sourceLayer parameter.')));\n            return;\n        }\n        if (sourceType === 'vector' && !sourceLayer) {\n            this.fire(new ErrorEvent(new Error('The sourceLayer parameter must be provided for vector source types.')));\n            return;\n        }\n        if (target.id === undefined) {\n            this.fire(new ErrorEvent(new Error('The feature id parameter must be provided.')));\n        }\n\n        sourceCache.setFeatureState(sourceLayer, target.id, state);\n    }\n\n    removeFeatureState(target: FeatureIdentifier, key?: string) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const sourceCache = this.sourceCaches[sourceId];\n\n        if (sourceCache === undefined) {\n            this.fire(new ErrorEvent(new Error(`The source '${sourceId}' does not exist in the map's style.`)));\n            return;\n        }\n\n        const sourceType = sourceCache.getSource().type;\n        const sourceLayer = sourceType === 'vector' ? target.sourceLayer : undefined;\n\n        if (sourceType === 'vector' && !sourceLayer) {\n            this.fire(new ErrorEvent(new Error('The sourceLayer parameter must be provided for vector source types.')));\n            return;\n        }\n\n        if (key && (typeof target.id !== 'string' && typeof target.id !== 'number')) {\n            this.fire(new ErrorEvent(new Error('A feature id is required to remove its specific state property.')));\n            return;\n        }\n\n        sourceCache.removeFeatureState(sourceLayer, target.id, key);\n    }\n\n    getFeatureState(target: FeatureIdentifier) {\n        this._checkLoaded();\n        const sourceId = target.source;\n        const sourceLayer = target.sourceLayer;\n        const sourceCache = this.sourceCaches[sourceId];\n\n        if (sourceCache === undefined) {\n            this.fire(new ErrorEvent(new Error(`The source '${sourceId}' does not exist in the map's style.`)));\n            return;\n        }\n        const sourceType = sourceCache.getSource().type;\n        if (sourceType === 'vector' && !sourceLayer) {\n            this.fire(new ErrorEvent(new Error('The sourceLayer parameter must be provided for vector source types.')));\n            return;\n        }\n        if (target.id === undefined) {\n            this.fire(new ErrorEvent(new Error('The feature id parameter must be provided.')));\n        }\n\n        return sourceCache.getFeatureState(sourceLayer, target.id);\n    }\n\n    getTransition() {\n        return extend({duration: 300, delay: 0}, this.stylesheet && this.stylesheet.transition);\n    }\n\n    serialize(): StyleSpecification | undefined {\n        // We return undefined before we're loaded, following the pattern of Map.getStyle() before\n        // the Style object is initialized.\n        // Internally, Style._validate() calls Style.serialize() but callers are responsible for\n        // calling Style._checkLoaded() first if their validation requires the style to be loaded.\n        if (!this._loaded) return;\n\n        const sources = mapObject(this.sourceCaches, (source) => source.serialize());\n        const layers = this._serializeByIds(this._order, true);\n        const terrain = this.map.getTerrain() || undefined;\n        const myStyleSheet = this.stylesheet;\n\n        return filterObject({\n            version: myStyleSheet.version,\n            name: myStyleSheet.name,\n            metadata: myStyleSheet.metadata,\n            light: myStyleSheet.light,\n            sky: myStyleSheet.sky,\n            center: myStyleSheet.center,\n            zoom: myStyleSheet.zoom,\n            bearing: myStyleSheet.bearing,\n            pitch: myStyleSheet.pitch,\n            sprite: myStyleSheet.sprite,\n            glyphs: myStyleSheet.glyphs,\n            transition: myStyleSheet.transition,\n            sources,\n            layers,\n            terrain\n        },\n        (value) => { return value !== undefined; });\n    }\n\n    _updateLayer(layer: StyleLayer) {\n        this._updatedLayers[layer.id] = true;\n        if (layer.source && !this._updatedSources[layer.source] &&\n            //Skip for raster layers (https://github.com/mapbox/mapbox-gl-js/issues/7865)\n            this.sourceCaches[layer.source].getSource().type !== 'raster') {\n            this._updatedSources[layer.source] = 'reload';\n            this.sourceCaches[layer.source].pause();\n        }\n\n        // upon updating, serialized layer dictionary should be reset.\n        // When needed, it will be populated with the correct copy again.\n        this._serializedLayers = null;\n        this._changed = true;\n    }\n\n    _flattenAndSortRenderedFeatures(sourceResults: Array<{ [key: string]: Array<{featureIndex: number; feature: MapGeoJSONFeature}> }>) {\n        // Feature order is complicated.\n        // The order between features in two 2D layers is always determined by layer order.\n        // The order between features in two 3D layers is always determined by depth.\n        // The order between a feature in a 2D layer and a 3D layer is tricky:\n        //      Most often layer order determines the feature order in this case. If\n        //      a line layer is above a extrusion layer the line feature will be rendered\n        //      above the extrusion. If the line layer is below the extrusion layer,\n        //      it will be rendered below it.\n        //\n        //      There is a weird case though.\n        //      You have layers in this order: extrusion_layer_a, line_layer, extrusion_layer_b\n        //      Each layer has a feature that overlaps the other features.\n        //      The feature in extrusion_layer_a is closer than the feature in extrusion_layer_b so it is rendered above.\n        //      The feature in line_layer is rendered above extrusion_layer_a.\n        //      This means that that the line_layer feature is above the extrusion_layer_b feature despite\n        //      it being in an earlier layer.\n\n        const isLayer3D = layerId => this._layers[layerId].type === 'fill-extrusion';\n\n        const layerIndex = {};\n        const features3D = [];\n        for (let l = this._order.length - 1; l >= 0; l--) {\n            const layerId = this._order[l];\n            if (isLayer3D(layerId)) {\n                layerIndex[layerId] = l;\n                for (const sourceResult of sourceResults) {\n                    const layerFeatures = sourceResult[layerId];\n                    if (layerFeatures) {\n                        for (const featureWrapper of layerFeatures) {\n                            features3D.push(featureWrapper);\n                        }\n                    }\n                }\n            }\n        }\n\n        features3D.sort((a, b) => {\n            return b.intersectionZ - a.intersectionZ;\n        });\n\n        const features = [];\n        for (let l = this._order.length - 1; l >= 0; l--) {\n            const layerId = this._order[l];\n\n            if (isLayer3D(layerId)) {\n                // add all 3D features that are in or above the current layer\n                for (let i = features3D.length - 1; i >= 0; i--) {\n                    const topmost3D = features3D[i].feature;\n                    if (layerIndex[topmost3D.layer.id] < l) break;\n                    features.push(topmost3D);\n                    features3D.pop();\n                }\n            } else {\n                for (const sourceResult of sourceResults) {\n                    const layerFeatures = sourceResult[layerId];\n                    if (layerFeatures) {\n                        for (const featureWrapper of layerFeatures) {\n                            features.push(featureWrapper.feature);\n                        }\n                    }\n                }\n            }\n        }\n\n        return features;\n    }\n\n    queryRenderedFeatures(queryGeometry: any, params: QueryRenderedFeaturesOptions, transform: Transform) {\n        if (params && params.filter) {\n            this._validate(validateStyle.filter, 'queryRenderedFeatures.filter', params.filter, null, params);\n        }\n\n        const includedSources = {};\n        if (params && params.layers) {\n            if (!Array.isArray(params.layers)) {\n                this.fire(new ErrorEvent(new Error('parameters.layers must be an Array.')));\n                return [];\n            }\n            for (const layerId of params.layers) {\n                const layer = this._layers[layerId];\n                if (!layer) {\n                    // this layer is not in the style.layers array\n                    this.fire(new ErrorEvent(new Error(`The layer '${layerId}' does not exist in the map's style and cannot be queried for features.`)));\n                    return [];\n                }\n                includedSources[layer.source] = true;\n            }\n        }\n\n        const sourceResults = [];\n\n        params.availableImages = this._availableImages;\n\n        // LayerSpecification is serialized StyleLayer, and this casting is safe.\n        const serializedLayers = this._serializedAllLayers() as {[_: string]: StyleLayer};\n\n        for (const id in this.sourceCaches) {\n            if (params.layers && !includedSources[id]) continue;\n            sourceResults.push(\n                queryRenderedFeatures(\n                    this.sourceCaches[id],\n                    this._layers,\n                    serializedLayers,\n                    queryGeometry,\n                    params,\n                    transform)\n            );\n        }\n\n        if (this.placement) {\n            // If a placement has run, query against its CollisionIndex\n            // for symbol results, and treat it as an extra source to merge\n            sourceResults.push(\n                queryRenderedSymbols(\n                    this._layers,\n                    serializedLayers,\n                    this.sourceCaches,\n                    queryGeometry,\n                    params,\n                    this.placement.collisionIndex,\n                    this.placement.retainedQueryData)\n            );\n        }\n\n        return this._flattenAndSortRenderedFeatures(sourceResults);\n    }\n\n    querySourceFeatures(\n        sourceID: string,\n        params?: QuerySourceFeatureOptions\n    ) {\n        if (params && params.filter) {\n            this._validate(validateStyle.filter, 'querySourceFeatures.filter', params.filter, null, params);\n        }\n        const sourceCache = this.sourceCaches[sourceID];\n        return sourceCache ? querySourceFeatures(sourceCache, params) : [];\n    }\n\n    getLight() {\n        return this.light.getLight();\n    }\n\n    setLight(lightOptions: LightSpecification, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n\n        const light = this.light.getLight();\n        let _update = false;\n        for (const key in lightOptions) {\n            if (!deepEqual(lightOptions[key], light[key])) {\n                _update = true;\n                break;\n            }\n        }\n        if (!_update) return;\n\n        const parameters = {\n            now: browser.now(),\n            transition: extend({\n                duration: 300,\n                delay: 0\n            }, this.stylesheet.transition)\n        };\n\n        this.light.setLight(lightOptions, options);\n        this.light.updateTransitions(parameters);\n    }\n\n    getSky(): SkySpecification {\n        return this.stylesheet?.sky;\n    }\n\n    setSky(skyOptions?: SkySpecification, options: StyleSetterOptions = {}) {\n        const sky = this.getSky();\n        let update = false;\n        if (!skyOptions && !sky) return;\n\n        if (skyOptions && !sky) {\n            update = true;\n        } else if (!skyOptions && sky) {\n            update = true;\n        } else {\n            for (const key in skyOptions) {\n                if (!deepEqual(skyOptions[key], sky[key])) {\n                    update = true;\n                    break;\n                }\n            }\n        }\n        if (!update) return;\n\n        const parameters = {\n            now: browser.now(),\n            transition: extend({\n                duration: 300,\n                delay: 0\n            }, this.stylesheet.transition)\n        };\n\n        this.stylesheet.sky = skyOptions;\n        this.sky.setSky(skyOptions, options);\n        this.sky.updateTransitions(parameters);\n    }\n\n    _validate(validate: Validator, key: string, value: any, props: any, options: {\n        validate?: boolean;\n    } = {}) {\n        if (options && options.validate === false) {\n            return false;\n        }\n        return emitValidationErrors(this, validate.call(validateStyle, extend({\n            key,\n            style: this.serialize(),\n            value,\n            styleSpec\n        }, props)));\n    }\n\n    _remove(mapRemoved: boolean = true) {\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        if (this._loadStyleRequest) {\n            this._loadStyleRequest.abort();\n            this._loadStyleRequest = null;\n        }\n        if (this._spriteRequest) {\n            this._spriteRequest.abort();\n            this._spriteRequest = null;\n        }\n        rtlMainThreadPluginFactory().off(RTLPluginLoadedEventName, this._rtlPluginLoaded);\n        for (const layerId in this._layers) {\n            const layer: StyleLayer = this._layers[layerId];\n            layer.setEventedParent(null);\n        }\n        for (const id in this.sourceCaches) {\n            const sourceCache = this.sourceCaches[id];\n            sourceCache.setEventedParent(null);\n            sourceCache.onRemove(this.map);\n        }\n        this.imageManager.setEventedParent(null);\n        this.setEventedParent(null);\n        if (mapRemoved) {\n            this.dispatcher.broadcast(MessageType.removeMap, undefined);\n        }\n        this.dispatcher.remove(mapRemoved);\n    }\n\n    _clearSource(id: string) {\n        this.sourceCaches[id].clearTiles();\n    }\n\n    _reloadSource(id: string) {\n        this.sourceCaches[id].resume();\n        this.sourceCaches[id].reload();\n    }\n\n    _updateSources(transform: Transform) {\n        for (const id in this.sourceCaches) {\n            this.sourceCaches[id].update(transform, this.map.terrain);\n        }\n    }\n\n    _generateCollisionBoxes() {\n        for (const id in this.sourceCaches) {\n            this._reloadSource(id);\n        }\n    }\n\n    _updatePlacement(transform: Transform, showCollisionBoxes: boolean, fadeDuration: number, crossSourceCollisions: boolean, forceFullPlacement: boolean = false) {\n        let symbolBucketsChanged = false;\n        let placementCommitted = false;\n\n        const layerTiles = {};\n\n        for (const layerID of this._order) {\n            const styleLayer = this._layers[layerID];\n            if (styleLayer.type !== 'symbol') continue;\n\n            if (!layerTiles[styleLayer.source]) {\n                const sourceCache = this.sourceCaches[styleLayer.source];\n                layerTiles[styleLayer.source] = sourceCache.getRenderableIds(true)\n                    .map((id) => sourceCache.getTileByID(id))\n                    .sort((a, b) => (b.tileID.overscaledZ - a.tileID.overscaledZ) || (a.tileID.isLessThan(b.tileID) ? -1 : 1));\n            }\n\n            const layerBucketsChanged = this.crossTileSymbolIndex.addLayer(styleLayer, layerTiles[styleLayer.source], transform.center.lng);\n            symbolBucketsChanged = symbolBucketsChanged || layerBucketsChanged;\n        }\n        this.crossTileSymbolIndex.pruneUnusedLayers(this._order);\n\n        // Anything that changes our \"in progress\" layer and tile indices requires us\n        // to start over. When we start over, we do a full placement instead of incremental\n        // to prevent starvation.\n        // We need to restart placement to keep layer indices in sync.\n        // Also force full placement when fadeDuration === 0 to ensure that newly loaded\n        // tiles will fully display symbols in their first frame\n        forceFullPlacement = forceFullPlacement || this._layerOrderChanged || fadeDuration === 0;\n\n        if (forceFullPlacement || !this.pauseablePlacement || (this.pauseablePlacement.isDone() && !this.placement.stillRecent(browser.now(), transform.zoom))) {\n            this.pauseablePlacement = new PauseablePlacement(transform, this.map.terrain, this._order, forceFullPlacement, showCollisionBoxes, fadeDuration, crossSourceCollisions, this.placement);\n            this._layerOrderChanged = false;\n        }\n\n        if (this.pauseablePlacement.isDone()) {\n            // the last placement finished running, but the next one hasnât\n            // started yet because of the `stillRecent` check immediately\n            // above, so mark it stale to ensure that we request another\n            // render frame\n            this.placement.setStale();\n        } else {\n            this.pauseablePlacement.continuePlacement(this._order, this._layers, layerTiles);\n\n            if (this.pauseablePlacement.isDone()) {\n                this.placement = this.pauseablePlacement.commit(browser.now());\n                placementCommitted = true;\n            }\n\n            if (symbolBucketsChanged) {\n                // since the placement gets split over multiple frames it is possible\n                // these buckets were processed before they were changed and so the\n                // placement is already stale while it is in progress\n                this.pauseablePlacement.placement.setStale();\n            }\n        }\n\n        if (placementCommitted || symbolBucketsChanged) {\n            for (const layerID of this._order) {\n                const styleLayer = this._layers[layerID];\n                if (styleLayer.type !== 'symbol') continue;\n                this.placement.updateLayerOpacities(styleLayer, layerTiles[styleLayer.source]);\n            }\n        }\n\n        // needsRender is false when we have just finished a placement that didn't change the visibility of any symbols\n        const needsRerender = !this.pauseablePlacement.isDone() || this.placement.hasTransitions(browser.now());\n        return needsRerender;\n    }\n\n    _releaseSymbolFadeTiles() {\n        for (const id in this.sourceCaches) {\n            this.sourceCaches[id].releaseSymbolFadeTiles();\n        }\n    }\n\n    // Callbacks from web workers\n\n    async getImages(mapId: string | number, params: GetImagesParameters): Promise<GetImagesResponse> {\n        const images = await this.imageManager.getImages(params.icons);\n\n        // Apply queued image changes before setting the tile's dependencies so that the tile\n        // is not reloaded unnecessarily. Without this forced update the reload could happen in cases\n        // like this one:\n        // - icons contains \"my-image\"\n        // - imageManager.getImages(...) triggers `onstyleimagemissing`\n        // - the user adds \"my-image\" within the callback\n        // - addImage adds \"my-image\" to this._changedImages\n        // - the next frame triggers a reload of this tile even though it already has the latest version\n        this._updateTilesForChangedImages();\n\n        const sourceCache = this.sourceCaches[params.source];\n        if (sourceCache) {\n            sourceCache.setDependencies(params.tileID.key, params.type, params.icons);\n        }\n        return images;\n    }\n\n    async getGlyphs(mapId: string | number, params: GetGlyphsParameters): Promise<GetGlyphsResponse> {\n        const glypgs = await this.glyphManager.getGlyphs(params.stacks);\n        const sourceCache = this.sourceCaches[params.source];\n        if (sourceCache) {\n            // we are not setting stacks as dependencies since for now\n            // we just need to know which tiles have glyph dependencies\n            sourceCache.setDependencies(params.tileID.key, params.type, ['']);\n        }\n        return glypgs;\n    }\n\n    getGlyphsUrl() {\n        return this.stylesheet.glyphs || null;\n    }\n\n    setGlyphs(glyphsUrl: string | null, options: StyleSetterOptions = {}) {\n        this._checkLoaded();\n        if (glyphsUrl && this._validate(validateStyle.glyphs, 'glyphs', glyphsUrl, null, options)) {\n            return;\n        }\n\n        this._glyphsDidChange = true;\n        this.stylesheet.glyphs = glyphsUrl;\n        this.glyphManager.entries = {};\n        this.glyphManager.setURL(glyphsUrl);\n    }\n\n    /**\n     * Add a sprite.\n     *\n     * @param id - The id of the desired sprite\n     * @param url - The url to load the desired sprite from\n     * @param options - The style setter options\n     * @param completion - The completion handler\n     */\n    addSprite(id: string, url: string, options: StyleSetterOptions = {}, completion?: (err: Error) => void) {\n        this._checkLoaded();\n\n        const spriteToAdd = [{id, url}];\n        const updatedSprite = [\n            ...coerceSpriteToArray(this.stylesheet.sprite),\n            ...spriteToAdd\n        ];\n\n        if (this._validate(validateStyle.sprite, 'sprite', updatedSprite, null, options)) return;\n\n        this.stylesheet.sprite = updatedSprite;\n        this._loadSprite(spriteToAdd, true, completion);\n    }\n\n    /**\n     * Remove a sprite by its id. When the last sprite is removed, the whole `this.stylesheet.sprite` object becomes\n     * `undefined`. This falsy `undefined` value later prevents attempts to load the sprite when it's absent.\n     *\n     * @param id - the id of the sprite to remove\n     */\n    removeSprite(id: string) {\n        this._checkLoaded();\n\n        const internalSpriteRepresentation = coerceSpriteToArray(this.stylesheet.sprite);\n\n        if (!internalSpriteRepresentation.find(sprite => sprite.id === id)) {\n            this.fire(new ErrorEvent(new Error(`Sprite \"${id}\" doesn't exists on this map.`)));\n            return;\n        }\n\n        if (this._spritesImagesIds[id]) {\n            for (const imageId of this._spritesImagesIds[id]) {\n                this.imageManager.removeImage(imageId);\n                this._changedImages[imageId] = true;\n            }\n        }\n\n        internalSpriteRepresentation.splice(internalSpriteRepresentation.findIndex(sprite => sprite.id === id), 1);\n        this.stylesheet.sprite = internalSpriteRepresentation.length > 0 ? internalSpriteRepresentation : undefined;\n\n        delete this._spritesImagesIds[id];\n        this._availableImages = this.imageManager.listImages();\n        this._changed = true;\n        this.dispatcher.broadcast(MessageType.setImages, this._availableImages);\n        this.fire(new Event('data', {dataType: 'style'}));\n    }\n\n    /**\n     * Get the current sprite value.\n     *\n     * @returns empty array when no sprite is set; id-url pairs otherwise\n     */\n    getSprite() {\n        return coerceSpriteToArray(this.stylesheet.sprite);\n    }\n\n    /**\n     * Set a new value for the style's sprite.\n     *\n     * @param sprite - new sprite value\n     * @param options - style setter options\n     * @param completion - the completion handler\n     */\n    setSprite(sprite: SpriteSpecification, options: StyleSetterOptions = {}, completion?: (err: Error) => void) {\n        this._checkLoaded();\n\n        if (sprite && this._validate(validateStyle.sprite, 'sprite', sprite, null, options)) {\n            return;\n        }\n\n        this.stylesheet.sprite = sprite;\n\n        if (sprite) {\n            this._loadSprite(sprite, true, completion);\n        } else {\n            this._unloadSprite();\n            if (completion) {\n                completion(null);\n            }\n        }\n    }\n}\n", "import {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos', type: 'Int16', components: 2}\n]);\n", "\n// Disable Flow annotations here because Flow doesn't support importing GLSL files\n\nimport preludeFrag from './_prelude.fragment.glsl.g';\nimport preludeVert from './_prelude.vertex.glsl.g';\nimport backgroundFrag from './background.fragment.glsl.g';\nimport backgroundVert from './background.vertex.glsl.g';\nimport backgroundPatternFrag from './background_pattern.fragment.glsl.g';\nimport backgroundPatternVert from './background_pattern.vertex.glsl.g';\nimport circleFrag from './circle.fragment.glsl.g';\nimport circleVert from './circle.vertex.glsl.g';\nimport clippingMaskFrag from './clipping_mask.fragment.glsl.g';\nimport clippingMaskVert from './clipping_mask.vertex.glsl.g';\nimport heatmapFrag from './heatmap.fragment.glsl.g';\nimport heatmapVert from './heatmap.vertex.glsl.g';\nimport heatmapTextureFrag from './heatmap_texture.fragment.glsl.g';\nimport heatmapTextureVert from './heatmap_texture.vertex.glsl.g';\nimport collisionBoxFrag from './collision_box.fragment.glsl.g';\nimport collisionBoxVert from './collision_box.vertex.glsl.g';\nimport collisionCircleFrag from './collision_circle.fragment.glsl.g';\nimport collisionCircleVert from './collision_circle.vertex.glsl.g';\nimport debugFrag from './debug.fragment.glsl.g';\nimport debugVert from './debug.vertex.glsl.g';\nimport fillFrag from './fill.fragment.glsl.g';\nimport fillVert from './fill.vertex.glsl.g';\nimport fillOutlineFrag from './fill_outline.fragment.glsl.g';\nimport fillOutlineVert from './fill_outline.vertex.glsl.g';\nimport fillOutlinePatternFrag from './fill_outline_pattern.fragment.glsl.g';\nimport fillOutlinePatternVert from './fill_outline_pattern.vertex.glsl.g';\nimport fillPatternFrag from './fill_pattern.fragment.glsl.g';\nimport fillPatternVert from './fill_pattern.vertex.glsl.g';\nimport fillExtrusionFrag from './fill_extrusion.fragment.glsl.g';\nimport fillExtrusionVert from './fill_extrusion.vertex.glsl.g';\nimport fillExtrusionPatternFrag from './fill_extrusion_pattern.fragment.glsl.g';\nimport fillExtrusionPatternVert from './fill_extrusion_pattern.vertex.glsl.g';\nimport hillshadePrepareFrag from './hillshade_prepare.fragment.glsl.g';\nimport hillshadePrepareVert from './hillshade_prepare.vertex.glsl.g';\nimport hillshadeFrag from './hillshade.fragment.glsl.g';\nimport hillshadeVert from './hillshade.vertex.glsl.g';\nimport lineFrag from './line.fragment.glsl.g';\nimport lineVert from './line.vertex.glsl.g';\nimport lineGradientFrag from './line_gradient.fragment.glsl.g';\nimport lineGradientVert from './line_gradient.vertex.glsl.g';\nimport linePatternFrag from './line_pattern.fragment.glsl.g';\nimport linePatternVert from './line_pattern.vertex.glsl.g';\nimport lineSDFFrag from './line_sdf.fragment.glsl.g';\nimport lineSDFVert from './line_sdf.vertex.glsl.g';\nimport rasterFrag from './raster.fragment.glsl.g';\nimport rasterVert from './raster.vertex.glsl.g';\nimport symbolIconFrag from './symbol_icon.fragment.glsl.g';\nimport symbolIconVert from './symbol_icon.vertex.glsl.g';\nimport symbolSDFFrag from './symbol_sdf.fragment.glsl.g';\nimport symbolSDFVert from './symbol_sdf.vertex.glsl.g';\nimport symbolTextAndIconFrag from './symbol_text_and_icon.fragment.glsl.g';\nimport symbolTextAndIconVert from './symbol_text_and_icon.vertex.glsl.g';\nimport terrainDepthFrag from './terrain_depth.fragment.glsl.g';\nimport terrainCoordsFrag from './terrain_coords.fragment.glsl.g';\nimport terrainFrag from './terrain.fragment.glsl.g';\nimport terrainDepthVert from './terrain_depth.vertex.glsl.g';\nimport terrainCoordsVert from './terrain_coords.vertex.glsl.g';\nimport terrainVert from './terrain.vertex.glsl.g';\nimport skyFrag from './sky.fragment.glsl.g';\nimport skyVert from './sky.vertex.glsl.g';\n\nexport const shaders = {\n    prelude: compile(preludeFrag, preludeVert),\n    background: compile(backgroundFrag, backgroundVert),\n    backgroundPattern: compile(backgroundPatternFrag, backgroundPatternVert),\n    circle: compile(circleFrag, circleVert),\n    clippingMask: compile(clippingMaskFrag, clippingMaskVert),\n    heatmap: compile(heatmapFrag, heatmapVert),\n    heatmapTexture: compile(heatmapTextureFrag, heatmapTextureVert),\n    collisionBox: compile(collisionBoxFrag, collisionBoxVert),\n    collisionCircle: compile(collisionCircleFrag, collisionCircleVert),\n    debug: compile(debugFrag, debugVert),\n    fill: compile(fillFrag, fillVert),\n    fillOutline: compile(fillOutlineFrag, fillOutlineVert),\n    fillOutlinePattern: compile(fillOutlinePatternFrag, fillOutlinePatternVert),\n    fillPattern: compile(fillPatternFrag, fillPatternVert),\n    fillExtrusion: compile(fillExtrusionFrag, fillExtrusionVert),\n    fillExtrusionPattern: compile(fillExtrusionPatternFrag, fillExtrusionPatternVert),\n    hillshadePrepare: compile(hillshadePrepareFrag, hillshadePrepareVert),\n    hillshade: compile(hillshadeFrag, hillshadeVert),\n    line: compile(lineFrag, lineVert),\n    lineGradient: compile(lineGradientFrag, lineGradientVert),\n    linePattern: compile(linePatternFrag, linePatternVert),\n    lineSDF: compile(lineSDFFrag, lineSDFVert),\n    raster: compile(rasterFrag, rasterVert),\n    symbolIcon: compile(symbolIconFrag, symbolIconVert),\n    symbolSDF: compile(symbolSDFFrag, symbolSDFVert),\n    symbolTextAndIcon: compile(symbolTextAndIconFrag, symbolTextAndIconVert),\n    terrain: compile(terrainFrag, terrainVert),\n    terrainDepth: compile(terrainDepthFrag, terrainDepthVert),\n    terrainCoords: compile(terrainCoordsFrag, terrainCoordsVert),\n    sky: compile(skyFrag, skyVert)};\n\n// Expand #pragmas to #ifdefs.\n\nfunction compile(fragmentSource, vertexSource) {\n    const re = /#pragma mapbox: ([\\w]+) ([\\w]+) ([\\w]+) ([\\w]+)/g;\n\n    const staticAttributes = vertexSource.match(/attribute ([\\w]+) ([\\w]+)/g);\n    const fragmentUniforms = fragmentSource.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g);\n    const vertexUniforms = vertexSource.match(/uniform ([\\w]+) ([\\w]+)([\\s]*)([\\w]*)/g);\n    const staticUniforms = vertexUniforms ? vertexUniforms.concat(fragmentUniforms) : fragmentUniforms;\n\n    const fragmentPragmas = {};\n\n    fragmentSource = fragmentSource.replace(re, (match, operation, precision, type, name) => {\n        fragmentPragmas[name] = true;\n        if (operation === 'define') {\n            return `\n#ifndef HAS_UNIFORM_u_${name}\nvarying ${precision} ${type} ${name};\n#else\nuniform ${precision} ${type} u_${name};\n#endif\n`;\n        } else /* if (operation === 'initialize') */ {\n            return `\n#ifdef HAS_UNIFORM_u_${name}\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n        }\n    });\n\n    vertexSource = vertexSource.replace(re, (match, operation, precision, type, name) => {\n        const attrType = type === 'float' ? 'vec2' : 'vec4';\n        const unpackType = name.match(/color/) ? 'color' : attrType;\n\n        if (fragmentPragmas[name]) {\n            if (operation === 'define') {\n                return `\n#ifndef HAS_UNIFORM_u_${name}\nuniform lowp float u_${name}_t;\nattribute ${precision} ${attrType} a_${name};\nvarying ${precision} ${type} ${name};\n#else\nuniform ${precision} ${type} u_${name};\n#endif\n`;\n            } else /* if (operation === 'initialize') */ {\n                if (unpackType === 'vec4') {\n                    // vec4 attributes are only used for cross-faded properties, and are not packed\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${name} = a_${name};\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                } else {\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${name} = unpack_mix_${unpackType}(a_${name}, u_${name}_t);\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                }\n            }\n        } else {\n            if (operation === 'define') {\n                return `\n#ifndef HAS_UNIFORM_u_${name}\nuniform lowp float u_${name}_t;\nattribute ${precision} ${attrType} a_${name};\n#else\nuniform ${precision} ${type} u_${name};\n#endif\n`;\n            } else /* if (operation === 'initialize') */ {\n                if (unpackType === 'vec4') {\n                    // vec4 attributes are only used for cross-faded properties, and are not packed\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${precision} ${type} ${name} = a_${name};\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                } else /* */ {\n                    return `\n#ifndef HAS_UNIFORM_u_${name}\n    ${precision} ${type} ${name} = unpack_mix_${unpackType}(a_${name}, u_${name}_t);\n#else\n    ${precision} ${type} ${name} = u_${name};\n#endif\n`;\n                }\n            }\n        }\n    });\n\n    return {fragmentSource, vertexSource, staticAttributes, staticUniforms};\n}\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision mediump float;\\n#else\\n#if !defined(lowp)\\n#define lowp\\n#endif\\n#if !defined(mediump)\\n#define mediump\\n#endif\\n#if !defined(highp)\\n#define highp\\n#endif\\n#endif\\n';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#else\\n#if !defined(lowp)\\n#define lowp\\n#endif\\n#if !defined(mediump)\\n#define mediump\\n#endif\\n#if !defined(highp)\\n#define highp\\n#endif\\n#endif\\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\\n#ifdef TERRAIN3D\\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\\n#endif\\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\\n#ifdef TERRAIN3D\\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\\n#else\\nreturn 1.0;\\n#endif\\n}float calculate_visibility(vec4 pos) {\\n#ifdef TERRAIN3D\\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\\n#else\\nreturn 1.0;\\n#endif\\n}float ele(vec2 pos) {\\n#ifdef TERRAIN3D\\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\\n#else\\nreturn 0.0;\\n#endif\\n}float get_elevation(vec2 pos) {\\n#ifdef TERRAIN3D\\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\\n#else\\nreturn 0.0;\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'varying vec3 v_data;varying float v_visibility;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define mediump float radius\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define highp vec4 stroke_color\\n#pragma mapbox: define mediump float stroke_width\\n#pragma mapbox: define lowp float stroke_opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize mediump float radius\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize highp vec4 stroke_color\\n#pragma mapbox: initialize mediump float stroke_width\\n#pragma mapbox: initialize lowp float stroke_opacity\\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define mediump float radius\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define highp vec4 stroke_color\\n#pragma mapbox: define mediump float stroke_width\\n#pragma mapbox: define lowp float stroke_opacity\\nvoid main(void) {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize mediump float radius\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize highp vec4 stroke_color\\n#pragma mapbox: initialize mediump float stroke_width\\n#pragma mapbox: initialize lowp float stroke_opacity\\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'void main() {gl_FragColor=vec4(1.0);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform highp float u_intensity;varying vec2 v_extrude;\\n#pragma mapbox: define highp float weight\\n#define GAUSS_COEF 0.3989422804014327\\nvoid main() {\\n#pragma mapbox: initialize highp float weight\\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\\n#pragma mapbox: define highp float weight\\n#pragma mapbox: define mediump float radius\\nconst highp float ZERO=1.0/255.0/16.0;\\n#define GAUSS_COEF 0.3989422804014327\\nvoid main(void) {\\n#pragma mapbox: initialize highp float weight\\n#pragma mapbox: initialize mediump float radius\\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(0.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float opacity\\ngl_FragColor=color*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;uniform mat4 u_matrix;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float opacity\\ngl_Position=u_matrix*vec4(a_pos,0,1);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'varying vec2 v_pos;\\n#pragma mapbox: define highp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 outline_color\\n#pragma mapbox: initialize lowp float opacity\\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\\n#pragma mapbox: define highp vec4 outline_color\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 outline_color\\n#pragma mapbox: initialize lowp float opacity\\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'varying vec4 v_color;void main() {gl_FragColor=v_color;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\\n#ifdef TERRAIN3D\\nattribute vec2 a_centroid;\\n#endif\\nvarying vec4 v_color;\\n#pragma mapbox: define highp float base\\n#pragma mapbox: define highp float height\\n#pragma mapbox: define highp vec4 color\\nvoid main() {\\n#pragma mapbox: initialize highp float base\\n#pragma mapbox: initialize highp float height\\n#pragma mapbox: initialize highp vec4 color\\nvec3 normal=a_normal_ed.xyz;\\n#ifdef TERRAIN3D\\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\\n#else\\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\\n#endif\\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\\n#pragma mapbox: define lowp float base\\n#pragma mapbox: define lowp float height\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float base\\n#pragma mapbox: initialize lowp float height\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\\n#ifdef TERRAIN3D\\nattribute vec2 a_centroid;\\n#endif\\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\\n#pragma mapbox: define lowp float base\\n#pragma mapbox: define lowp float height\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float base\\n#pragma mapbox: initialize lowp float height\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\\n#ifdef TERRAIN3D\\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\\n#else\\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\\n#endif\\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\\n? a_pos\\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\\n#define PI 3.141592653589793\\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_width2=vec2(outset,inset);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_width2=vec2(outset,inset);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#ifdef GL_ES\\nprecision highp float;\\n#endif\\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\n#define LINE_DISTANCE_SCALE 2.0\\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\n#pragma mapbox: define lowp vec4 pattern_from\\n#pragma mapbox: define lowp vec4 pattern_to\\n#pragma mapbox: define lowp float pixel_ratio_from\\n#pragma mapbox: define lowp float pixel_ratio_to\\nvoid main() {\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\n#pragma mapbox: initialize mediump vec4 pattern_from\\n#pragma mapbox: initialize mediump vec4 pattern_to\\n#pragma mapbox: initialize lowp float pixel_ratio_from\\n#pragma mapbox: initialize lowp float pixel_ratio_to\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '\\n#define scale 0.015873016\\n#define LINE_DISTANCE_SCALE 2.0\\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\\n#pragma mapbox: define highp vec4 color\\n#pragma mapbox: define lowp float blur\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define mediump float gapwidth\\n#pragma mapbox: define lowp float offset\\n#pragma mapbox: define mediump float width\\n#pragma mapbox: define lowp float floorwidth\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 color\\n#pragma mapbox: initialize lowp float blur\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize mediump float gapwidth\\n#pragma mapbox: initialize lowp float offset\\n#pragma mapbox: initialize mediump float width\\n#pragma mapbox: initialize lowp float floorwidth\\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\\n#ifdef TERRAIN3D\\nv_gamma_scale=1.0;\\n#else\\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\\n#endif\\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\\n#pragma mapbox: define lowp float opacity\\nvoid main() {\\n#pragma mapbox: initialize lowp float opacity\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\\ncamera_to_anchor_distance/u_camera_to_center_distance :\\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#define SDF_PX 8.0\\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\\ncamera_to_anchor_distance/u_camera_to_center_distance :\\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default '#define SDF_PX 8.0\\n#define SDF 1.0\\n#define ICON 0.0\\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\\n#ifdef OVERDRAW_INSPECTOR\\ngl_FragColor=vec4(1.0);\\n#endif\\n}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\\n#pragma mapbox: define highp vec4 fill_color\\n#pragma mapbox: define highp vec4 halo_color\\n#pragma mapbox: define lowp float opacity\\n#pragma mapbox: define lowp float halo_width\\n#pragma mapbox: define lowp float halo_blur\\nvoid main() {\\n#pragma mapbox: initialize highp vec4 fill_color\\n#pragma mapbox: initialize highp vec4 halo_color\\n#pragma mapbox: initialize lowp float opacity\\n#pragma mapbox: initialize lowp float halo_width\\n#pragma mapbox: initialize lowp float halo_blur\\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\\ncamera_to_anchor_distance/u_camera_to_center_distance :\\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}';\n", "// This file is generated. Edit build/generate-shaders.ts, then run `npm run codegen`.\nexport default 'attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}';\n", "\nimport type {Program} from './program';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {Context} from '../gl/context';\n\n/**\n * @internal\n * A vertex array object used to pass data to the webgl code\n */\nexport class VertexArrayObject {\n    context: Context;\n    boundProgram: Program<any>;\n    boundLayoutVertexBuffer: VertexBuffer;\n    boundPaintVertexBuffers: Array<VertexBuffer>;\n    boundIndexBuffer: IndexBuffer;\n    boundVertexOffset: number;\n    boundDynamicVertexBuffer: VertexBuffer;\n    boundDynamicVertexBuffer2: VertexBuffer;\n    boundDynamicVertexBuffer3: VertexBuffer;\n    vao: any;\n\n    constructor() {\n        this.boundProgram = null;\n        this.boundLayoutVertexBuffer = null;\n        this.boundPaintVertexBuffers = [];\n        this.boundIndexBuffer = null;\n        this.boundVertexOffset = null;\n        this.boundDynamicVertexBuffer = null;\n        this.vao = null;\n    }\n\n    bind(context: Context,\n        program: Program<any>,\n        layoutVertexBuffer: VertexBuffer,\n        paintVertexBuffers: Array<VertexBuffer>,\n        indexBuffer?: IndexBuffer | null,\n        vertexOffset?: number | null,\n        dynamicVertexBuffer?: VertexBuffer | null,\n        dynamicVertexBuffer2?: VertexBuffer | null,\n        dynamicVertexBuffer3?: VertexBuffer | null) {\n\n        this.context = context;\n\n        let paintBuffersDiffer = this.boundPaintVertexBuffers.length !== paintVertexBuffers.length;\n        for (let i = 0; !paintBuffersDiffer && i < paintVertexBuffers.length; i++) {\n            if (this.boundPaintVertexBuffers[i] !== paintVertexBuffers[i]) {\n                paintBuffersDiffer = true;\n            }\n        }\n\n        const isFreshBindRequired = (\n            !this.vao ||\n            this.boundProgram !== program ||\n            this.boundLayoutVertexBuffer !== layoutVertexBuffer ||\n            paintBuffersDiffer ||\n            this.boundIndexBuffer !== indexBuffer ||\n            this.boundVertexOffset !== vertexOffset ||\n            this.boundDynamicVertexBuffer !== dynamicVertexBuffer ||\n            this.boundDynamicVertexBuffer2 !== dynamicVertexBuffer2 ||\n            this.boundDynamicVertexBuffer3 !== dynamicVertexBuffer3\n        );\n\n        if (isFreshBindRequired) {\n            this.freshBind(program, layoutVertexBuffer, paintVertexBuffers, indexBuffer, vertexOffset, dynamicVertexBuffer, dynamicVertexBuffer2, dynamicVertexBuffer3);\n        } else {\n            context.bindVertexArray.set(this.vao);\n\n            if (dynamicVertexBuffer) {\n                // The buffer may have been updated. Rebind to upload data.\n                dynamicVertexBuffer.bind();\n            }\n\n            if (indexBuffer && indexBuffer.dynamicDraw) {\n                indexBuffer.bind();\n            }\n\n            if (dynamicVertexBuffer2) {\n                dynamicVertexBuffer2.bind();\n            }\n\n            if (dynamicVertexBuffer3) {\n                dynamicVertexBuffer3.bind();\n            }\n        }\n    }\n\n    freshBind(program: Program<any>,\n        layoutVertexBuffer: VertexBuffer,\n        paintVertexBuffers: Array<VertexBuffer>,\n        indexBuffer?: IndexBuffer | null,\n        vertexOffset?: number | null,\n        dynamicVertexBuffer?: VertexBuffer | null,\n        dynamicVertexBuffer2?: VertexBuffer | null,\n        dynamicVertexBuffer3?: VertexBuffer | null) {\n\n        const numNextAttributes = program.numAttributes;\n\n        const context = this.context;\n        const gl = context.gl;\n\n        if (this.vao) this.destroy();\n        this.vao = context.createVertexArray();\n        context.bindVertexArray.set(this.vao);\n\n        // store the arguments so that we can verify them when the vao is bound again\n        this.boundProgram = program;\n        this.boundLayoutVertexBuffer = layoutVertexBuffer;\n        this.boundPaintVertexBuffers = paintVertexBuffers;\n        this.boundIndexBuffer = indexBuffer;\n        this.boundVertexOffset = vertexOffset;\n        this.boundDynamicVertexBuffer = dynamicVertexBuffer;\n        this.boundDynamicVertexBuffer2 = dynamicVertexBuffer2;\n        this.boundDynamicVertexBuffer3 = dynamicVertexBuffer3;\n\n        layoutVertexBuffer.enableAttributes(gl, program);\n        for (const vertexBuffer of paintVertexBuffers) {\n            vertexBuffer.enableAttributes(gl, program);\n        }\n\n        if (dynamicVertexBuffer) {\n            dynamicVertexBuffer.enableAttributes(gl, program);\n        }\n        if (dynamicVertexBuffer2) {\n            dynamicVertexBuffer2.enableAttributes(gl, program);\n        }\n        if (dynamicVertexBuffer3) {\n            dynamicVertexBuffer3.enableAttributes(gl, program);\n        }\n\n        layoutVertexBuffer.bind();\n        layoutVertexBuffer.setVertexAttribPointers(gl, program, vertexOffset);\n        for (const vertexBuffer of paintVertexBuffers) {\n            vertexBuffer.bind();\n            vertexBuffer.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n\n        if (dynamicVertexBuffer) {\n            dynamicVertexBuffer.bind();\n            dynamicVertexBuffer.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n        if (indexBuffer) {\n            indexBuffer.bind();\n        }\n        if (dynamicVertexBuffer2) {\n            dynamicVertexBuffer2.bind();\n            dynamicVertexBuffer2.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n        if (dynamicVertexBuffer3) {\n            dynamicVertexBuffer3.bind();\n            dynamicVertexBuffer3.setVertexAttribPointers(gl, program, vertexOffset);\n        }\n\n        context.currentNumAttributes = numNextAttributes;\n    }\n\n    destroy() {\n        if (this.vao) {\n            this.context.deleteVertexArray(this.vao);\n            this.vao = null;\n        }\n    }\n}\n", "import {\n    Uniform1i,\n    Uniform1f,\n    Uniform4f,\n    UniformMatrix4f,\n    UniformColor\n} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../../render/uniform_binding';\nimport {mat4} from 'gl-matrix';\nimport {Sky} from '../../style/sky';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\n\nexport type TerrainPreludeUniformsType = {\n    'u_depth': Uniform1i;\n    'u_terrain': Uniform1i;\n    'u_terrain_dim': Uniform1f;\n    'u_terrain_matrix': UniformMatrix4f;\n    'u_terrain_unpack': Uniform4f;\n    'u_terrain_exaggeration': Uniform1f;\n};\n\nexport type TerrainUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_texture': Uniform1i;\n    'u_ele_delta': Uniform1f;\n    'u_fog_matrix': UniformMatrix4f;\n    'u_fog_color': UniformColor;\n    'u_fog_ground_blend': Uniform1f;\n    'u_fog_ground_blend_opacity': Uniform1f;\n    'u_horizon_color': UniformColor;\n    'u_horizon_fog_blend': Uniform1f;\n};\n\nexport type TerrainDepthUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_ele_delta': Uniform1f;\n};\n\nexport type TerrainCoordsUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_texture': Uniform1i;\n    'u_terrain_coords_id': Uniform1f;\n    'u_ele_delta': Uniform1f;\n};\n\nconst terrainPreludeUniforms = (context: Context, locations: UniformLocations): TerrainPreludeUniformsType => ({\n    'u_depth': new Uniform1i(context, locations.u_depth),\n    'u_terrain': new Uniform1i(context, locations.u_terrain),\n    'u_terrain_dim': new Uniform1f(context, locations.u_terrain_dim),\n    'u_terrain_matrix': new UniformMatrix4f(context, locations.u_terrain_matrix),\n    'u_terrain_unpack': new Uniform4f(context, locations.u_terrain_unpack),\n    'u_terrain_exaggeration': new Uniform1f(context, locations.u_terrain_exaggeration)\n});\n\nconst terrainUniforms = (context: Context, locations: UniformLocations): TerrainUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta),\n    'u_fog_matrix': new UniformMatrix4f(context, locations.u_fog_matrix),\n    'u_fog_color': new UniformColor(context, locations.u_fog_color),\n    'u_fog_ground_blend': new Uniform1f(context, locations.u_fog_ground_blend),\n    'u_fog_ground_blend_opacity': new Uniform1f(context, locations.u_fog_ground_blend_opacity),\n    'u_horizon_color': new UniformColor(context, locations.u_horizon_color),\n    'u_horizon_fog_blend': new Uniform1f(context, locations.u_horizon_fog_blend)\n});\n\nconst terrainDepthUniforms = (context: Context, locations: UniformLocations): TerrainDepthUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta)\n});\n\nconst terrainCoordsUniforms = (context: Context, locations: UniformLocations): TerrainCoordsUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_terrain_coords_id': new Uniform1f(context, locations.u_terrain_coords_id),\n    'u_ele_delta': new Uniform1f(context, locations.u_ele_delta)\n});\n\nconst terrainUniformValues = (\n    matrix: mat4,\n    eleDelta: number,\n    fogMatrix: mat4,\n    sky: Sky,\n    pitch: number): UniformValues<TerrainUniformsType> => ({\n    'u_matrix': matrix,\n    'u_texture': 0,\n    'u_ele_delta': eleDelta,\n    'u_fog_matrix': fogMatrix,\n    'u_fog_color': sky ? sky.properties.get('fog-color') : Color.white,\n    'u_fog_ground_blend': sky ? sky.properties.get('fog-ground-blend') : 1,\n    'u_fog_ground_blend_opacity': sky ? sky.calculateFogBlendOpacity(pitch) : 0,\n    'u_horizon_color': sky ? sky.properties.get('horizon-color') : Color.white,\n    'u_horizon_fog_blend': sky ? sky.properties.get('horizon-fog-blend') : 1\n});\n\nconst terrainDepthUniformValues = (\n    matrix: mat4,\n    eleDelta: number\n): UniformValues<TerrainDepthUniformsType> => ({\n    'u_matrix': matrix,\n    'u_ele_delta': eleDelta\n});\n\nconst terrainCoordsUniformValues = (\n    matrix: mat4,\n    coordsId: number,\n    eleDelta: number\n): UniformValues<TerrainCoordsUniformsType> => ({\n    'u_matrix': matrix,\n    'u_terrain_coords_id': coordsId / 255,\n    'u_texture': 0,\n    'u_ele_delta': eleDelta\n});\n\nexport {terrainUniforms, terrainDepthUniforms, terrainCoordsUniforms, terrainPreludeUniforms, terrainUniformValues, terrainDepthUniformValues, terrainCoordsUniformValues};\n", "import {shaders} from '../shaders/shaders';\nimport {ProgramConfiguration} from '../data/program_configuration';\nimport {VertexArrayObject} from './vertex_array_object';\nimport {Context} from '../gl/context';\n\nimport type {SegmentVector} from '../data/segment';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {DepthMode} from '../gl/depth_mode';\nimport type {StencilMode} from '../gl/stencil_mode';\nimport type {ColorMode} from '../gl/color_mode';\nimport type {CullFaceMode} from '../gl/cull_face_mode';\nimport type {UniformBindings, UniformValues, UniformLocations} from './uniform_binding';\nimport type {BinderUniform} from '../data/program_configuration';\nimport {terrainPreludeUniforms, TerrainPreludeUniformsType} from './program/terrain_program';\nimport type {TerrainData} from '../render/terrain';\nimport {Terrain} from '../render/terrain';\n\nexport type DrawMode = WebGLRenderingContextBase['LINES'] | WebGLRenderingContextBase['TRIANGLES'] | WebGL2RenderingContext['LINE_STRIP'];\n\nfunction getTokenizedAttributesAndUniforms(array: Array<string>): Array<string> {\n    const result = [];\n\n    for (let i = 0; i < array.length; i++) {\n        if (array[i] === null) continue;\n        const token = array[i].split(' ');\n        result.push(token.pop());\n    }\n    return result;\n}\n\n/**\n * @internal\n * A webgl program to execute in the GPU space\n */\nexport class Program<Us extends UniformBindings> {\n    program: WebGLProgram;\n    attributes: {[_: string]: number};\n    numAttributes: number;\n    fixedUniforms: Us;\n    terrainUniforms: TerrainPreludeUniformsType;\n    binderUniforms: Array<BinderUniform>;\n    failedToCreate: boolean;\n\n    constructor(context: Context,\n        source: {\n            fragmentSource: string;\n            vertexSource: string;\n            staticAttributes: Array<string>;\n            staticUniforms: Array<string>;\n        },\n        configuration: ProgramConfiguration,\n        fixedUniforms: (b: Context, a: UniformLocations) => Us,\n        showOverdrawInspector: boolean,\n        terrain: Terrain) {\n\n        const gl = context.gl;\n        this.program = gl.createProgram();\n\n        const staticAttrInfo = getTokenizedAttributesAndUniforms(source.staticAttributes);\n        const dynamicAttrInfo = configuration ? configuration.getBinderAttributes() : [];\n        const allAttrInfo = staticAttrInfo.concat(dynamicAttrInfo);\n\n        const preludeUniformsInfo = shaders.prelude.staticUniforms ? getTokenizedAttributesAndUniforms(shaders.prelude.staticUniforms) : [];\n        const staticUniformsInfo = source.staticUniforms ? getTokenizedAttributesAndUniforms(source.staticUniforms) : [];\n        const dynamicUniformsInfo = configuration ? configuration.getBinderUniforms() : [];\n        // remove duplicate uniforms\n        const uniformList = preludeUniformsInfo.concat(staticUniformsInfo).concat(dynamicUniformsInfo);\n        const allUniformsInfo = [];\n        for (const uniform of uniformList) {\n            if (allUniformsInfo.indexOf(uniform) < 0) allUniformsInfo.push(uniform);\n        }\n\n        const defines = configuration ? configuration.defines() : [];\n        if (showOverdrawInspector) {\n            defines.push('#define OVERDRAW_INSPECTOR;');\n        }\n        if (terrain) {\n            defines.push('#define TERRAIN3D;');\n        }\n\n        const fragmentSource = defines.concat(shaders.prelude.fragmentSource, source.fragmentSource).join('\\n');\n        const vertexSource = defines.concat(shaders.prelude.vertexSource, source.vertexSource).join('\\n');\n\n        const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n        if (gl.isContextLost()) {\n            this.failedToCreate = true;\n            return;\n        }\n        gl.shaderSource(fragmentShader, fragmentSource);\n        gl.compileShader(fragmentShader);\n\n        if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {\n            throw new Error(`Could not compile fragment shader: ${gl.getShaderInfoLog(fragmentShader)}`);\n        }\n\n        gl.attachShader(this.program, fragmentShader);\n\n        const vertexShader = gl.createShader(gl.VERTEX_SHADER);\n        if (gl.isContextLost()) {\n            this.failedToCreate = true;\n            return;\n        }\n        gl.shaderSource(vertexShader, vertexSource);\n        gl.compileShader(vertexShader);\n\n        if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {\n            throw new Error(`Could not compile vertex shader: ${gl.getShaderInfoLog(vertexShader)}`);\n        }\n\n        gl.attachShader(this.program, vertexShader);\n\n        this.attributes = {};\n        const uniformLocations = {};\n\n        this.numAttributes = allAttrInfo.length;\n\n        for (let i = 0; i < this.numAttributes; i++) {\n            if (allAttrInfo[i]) {\n                gl.bindAttribLocation(this.program, i, allAttrInfo[i]);\n                this.attributes[allAttrInfo[i]] = i;\n            }\n        }\n\n        gl.linkProgram(this.program);\n\n        if (!gl.getProgramParameter(this.program, gl.LINK_STATUS)) {\n            throw new Error(`Program failed to link: ${gl.getProgramInfoLog(this.program)}`);\n        }\n\n        gl.deleteShader(vertexShader);\n        gl.deleteShader(fragmentShader);\n\n        for (let it = 0; it < allUniformsInfo.length; it++) {\n            const uniform = allUniformsInfo[it];\n            if (uniform && !uniformLocations[uniform]) {\n                const uniformLocation = gl.getUniformLocation(this.program, uniform);\n                if (uniformLocation) {\n                    uniformLocations[uniform] = uniformLocation;\n                }\n            }\n        }\n\n        this.fixedUniforms = fixedUniforms(context, uniformLocations);\n        this.terrainUniforms = terrainPreludeUniforms(context, uniformLocations);\n        this.binderUniforms = configuration ? configuration.getUniforms(context, uniformLocations) : [];\n    }\n\n    draw(context: Context,\n        drawMode: DrawMode,\n        depthMode: Readonly<DepthMode>,\n        stencilMode: Readonly<StencilMode>,\n        colorMode: Readonly<ColorMode>,\n        cullFaceMode: Readonly<CullFaceMode>,\n        uniformValues: UniformValues<Us>,\n        terrain: TerrainData,\n        layerID: string,\n        layoutVertexBuffer: VertexBuffer,\n        indexBuffer: IndexBuffer,\n        segments: SegmentVector,\n        currentProperties?: any,\n        zoom?: number | null,\n        configuration?: ProgramConfiguration | null,\n        dynamicLayoutBuffer?: VertexBuffer | null,\n        dynamicLayoutBuffer2?: VertexBuffer | null,\n        dynamicLayoutBuffer3?: VertexBuffer | null) {\n\n        const gl = context.gl;\n\n        if (this.failedToCreate) return;\n\n        context.program.set(this.program);\n        context.setDepthMode(depthMode);\n        context.setStencilMode(stencilMode);\n        context.setColorMode(colorMode);\n        context.setCullFace(cullFaceMode);\n\n        // set variables used by the 3d functions defined in _prelude.vertex.glsl\n        if (terrain) {\n            context.activeTexture.set(gl.TEXTURE2);\n            gl.bindTexture(gl.TEXTURE_2D, terrain.depthTexture);\n            context.activeTexture.set(gl.TEXTURE3);\n            gl.bindTexture(gl.TEXTURE_2D, terrain.texture);\n            for (const name in this.terrainUniforms) {\n                this.terrainUniforms[name].set(terrain[name]);\n            }\n        }\n\n        for (const name in this.fixedUniforms) {\n            this.fixedUniforms[name].set(uniformValues[name]);\n        }\n\n        if (configuration) {\n            configuration.setUniforms(context, this.binderUniforms, currentProperties, {zoom: (zoom as any)});\n        }\n\n        let primitiveSize = 0;\n        switch (drawMode) {\n            case gl.LINES:\n                primitiveSize = 2;\n                break;\n            case gl.TRIANGLES:\n                primitiveSize = 3;\n                break;\n            case gl.LINE_STRIP:\n                primitiveSize = 1;\n                break;\n        }\n\n        for (const segment of segments.get()) {\n            const vaos = segment.vaos || (segment.vaos = {});\n            const vao: VertexArrayObject = vaos[layerID] || (vaos[layerID] = new VertexArrayObject());\n\n            vao.bind(\n                context,\n                this,\n                layoutVertexBuffer,\n                configuration ? configuration.getPaintVertexBuffers() : [],\n                indexBuffer,\n                segment.vertexOffset,\n                dynamicLayoutBuffer,\n                dynamicLayoutBuffer2,\n                dynamicLayoutBuffer3\n            );\n\n            gl.drawElements(\n                drawMode,\n                segment.primitiveLength * primitiveSize,\n                gl.UNSIGNED_SHORT,\n                segment.primitiveOffset * primitiveSize * 2);\n        }\n    }\n}\n", "import {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f\n} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Painter} from '../painter';\nimport type {OverscaledTileID} from '../../source/tile_id';\nimport type {CrossFaded} from '../../style/properties';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {UniformValues} from '../uniform_binding';\nimport type {Tile} from '../../source/tile';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\n\ntype BackgroundPatternUniformsType = {\n    'u_image': Uniform1i;\n    'u_pattern_tl_a': Uniform2f;\n    'u_pattern_br_a': Uniform2f;\n    'u_pattern_tl_b': Uniform2f;\n    'u_pattern_br_b': Uniform2f;\n    'u_texsize': Uniform2f;\n    'u_mix': Uniform1f;\n    'u_pattern_size_a': Uniform2f;\n    'u_pattern_size_b': Uniform2f;\n    'u_scale_a': Uniform1f;\n    'u_scale_b': Uniform1f;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_tile_units_to_pixels': Uniform1f;\n};\n\nexport type PatternUniformsType = {\n    // pattern uniforms:\n    'u_image': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n};\n\nfunction patternUniformValues(crossfade: CrossfadeParameters, painter: Painter, tile: Tile): UniformValues<PatternUniformsType> {\n\n    const tileRatio = 1 / pixelsToTileUnits(tile, 1, painter.transform.tileZoom);\n\n    const numTiles = Math.pow(2, tile.tileID.overscaledZ);\n    const tileSizeAtNearestZoom = tile.tileSize * Math.pow(2, painter.transform.tileZoom) / numTiles;\n\n    const pixelX = tileSizeAtNearestZoom * (tile.tileID.canonical.x + tile.tileID.wrap * numTiles);\n    const pixelY = tileSizeAtNearestZoom * tile.tileID.canonical.y;\n\n    return {\n        'u_image': 0,\n        'u_texsize': tile.imageAtlasTexture.size,\n        'u_scale': [tileRatio, crossfade.fromScale, crossfade.toScale],\n        'u_fade': crossfade.t,\n        // split the pixel coord into two pairs of 16 bit numbers. The glsl spec only guarantees 16 bits of precision.\n        'u_pixel_coord_upper': [pixelX >> 16, pixelY >> 16],\n        'u_pixel_coord_lower': [pixelX & 0xFFFF, pixelY & 0xFFFF]\n    };\n}\n\nfunction bgPatternUniformValues(\n    image: CrossFaded<ResolvedImage>,\n    crossfade: CrossfadeParameters,\n    painter: Painter,\n    tile: {\n        tileID: OverscaledTileID;\n        tileSize: number;\n    }\n): UniformValues<BackgroundPatternUniformsType> {\n    const imagePosA = painter.imageManager.getPattern(image.from.toString());\n    const imagePosB = painter.imageManager.getPattern(image.to.toString());\n    const {width, height} = painter.imageManager.getPixelSize();\n\n    const numTiles = Math.pow(2, tile.tileID.overscaledZ);\n    const tileSizeAtNearestZoom = tile.tileSize * Math.pow(2, painter.transform.tileZoom) / numTiles;\n\n    const pixelX = tileSizeAtNearestZoom * (tile.tileID.canonical.x + tile.tileID.wrap * numTiles);\n    const pixelY = tileSizeAtNearestZoom * tile.tileID.canonical.y;\n\n    return {\n        'u_image': 0,\n        'u_pattern_tl_a': (imagePosA as any).tl,\n        'u_pattern_br_a': (imagePosA as any).br,\n        'u_pattern_tl_b': (imagePosB as any).tl,\n        'u_pattern_br_b': (imagePosB as any).br,\n        'u_texsize': [width, height],\n        'u_mix': crossfade.t,\n        'u_pattern_size_a': (imagePosA as any).displaySize,\n        'u_pattern_size_b': (imagePosB as any).displaySize,\n        'u_scale_a': crossfade.fromScale,\n        'u_scale_b': crossfade.toScale,\n        'u_tile_units_to_pixels': 1 / pixelsToTileUnits(tile, 1, painter.transform.tileZoom),\n        // split the pixel coord into two pairs of 16 bit numbers. The glsl spec only guarantees 16 bits of precision.\n        'u_pixel_coord_upper': [pixelX >> 16, pixelY >> 16],\n        'u_pixel_coord_lower': [pixelX & 0xFFFF, pixelY & 0xFFFF]\n    };\n}\nexport {bgPatternUniformValues, patternUniformValues};\n", "import {patternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f,\n    UniformMatrix4f\n} from '../uniform_binding';\n\nimport {mat3, mat4, vec3} from 'gl-matrix';\nimport {extend} from '../../util/util';\n\nimport type {Context} from '../../gl/context';\nimport type {Painter} from '../painter';\nimport type {OverscaledTileID} from '../../source/tile_id';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {Tile} from '../../source/tile';\n\nexport type FillExtrusionUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_lightpos': Uniform3f;\n    'u_lightintensity': Uniform1f;\n    'u_lightcolor': Uniform3f;\n    'u_vertical_gradient': Uniform1f;\n    'u_opacity': Uniform1f;\n};\n\nexport type FillExtrusionPatternUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_lightpos': Uniform3f;\n    'u_lightintensity': Uniform1f;\n    'u_lightcolor': Uniform3f;\n    'u_height_factor': Uniform1f;\n    'u_vertical_gradient': Uniform1f;\n    // pattern uniforms:\n    'u_texsize': Uniform2f;\n    'u_image': Uniform1i;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n    'u_opacity': Uniform1f;\n};\n\nconst fillExtrusionUniforms = (context: Context, locations: UniformLocations): FillExtrusionUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_lightpos': new Uniform3f(context, locations.u_lightpos),\n    'u_lightintensity': new Uniform1f(context, locations.u_lightintensity),\n    'u_lightcolor': new Uniform3f(context, locations.u_lightcolor),\n    'u_vertical_gradient': new Uniform1f(context, locations.u_vertical_gradient),\n    'u_opacity': new Uniform1f(context, locations.u_opacity)\n});\n\nconst fillExtrusionPatternUniforms = (context: Context, locations: UniformLocations): FillExtrusionPatternUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_lightpos': new Uniform3f(context, locations.u_lightpos),\n    'u_lightintensity': new Uniform1f(context, locations.u_lightintensity),\n    'u_lightcolor': new Uniform3f(context, locations.u_lightcolor),\n    'u_vertical_gradient': new Uniform1f(context, locations.u_vertical_gradient),\n    'u_height_factor': new Uniform1f(context, locations.u_height_factor),\n    // pattern uniforms\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade),\n    'u_opacity': new Uniform1f(context, locations.u_opacity)\n});\n\nconst fillExtrusionUniformValues = (\n    matrix: mat4,\n    painter: Painter,\n    shouldUseVerticalGradient: boolean,\n    opacity: number\n): UniformValues<FillExtrusionUniformsType> => {\n    const light = painter.style.light;\n    const _lp = light.properties.get('position');\n    const lightPos = [_lp.x, _lp.y, _lp.z] as vec3;\n    const lightMat = mat3.create();\n    if (light.properties.get('anchor') === 'viewport') {\n        mat3.fromRotation(lightMat, -painter.transform.angle);\n    }\n    vec3.transformMat3(lightPos, lightPos, lightMat);\n\n    const lightColor = light.properties.get('color');\n\n    return {\n        'u_matrix': matrix,\n        'u_lightpos': lightPos,\n        'u_lightintensity': light.properties.get('intensity'),\n        'u_lightcolor': [lightColor.r, lightColor.g, lightColor.b],\n        'u_vertical_gradient': +shouldUseVerticalGradient,\n        'u_opacity': opacity\n    };\n};\n\nconst fillExtrusionPatternUniformValues = (\n    matrix: mat4,\n    painter: Painter,\n    shouldUseVerticalGradient: boolean,\n    opacity: number,\n    coord: OverscaledTileID,\n    crossfade: CrossfadeParameters,\n    tile: Tile\n): UniformValues<FillExtrusionPatternUniformsType> => {\n    return extend(fillExtrusionUniformValues(matrix, painter, shouldUseVerticalGradient, opacity),\n        patternUniformValues(crossfade, painter, tile),\n        {\n            'u_height_factor': -Math.pow(2, coord.overscaledZ) / tile.tileSize / 8\n        });\n};\n\nexport {\n    fillExtrusionUniforms,\n    fillExtrusionPatternUniforms,\n    fillExtrusionUniformValues,\n    fillExtrusionPatternUniformValues\n};\n", "import * as glMatrix from \"./common.js\";\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(9);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n    out[3] = 0;\n    out[5] = 0;\n    out[6] = 0;\n    out[7] = 0;\n  }\n\n  out[0] = 1;\n  out[4] = 1;\n  out[8] = 1;\n  return out;\n}\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a   the source 4x4 matrix\n * @returns {mat3} out\n */\n\nexport function fromMat4(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[4];\n  out[4] = a[5];\n  out[5] = a[6];\n  out[6] = a[8];\n  out[7] = a[9];\n  out[8] = a[10];\n  return out;\n}\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(9);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  out[4] = a[4];\n  out[5] = a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\n\nexport function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n  var out = new glMatrix.ARRAY_TYPE(9);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m10;\n  out[4] = m11;\n  out[5] = m12;\n  out[6] = m20;\n  out[7] = m21;\n  out[8] = m22;\n  return out;\n}\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\n\nexport function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m02;\n  out[3] = m10;\n  out[4] = m11;\n  out[5] = m12;\n  out[6] = m20;\n  out[7] = m21;\n  out[8] = m22;\n  return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 1;\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache some values\n  if (out === a) {\n    var a01 = a[1],\n        a02 = a[2],\n        a12 = a[5];\n    out[1] = a[3];\n    out[2] = a[6];\n    out[3] = a01;\n    out[5] = a[7];\n    out[6] = a02;\n    out[7] = a12;\n  } else {\n    out[0] = a[0];\n    out[1] = a[3];\n    out[2] = a[6];\n    out[3] = a[1];\n    out[4] = a[4];\n    out[5] = a[7];\n    out[6] = a[2];\n    out[7] = a[5];\n    out[8] = a[8];\n  }\n\n  return out;\n}\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function invert(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2];\n  var a10 = a[3],\n      a11 = a[4],\n      a12 = a[5];\n  var a20 = a[6],\n      a21 = a[7],\n      a22 = a[8];\n  var b01 = a22 * a11 - a12 * a21;\n  var b11 = -a22 * a10 + a12 * a20;\n  var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n  var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n  if (!det) {\n    return null;\n  }\n\n  det = 1.0 / det;\n  out[0] = b01 * det;\n  out[1] = (-a22 * a01 + a02 * a21) * det;\n  out[2] = (a12 * a01 - a02 * a11) * det;\n  out[3] = b11 * det;\n  out[4] = (a22 * a00 - a02 * a20) * det;\n  out[5] = (-a12 * a00 + a02 * a10) * det;\n  out[6] = b21 * det;\n  out[7] = (-a21 * a00 + a01 * a20) * det;\n  out[8] = (a11 * a00 - a01 * a10) * det;\n  return out;\n}\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nexport function adjoint(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2];\n  var a10 = a[3],\n      a11 = a[4],\n      a12 = a[5];\n  var a20 = a[6],\n      a21 = a[7],\n      a22 = a[8];\n  out[0] = a11 * a22 - a12 * a21;\n  out[1] = a02 * a21 - a01 * a22;\n  out[2] = a01 * a12 - a02 * a11;\n  out[3] = a12 * a20 - a10 * a22;\n  out[4] = a00 * a22 - a02 * a20;\n  out[5] = a02 * a10 - a00 * a12;\n  out[6] = a10 * a21 - a11 * a20;\n  out[7] = a01 * a20 - a00 * a21;\n  out[8] = a00 * a11 - a01 * a10;\n  return out;\n}\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2];\n  var a10 = a[3],\n      a11 = a[4],\n      a12 = a[5];\n  var a20 = a[6],\n      a21 = a[7],\n      a22 = a[8];\n  return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function multiply(out, a, b) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2];\n  var a10 = a[3],\n      a11 = a[4],\n      a12 = a[5];\n  var a20 = a[6],\n      a21 = a[7],\n      a22 = a[8];\n  var b00 = b[0],\n      b01 = b[1],\n      b02 = b[2];\n  var b10 = b[3],\n      b11 = b[4],\n      b12 = b[5];\n  var b20 = b[6],\n      b21 = b[7],\n      b22 = b[8];\n  out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n  out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n  out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n  out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n  out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n  out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n  out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n  out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n  out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n  return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\nexport function translate(out, a, v) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a10 = a[3],\n      a11 = a[4],\n      a12 = a[5],\n      a20 = a[6],\n      a21 = a[7],\n      a22 = a[8],\n      x = v[0],\n      y = v[1];\n  out[0] = a00;\n  out[1] = a01;\n  out[2] = a02;\n  out[3] = a10;\n  out[4] = a11;\n  out[5] = a12;\n  out[6] = x * a00 + y * a10 + a20;\n  out[7] = x * a01 + y * a11 + a21;\n  out[8] = x * a02 + y * a12 + a22;\n  return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nexport function rotate(out, a, rad) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a10 = a[3],\n      a11 = a[4],\n      a12 = a[5],\n      a20 = a[6],\n      a21 = a[7],\n      a22 = a[8],\n      s = Math.sin(rad),\n      c = Math.cos(rad);\n  out[0] = c * a00 + s * a10;\n  out[1] = c * a01 + s * a11;\n  out[2] = c * a02 + s * a12;\n  out[3] = c * a10 - s * a00;\n  out[4] = c * a11 - s * a01;\n  out[5] = c * a12 - s * a02;\n  out[6] = a20;\n  out[7] = a21;\n  out[8] = a22;\n  return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\nexport function scale(out, a, v) {\n  var x = v[0],\n      y = v[1];\n  out[0] = x * a[0];\n  out[1] = x * a[1];\n  out[2] = x * a[2];\n  out[3] = y * a[3];\n  out[4] = y * a[4];\n  out[5] = y * a[5];\n  out[6] = a[6];\n  out[7] = a[7];\n  out[8] = a[8];\n  return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n *     mat3.identity(dest);\n *     mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\n\nexport function fromTranslation(out, v) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = 1;\n  out[5] = 0;\n  out[6] = v[0];\n  out[7] = v[1];\n  out[8] = 1;\n  return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n *     mat3.identity(dest);\n *     mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nexport function fromRotation(out, rad) {\n  var s = Math.sin(rad),\n      c = Math.cos(rad);\n  out[0] = c;\n  out[1] = s;\n  out[2] = 0;\n  out[3] = -s;\n  out[4] = c;\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n *     mat3.identity(dest);\n *     mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\n\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = v[1];\n  out[5] = 0;\n  out[6] = 0;\n  out[7] = 0;\n  out[8] = 1;\n  return out;\n}\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\n\nexport function fromMat2d(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = 0;\n  out[3] = a[2];\n  out[4] = a[3];\n  out[5] = 0;\n  out[6] = a[4];\n  out[7] = a[5];\n  out[8] = 1;\n  return out;\n}\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\n\nexport function fromQuat(out, q) {\n  var x = q[0],\n      y = q[1],\n      z = q[2],\n      w = q[3];\n  var x2 = x + x;\n  var y2 = y + y;\n  var z2 = z + z;\n  var xx = x * x2;\n  var yx = y * x2;\n  var yy = y * y2;\n  var zx = z * x2;\n  var zy = z * y2;\n  var zz = z * z2;\n  var wx = w * x2;\n  var wy = w * y2;\n  var wz = w * z2;\n  out[0] = 1 - yy - zz;\n  out[3] = yx - wz;\n  out[6] = zx + wy;\n  out[1] = yx + wz;\n  out[4] = 1 - xx - zz;\n  out[7] = zy - wx;\n  out[2] = zx - wy;\n  out[5] = zy + wx;\n  out[8] = 1 - xx - yy;\n  return out;\n}\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\n\nexport function normalFromMat4(out, a) {\n  var a00 = a[0],\n      a01 = a[1],\n      a02 = a[2],\n      a03 = a[3];\n  var a10 = a[4],\n      a11 = a[5],\n      a12 = a[6],\n      a13 = a[7];\n  var a20 = a[8],\n      a21 = a[9],\n      a22 = a[10],\n      a23 = a[11];\n  var a30 = a[12],\n      a31 = a[13],\n      a32 = a[14],\n      a33 = a[15];\n  var b00 = a00 * a11 - a01 * a10;\n  var b01 = a00 * a12 - a02 * a10;\n  var b02 = a00 * a13 - a03 * a10;\n  var b03 = a01 * a12 - a02 * a11;\n  var b04 = a01 * a13 - a03 * a11;\n  var b05 = a02 * a13 - a03 * a12;\n  var b06 = a20 * a31 - a21 * a30;\n  var b07 = a20 * a32 - a22 * a30;\n  var b08 = a20 * a33 - a23 * a30;\n  var b09 = a21 * a32 - a22 * a31;\n  var b10 = a21 * a33 - a23 * a31;\n  var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n  var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n  if (!det) {\n    return null;\n  }\n\n  det = 1.0 / det;\n  out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n  out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n  out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n  out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n  out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n  out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n  out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n  out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n  out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n  return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\nexport function projection(out, width, height) {\n  out[0] = 2 / width;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 0;\n  out[4] = -2 / height;\n  out[5] = 0;\n  out[6] = -1;\n  out[7] = 1;\n  out[8] = 1;\n  return out;\n}\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n  return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n  return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  out[4] = a[4] + b[4];\n  out[5] = a[5] + b[5];\n  out[6] = a[6] + b[6];\n  out[7] = a[7] + b[7];\n  out[8] = a[8] + b[8];\n  return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  out[4] = a[4] - b[4];\n  out[5] = a[5] - b[5];\n  out[6] = a[6] - b[6];\n  out[7] = a[7] - b[7];\n  out[8] = a[8] - b[8];\n  return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\n\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  out[4] = a[4] * b;\n  out[5] = a[5] * b;\n  out[6] = a[6] * b;\n  out[7] = a[7] * b;\n  out[8] = a[8] * b;\n  return out;\n}\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  out[4] = a[4] + b[4] * scale;\n  out[5] = a[5] + b[5] * scale;\n  out[6] = a[6] + b[6] * scale;\n  out[7] = a[7] + b[7] * scale;\n  out[8] = a[8] + b[8] * scale;\n  return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3],\n      a4 = a[4],\n      a5 = a[5],\n      a6 = a[6],\n      a7 = a[7],\n      a8 = a[8];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3],\n      b4 = b[4],\n      b5 = b[5],\n      b6 = b[6],\n      b7 = b[7],\n      b8 = b[8];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\n\nexport var sub = subtract;", "import {patternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    Uniform3f,\n    UniformMatrix4f\n} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Painter} from '../painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {Tile} from '../../source/tile';\nimport {mat4} from 'gl-matrix';\n\nexport type FillUniformsType = {\n    'u_matrix': UniformMatrix4f;\n};\n\nexport type FillOutlineUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_world': Uniform2f;\n};\n\nexport type FillPatternUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    // pattern uniforms:\n    'u_texsize': Uniform2f;\n    'u_image': Uniform1i;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n};\n\nexport type FillOutlinePatternUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_world': Uniform2f;\n    // pattern uniforms:\n    'u_texsize': Uniform2f;\n    'u_image': Uniform1i;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n};\n\nconst fillUniforms = (context: Context, locations: UniformLocations): FillUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix)\n});\n\nconst fillPatternUniforms = (context: Context, locations: UniformLocations): FillPatternUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade)\n});\n\nconst fillOutlineUniforms = (context: Context, locations: UniformLocations): FillOutlineUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_world': new Uniform2f(context, locations.u_world)\n});\n\nconst fillOutlinePatternUniforms = (context: Context, locations: UniformLocations): FillOutlinePatternUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_world': new Uniform2f(context, locations.u_world),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade)\n});\n\nconst fillUniformValues = (matrix: mat4): UniformValues<FillUniformsType> => ({\n    'u_matrix': matrix\n});\n\nconst fillPatternUniformValues = (\n    matrix: mat4,\n    painter: Painter,\n    crossfade: CrossfadeParameters,\n    tile: Tile\n): UniformValues<FillPatternUniformsType> => extend(\n    fillUniformValues(matrix),\n    patternUniformValues(crossfade, painter, tile)\n);\n\nconst fillOutlineUniformValues = (matrix: mat4, drawingBufferSize: [number, number]): UniformValues<FillOutlineUniformsType> => ({\n    'u_matrix': matrix,\n    'u_world': drawingBufferSize\n});\n\nconst fillOutlinePatternUniformValues = (\n    matrix: mat4,\n    painter: Painter,\n    crossfade: CrossfadeParameters,\n    tile: Tile,\n    drawingBufferSize: [number, number]\n): UniformValues<FillOutlinePatternUniformsType> => extend(\n    fillPatternUniformValues(matrix, painter, crossfade, tile),\n    {\n        'u_world': drawingBufferSize\n    }\n);\n\nexport {\n    fillUniforms,\n    fillPatternUniforms,\n    fillOutlineUniforms,\n    fillOutlinePatternUniforms,\n    fillUniformValues,\n    fillPatternUniformValues,\n    fillOutlineUniformValues,\n    fillOutlinePatternUniformValues\n};\n", "import {Uniform1i, Uniform1f, Uniform2f, UniformMatrix4f} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {OverscaledTileID} from '../../source/tile_id';\nimport type {Tile} from '../../source/tile';\nimport type {CircleStyleLayer} from '../../style/style_layer/circle_style_layer';\nimport type {Painter} from '../painter';\n\nexport type CircleUniformsType = {\n    'u_camera_to_center_distance': Uniform1f;\n    'u_scale_with_map': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_extrude_scale': Uniform2f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_matrix': UniformMatrix4f;\n};\n\nconst circleUniforms = (context: Context, locations: UniformLocations): CircleUniformsType => ({\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_scale_with_map': new Uniform1i(context, locations.u_scale_with_map),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_extrude_scale': new Uniform2f(context, locations.u_extrude_scale),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix)\n});\n\nconst circleUniformValues = (\n    painter: Painter,\n    coord: OverscaledTileID,\n    tile: Tile,\n    layer: CircleStyleLayer\n): UniformValues<CircleUniformsType> => {\n    const transform = painter.transform;\n\n    let pitchWithMap: boolean, extrudeScale: [number, number];\n    if (layer.paint.get('circle-pitch-alignment') === 'map') {\n        const pixelRatio = pixelsToTileUnits(tile, 1, transform.zoom);\n        pitchWithMap = true;\n        extrudeScale = [pixelRatio, pixelRatio];\n    } else {\n        pitchWithMap = false;\n        extrudeScale = transform.pixelsToGLUnits;\n    }\n\n    return {\n        'u_camera_to_center_distance': transform.cameraToCenterDistance,\n        'u_scale_with_map': +(layer.paint.get('circle-pitch-scale') === 'map'),\n        'u_matrix': painter.translatePosMatrix(\n            coord.posMatrix,\n            tile,\n            layer.paint.get('circle-translate'),\n            layer.paint.get('circle-translate-anchor')),\n        'u_pitch_with_map': +(pitchWithMap),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_extrude_scale': extrudeScale\n    };\n};\n\nexport {circleUniforms, circleUniformValues};\n", "import {Uniform1f, Uniform2f, UniformMatrix4f} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Transform} from '../../geo/transform';\nimport {mat4} from 'gl-matrix';\n\nexport type CollisionUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_pixel_extrude_scale': Uniform2f;\n};\n\nexport type CollisionCircleUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_inv_matrix': UniformMatrix4f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_viewport_size': Uniform2f;\n};\n\nconst collisionUniforms = (context: Context, locations: UniformLocations): CollisionUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_pixel_extrude_scale': new Uniform2f(context, locations.u_pixel_extrude_scale)\n});\n\nconst collisionCircleUniforms = (context: Context, locations: UniformLocations): CollisionCircleUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_inv_matrix': new UniformMatrix4f(context, locations.u_inv_matrix),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_viewport_size': new Uniform2f(context, locations.u_viewport_size)\n});\n\nconst collisionUniformValues = (transform: {width: number; height: number}, matrix: mat4): UniformValues<CollisionUniformsType> => {\n    return {\n        'u_matrix': matrix,\n        'u_pixel_extrude_scale': [1.0 / transform.width, 1.0 / transform.height],\n    };\n};\n\nconst collisionCircleUniformValues = (matrix: mat4, invMatrix: mat4, transform: Transform): UniformValues<CollisionCircleUniformsType> => {\n    return {\n        'u_matrix': matrix,\n        'u_inv_matrix': invMatrix,\n        'u_camera_to_center_distance': transform.cameraToCenterDistance,\n        'u_viewport_size': [transform.width, transform.height]\n    };\n};\n\nexport {collisionUniforms, collisionUniformValues, collisionCircleUniforms, collisionCircleUniformValues};\n", "import {UniformColor, UniformMatrix4f, Uniform1i, Uniform1f} from '../uniform_binding';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {mat4} from 'gl-matrix';\n\nexport type DebugUniformsType = {\n    'u_color': UniformColor;\n    'u_matrix': UniformMatrix4f;\n    'u_overlay': Uniform1i;\n    'u_overlay_scale': Uniform1f;\n};\n\nconst debugUniforms = (context: Context, locations: UniformLocations): DebugUniformsType => ({\n    'u_color': new UniformColor(context, locations.u_color),\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_overlay': new Uniform1i(context, locations.u_overlay),\n    'u_overlay_scale': new Uniform1f(context, locations.u_overlay_scale)\n});\n\nconst debugUniformValues = (matrix: mat4, color: Color, scaleRatio: number = 1): UniformValues<DebugUniformsType> => ({\n    'u_matrix': matrix,\n    'u_color': color,\n    'u_overlay': 0,\n    'u_overlay_scale': scaleRatio\n});\n\nexport {debugUniforms, debugUniformValues};\n", "import {UniformMatrix4f} from '../uniform_binding';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {mat4} from 'gl-matrix';\n\nexport type ClippingMaskUniformsType = {\n    'u_matrix': UniformMatrix4f;\n};\n\nconst clippingMaskUniforms = (context: Context, locations: UniformLocations): ClippingMaskUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix)\n});\n\nconst clippingMaskUniformValues = (matrix: mat4): UniformValues<ClippingMaskUniformsType> => ({\n    'u_matrix': matrix\n});\n\nexport {clippingMaskUniforms, clippingMaskUniformValues};\n", "import {mat4} from 'gl-matrix';\n\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    UniformMatrix4f\n} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\n\nimport type {Context} from '../../gl/context';\nimport type {Tile} from '../../source/tile';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Painter} from '../painter';\nimport type {HeatmapStyleLayer} from '../../style/style_layer/heatmap_style_layer';\n\nexport type HeatmapUniformsType = {\n    'u_extrude_scale': Uniform1f;\n    'u_intensity': Uniform1f;\n    'u_matrix': UniformMatrix4f;\n};\n\nexport type HeatmapTextureUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_world': Uniform2f;\n    'u_image': Uniform1i;\n    'u_color_ramp': Uniform1i;\n    'u_opacity': Uniform1f;\n};\n\nconst heatmapUniforms = (context: Context, locations: UniformLocations): HeatmapUniformsType => ({\n    'u_extrude_scale': new Uniform1f(context, locations.u_extrude_scale),\n    'u_intensity': new Uniform1f(context, locations.u_intensity),\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix)\n});\n\nconst heatmapTextureUniforms = (context: Context, locations: UniformLocations): HeatmapTextureUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_world': new Uniform2f(context, locations.u_world),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_color_ramp': new Uniform1i(context, locations.u_color_ramp),\n    'u_opacity': new Uniform1f(context, locations.u_opacity)\n});\n\nconst heatmapUniformValues = (matrix: mat4, tile: Tile, zoom: number, intensity: number): UniformValues<HeatmapUniformsType> => ({\n    'u_matrix': matrix,\n    'u_extrude_scale': pixelsToTileUnits(tile, 1, zoom),\n    'u_intensity': intensity\n});\n\nconst heatmapTextureUniformValues = (\n    painter: Painter,\n    layer: HeatmapStyleLayer,\n    textureUnit: number,\n    colorRampUnit: number\n): UniformValues<HeatmapTextureUniformsType> => {\n    const matrix = mat4.create();\n    mat4.ortho(matrix, 0, painter.width, painter.height, 0, 0, 1);\n\n    const gl = painter.context.gl;\n\n    return {\n        'u_matrix': matrix,\n        'u_world': [gl.drawingBufferWidth, gl.drawingBufferHeight],\n        'u_image': textureUnit,\n        'u_color_ramp': colorRampUnit,\n        'u_opacity': layer.paint.get('heatmap-opacity')\n    };\n};\n\nexport {\n    heatmapUniforms,\n    heatmapTextureUniforms,\n    heatmapUniformValues,\n    heatmapTextureUniformValues\n};\n", "import {mat4} from 'gl-matrix';\n\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    UniformColor,\n    UniformMatrix4f,\n    Uniform4f\n} from '../uniform_binding';\nimport {EXTENT} from '../../data/extent';\nimport {MercatorCoordinate} from '../../geo/mercator_coordinate';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Tile} from '../../source/tile';\nimport type {Painter} from '../painter';\nimport type {HillshadeStyleLayer} from '../../style/style_layer/hillshade_style_layer';\nimport type {DEMData} from '../../data/dem_data';\nimport type {OverscaledTileID} from '../../source/tile_id';\n\nexport type HillshadeUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_image': Uniform1i;\n    'u_latrange': Uniform2f;\n    'u_light': Uniform2f;\n    'u_shadow': UniformColor;\n    'u_highlight': UniformColor;\n    'u_accent': UniformColor;\n};\n\nexport type HillshadePrepareUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_image': Uniform1i;\n    'u_dimension': Uniform2f;\n    'u_zoom': Uniform1f;\n    'u_unpack': Uniform4f;\n};\n\nconst hillshadeUniforms = (context: Context, locations: UniformLocations): HillshadeUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_latrange': new Uniform2f(context, locations.u_latrange),\n    'u_light': new Uniform2f(context, locations.u_light),\n    'u_shadow': new UniformColor(context, locations.u_shadow),\n    'u_highlight': new UniformColor(context, locations.u_highlight),\n    'u_accent': new UniformColor(context, locations.u_accent)\n});\n\nconst hillshadePrepareUniforms = (context: Context, locations: UniformLocations): HillshadePrepareUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_dimension': new Uniform2f(context, locations.u_dimension),\n    'u_zoom': new Uniform1f(context, locations.u_zoom),\n    'u_unpack': new Uniform4f(context, locations.u_unpack)\n});\n\nconst hillshadeUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: HillshadeStyleLayer,\n    coord: OverscaledTileID\n): UniformValues<HillshadeUniformsType> => {\n    const shadow = layer.paint.get('hillshade-shadow-color');\n    const highlight = layer.paint.get('hillshade-highlight-color');\n    const accent = layer.paint.get('hillshade-accent-color');\n\n    let azimuthal = layer.paint.get('hillshade-illumination-direction') * (Math.PI / 180);\n    // modify azimuthal angle by map rotation if light is anchored at the viewport\n    if (layer.paint.get('hillshade-illumination-anchor') === 'viewport') {\n        azimuthal -= painter.transform.angle;\n    }\n    const align = !painter.options.moving;\n    return {\n        'u_matrix': coord ? coord.posMatrix : painter.transform.calculatePosMatrix(tile.tileID.toUnwrapped(), align),\n        'u_image': 0,\n        'u_latrange': getTileLatRange(painter, tile.tileID),\n        'u_light': [layer.paint.get('hillshade-exaggeration'), azimuthal],\n        'u_shadow': shadow,\n        'u_highlight': highlight,\n        'u_accent': accent\n    };\n};\n\nconst hillshadeUniformPrepareValues = (tileID: OverscaledTileID, dem: DEMData): UniformValues<HillshadePrepareUniformsType> => {\n\n    const stride = dem.stride;\n    const matrix = mat4.create();\n    // Flip rendering at y axis.\n    mat4.ortho(matrix, 0, EXTENT, -EXTENT, 0, 0, 1);\n    mat4.translate(matrix, matrix, [0, -EXTENT, 0]);\n\n    return {\n        'u_matrix': matrix,\n        'u_image': 1,\n        'u_dimension': [stride, stride],\n        'u_zoom': tileID.overscaledZ,\n        'u_unpack': dem.getUnpackVector()\n    };\n};\n\nfunction getTileLatRange(painter: Painter, tileID: OverscaledTileID) {\n    // for scaling the magnitude of a points slope by its latitude\n    const tilesAtZoom = Math.pow(2, tileID.canonical.z);\n    const y = tileID.canonical.y;\n    return [\n        new MercatorCoordinate(0, y / tilesAtZoom).toLngLat().lat,\n        new MercatorCoordinate(0, (y + 1) / tilesAtZoom).toLngLat().lat];\n}\n\nexport {\n    hillshadeUniforms,\n    hillshadePrepareUniforms,\n    hillshadeUniformValues,\n    hillshadeUniformPrepareValues\n};\n", "import {Uniform1i, Uniform1f, Uniform2f, Uniform3f, UniformMatrix4f} from '../uniform_binding';\nimport {pixelsToTileUnits} from '../../source/pixels_to_tile_units';\nimport {extend} from '../../util/util';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Transform} from '../../geo/transform';\nimport type {Tile} from '../../source/tile';\nimport type {CrossFaded} from '../../style/properties';\nimport type {LineStyleLayer} from '../../style/style_layer/line_style_layer';\nimport type {Painter} from '../painter';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport {OverscaledTileID} from '../../source/tile_id';\n\nexport type LineUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n};\n\nexport type LineGradientUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_image': Uniform1i;\n    'u_image_height': Uniform1f;\n};\n\nexport type LinePatternUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_texsize': Uniform2f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_image': Uniform1i;\n    'u_scale': Uniform3f;\n    'u_fade': Uniform1f;\n};\n\nexport type LineSDFUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_ratio': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_units_to_pixels': Uniform2f;\n    'u_patternscale_a': Uniform2f;\n    'u_patternscale_b': Uniform2f;\n    'u_sdfgamma': Uniform1f;\n    'u_image': Uniform1i;\n    'u_tex_y_a': Uniform1f;\n    'u_tex_y_b': Uniform1f;\n    'u_mix': Uniform1f;\n};\n\nconst lineUniforms = (context: Context, locations: UniformLocations): LineUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels)\n});\n\nconst lineGradientUniforms = (context: Context, locations: UniformLocations): LineGradientUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_image_height': new Uniform1f(context, locations.u_image_height)\n});\n\nconst linePatternUniforms = (context: Context, locations: UniformLocations): LinePatternUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_scale': new Uniform3f(context, locations.u_scale),\n    'u_fade': new Uniform1f(context, locations.u_fade)\n});\n\nconst lineSDFUniforms = (context: Context, locations: UniformLocations): LineSDFUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_ratio': new Uniform1f(context, locations.u_ratio),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_units_to_pixels': new Uniform2f(context, locations.u_units_to_pixels),\n    'u_patternscale_a': new Uniform2f(context, locations.u_patternscale_a),\n    'u_patternscale_b': new Uniform2f(context, locations.u_patternscale_b),\n    'u_sdfgamma': new Uniform1f(context, locations.u_sdfgamma),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_tex_y_a': new Uniform1f(context, locations.u_tex_y_a),\n    'u_tex_y_b': new Uniform1f(context, locations.u_tex_y_b),\n    'u_mix': new Uniform1f(context, locations.u_mix)\n});\n\nconst lineUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    coord: OverscaledTileID\n): UniformValues<LineUniformsType> => {\n    const transform = painter.transform;\n\n    return {\n        'u_matrix': calculateMatrix(painter, tile, layer, coord),\n        'u_ratio': 1 / pixelsToTileUnits(tile, 1, transform.zoom),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_units_to_pixels': [\n            1 / transform.pixelsToGLUnits[0],\n            1 / transform.pixelsToGLUnits[1]\n        ]\n    };\n};\n\nconst lineGradientUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    imageHeight: number,\n    coord: OverscaledTileID\n): UniformValues<LineGradientUniformsType> => {\n    return extend(lineUniformValues(painter, tile, layer, coord), {\n        'u_image': 0,\n        'u_image_height': imageHeight,\n    });\n};\n\nconst linePatternUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    crossfade: CrossfadeParameters,\n    coord: OverscaledTileID\n): UniformValues<LinePatternUniformsType> => {\n    const transform = painter.transform;\n    const tileZoomRatio = calculateTileRatio(tile, transform);\n    return {\n        'u_matrix': calculateMatrix(painter, tile, layer, coord),\n        'u_texsize': tile.imageAtlasTexture.size,\n        // camera zoom ratio\n        'u_ratio': 1 / pixelsToTileUnits(tile, 1, transform.zoom),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_image': 0,\n        'u_scale': [tileZoomRatio, crossfade.fromScale, crossfade.toScale],\n        'u_fade': crossfade.t,\n        'u_units_to_pixels': [\n            1 / transform.pixelsToGLUnits[0],\n            1 / transform.pixelsToGLUnits[1]\n        ]\n    };\n};\n\nconst lineSDFUniformValues = (\n    painter: Painter,\n    tile: Tile,\n    layer: LineStyleLayer,\n    dasharray: CrossFaded<Array<number>>,\n    crossfade: CrossfadeParameters,\n    coord: OverscaledTileID\n): UniformValues<LineSDFUniformsType> => {\n    const transform = painter.transform;\n    const lineAtlas = painter.lineAtlas;\n    const tileRatio = calculateTileRatio(tile, transform);\n\n    const round = layer.layout.get('line-cap') === 'round';\n\n    const posA = lineAtlas.getDash(dasharray.from, round);\n    const posB = lineAtlas.getDash(dasharray.to, round);\n\n    const widthA = posA.width * crossfade.fromScale;\n    const widthB = posB.width * crossfade.toScale;\n\n    return extend(lineUniformValues(painter, tile, layer, coord), {\n        'u_patternscale_a': [tileRatio / widthA, -posA.height / 2],\n        'u_patternscale_b': [tileRatio / widthB, -posB.height / 2],\n        'u_sdfgamma': lineAtlas.width / (Math.min(widthA, widthB) * 256 * painter.pixelRatio) / 2,\n        'u_image': 0,\n        'u_tex_y_a': posA.y,\n        'u_tex_y_b': posB.y,\n        'u_mix': crossfade.t\n    });\n};\n\nfunction calculateTileRatio(tile: Tile, transform: Transform) {\n    return 1 / pixelsToTileUnits(tile, 1, transform.tileZoom);\n}\n\nfunction calculateMatrix(painter: Painter, tile: Tile, layer: LineStyleLayer, coord: OverscaledTileID) {\n    return painter.translatePosMatrix(\n        coord ? coord.posMatrix : tile.tileID.posMatrix,\n        tile,\n        layer.paint.get('line-translate'),\n        layer.paint.get('line-translate-anchor')\n    );\n}\n\nexport {\n    lineUniforms,\n    lineGradientUniforms,\n    linePatternUniforms,\n    lineSDFUniforms,\n    lineUniformValues,\n    lineGradientUniformValues,\n    linePatternUniformValues,\n    lineSDFUniformValues\n};\n", "import {Uniform1i, Uniform1f, Uniform2f, Uniform3f, UniformMatrix4f} from '../uniform_binding';\n\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {RasterStyleLayer} from '../../style/style_layer/raster_style_layer';\nimport {mat4} from 'gl-matrix';\n\nexport type RasterUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_tl_parent': Uniform2f;\n    'u_scale_parent': Uniform1f;\n    'u_buffer_scale': Uniform1f;\n    'u_fade_t': Uniform1f;\n    'u_opacity': Uniform1f;\n    'u_image0': Uniform1i;\n    'u_image1': Uniform1i;\n    'u_brightness_low': Uniform1f;\n    'u_brightness_high': Uniform1f;\n    'u_saturation_factor': Uniform1f;\n    'u_contrast_factor': Uniform1f;\n    'u_spin_weights': Uniform3f;\n};\n\nconst rasterUniforms = (context: Context, locations: UniformLocations): RasterUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_tl_parent': new Uniform2f(context, locations.u_tl_parent),\n    'u_scale_parent': new Uniform1f(context, locations.u_scale_parent),\n    'u_buffer_scale': new Uniform1f(context, locations.u_buffer_scale),\n    'u_fade_t': new Uniform1f(context, locations.u_fade_t),\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_image0': new Uniform1i(context, locations.u_image0),\n    'u_image1': new Uniform1i(context, locations.u_image1),\n    'u_brightness_low': new Uniform1f(context, locations.u_brightness_low),\n    'u_brightness_high': new Uniform1f(context, locations.u_brightness_high),\n    'u_saturation_factor': new Uniform1f(context, locations.u_saturation_factor),\n    'u_contrast_factor': new Uniform1f(context, locations.u_contrast_factor),\n    'u_spin_weights': new Uniform3f(context, locations.u_spin_weights)\n});\n\nconst rasterUniformValues = (\n    matrix: mat4,\n    parentTL: [number, number],\n    parentScaleBy: number,\n    fade: {\n        mix: number;\n        opacity: number;\n    },\n    layer: RasterStyleLayer\n): UniformValues<RasterUniformsType> => ({\n    'u_matrix': matrix,\n    'u_tl_parent': parentTL,\n    'u_scale_parent': parentScaleBy,\n    'u_buffer_scale': 1,\n    'u_fade_t': fade.mix,\n    'u_opacity': fade.opacity * layer.paint.get('raster-opacity'),\n    'u_image0': 0,\n    'u_image1': 1,\n    'u_brightness_low': layer.paint.get('raster-brightness-min'),\n    'u_brightness_high': layer.paint.get('raster-brightness-max'),\n    'u_saturation_factor': saturationFactor(layer.paint.get('raster-saturation')),\n    'u_contrast_factor': contrastFactor(layer.paint.get('raster-contrast')),\n    'u_spin_weights': spinWeights(layer.paint.get('raster-hue-rotate'))\n});\n\nfunction spinWeights(angle) {\n    angle *= Math.PI / 180;\n    const s = Math.sin(angle);\n    const c = Math.cos(angle);\n    return [\n        (2 * c + 1) / 3,\n        (-Math.sqrt(3) * s - c + 1) / 3,\n        (Math.sqrt(3) * s - c + 1) / 3\n    ];\n}\n\nfunction contrastFactor(contrast) {\n    return contrast > 0 ?\n        1 / (1 - contrast) :\n        1 + contrast;\n}\n\nfunction saturationFactor(saturation) {\n    return saturation > 0 ?\n        1 - 1 / (1.001 - saturation) :\n        -saturation;\n}\n\nexport {rasterUniforms, rasterUniformValues};\n", "import {Uniform1i, Uniform1f, Uniform2f, UniformMatrix4f} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Context} from '../../gl/context';\nimport type {Painter} from '../painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {mat4} from 'gl-matrix';\n\nexport type SymbolIconUniformsType = {\n    'u_is_size_zoom_constant': Uniform1i;\n    'u_is_size_feature_constant': Uniform1i;\n    'u_size_t': Uniform1f;\n    'u_size': Uniform1f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_pitch': Uniform1f;\n    'u_rotate_symbol': Uniform1i;\n    'u_aspect_ratio': Uniform1f;\n    'u_fade_change': Uniform1f;\n    'u_matrix': UniformMatrix4f;\n    'u_label_plane_matrix': UniformMatrix4f;\n    'u_coord_matrix': UniformMatrix4f;\n    'u_is_text': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_is_along_line': Uniform1i;\n    'u_is_variable_anchor': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_texture': Uniform1i;\n    'u_translation': Uniform2f;\n    'u_pitched_scale': Uniform1f;\n};\n\nexport type SymbolSDFUniformsType = {\n    'u_is_size_zoom_constant': Uniform1i;\n    'u_is_size_feature_constant': Uniform1i;\n    'u_size_t': Uniform1f;\n    'u_size': Uniform1f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_pitch': Uniform1f;\n    'u_rotate_symbol': Uniform1i;\n    'u_aspect_ratio': Uniform1f;\n    'u_fade_change': Uniform1f;\n    'u_matrix': UniformMatrix4f;\n    'u_label_plane_matrix': UniformMatrix4f;\n    'u_coord_matrix': UniformMatrix4f;\n    'u_is_text': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_is_along_line': Uniform1i;\n    'u_is_variable_anchor': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_texture': Uniform1i;\n    'u_gamma_scale': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_is_halo': Uniform1i;\n    'u_translation': Uniform2f;\n    'u_pitched_scale': Uniform1f;\n};\n\nexport type symbolTextAndIconUniformsType = {\n    'u_is_size_zoom_constant': Uniform1i;\n    'u_is_size_feature_constant': Uniform1i;\n    'u_size_t': Uniform1f;\n    'u_size': Uniform1f;\n    'u_camera_to_center_distance': Uniform1f;\n    'u_pitch': Uniform1f;\n    'u_rotate_symbol': Uniform1i;\n    'u_aspect_ratio': Uniform1f;\n    'u_fade_change': Uniform1f;\n    'u_matrix': UniformMatrix4f;\n    'u_label_plane_matrix': UniformMatrix4f;\n    'u_coord_matrix': UniformMatrix4f;\n    'u_is_text': Uniform1i;\n    'u_pitch_with_map': Uniform1i;\n    'u_is_along_line': Uniform1i;\n    'u_is_variable_anchor': Uniform1i;\n    'u_texsize': Uniform2f;\n    'u_texsize_icon': Uniform2f;\n    'u_texture': Uniform1i;\n    'u_texture_icon': Uniform1i;\n    'u_gamma_scale': Uniform1f;\n    'u_device_pixel_ratio': Uniform1f;\n    'u_is_halo': Uniform1i;\n    'u_translation': Uniform2f;\n    'u_pitched_scale': Uniform1f;\n};\n\nconst symbolIconUniforms = (context: Context, locations: UniformLocations): SymbolIconUniformsType => ({\n    'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),\n    'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),\n    'u_size_t': new Uniform1f(context, locations.u_size_t),\n    'u_size': new Uniform1f(context, locations.u_size),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_pitch': new Uniform1f(context, locations.u_pitch),\n    'u_rotate_symbol': new Uniform1i(context, locations.u_rotate_symbol),\n    'u_aspect_ratio': new Uniform1f(context, locations.u_aspect_ratio),\n    'u_fade_change': new Uniform1f(context, locations.u_fade_change),\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_label_plane_matrix': new UniformMatrix4f(context, locations.u_label_plane_matrix),\n    'u_coord_matrix': new UniformMatrix4f(context, locations.u_coord_matrix),\n    'u_is_text': new Uniform1i(context, locations.u_is_text),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_is_along_line': new Uniform1i(context, locations.u_is_along_line),\n    'u_is_variable_anchor': new Uniform1i(context, locations.u_is_variable_anchor),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_pitched_scale': new Uniform1f(context, locations.u_pitched_scale),\n});\n\nconst symbolSDFUniforms = (context: Context, locations: UniformLocations): SymbolSDFUniformsType => ({\n    'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),\n    'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),\n    'u_size_t': new Uniform1f(context, locations.u_size_t),\n    'u_size': new Uniform1f(context, locations.u_size),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_pitch': new Uniform1f(context, locations.u_pitch),\n    'u_rotate_symbol': new Uniform1i(context, locations.u_rotate_symbol),\n    'u_aspect_ratio': new Uniform1f(context, locations.u_aspect_ratio),\n    'u_fade_change': new Uniform1f(context, locations.u_fade_change),\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_label_plane_matrix': new UniformMatrix4f(context, locations.u_label_plane_matrix),\n    'u_coord_matrix': new UniformMatrix4f(context, locations.u_coord_matrix),\n    'u_is_text': new Uniform1i(context, locations.u_is_text),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_is_along_line': new Uniform1i(context, locations.u_is_along_line),\n    'u_is_variable_anchor': new Uniform1i(context, locations.u_is_variable_anchor),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_gamma_scale': new Uniform1f(context, locations.u_gamma_scale),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_is_halo': new Uniform1i(context, locations.u_is_halo),\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_pitched_scale': new Uniform1f(context, locations.u_pitched_scale),\n});\n\nconst symbolTextAndIconUniforms = (context: Context, locations: UniformLocations): symbolTextAndIconUniformsType => ({\n    'u_is_size_zoom_constant': new Uniform1i(context, locations.u_is_size_zoom_constant),\n    'u_is_size_feature_constant': new Uniform1i(context, locations.u_is_size_feature_constant),\n    'u_size_t': new Uniform1f(context, locations.u_size_t),\n    'u_size': new Uniform1f(context, locations.u_size),\n    'u_camera_to_center_distance': new Uniform1f(context, locations.u_camera_to_center_distance),\n    'u_pitch': new Uniform1f(context, locations.u_pitch),\n    'u_rotate_symbol': new Uniform1i(context, locations.u_rotate_symbol),\n    'u_aspect_ratio': new Uniform1f(context, locations.u_aspect_ratio),\n    'u_fade_change': new Uniform1f(context, locations.u_fade_change),\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_label_plane_matrix': new UniformMatrix4f(context, locations.u_label_plane_matrix),\n    'u_coord_matrix': new UniformMatrix4f(context, locations.u_coord_matrix),\n    'u_is_text': new Uniform1i(context, locations.u_is_text),\n    'u_pitch_with_map': new Uniform1i(context, locations.u_pitch_with_map),\n    'u_is_along_line': new Uniform1i(context, locations.u_is_along_line),\n    'u_is_variable_anchor': new Uniform1i(context, locations.u_is_variable_anchor),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_texsize_icon': new Uniform2f(context, locations.u_texsize_icon),\n    'u_texture': new Uniform1i(context, locations.u_texture),\n    'u_texture_icon': new Uniform1i(context, locations.u_texture_icon),\n    'u_gamma_scale': new Uniform1f(context, locations.u_gamma_scale),\n    'u_device_pixel_ratio': new Uniform1f(context, locations.u_device_pixel_ratio),\n    'u_is_halo': new Uniform1i(context, locations.u_is_halo),\n    'u_translation': new Uniform2f(context, locations.u_translation),\n    'u_pitched_scale': new Uniform1f(context, locations.u_pitched_scale),\n});\n\nconst symbolIconUniformValues = (\n    functionType: string,\n    size: {\n        uSizeT: number;\n        uSize: number;\n    },\n    rotateInShader: boolean,\n    pitchWithMap: boolean,\n    isAlongLine: boolean,\n    isVariableAnchor: boolean,\n    painter: Painter,\n    matrix: mat4,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    translation: [number, number],\n    isText: boolean,\n    texSize: [number, number],\n    pitchedScale: number\n): UniformValues<SymbolIconUniformsType> => {\n    const transform = painter.transform;\n\n    return {\n        'u_is_size_zoom_constant': +(functionType === 'constant' || functionType === 'source'),\n        'u_is_size_feature_constant': +(functionType === 'constant' || functionType === 'camera'),\n        'u_size_t': size ? size.uSizeT : 0,\n        'u_size': size ? size.uSize : 0,\n        'u_camera_to_center_distance': transform.cameraToCenterDistance,\n        'u_pitch': transform.pitch / 360 * 2 * Math.PI,\n        'u_rotate_symbol': +rotateInShader,\n        'u_aspect_ratio': transform.width / transform.height,\n        'u_fade_change': painter.options.fadeDuration ? painter.symbolFadeChange : 1,\n        'u_matrix': matrix,\n        'u_label_plane_matrix': labelPlaneMatrix,\n        'u_coord_matrix': glCoordMatrix,\n        'u_is_text': +isText,\n        'u_pitch_with_map': +pitchWithMap,\n        'u_is_along_line': isAlongLine,\n        'u_is_variable_anchor': isVariableAnchor,\n        'u_texsize': texSize,\n        'u_texture': 0,\n        'u_translation': translation,\n        'u_pitched_scale': pitchedScale\n    };\n};\n\nconst symbolSDFUniformValues = (\n    functionType: string,\n    size: {\n        uSizeT: number;\n        uSize: number;\n    },\n    rotateInShader: boolean,\n    pitchWithMap: boolean,\n    isAlongLine: boolean,\n    isVariableAnchor: boolean,\n    painter: Painter,\n    matrix: mat4,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    translation: [number, number],\n    isText: boolean,\n    texSize: [number, number],\n    isHalo: boolean,\n    pitchedScale: number\n): UniformValues<SymbolSDFUniformsType> => {\n    const transform = painter.transform;\n\n    return extend(symbolIconUniformValues(functionType, size,\n        rotateInShader, pitchWithMap, isAlongLine, isVariableAnchor, painter, matrix, labelPlaneMatrix,\n        glCoordMatrix, translation, isText, texSize, pitchedScale), {\n        'u_gamma_scale': (pitchWithMap ? Math.cos(transform._pitch) * transform.cameraToCenterDistance : 1),\n        'u_device_pixel_ratio': painter.pixelRatio,\n        'u_is_halo': +isHalo\n    });\n};\n\nconst symbolTextAndIconUniformValues = (\n    functionType: string,\n    size: {\n        uSizeT: number;\n        uSize: number;\n    },\n    rotateInShader: boolean,\n    pitchWithMap: boolean,\n    isAlongLine: boolean,\n    isVariableAnchor: boolean,\n    painter: Painter,\n    matrix: mat4,\n    labelPlaneMatrix: mat4,\n    glCoordMatrix: mat4,\n    translation: [number, number],\n    texSizeSDF: [number, number],\n    texSizeIcon: [number, number],\n    pitchedScale: number\n): UniformValues<SymbolIconUniformsType> => {\n    return extend(symbolSDFUniformValues(functionType, size,\n        rotateInShader, pitchWithMap, isAlongLine, isVariableAnchor, painter, matrix, labelPlaneMatrix,\n        glCoordMatrix, translation, true, texSizeSDF, true, pitchedScale), {\n        'u_texsize_icon': texSizeIcon,\n        'u_texture_icon': 1\n    });\n};\n\nexport {symbolIconUniforms, symbolSDFUniforms, symbolIconUniformValues, symbolSDFUniformValues, symbolTextAndIconUniformValues, symbolTextAndIconUniforms};\n", "import {bgPatternUniformValues} from './pattern';\nimport {\n    Uniform1i,\n    Uniform1f,\n    Uniform2f,\n    UniformColor,\n    UniformMatrix4f\n} from '../uniform_binding';\nimport {extend} from '../../util/util';\n\nimport type {Painter} from '../painter';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {Color, ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {CrossFaded} from '../../style/properties';\nimport type {CrossfadeParameters} from '../../style/evaluation_parameters';\nimport type {OverscaledTileID} from '../../source/tile_id';\nimport {mat4} from 'gl-matrix';\n\nexport type BackgroundUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_opacity': Uniform1f;\n    'u_color': UniformColor;\n};\n\nexport type BackgroundPatternUniformsType = {\n    'u_matrix': UniformMatrix4f;\n    'u_opacity': Uniform1f;\n    // pattern uniforms:\n    'u_image': Uniform1i;\n    'u_pattern_tl_a': Uniform2f;\n    'u_pattern_br_a': Uniform2f;\n    'u_pattern_tl_b': Uniform2f;\n    'u_pattern_br_b': Uniform2f;\n    'u_texsize': Uniform2f;\n    'u_mix': Uniform1f;\n    'u_pattern_size_a': Uniform2f;\n    'u_pattern_size_b': Uniform2f;\n    'u_scale_a': Uniform1f;\n    'u_scale_b': Uniform1f;\n    'u_pixel_coord_upper': Uniform2f;\n    'u_pixel_coord_lower': Uniform2f;\n    'u_tile_units_to_pixels': Uniform1f;\n};\n\nconst backgroundUniforms = (context: Context, locations: UniformLocations): BackgroundUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_color': new UniformColor(context, locations.u_color)\n});\n\nconst backgroundPatternUniforms = (context: Context, locations: UniformLocations): BackgroundPatternUniformsType => ({\n    'u_matrix': new UniformMatrix4f(context, locations.u_matrix),\n    'u_opacity': new Uniform1f(context, locations.u_opacity),\n    'u_image': new Uniform1i(context, locations.u_image),\n    'u_pattern_tl_a': new Uniform2f(context, locations.u_pattern_tl_a),\n    'u_pattern_br_a': new Uniform2f(context, locations.u_pattern_br_a),\n    'u_pattern_tl_b': new Uniform2f(context, locations.u_pattern_tl_b),\n    'u_pattern_br_b': new Uniform2f(context, locations.u_pattern_br_b),\n    'u_texsize': new Uniform2f(context, locations.u_texsize),\n    'u_mix': new Uniform1f(context, locations.u_mix),\n    'u_pattern_size_a': new Uniform2f(context, locations.u_pattern_size_a),\n    'u_pattern_size_b': new Uniform2f(context, locations.u_pattern_size_b),\n    'u_scale_a': new Uniform1f(context, locations.u_scale_a),\n    'u_scale_b': new Uniform1f(context, locations.u_scale_b),\n    'u_pixel_coord_upper': new Uniform2f(context, locations.u_pixel_coord_upper),\n    'u_pixel_coord_lower': new Uniform2f(context, locations.u_pixel_coord_lower),\n    'u_tile_units_to_pixels': new Uniform1f(context, locations.u_tile_units_to_pixels)\n});\n\nconst backgroundUniformValues = (matrix: mat4, opacity: number, color: Color): UniformValues<BackgroundUniformsType> => ({\n    'u_matrix': matrix,\n    'u_opacity': opacity,\n    'u_color': color\n});\n\nconst backgroundPatternUniformValues = (\n    matrix: mat4,\n    opacity: number,\n    painter: Painter,\n    image: CrossFaded<ResolvedImage>,\n    tile: {\n        tileID: OverscaledTileID;\n        tileSize: number;\n    },\n    crossfade: CrossfadeParameters\n): UniformValues<BackgroundPatternUniformsType> => extend(\n    bgPatternUniformValues(image, crossfade, painter, tile),\n    {\n        'u_matrix': matrix,\n        'u_opacity': opacity\n    }\n);\n\nexport {\n    backgroundUniforms,\n    backgroundPatternUniforms,\n    backgroundUniformValues,\n    backgroundPatternUniformValues\n};\n", "import {fillExtrusionUniforms, fillExtrusionPatternUniforms} from './fill_extrusion_program';\nimport {fillUniforms, fillPatternUniforms, fillOutlineUniforms, fillOutlinePatternUniforms} from './fill_program';\nimport {circleUniforms} from './circle_program';\nimport {collisionUniforms, collisionCircleUniforms} from './collision_program';\nimport {debugUniforms} from './debug_program';\nimport {clippingMaskUniforms} from './clipping_mask_program';\nimport {heatmapUniforms, heatmapTextureUniforms} from './heatmap_program';\nimport {hillshadeUniforms, hillshadePrepareUniforms} from './hillshade_program';\nimport {lineUniforms, lineGradientUniforms, linePatternUniforms, lineSDFUniforms} from './line_program';\nimport {rasterUniforms} from './raster_program';\nimport {symbolIconUniforms, symbolSDFUniforms, symbolTextAndIconUniforms} from './symbol_program';\nimport {backgroundUniforms, backgroundPatternUniforms} from './background_program';\nimport {terrainUniforms, terrainDepthUniforms, terrainCoordsUniforms} from './terrain_program';\nimport {skyUniforms} from './sky_program';\n\nexport const programUniforms = {\n    fillExtrusion: fillExtrusionUniforms,\n    fillExtrusionPattern: fillExtrusionPatternUniforms,\n    fill: fillUniforms,\n    fillPattern: fillPatternUniforms,\n    fillOutline: fillOutlineUniforms,\n    fillOutlinePattern: fillOutlinePatternUniforms,\n    circle: circleUniforms,\n    collisionBox: collisionUniforms,\n    collisionCircle: collisionCircleUniforms,\n    debug: debugUniforms,\n    clippingMask: clippingMaskUniforms,\n    heatmap: heatmapUniforms,\n    heatmapTexture: heatmapTextureUniforms,\n    hillshade: hillshadeUniforms,\n    hillshadePrepare: hillshadePrepareUniforms,\n    line: lineUniforms,\n    lineGradient: lineGradientUniforms,\n    linePattern: linePatternUniforms,\n    lineSDF: lineSDFUniforms,\n    raster: rasterUniforms,\n    symbolIcon: symbolIconUniforms,\n    symbolSDF: symbolSDFUniforms,\n    symbolTextAndIcon: symbolTextAndIconUniforms,\n    background: backgroundUniforms,\n    backgroundPattern: backgroundPatternUniforms,\n    terrain: terrainUniforms,\n    terrainDepth: terrainDepthUniforms,\n    terrainCoords: terrainCoordsUniforms,\n    sky: skyUniforms\n};\n", "import {UniformColor, Uniform1f} from '../uniform_binding';\nimport type {Context} from '../../gl/context';\nimport type {UniformValues, UniformLocations} from '../uniform_binding';\nimport {Transform} from '../../geo/transform';\nimport {Sky} from '../../style/sky';\n\nexport type SkyUniformsType = {\n    'u_sky_color': UniformColor;\n    'u_horizon_color': UniformColor;\n    'u_horizon': Uniform1f;\n    'u_sky_horizon_blend': Uniform1f;\n};\n\nconst skyUniforms = (context: Context, locations: UniformLocations): SkyUniformsType => ({\n    'u_sky_color': new UniformColor(context, locations.u_sky_color),\n    'u_horizon_color': new UniformColor(context, locations.u_horizon_color),\n    'u_horizon': new Uniform1f(context, locations.u_horizon),\n    'u_sky_horizon_blend': new Uniform1f(context, locations.u_sky_horizon_blend),\n});\n\nconst skyUniformValues = (sky: Sky, transform: Transform, pixelRatio: number): UniformValues<SkyUniformsType> => ({\n    'u_sky_color': sky.properties.get('sky-color'),\n    'u_horizon_color': sky.properties.get('horizon-color'),\n    'u_horizon': (transform.height / 2 + transform.getHorizon()) * pixelRatio,\n    'u_sky_horizon_blend': (sky.properties.get('sky-horizon-blend') * transform.height / 2) * pixelRatio,\n});\n\nexport {skyUniforms, skyUniformValues};\n", "\nimport type {StructArray} from '../util/struct_array';\nimport type {TriangleIndexArray, LineIndexArray, LineStripIndexArray} from '../data/index_array_type';\nimport type {Context} from '../gl/context';\n\n/**\n * @internal\n * an index buffer class\n */\nexport class IndexBuffer {\n    context: Context;\n    buffer: WebGLBuffer;\n    dynamicDraw: boolean;\n\n    constructor(context: Context, array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean) {\n        this.context = context;\n        const gl = context.gl;\n        this.buffer = gl.createBuffer();\n        this.dynamicDraw = Boolean(dynamicDraw);\n\n        // The bound index buffer is part of vertex array object state. We don't want to\n        // modify whatever VAO happens to be currently bound, so make sure the default\n        // vertex array provided by the context is bound instead.\n        this.context.unbindVAO();\n\n        context.bindElementBuffer.set(this.buffer);\n        gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, array.arrayBuffer, this.dynamicDraw ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW);\n\n        if (!this.dynamicDraw) {\n            delete array.arrayBuffer;\n        }\n    }\n\n    bind() {\n        this.context.bindElementBuffer.set(this.buffer);\n    }\n\n    updateData(array: StructArray) {\n        const gl = this.context.gl;\n        if (!this.dynamicDraw) throw new Error('Attempted to update data while not in dynamic mode.');\n        // The right VAO will get this buffer re-bound later in VertexArrayObject#bind\n        // See https://github.com/mapbox/mapbox-gl-js/issues/5620\n        this.context.unbindVAO();\n        this.bind();\n        gl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, array.arrayBuffer);\n    }\n\n    destroy() {\n        const gl = this.context.gl;\n        if (this.buffer) {\n            gl.deleteBuffer(this.buffer);\n            delete this.buffer;\n        }\n    }\n}\n", "\nimport type {\n    StructArray,\n    StructArrayMember\n} from '../util/struct_array';\n\nimport type {Program} from '../render/program';\nimport type {Context} from '../gl/context';\n\n/**\n * An Enum for AttributeType\n */\nconst AttributeType = {\n    Int8: 'BYTE',\n    Uint8: 'UNSIGNED_BYTE',\n    Int16: 'SHORT',\n    Uint16: 'UNSIGNED_SHORT',\n    Int32: 'INT',\n    Uint32: 'UNSIGNED_INT',\n    Float32: 'FLOAT'\n};\n\n/**\n * @internal\n * The `VertexBuffer` class turns a `StructArray` into a WebGL buffer. Each member of the StructArray's\n * Struct type is converted to a WebGL attribute.\n */\nexport class VertexBuffer {\n    length: number;\n    attributes: ReadonlyArray<StructArrayMember>;\n    itemSize: number;\n    dynamicDraw: boolean;\n    context: Context;\n    buffer: WebGLBuffer;\n\n    /**\n     * @param dynamicDraw - Whether this buffer will be repeatedly updated.\n     */\n    constructor(context: Context, array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean) {\n        this.length = array.length;\n        this.attributes = attributes;\n        this.itemSize = array.bytesPerElement;\n        this.dynamicDraw = dynamicDraw;\n\n        this.context = context;\n        const gl = context.gl;\n        this.buffer = gl.createBuffer();\n        context.bindVertexBuffer.set(this.buffer);\n        gl.bufferData(gl.ARRAY_BUFFER, array.arrayBuffer, this.dynamicDraw ? gl.DYNAMIC_DRAW : gl.STATIC_DRAW);\n\n        if (!this.dynamicDraw) {\n            delete array.arrayBuffer;\n        }\n    }\n\n    bind() {\n        this.context.bindVertexBuffer.set(this.buffer);\n    }\n\n    updateData(array: StructArray) {\n        if (array.length !== this.length) throw new Error(`Length of new data is ${array.length}, which doesn't match current length of ${this.length}`);\n        const gl = this.context.gl;\n        this.bind();\n        gl.bufferSubData(gl.ARRAY_BUFFER, 0, array.arrayBuffer);\n    }\n\n    enableAttributes(gl: WebGLRenderingContext|WebGL2RenderingContext, program: Program<any>) {\n        for (let j = 0; j < this.attributes.length; j++) {\n            const member = this.attributes[j];\n            const attribIndex: number | void = program.attributes[member.name];\n            if (attribIndex !== undefined) {\n                gl.enableVertexAttribArray(attribIndex);\n            }\n        }\n    }\n\n    /**\n     * Set the attribute pointers in a WebGL context\n     * @param gl - The WebGL context\n     * @param program - The active WebGL program\n     * @param vertexOffset - Index of the starting vertex of the segment\n     */\n    setVertexAttribPointers(gl: WebGLRenderingContext|WebGL2RenderingContext, program: Program<any>, vertexOffset?: number | null) {\n        for (let j = 0; j < this.attributes.length; j++) {\n            const member = this.attributes[j];\n            const attribIndex: number | void = program.attributes[member.name];\n\n            if (attribIndex !== undefined) {\n                gl.vertexAttribPointer(\n                    attribIndex,\n                    member.components,\n                    (gl as any)[AttributeType[member.type]],\n                    false,\n                    this.itemSize,\n                    member.offset + (this.itemSize * (vertexOffset || 0))\n                );\n            }\n        }\n    }\n\n    /**\n     * Destroy the GL buffer bound to the given WebGL context\n     */\n    destroy() {\n        const gl = this.context.gl;\n        if (this.buffer) {\n            gl.deleteBuffer(this.buffer);\n            delete this.buffer;\n        }\n    }\n}\n", "const cache = new WeakMap();\nexport function isWebGL2(\n    gl: WebGLRenderingContext | WebGL2RenderingContext\n): gl is WebGL2RenderingContext {\n    if (cache.has(gl)) {\n        return cache.get(gl);\n    } else {\n        const value = gl.getParameter(gl.VERSION)?.startsWith('WebGL 2.0');\n        cache.set(gl, value);\n        return value;\n    }\n}\n", "import {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {isWebGL2} from './webgl2';\n\nimport type {Context} from './context';\nimport type {\n    BlendFuncType,\n    BlendEquationType,\n    ColorMaskType,\n    DepthRangeType,\n    DepthMaskType,\n    StencilFuncType,\n    StencilOpType,\n    DepthFuncType,\n    TextureUnitType,\n    ViewportType,\n    CullFaceModeType,\n    FrontFaceType,\n} from './types';\n\nexport interface IValue<T> {\n    current: T;\n    default: T;\n    dirty: boolean;\n    get(): T;\n    setDefault(): void;\n    set(value: T): void;\n}\n\nclass BaseValue<T> implements IValue<T> {\n    gl: WebGLRenderingContext|WebGL2RenderingContext;\n    current: T;\n    default: T;\n    dirty: boolean;\n\n    constructor(context: Context) {\n        this.gl = context.gl;\n        this.default = this.getDefault();\n        this.current = this.default;\n        this.dirty = false;\n    }\n\n    get(): T {\n        return this.current;\n    }\n    set(value: T) { // eslint-disable-line\n        // overridden in child classes;\n    }\n\n    getDefault(): T {\n        return this.default; // overridden in child classes\n    }\n    setDefault() {\n        this.set(this.default);\n    }\n}\n\nexport class ClearColor extends BaseValue<Color> {\n    getDefault(): Color {\n        return Color.transparent;\n    }\n    set(v: Color) {\n        const c = this.current;\n        if (v.r === c.r && v.g === c.g && v.b === c.b && v.a === c.a && !this.dirty) return;\n        this.gl.clearColor(v.r, v.g, v.b, v.a);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ClearDepth extends BaseValue<number> {\n    getDefault(): number {\n        return 1;\n    }\n    set(v: number) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.clearDepth(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ClearStencil extends BaseValue<number> {\n    getDefault(): number {\n        return 0;\n    }\n    set(v: number) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.clearStencil(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ColorMask extends BaseValue<ColorMaskType> {\n    getDefault(): ColorMaskType {\n        return [true, true, true, true];\n    }\n    set(v: ColorMaskType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && v[2] === c[2] && v[3] === c[3] && !this.dirty) return;\n        this.gl.colorMask(v[0], v[1], v[2], v[3]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthMask extends BaseValue<DepthMaskType> {\n    getDefault(): DepthMaskType {\n        return true;\n    }\n    set(v: DepthMaskType): void {\n        if (v === this.current && !this.dirty) return;\n        this.gl.depthMask(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilMask extends BaseValue<number> {\n    getDefault(): number {\n        return 0xFF;\n    }\n    set(v: number): void {\n        if (v === this.current && !this.dirty) return;\n        this.gl.stencilMask(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilFunc extends BaseValue<StencilFuncType> {\n    getDefault(): StencilFuncType {\n        return {\n            func: this.gl.ALWAYS,\n            ref: 0,\n            mask: 0xFF\n        };\n    }\n    set(v: StencilFuncType): void {\n        const c = this.current;\n        if (v.func === c.func && v.ref === c.ref && v.mask === c.mask && !this.dirty) return;\n        this.gl.stencilFunc(v.func, v.ref, v.mask);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilOp extends BaseValue<StencilOpType> {\n    getDefault(): StencilOpType {\n        const gl = this.gl;\n        return [gl.KEEP, gl.KEEP, gl.KEEP];\n    }\n    set(v: StencilOpType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && v[2] === c[2] && !this.dirty) return;\n        this.gl.stencilOp(v[0], v[1], v[2]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class StencilTest extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.STENCIL_TEST);\n        } else {\n            gl.disable(gl.STENCIL_TEST);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthRange extends BaseValue<DepthRangeType> {\n    getDefault(): DepthRangeType {\n        return [0, 1];\n    }\n    set(v: DepthRangeType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && !this.dirty) return;\n        this.gl.depthRange(v[0], v[1]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthTest extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.DEPTH_TEST);\n        } else {\n            gl.disable(gl.DEPTH_TEST);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthFunc extends BaseValue<DepthFuncType> {\n    getDefault(): DepthFuncType {\n        return this.gl.LESS;\n    }\n    set(v: DepthFuncType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.depthFunc(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class Blend extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.BLEND);\n        } else {\n            gl.disable(gl.BLEND);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BlendFunc extends BaseValue<BlendFuncType> {\n    getDefault(): BlendFuncType {\n        const gl = this.gl;\n        return [gl.ONE, gl.ZERO];\n    }\n    set(v: BlendFuncType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && !this.dirty) return;\n        this.gl.blendFunc(v[0], v[1]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BlendColor extends BaseValue<Color> {\n    getDefault(): Color {\n        return Color.transparent;\n    }\n    set(v: Color) {\n        const c = this.current;\n        if (v.r === c.r && v.g === c.g && v.b === c.b && v.a === c.a && !this.dirty) return;\n        this.gl.blendColor(v.r, v.g, v.b, v.a);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BlendEquation extends BaseValue<BlendEquationType> {\n    getDefault(): BlendEquationType {\n        return this.gl.FUNC_ADD;\n    }\n    set(v: BlendEquationType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.blendEquation(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class CullFace extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        if (v) {\n            gl.enable(gl.CULL_FACE);\n        } else {\n            gl.disable(gl.CULL_FACE);\n        }\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class CullFaceSide extends BaseValue<CullFaceModeType> {\n    getDefault(): CullFaceModeType {\n        return this.gl.BACK;\n    }\n    set(v: CullFaceModeType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.cullFace(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class FrontFace extends BaseValue<FrontFaceType> {\n    getDefault(): FrontFaceType {\n        return this.gl.CCW;\n    }\n    set(v: FrontFaceType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.frontFace(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ProgramValue extends BaseValue<WebGLProgram> {\n    getDefault(): WebGLProgram {\n        return null;\n    }\n    set(v?: WebGLProgram | null) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.useProgram(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class ActiveTextureUnit extends BaseValue<TextureUnitType> {\n    getDefault(): TextureUnitType {\n        return this.gl.TEXTURE0;\n    }\n    set(v: TextureUnitType) {\n        if (v === this.current && !this.dirty) return;\n        this.gl.activeTexture(v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class Viewport extends BaseValue<ViewportType> {\n    getDefault(): ViewportType {\n        const gl = this.gl;\n        return [0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight];\n    }\n    set(v: ViewportType) {\n        const c = this.current;\n        if (v[0] === c[0] && v[1] === c[1] && v[2] === c[2] && v[3] === c[3] && !this.dirty) return;\n        this.gl.viewport(v[0], v[1], v[2], v[3]);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindFramebuffer extends BaseValue<WebGLFramebuffer> {\n    getDefault(): WebGLFramebuffer {\n        return null;\n    }\n    set(v?: WebGLFramebuffer | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindFramebuffer(gl.FRAMEBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindRenderbuffer extends BaseValue<WebGLRenderbuffer> {\n    getDefault(): WebGLRenderbuffer {\n        return null;\n    }\n    set(v?: WebGLRenderbuffer | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindRenderbuffer(gl.RENDERBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindTexture extends BaseValue<WebGLTexture> {\n    getDefault(): WebGLTexture {\n        return null;\n    }\n    set(v?: WebGLTexture | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindTexture(gl.TEXTURE_2D, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindVertexBuffer extends BaseValue<WebGLBuffer> {\n    getDefault(): WebGLBuffer {\n        return null;\n    }\n    set(v?: WebGLBuffer | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.bindBuffer(gl.ARRAY_BUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindElementBuffer extends BaseValue<WebGLBuffer> {\n    getDefault(): WebGLBuffer {\n        return null;\n    }\n    set(v?: WebGLBuffer | null) {\n        // Always rebind\n        const gl = this.gl;\n        gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class BindVertexArray extends BaseValue<WebGLVertexArrayObject | null> {\n    getDefault(): WebGLVertexArrayObject | null {\n        return null;\n    }\n    set(v: WebGLVertexArrayObject | null) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n\n        if (isWebGL2(gl)) {\n            gl.bindVertexArray(v);\n        } else {\n            gl.getExtension('OES_vertex_array_object')?.bindVertexArrayOES(v);\n        }\n\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class PixelStoreUnpack extends BaseValue<number> {\n    getDefault(): number {\n        return 4;\n    }\n    set(v: number) {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.pixelStorei(gl.UNPACK_ALIGNMENT, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class PixelStoreUnpackPremultiplyAlpha extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean): void {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, ((v as any)));\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class PixelStoreUnpackFlipY extends BaseValue<boolean> {\n    getDefault(): boolean {\n        return false;\n    }\n    set(v: boolean): void {\n        if (v === this.current && !this.dirty) return;\n        const gl = this.gl;\n        gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, ((v as any)));\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nclass FramebufferAttachment<T> extends BaseValue<T> {\n    parent: WebGLFramebuffer;\n    context: Context;\n\n    constructor(context: Context, parent: WebGLFramebuffer) {\n        super(context);\n        this.context = context;\n        this.parent = parent;\n    }\n    getDefault() {\n        return null;\n    }\n}\n\nexport class ColorAttachment extends FramebufferAttachment<WebGLTexture> {\n    setDirty() {\n        this.dirty = true;\n    }\n    set(v?: WebGLTexture | null): void {\n        if (v === this.current && !this.dirty) return;\n        this.context.bindFramebuffer.set(this.parent);\n        // note: it's possible to attach a renderbuffer to the color\n        // attachment point, but thus far MBGL only uses textures for color\n        const gl = this.gl;\n        gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, v, 0);\n\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthAttachment extends FramebufferAttachment<WebGLRenderbuffer> {\n    set(v?: WebGLRenderbuffer | null): void {\n        if (v === this.current && !this.dirty) return;\n        this.context.bindFramebuffer.set(this.parent);\n        // note: it's possible to attach a texture to the depth attachment\n        // point, but thus far MBGL only uses renderbuffers for depth\n        const gl = this.gl;\n        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n\nexport class DepthStencilAttachment extends FramebufferAttachment<WebGLRenderbuffer> {\n    set(v?: WebGLRenderbuffer | null): void {\n        if (v === this.current && !this.dirty) return;\n        this.context.bindFramebuffer.set(this.parent);\n        // note: it's possible to attach a texture to the depth attachment\n        // point, but thus far MBGL only uses renderbuffers for depth\n        const gl = this.gl;\n        gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, v);\n        this.current = v;\n        this.dirty = false;\n    }\n}\n", "import {ColorAttachment, DepthAttachment, DepthStencilAttachment} from './value';\n\nimport type {Context} from './context';\n\n/**\n * @internal\n * A framebuffer holder object\n */\nexport class Framebuffer {\n    context: Context;\n    width: number;\n    height: number;\n    framebuffer: WebGLFramebuffer;\n    colorAttachment: ColorAttachment;\n    depthAttachment: DepthAttachment;\n\n    constructor(context: Context, width: number, height: number, hasDepth: boolean, hasStencil: boolean) {\n        this.context = context;\n        this.width = width;\n        this.height = height;\n        const gl = context.gl;\n        const fbo = this.framebuffer = gl.createFramebuffer();\n\n        this.colorAttachment = new ColorAttachment(context, fbo);\n        if (hasDepth) {\n            this.depthAttachment = hasStencil ? new DepthStencilAttachment(context, fbo) : new DepthAttachment(context, fbo);\n        } else if (hasStencil) {\n            throw new Error('Stencil cannot be set without depth');\n        }\n        if (gl.checkFramebufferStatus(gl.FRAMEBUFFER) !== gl.FRAMEBUFFER_COMPLETE) {\n            throw new Error('Framebuffer is not complete');\n        }\n    }\n\n    destroy() {\n        const gl = this.context.gl;\n\n        const texture = this.colorAttachment.get();\n        if (texture) gl.deleteTexture(texture);\n\n        if (this.depthAttachment) {\n            const renderbuffer = this.depthAttachment.get();\n            if (renderbuffer) gl.deleteRenderbuffer(renderbuffer);\n        }\n\n        gl.deleteFramebuffer(this.framebuffer);\n    }\n}\n", "import {Color} from '@maplibre/maplibre-gl-style-spec';\n\nimport type {BlendFuncType, ColorMaskType} from './types';\n\nconst ZERO = 0x0000;\nconst ONE = 0x0001;\nconst ONE_MINUS_SRC_ALPHA = 0x0303;\n\nexport class ColorMode {\n    blendFunction: BlendFuncType;\n    blendColor: Color;\n    mask: ColorMaskType;\n\n    constructor(blendFunction: BlendFuncType, blendColor: Color, mask: ColorMaskType) {\n        this.blendFunction = blendFunction;\n        this.blendColor = blendColor;\n        this.mask = mask;\n    }\n\n    static Replace: BlendFuncType;\n\n    static disabled: Readonly<ColorMode>;\n    static unblended: Readonly<ColorMode>;\n    static alphaBlended: Readonly<ColorMode>;\n}\n\nColorMode.Replace = [ONE, ZERO];\n\nColorMode.disabled = new ColorMode(ColorMode.Replace, Color.transparent, [false, false, false, false]);\nColorMode.unblended = new ColorMode(ColorMode.Replace, Color.transparent, [true, true, true, true]);\nColorMode.alphaBlended = new ColorMode([ONE, ONE_MINUS_SRC_ALPHA], Color.transparent, [true, true, true, true]);\n", "import {IndexBuffer} from './index_buffer';\n\nimport {VertexBuffer} from './vertex_buffer';\nimport {Framebuffer} from './framebuffer';\nimport {DepthMode} from './depth_mode';\nimport {StencilMode} from './stencil_mode';\nimport {ColorMode} from './color_mode';\nimport {CullFaceMode} from './cull_face_mode';\nimport {deepEqual} from '../util/util';\nimport {ClearColor, ClearDepth, ClearStencil, ColorMask, DepthMask, StencilMask, StencilFunc, StencilOp, StencilTest, DepthRange, DepthTest, DepthFunc, Blend, BlendFunc, BlendColor, BlendEquation, CullFace, CullFaceSide, FrontFace, ProgramValue, ActiveTextureUnit, Viewport, BindFramebuffer, BindRenderbuffer, BindTexture, BindVertexBuffer, BindElementBuffer, BindVertexArray, PixelStoreUnpack, PixelStoreUnpackPremultiplyAlpha, PixelStoreUnpackFlipY} from './value';\n\nimport type {TriangleIndexArray, LineIndexArray, LineStripIndexArray} from '../data/index_array_type';\nimport type {\n    StructArray,\n    StructArrayMember\n} from '../util/struct_array';\nimport type {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {isWebGL2} from './webgl2';\n\ntype ClearArgs = {\n    color?: Color;\n    depth?: number;\n    stencil?: number;\n};\n\n/**\n * @internal\n * A webgl wrapper class to allow injection, mocking and abstaction\n */\nexport class Context {\n    gl: WebGLRenderingContext | WebGL2RenderingContext;\n\n    currentNumAttributes: number;\n    maxTextureSize: number;\n\n    clearColor: ClearColor;\n    clearDepth: ClearDepth;\n    clearStencil: ClearStencil;\n    colorMask: ColorMask;\n    depthMask: DepthMask;\n    stencilMask: StencilMask;\n    stencilFunc: StencilFunc;\n    stencilOp: StencilOp;\n    stencilTest: StencilTest;\n    depthRange: DepthRange;\n    depthTest: DepthTest;\n    depthFunc: DepthFunc;\n    blend: Blend;\n    blendFunc: BlendFunc;\n    blendColor: BlendColor;\n    blendEquation: BlendEquation;\n    cullFace: CullFace;\n    cullFaceSide: CullFaceSide;\n    frontFace: FrontFace;\n    program: ProgramValue;\n    activeTexture: ActiveTextureUnit;\n    viewport: Viewport;\n    bindFramebuffer: BindFramebuffer;\n    bindRenderbuffer: BindRenderbuffer;\n    bindTexture: BindTexture;\n    bindVertexBuffer: BindVertexBuffer;\n    bindElementBuffer: BindElementBuffer;\n    bindVertexArray: BindVertexArray;\n    pixelStoreUnpack: PixelStoreUnpack;\n    pixelStoreUnpackPremultiplyAlpha: PixelStoreUnpackPremultiplyAlpha;\n    pixelStoreUnpackFlipY: PixelStoreUnpackFlipY;\n\n    // eslint-disable-next-line camelcase\n    extTextureFilterAnisotropic: EXT_texture_filter_anisotropic | null;\n    extTextureFilterAnisotropicMax?: GLfloat;\n    HALF_FLOAT?: GLenum;\n    RGBA16F?: GLenum;\n    RGB16F?: GLenum;\n\n    constructor(gl: WebGLRenderingContext | WebGL2RenderingContext) {\n        this.gl = gl;\n        this.clearColor = new ClearColor(this);\n        this.clearDepth = new ClearDepth(this);\n        this.clearStencil = new ClearStencil(this);\n        this.colorMask = new ColorMask(this);\n        this.depthMask = new DepthMask(this);\n        this.stencilMask = new StencilMask(this);\n        this.stencilFunc = new StencilFunc(this);\n        this.stencilOp = new StencilOp(this);\n        this.stencilTest = new StencilTest(this);\n        this.depthRange = new DepthRange(this);\n        this.depthTest = new DepthTest(this);\n        this.depthFunc = new DepthFunc(this);\n        this.blend = new Blend(this);\n        this.blendFunc = new BlendFunc(this);\n        this.blendColor = new BlendColor(this);\n        this.blendEquation = new BlendEquation(this);\n        this.cullFace = new CullFace(this);\n        this.cullFaceSide = new CullFaceSide(this);\n        this.frontFace = new FrontFace(this);\n        this.program = new ProgramValue(this);\n        this.activeTexture = new ActiveTextureUnit(this);\n        this.viewport = new Viewport(this);\n        this.bindFramebuffer = new BindFramebuffer(this);\n        this.bindRenderbuffer = new BindRenderbuffer(this);\n        this.bindTexture = new BindTexture(this);\n        this.bindVertexBuffer = new BindVertexBuffer(this);\n        this.bindElementBuffer = new BindElementBuffer(this);\n        this.bindVertexArray = new BindVertexArray(this);\n        this.pixelStoreUnpack = new PixelStoreUnpack(this);\n        this.pixelStoreUnpackPremultiplyAlpha = new PixelStoreUnpackPremultiplyAlpha(this);\n        this.pixelStoreUnpackFlipY = new PixelStoreUnpackFlipY(this);\n\n        this.extTextureFilterAnisotropic = (\n            gl.getExtension('EXT_texture_filter_anisotropic') ||\n            gl.getExtension('MOZ_EXT_texture_filter_anisotropic') ||\n            gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic')\n        );\n\n        if (this.extTextureFilterAnisotropic) {\n            this.extTextureFilterAnisotropicMax = gl.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n        }\n\n        this.maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n\n        if (isWebGL2(gl)) {\n            this.HALF_FLOAT = gl.HALF_FLOAT;\n            const extColorBufferHalfFloat = gl.getExtension('EXT_color_buffer_half_float');\n            this.RGBA16F = gl.RGBA16F ?? extColorBufferHalfFloat?.RGBA16F_EXT;\n            this.RGB16F = gl.RGB16F ?? extColorBufferHalfFloat?.RGB16F_EXT;\n            gl.getExtension('EXT_color_buffer_float');\n        } else {\n            gl.getExtension('EXT_color_buffer_half_float');\n            gl.getExtension('OES_texture_half_float_linear');\n            const extTextureHalfFloat = gl.getExtension('OES_texture_half_float');\n            this.HALF_FLOAT = extTextureHalfFloat?.HALF_FLOAT_OES;\n        }\n    }\n\n    setDefault() {\n        this.unbindVAO();\n\n        this.clearColor.setDefault();\n        this.clearDepth.setDefault();\n        this.clearStencil.setDefault();\n        this.colorMask.setDefault();\n        this.depthMask.setDefault();\n        this.stencilMask.setDefault();\n        this.stencilFunc.setDefault();\n        this.stencilOp.setDefault();\n        this.stencilTest.setDefault();\n        this.depthRange.setDefault();\n        this.depthTest.setDefault();\n        this.depthFunc.setDefault();\n        this.blend.setDefault();\n        this.blendFunc.setDefault();\n        this.blendColor.setDefault();\n        this.blendEquation.setDefault();\n        this.cullFace.setDefault();\n        this.cullFaceSide.setDefault();\n        this.frontFace.setDefault();\n        this.program.setDefault();\n        this.activeTexture.setDefault();\n        this.bindFramebuffer.setDefault();\n        this.pixelStoreUnpack.setDefault();\n        this.pixelStoreUnpackPremultiplyAlpha.setDefault();\n        this.pixelStoreUnpackFlipY.setDefault();\n    }\n\n    setDirty() {\n        this.clearColor.dirty = true;\n        this.clearDepth.dirty = true;\n        this.clearStencil.dirty = true;\n        this.colorMask.dirty = true;\n        this.depthMask.dirty = true;\n        this.stencilMask.dirty = true;\n        this.stencilFunc.dirty = true;\n        this.stencilOp.dirty = true;\n        this.stencilTest.dirty = true;\n        this.depthRange.dirty = true;\n        this.depthTest.dirty = true;\n        this.depthFunc.dirty = true;\n        this.blend.dirty = true;\n        this.blendFunc.dirty = true;\n        this.blendColor.dirty = true;\n        this.blendEquation.dirty = true;\n        this.cullFace.dirty = true;\n        this.cullFaceSide.dirty = true;\n        this.frontFace.dirty = true;\n        this.program.dirty = true;\n        this.activeTexture.dirty = true;\n        this.viewport.dirty = true;\n        this.bindFramebuffer.dirty = true;\n        this.bindRenderbuffer.dirty = true;\n        this.bindTexture.dirty = true;\n        this.bindVertexBuffer.dirty = true;\n        this.bindElementBuffer.dirty = true;\n        this.bindVertexArray.dirty = true;\n        this.pixelStoreUnpack.dirty = true;\n        this.pixelStoreUnpackPremultiplyAlpha.dirty = true;\n        this.pixelStoreUnpackFlipY.dirty = true;\n    }\n\n    createIndexBuffer(array: TriangleIndexArray | LineIndexArray | LineStripIndexArray, dynamicDraw?: boolean) {\n        return new IndexBuffer(this, array, dynamicDraw);\n    }\n\n    createVertexBuffer(array: StructArray, attributes: ReadonlyArray<StructArrayMember>, dynamicDraw?: boolean) {\n        return new VertexBuffer(this, array, attributes, dynamicDraw);\n    }\n\n    createRenderbuffer(storageFormat: number, width: number, height: number) {\n        const gl = this.gl;\n\n        const rbo = gl.createRenderbuffer();\n        this.bindRenderbuffer.set(rbo);\n        gl.renderbufferStorage(gl.RENDERBUFFER, storageFormat, width, height);\n        this.bindRenderbuffer.set(null);\n\n        return rbo;\n    }\n\n    createFramebuffer(width: number, height: number, hasDepth: boolean, hasStencil: boolean) {\n        return new Framebuffer(this, width, height, hasDepth, hasStencil);\n    }\n\n    clear({\n        color,\n        depth,\n        stencil\n    }: ClearArgs) {\n        const gl = this.gl;\n        let mask = 0;\n\n        if (color) {\n            mask |= gl.COLOR_BUFFER_BIT;\n            this.clearColor.set(color);\n            this.colorMask.set([true, true, true, true]);\n        }\n\n        if (typeof depth !== 'undefined') {\n            mask |= gl.DEPTH_BUFFER_BIT;\n\n            // Workaround for platforms where clearDepth doesn't seem to work\n            // without resetting the depthRange. See https://github.com/mapbox/mapbox-gl-js/issues/3437\n            this.depthRange.set([0, 1]);\n\n            this.clearDepth.set(depth);\n            this.depthMask.set(true);\n        }\n\n        if (typeof stencil !== 'undefined') {\n            mask |= gl.STENCIL_BUFFER_BIT;\n            this.clearStencil.set(stencil);\n            this.stencilMask.set(0xFF);\n        }\n\n        gl.clear(mask);\n    }\n\n    setCullFace(cullFaceMode: Readonly<CullFaceMode>) {\n        if (cullFaceMode.enable === false) {\n            this.cullFace.set(false);\n        } else {\n            this.cullFace.set(true);\n            this.cullFaceSide.set(cullFaceMode.mode);\n            this.frontFace.set(cullFaceMode.frontFace);\n        }\n    }\n\n    setDepthMode(depthMode: Readonly<DepthMode>) {\n        if (depthMode.func === this.gl.ALWAYS && !depthMode.mask) {\n            this.depthTest.set(false);\n        } else {\n            this.depthTest.set(true);\n            this.depthFunc.set(depthMode.func);\n            this.depthMask.set(depthMode.mask);\n            this.depthRange.set(depthMode.range);\n        }\n    }\n\n    setStencilMode(stencilMode: Readonly<StencilMode>) {\n        if (stencilMode.test.func === this.gl.ALWAYS && !stencilMode.mask) {\n            this.stencilTest.set(false);\n        } else {\n            this.stencilTest.set(true);\n            this.stencilMask.set(stencilMode.mask);\n            this.stencilOp.set([stencilMode.fail, stencilMode.depthFail, stencilMode.pass]);\n            this.stencilFunc.set({\n                func: stencilMode.test.func,\n                ref: stencilMode.ref,\n                mask: stencilMode.test.mask\n            });\n        }\n    }\n\n    setColorMode(colorMode: Readonly<ColorMode>) {\n        if (deepEqual(colorMode.blendFunction, ColorMode.Replace)) {\n            this.blend.set(false);\n        } else {\n            this.blend.set(true);\n            this.blendFunc.set(colorMode.blendFunction);\n            this.blendColor.set(colorMode.blendColor);\n        }\n\n        this.colorMask.set(colorMode.mask);\n    }\n\n    createVertexArray(): WebGLVertexArrayObject | undefined {\n        if (isWebGL2(this.gl))\n            return this.gl.createVertexArray();\n        return this.gl.getExtension('OES_vertex_array_object')?.createVertexArrayOES();\n    }\n\n    deleteVertexArray(x: WebGLVertexArrayObject | undefined) {\n        if (isWebGL2(this.gl))\n            return this.gl.deleteVertexArray(x);\n        return this.gl.getExtension('OES_vertex_array_object')?.deleteVertexArrayOES(x);\n    }\n\n    unbindVAO() {\n        // Unbinding the VAO prevents other things (custom layers, new buffer creation) from\n        // unintentionally changing the state of the last VAO used.\n        this.bindVertexArray.set(null);\n    }\n}\n", "import type {DepthFuncType, DepthMaskType, DepthRangeType} from './types';\n\nconst ALWAYS = 0x0207;\n\nexport class DepthMode {\n    func: DepthFuncType;\n    mask: DepthMaskType;\n    range: DepthRangeType;\n\n    // DepthMask enums\n    static ReadOnly: boolean;\n    static ReadWrite: boolean;\n\n    constructor(depthFunc: DepthFuncType, depthMask: DepthMaskType, depthRange: DepthRangeType) {\n        this.func = depthFunc;\n        this.mask = depthMask;\n        this.range = depthRange;\n    }\n\n    static disabled: Readonly<DepthMode>;\n}\n\nDepthMode.ReadOnly = false;\nDepthMode.ReadWrite = true;\n\nDepthMode.disabled = new DepthMode(ALWAYS, DepthMode.ReadOnly, [0, 1]);\n", "import type {StencilOpConstant, StencilTestGL} from './types';\n\nconst ALWAYS = 0x0207;\nconst KEEP = 0x1E00;\n\nexport class StencilMode {\n    test: StencilTestGL;\n    ref: number;\n    mask: number;\n    fail: StencilOpConstant;\n    depthFail: StencilOpConstant;\n    pass: StencilOpConstant;\n\n    constructor(test: StencilTestGL, ref: number, mask: number, fail: StencilOpConstant,\n        depthFail: StencilOpConstant, pass: StencilOpConstant) {\n        this.test = test;\n        this.ref = ref;\n        this.mask = mask;\n        this.fail = fail;\n        this.depthFail = depthFail;\n        this.pass = pass;\n    }\n\n    static disabled: Readonly<StencilMode>;\n}\n\nStencilMode.disabled = new StencilMode({func: ALWAYS, mask: 0}, 0, 0, KEEP, KEEP, KEEP);\n", "import type {CullFaceModeType, FrontFaceType} from './types';\n\nconst BACK = 0x0405;\nconst CCW = 0x0901;\n\nexport class CullFaceMode {\n    enable: boolean;\n    mode: CullFaceModeType;\n    frontFace: FrontFaceType;\n\n    constructor(enable: boolean, mode: CullFaceModeType, frontFace: FrontFaceType) {\n        this.enable = enable;\n        this.mode = mode;\n        this.frontFace = frontFace;\n    }\n\n    static disabled: Readonly<CullFaceMode>;\n    static backCCW: Readonly<CullFaceMode>;\n}\n\nCullFaceMode.disabled = new CullFaceMode(false, BACK, CCW);\nCullFaceMode.backCCW = new CullFaceMode(true, BACK, CCW);\n", "import type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {OverscaledTileID} from '../source/tile_id';\nimport type {SymbolBucket} from '../data/bucket/symbol_bucket';\nimport {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {collisionUniformValues, collisionCircleUniformValues} from './program/collision_program';\nimport {QuadTriangleArray, CollisionCircleLayoutArray} from '../data/array_types.g';\nimport {collisionCircleLayout} from '../data/bucket/symbol_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {mat4} from 'gl-matrix';\nimport {VertexBuffer} from '../gl/vertex_buffer';\nimport {IndexBuffer} from '../gl/index_buffer';\n\ntype TileBatch = {\n    circleArray: Array<number>;\n    circleOffset: number;\n    transform: mat4;\n    invTransform: mat4;\n    coord: OverscaledTileID;\n};\n\nlet quadTriangles: QuadTriangleArray;\n\nexport function drawCollisionDebug(painter: Painter, sourceCache: SourceCache, layer: StyleLayer, coords: Array<OverscaledTileID>, isText: boolean) {\n    const context = painter.context;\n    const gl = context.gl;\n    const program = painter.useProgram('collisionBox');\n    const tileBatches: Array<TileBatch> = [];\n    let circleCount = 0;\n    let circleOffset = 0;\n\n    for (let i = 0; i < coords.length; i++) {\n        const coord = coords[i];\n        const tile = sourceCache.getTile(coord);\n        const bucket: SymbolBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n        const buffers = isText ? bucket.textCollisionBox : bucket.iconCollisionBox;\n        // Get collision circle data of this bucket\n        const circleArray: Array<number> = bucket.collisionCircleArray;\n        if (circleArray.length > 0) {\n            // We need to know the projection matrix that was used for projecting collision circles to the screen.\n            // This might vary between buckets as the symbol placement is a continuous process. This matrix is\n            // required for transforming points from previous screen space to the current one\n            const invTransform = mat4.create();\n\n            mat4.mul(invTransform, bucket.placementInvProjMatrix, painter.transform.glCoordMatrix);\n            mat4.mul(invTransform, invTransform, bucket.placementViewportMatrix);\n\n            tileBatches.push({\n                circleArray,\n                circleOffset,\n                transform: coord.posMatrix, // Ignore translation\n                invTransform,\n                coord\n            });\n\n            circleCount += circleArray.length / 4;  // 4 values per circle\n            circleOffset = circleCount;\n        }\n\n        // Draw collision boxes\n        if (!buffers) {\n            continue;\n        }\n\n        program.draw(context, gl.LINES,\n            DepthMode.disabled, StencilMode.disabled,\n            painter.colorModeForRenderPass(),\n            CullFaceMode.disabled,\n            collisionUniformValues(painter.transform, coord.posMatrix),\n            painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord),\n            layer.id, buffers.layoutVertexBuffer, buffers.indexBuffer,\n            buffers.segments, null, painter.transform.zoom, null, null,\n            buffers.collisionVertexBuffer);\n    }\n\n    if (!isText || !tileBatches.length) {\n        return;\n    }\n\n    // Render collision circles\n    const circleProgram = painter.useProgram('collisionCircle');\n\n    // Construct vertex data\n    const vertexData = new CollisionCircleLayoutArray();\n    vertexData.resize(circleCount * 4);\n    vertexData._trim();\n\n    let vertexOffset = 0;\n\n    for (const batch of tileBatches) {\n        for (let i = 0; i < batch.circleArray.length / 4; i++) {\n            const circleIdx = i * 4;\n            const x = batch.circleArray[circleIdx + 0];\n            const y = batch.circleArray[circleIdx + 1];\n            const radius = batch.circleArray[circleIdx + 2];\n            const collision = batch.circleArray[circleIdx + 3];\n\n            // 4 floats per vertex, 4 vertices per quad\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 0);\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 1);\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 2);\n            vertexData.emplace(vertexOffset++, x, y, radius, collision, 3);\n        }\n    }\n    if (!quadTriangles || quadTriangles.length < circleCount * 2) {\n        quadTriangles = createQuadTriangles(circleCount);\n    }\n\n    const indexBuffer: IndexBuffer = context.createIndexBuffer(quadTriangles, true);\n    const vertexBuffer: VertexBuffer = context.createVertexBuffer(vertexData, collisionCircleLayout.members, true);\n\n    // Render batches\n    for (const batch of tileBatches) {\n        const uniforms = collisionCircleUniformValues(\n            batch.transform,\n            batch.invTransform,\n            painter.transform\n        );\n\n        circleProgram.draw(\n            context,\n            gl.TRIANGLES,\n            DepthMode.disabled,\n            StencilMode.disabled,\n            painter.colorModeForRenderPass(),\n            CullFaceMode.disabled,\n            uniforms,\n            painter.style.map.terrain && painter.style.map.terrain.getTerrainData(batch.coord),\n            layer.id,\n            vertexBuffer,\n            indexBuffer,\n            SegmentVector.simpleSegment(0, batch.circleOffset * 2, batch.circleArray.length, batch.circleArray.length / 2),\n            null,\n            painter.transform.zoom,\n            null,\n            null,\n            null);\n    }\n\n    vertexBuffer.destroy();\n    indexBuffer.destroy();\n}\n\nfunction createQuadTriangles(quadCount: number): QuadTriangleArray {\n    const triCount = quadCount * 2;\n    const array = new QuadTriangleArray();\n\n    array.resize(triCount);\n    array._trim();\n\n    // Two triangles and 4 vertices per quad.\n    for (let i = 0; i < triCount; i++) {\n        const idx = i * 6;\n\n        array.uint16[idx + 0] = i * 4 + 0;\n        array.uint16[idx + 1] = i * 4 + 1;\n        array.uint16[idx + 2] = i * 4 + 2;\n        array.uint16[idx + 3] = i * 4 + 2;\n        array.uint16[idx + 4] = i * 4 + 3;\n        array.uint16[idx + 5] = i * 4 + 0;\n    }\n\n    return array;\n}\n", "import Point from '@mapbox/point-geometry';\nimport {drawCollisionDebug} from './draw_collision_debug';\n\nimport {SegmentVector} from '../data/segment';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport * as symbolProjection from '../symbol/projection';\nimport {EvaluatedZoomSize, evaluateSizeForFeature, evaluateSizeForZoom} from '../symbol/symbol_size';\nimport {mat4} from 'gl-matrix';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {addDynamicAttributes} from '../data/bucket/symbol_bucket';\n\nimport {getAnchorAlignment, WritingMode} from '../symbol/shaping';\nimport ONE_EM from '../symbol/one_em';\n\nimport {\n    SymbolIconUniformsType,\n    symbolIconUniformValues,\n    symbolSDFUniformValues,\n    symbolTextAndIconUniformValues\n} from './program/symbol_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {SymbolStyleLayer} from '../style/style_layer/symbol_style_layer';\n\nimport type {Texture, TextureFilter} from '../render/texture';\nimport type {OverscaledTileID, UnwrappedTileID} from '../source/tile_id';\nimport type {UniformValues} from './uniform_binding';\nimport type {SymbolSDFUniformsType} from '../render/program/symbol_program';\nimport type {CrossTileID, VariableOffset} from '../symbol/placement';\nimport type {SymbolBucket, SymbolBuffers} from '../data/bucket/symbol_bucket';\nimport type {TerrainData} from '../render/terrain';\nimport type {SymbolLayerSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport type {Transform} from '../geo/transform';\nimport type {ColorMode} from '../gl/color_mode';\nimport type {Program} from './program';\nimport type {TextAnchor} from '../style/style_layer/variable_text_anchor';\nimport {createProjection, Projection} from '../geo/projection/projection';\n\ntype SymbolTileRenderState = {\n    segments: SegmentVector;\n    sortKey: number;\n    terrainData: TerrainData;\n    state: {\n        program: Program<any>;\n        buffers: SymbolBuffers;\n        uniformValues: UniformValues<SymbolSDFUniformsType | SymbolIconUniformsType>;\n        atlasTexture: Texture;\n        atlasTextureIcon: Texture | null;\n        atlasInterpolation: TextureFilter;\n        atlasInterpolationIcon: TextureFilter;\n        isSDF: boolean;\n        hasHalo: boolean;\n    };\n};\n\nconst identityMat4 = mat4.identity(new Float32Array(16));\n\nexport function drawSymbols(painter: Painter, sourceCache: SourceCache, layer: SymbolStyleLayer, coords: Array<OverscaledTileID>, variableOffsets: {\n    [_ in CrossTileID]: VariableOffset;\n}) {\n    if (painter.renderPass !== 'translucent') return;\n\n    // Disable the stencil test so that labels aren't clipped to tile boundaries.\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n    const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n\n    //Compute variable-offsets before painting since icons and text data positioning\n    //depend on each other in this case.\n    if (hasVariablePlacement) {\n        updateVariableAnchors(coords, painter, layer, sourceCache,\n            layer.layout.get('text-rotation-alignment'),\n            layer.layout.get('text-pitch-alignment'),\n            layer.paint.get('text-translate'),\n            layer.paint.get('text-translate-anchor'),\n            variableOffsets\n        );\n    }\n\n    if (layer.paint.get('icon-opacity').constantOr(1) !== 0) {\n        drawLayerSymbols(painter, sourceCache, layer, coords, false,\n            layer.paint.get('icon-translate'),\n            layer.paint.get('icon-translate-anchor'),\n            layer.layout.get('icon-rotation-alignment'),\n            layer.layout.get('icon-pitch-alignment'),\n            layer.layout.get('icon-keep-upright'),\n            stencilMode, colorMode\n        );\n    }\n\n    if (layer.paint.get('text-opacity').constantOr(1) !== 0) {\n        drawLayerSymbols(painter, sourceCache, layer, coords, true,\n            layer.paint.get('text-translate'),\n            layer.paint.get('text-translate-anchor'),\n            layer.layout.get('text-rotation-alignment'),\n            layer.layout.get('text-pitch-alignment'),\n            layer.layout.get('text-keep-upright'),\n            stencilMode, colorMode\n        );\n    }\n\n    if (sourceCache.map.showCollisionBoxes) {\n        drawCollisionDebug(painter, sourceCache, layer, coords, true);\n        drawCollisionDebug(painter, sourceCache, layer, coords, false);\n    }\n}\n\nfunction calculateVariableRenderShift(\n    anchor: TextAnchor,\n    width: number,\n    height: number,\n    textOffset: [number, number],\n    textBoxScale: number,\n    renderTextSize: number): Point {\n    const {horizontalAlign, verticalAlign} = getAnchorAlignment(anchor);\n    const shiftX = -(horizontalAlign - 0.5) * width;\n    const shiftY = -(verticalAlign - 0.5) * height;\n    return new Point(\n        (shiftX / textBoxScale + textOffset[0]) * renderTextSize,\n        (shiftY / textBoxScale + textOffset[1]) * renderTextSize\n    );\n}\n\nfunction updateVariableAnchors(coords: Array<OverscaledTileID>,\n    painter: Painter,\n    layer:SymbolStyleLayer, sourceCache: SourceCache,\n    rotationAlignment: SymbolLayerSpecification['layout']['text-rotation-alignment'],\n    pitchAlignment: SymbolLayerSpecification['layout']['text-pitch-alignment'],\n    translate: [number, number],\n    translateAnchor: 'map' | 'viewport',\n    variableOffsets: {[_ in CrossTileID]: VariableOffset}) {\n    const transform = painter.transform;\n    const projection = createProjection();\n    const rotateWithMap = rotationAlignment === 'map';\n    const pitchWithMap = pitchAlignment === 'map';\n\n    for (const coord of coords) {\n        const tile = sourceCache.getTile(coord);\n        const bucket = tile.getBucket(layer) as SymbolBucket;\n        if (!bucket || !bucket.text || !bucket.text.segments.get().length) continue;\n\n        const sizeData = bucket.textSizeData;\n        const size = evaluateSizeForZoom(sizeData, transform.zoom);\n\n        const pixelToTileScale = pixelsToTileUnits(tile, 1, painter.transform.zoom);\n        const labelPlaneMatrix = symbolProjection.getLabelPlaneMatrix(coord.posMatrix, pitchWithMap, rotateWithMap, painter.transform, pixelToTileScale);\n        const updateTextFitIcon = layer.layout.get('icon-text-fit') !== 'none' && bucket.hasIconData();\n\n        if (size) {\n            const tileScale = Math.pow(2, transform.zoom - tile.tileID.overscaledZ);\n            const getElevation = painter.style.map.terrain ? (x: number, y: number) => painter.style.map.terrain.getElevation(coord, x, y) : null;\n            const translation = projection.translatePosition(transform, tile, translate, translateAnchor);\n            updateVariableAnchorsForBucket(bucket, rotateWithMap, pitchWithMap, variableOffsets,\n                transform, labelPlaneMatrix, coord.posMatrix, tileScale, size, updateTextFitIcon, projection, translation, coord.toUnwrapped(), getElevation);\n        }\n    }\n}\n\nfunction getShiftedAnchor(projectedAnchorPoint: Point, projectionContext: symbolProjection.SymbolProjectionContext, rotateWithMap, shift: Point, transformAngle: number, pitchedTextShiftCorrection: number) {\n    // Usual case is that we take the projected anchor and add the pixel-based shift\n    // calculated earlier. In the (somewhat weird) case of pitch-aligned text, we add an equivalent\n    // tile-unit based shift to the anchor before projecting to the label plane.\n    const translatedAnchor = projectionContext.tileAnchorPoint.add(new Point(projectionContext.translation[0], projectionContext.translation[1]));\n    if (projectionContext.pitchWithMap) {\n        let adjustedShift = shift.mult(pitchedTextShiftCorrection);\n        if (!rotateWithMap) {\n            adjustedShift = adjustedShift.rotate(-transformAngle);\n        }\n        const tileAnchorShifted = translatedAnchor.add(adjustedShift);\n        return symbolProjection.project(tileAnchorShifted.x, tileAnchorShifted.y, projectionContext.labelPlaneMatrix, projectionContext.getElevation).point;\n    } else {\n        if (rotateWithMap) {\n            // Compute the angle with which to rotate the anchor, so that it is aligned with\n            // the map's actual east-west axis. Very similar to what is done in the shader.\n            const projectedAnchorRight = symbolProjection.projectTileCoordinatesToViewport(projectionContext.tileAnchorPoint.x + 1, projectionContext.tileAnchorPoint.y, projectionContext);\n            const east = projectedAnchorRight.point.sub(projectedAnchorPoint);\n            const angle = Math.atan(east.y / east.x) + (east.x < 0 ? Math.PI : 0);\n            return projectedAnchorPoint.add(shift.rotate(angle));\n        } else {\n            return projectedAnchorPoint.add(shift);\n        }\n    }\n}\n\nfunction updateVariableAnchorsForBucket(\n    bucket: SymbolBucket,\n    rotateWithMap: boolean,\n    pitchWithMap: boolean,\n    variableOffsets: {[_ in CrossTileID]: VariableOffset},\n    transform: Transform,\n    labelPlaneMatrix: mat4,\n    posMatrix: mat4,\n    tileScale: number,\n    size: EvaluatedZoomSize,\n    updateTextFitIcon: boolean,\n    projection: Projection,\n    translation: [number, number],\n    unwrappedTileID: UnwrappedTileID,\n    getElevation: (x: number, y: number) => number) {\n    const placedSymbols = bucket.text.placedSymbolArray;\n    const dynamicTextLayoutVertexArray = bucket.text.dynamicLayoutVertexArray;\n    const dynamicIconLayoutVertexArray = bucket.icon.dynamicLayoutVertexArray;\n    const placedTextShifts = {};\n\n    dynamicTextLayoutVertexArray.clear();\n    for (let s = 0; s < placedSymbols.length; s++) {\n        const symbol = placedSymbols.get(s);\n        const skipOrientation = bucket.allowVerticalPlacement && !symbol.placedOrientation;\n        const variableOffset = (!symbol.hidden && symbol.crossTileID && !skipOrientation) ? variableOffsets[symbol.crossTileID] : null;\n\n        if (!variableOffset) {\n            // These symbols are from a justification that is not being used, or a label that wasn't placed\n            // so we don't need to do the extra math to figure out what incremental shift to apply.\n            symbolProjection.hideGlyphs(symbol.numGlyphs, dynamicTextLayoutVertexArray);\n        } else  {\n            const tileAnchor = new Point(symbol.anchorX, symbol.anchorY);\n            const projectionContext = {\n                getElevation,\n                width: transform.width,\n                height: transform.height,\n                labelPlaneMatrix,\n                lineVertexArray: null,\n                pitchWithMap,\n                projection,\n                projectionCache: null,\n                tileAnchorPoint: tileAnchor,\n                translation,\n                unwrappedTileID\n            };\n            const projectedAnchor = pitchWithMap ?\n                symbolProjection.project(tileAnchor.x, tileAnchor.y, posMatrix, getElevation) :\n                symbolProjection.projectTileCoordinatesToViewport(tileAnchor.x, tileAnchor.y, projectionContext);\n            const perspectiveRatio = symbolProjection.getPerspectiveRatio(transform.cameraToCenterDistance, projectedAnchor.signedDistanceFromCamera);\n            let renderTextSize = evaluateSizeForFeature(bucket.textSizeData, size, symbol) * perspectiveRatio / ONE_EM;\n            if (pitchWithMap) {\n                // Go from size in pixels to equivalent size in tile units\n                renderTextSize *= bucket.tilePixelRatio / tileScale;\n            }\n\n            const {width, height, anchor, textOffset, textBoxScale} = variableOffset;\n            const shift = calculateVariableRenderShift(anchor, width, height, textOffset, textBoxScale, renderTextSize);\n\n            const pitchedTextCorrection = projection.getPitchedTextCorrection(transform, tileAnchor.add(new Point(translation[0], translation[1])), unwrappedTileID);\n            const shiftedAnchor = getShiftedAnchor(projectedAnchor.point, projectionContext, rotateWithMap, shift, transform.angle, pitchedTextCorrection);\n\n            const angle = (bucket.allowVerticalPlacement && symbol.placedOrientation === WritingMode.vertical) ? Math.PI / 2 : 0;\n            for (let g = 0; g < symbol.numGlyphs; g++) {\n                addDynamicAttributes(dynamicTextLayoutVertexArray, shiftedAnchor, angle);\n            }\n            //Only offset horizontal text icons\n            if (updateTextFitIcon && symbol.associatedIconIndex >= 0) {\n                placedTextShifts[symbol.associatedIconIndex] = {shiftedAnchor, angle};\n            }\n        }\n    }\n\n    if (updateTextFitIcon) {\n        dynamicIconLayoutVertexArray.clear();\n        const placedIcons = bucket.icon.placedSymbolArray;\n        for (let i = 0; i < placedIcons.length; i++) {\n            const placedIcon = placedIcons.get(i);\n            if (placedIcon.hidden) {\n                symbolProjection.hideGlyphs(placedIcon.numGlyphs, dynamicIconLayoutVertexArray);\n            } else {\n                const shift = placedTextShifts[i];\n                if (!shift) {\n                    symbolProjection.hideGlyphs(placedIcon.numGlyphs, dynamicIconLayoutVertexArray);\n                } else {\n                    for (let g = 0; g < placedIcon.numGlyphs; g++) {\n                        addDynamicAttributes(dynamicIconLayoutVertexArray, shift.shiftedAnchor, shift.angle);\n                    }\n                }\n            }\n        }\n        bucket.icon.dynamicLayoutVertexBuffer.updateData(dynamicIconLayoutVertexArray);\n    }\n    bucket.text.dynamicLayoutVertexBuffer.updateData(dynamicTextLayoutVertexArray);\n}\n\nfunction getSymbolProgramName(isSDF: boolean, isText: boolean, bucket: SymbolBucket) {\n    if (bucket.iconsInText && isText) {\n        return 'symbolTextAndIcon';\n    } else if (isSDF) {\n        return 'symbolSDF';\n    } else {\n        return 'symbolIcon';\n    }\n}\n\nfunction drawLayerSymbols(\n    painter: Painter,\n    sourceCache: SourceCache,\n    layer: SymbolStyleLayer,\n    coords: Array<OverscaledTileID>,\n    isText: boolean,\n    translate: [number, number],\n    translateAnchor: 'map' | 'viewport',\n    rotationAlignment: SymbolLayerSpecification['layout']['text-rotation-alignment'],\n    pitchAlignment: SymbolLayerSpecification['layout']['text-pitch-alignment'],\n    keepUpright: boolean,\n    stencilMode: StencilMode,\n    colorMode: Readonly<ColorMode>) {\n\n    const context = painter.context;\n    const gl = context.gl;\n    const tr = painter.transform;\n    const projection = createProjection();\n\n    const rotateWithMap = rotationAlignment === 'map';\n    const pitchWithMap = pitchAlignment === 'map';\n    const alongLine = rotationAlignment !== 'viewport' && layer.layout.get('symbol-placement') !== 'point';\n    // Line label rotation happens in `updateLineLabels`\n    // Pitched point labels are automatically rotated by the labelPlaneMatrix projection\n    // Unpitched point labels need to have their rotation applied after projection\n    const rotateInShader = rotateWithMap && !pitchWithMap && !alongLine;\n\n    const isViewportLine = !pitchWithMap && alongLine;\n\n    const hasSortKey = !layer.layout.get('symbol-sort-key').isConstant();\n    let sortFeaturesByKey = false;\n\n    const depthMode = painter.depthModeForSublayer(0, DepthMode.ReadOnly);\n\n    const hasVariablePlacement = layer._unevaluatedLayout.hasValue('text-variable-anchor') || layer._unevaluatedLayout.hasValue('text-variable-anchor-offset');\n\n    const tileRenderState: Array<SymbolTileRenderState> = [];\n\n    const pitchedTextRescaling = projection.getCircleRadiusCorrection(tr);\n\n    for (const coord of coords) {\n        const tile = sourceCache.getTile(coord);\n        const bucket = tile.getBucket(layer) as SymbolBucket;\n        if (!bucket) continue;\n        const buffers = isText ? bucket.text : bucket.icon;\n\n        if (!buffers || !buffers.segments.get().length || !buffers.hasVisibleVertices) continue;\n        const programConfiguration = buffers.programConfigurations.get(layer.id);\n\n        const isSDF = isText || bucket.sdfIcons;\n\n        const sizeData = isText ? bucket.textSizeData : bucket.iconSizeData;\n        const transformed = pitchWithMap || tr.pitch !== 0;\n\n        const program = painter.useProgram(getSymbolProgramName(isSDF, isText, bucket), programConfiguration);\n        const size = evaluateSizeForZoom(sizeData, tr.zoom);\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n        let texSize: [number, number];\n        let texSizeIcon: [number, number] = [0, 0];\n        let atlasTexture: Texture;\n        let atlasInterpolation: TextureFilter;\n        let atlasTextureIcon = null;\n        let atlasInterpolationIcon: TextureFilter;\n        if (isText) {\n            atlasTexture = tile.glyphAtlasTexture;\n            atlasInterpolation = gl.LINEAR;\n            texSize = tile.glyphAtlasTexture.size;\n            if (bucket.iconsInText) {\n                texSizeIcon = tile.imageAtlasTexture.size;\n                atlasTextureIcon = tile.imageAtlasTexture;\n                const zoomDependentSize = sizeData.kind === 'composite' || sizeData.kind === 'camera';\n                atlasInterpolationIcon = transformed || painter.options.rotating || painter.options.zooming || zoomDependentSize ? gl.LINEAR : gl.NEAREST;\n            }\n        } else {\n            const iconScaled = layer.layout.get('icon-size').constantOr(0) !== 1 || bucket.iconsNeedLinear;\n            atlasTexture = tile.imageAtlasTexture;\n            atlasInterpolation = isSDF || painter.options.rotating || painter.options.zooming || iconScaled || transformed ?\n                gl.LINEAR :\n                gl.NEAREST;\n            texSize = tile.imageAtlasTexture.size;\n        }\n\n        const s = pixelsToTileUnits(tile, 1, painter.transform.zoom);\n        const baseMatrix = isViewportLine ? coord.posMatrix : identityMat4;\n        const labelPlaneMatrix = symbolProjection.getLabelPlaneMatrix(baseMatrix, pitchWithMap, rotateWithMap, painter.transform, s);\n        const glCoordMatrixForShader = symbolProjection.getGlCoordMatrix(baseMatrix, pitchWithMap, rotateWithMap, painter.transform, s);\n        const glCoordMatrixForSymbolPlacement = symbolProjection.getGlCoordMatrix(coord.posMatrix, pitchWithMap, rotateWithMap, painter.transform, s);\n\n        const translation = projection.translatePosition(painter.transform, tile, translate, translateAnchor);\n\n        const hasVariableAnchors = hasVariablePlacement && bucket.hasTextData();\n        const updateTextFitIcon = layer.layout.get('icon-text-fit') !== 'none' &&\n            hasVariableAnchors &&\n            bucket.hasIconData();\n\n        if (alongLine) {\n            const getElevation = painter.style.map.terrain ? (x: number, y: number) => painter.style.map.terrain.getElevation(coord, x, y) : null;\n            const rotateToLine = layer.layout.get('text-rotation-alignment') === 'map';\n            symbolProjection.updateLineLabels(bucket, coord.posMatrix, painter, isText, labelPlaneMatrix, glCoordMatrixForSymbolPlacement, pitchWithMap, keepUpright, rotateToLine, projection, coord.toUnwrapped(), tr.width, tr.height, translation, getElevation);\n        }\n\n        const matrix = coord.posMatrix; // formerly also incorporated translate and translate-anchor\n        const shaderVariableAnchor = (isText && hasVariablePlacement) || updateTextFitIcon;\n        const noLabelPlane = (alongLine || shaderVariableAnchor);\n        const uLabelPlaneMatrix = noLabelPlane ? identityMat4 : labelPlaneMatrix;\n        const uglCoordMatrix = glCoordMatrixForShader; // formerly also incorporated translate and translate-anchor\n\n        const hasHalo = isSDF && layer.paint.get(isText ? 'text-halo-width' : 'icon-halo-width').constantOr(1) !== 0;\n\n        let uniformValues: UniformValues<SymbolSDFUniformsType | SymbolIconUniformsType>;\n        if (isSDF) {\n            if (!bucket.iconsInText) {\n                uniformValues = symbolSDFUniformValues(sizeData.kind,\n                    size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter, matrix,\n                    uLabelPlaneMatrix, uglCoordMatrix, translation, isText, texSize, true, pitchedTextRescaling);\n            } else {\n                uniformValues = symbolTextAndIconUniformValues(sizeData.kind,\n                    size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter, matrix,\n                    uLabelPlaneMatrix, uglCoordMatrix, translation, texSize, texSizeIcon, pitchedTextRescaling);\n            }\n        } else {\n            uniformValues = symbolIconUniformValues(sizeData.kind,\n                size, rotateInShader, pitchWithMap, alongLine, shaderVariableAnchor, painter, matrix,\n                uLabelPlaneMatrix, uglCoordMatrix, translation, isText, texSize, pitchedTextRescaling);\n        }\n\n        const state = {\n            program,\n            buffers,\n            uniformValues,\n            atlasTexture,\n            atlasTextureIcon,\n            atlasInterpolation,\n            atlasInterpolationIcon,\n            isSDF,\n            hasHalo\n        };\n\n        if (hasSortKey && bucket.canOverlap) {\n            sortFeaturesByKey = true;\n            const oldSegments = buffers.segments.get();\n            for (const segment of oldSegments) {\n                tileRenderState.push({\n                    segments: new SegmentVector([segment]),\n                    sortKey: segment.sortKey,\n                    state,\n                    terrainData\n                });\n            }\n        } else {\n            tileRenderState.push({\n                segments: buffers.segments,\n                sortKey: 0,\n                state,\n                terrainData\n            });\n        }\n    }\n\n    if (sortFeaturesByKey) {\n        tileRenderState.sort((a, b) => a.sortKey - b.sortKey);\n    }\n\n    for (const segmentState of tileRenderState) {\n        const state = segmentState.state;\n\n        context.activeTexture.set(gl.TEXTURE0);\n        state.atlasTexture.bind(state.atlasInterpolation, gl.CLAMP_TO_EDGE);\n        if (state.atlasTextureIcon) {\n            context.activeTexture.set(gl.TEXTURE1);\n            if (state.atlasTextureIcon) {\n                state.atlasTextureIcon.bind(state.atlasInterpolationIcon, gl.CLAMP_TO_EDGE);\n            }\n        }\n\n        if (state.isSDF) {\n            const uniformValues = state.uniformValues;\n            if (state.hasHalo) {\n                uniformValues['u_is_halo'] = 1;\n                drawSymbolElements(state.buffers, segmentState.segments, layer, painter, state.program, depthMode, stencilMode, colorMode, uniformValues, segmentState.terrainData);\n            }\n            uniformValues['u_is_halo'] = 0;\n        }\n        drawSymbolElements(state.buffers, segmentState.segments, layer, painter, state.program, depthMode, stencilMode, colorMode, state.uniformValues, segmentState.terrainData);\n    }\n}\n\nfunction drawSymbolElements(\n    buffers: SymbolBuffers,\n    segments: SegmentVector,\n    layer: SymbolStyleLayer,\n    painter: Painter,\n    program: Program<any>,\n    depthMode: Readonly<DepthMode>,\n    stencilMode: StencilMode,\n    colorMode: Readonly<ColorMode>,\n    uniformValues: UniformValues<SymbolSDFUniformsType | SymbolIconUniformsType>,\n    terrainData: TerrainData) {\n    const context = painter.context;\n    const gl = context.gl;\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n        uniformValues, terrainData, layer.id, buffers.layoutVertexBuffer,\n        buffers.indexBuffer, segments, layer.paint,\n        painter.transform.zoom, buffers.programConfigurations.get(layer.id),\n        buffers.dynamicLayoutVertexBuffer, buffers.opacityVertexBuffer);\n}\n", "import {Texture} from './texture';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Context} from '../gl/context';\nimport {Framebuffer} from '../gl/framebuffer';\nimport {Tile} from '../source/tile';\nimport {\n    heatmapUniformValues,\n    heatmapTextureUniformValues\n} from './program/heatmap_program';\nimport {HEATMAP_FULL_RENDER_FBO_KEY} from '../style/style_layer/heatmap_style_layer';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {HeatmapStyleLayer} from '../style/style_layer/heatmap_style_layer';\nimport type {HeatmapBucket} from '../data/bucket/heatmap_bucket';\nimport type {OverscaledTileID} from '../source/tile_id';\n\nexport function drawHeatmap(painter: Painter, sourceCache: SourceCache, layer: HeatmapStyleLayer, tileIDs: Array<OverscaledTileID>) {\n    if (layer.paint.get('heatmap-opacity') === 0) {\n        return;\n    }\n    const context = painter.context;\n\n    if (painter.style.map.terrain) {\n        for (const coord of tileIDs) {\n            const tile = sourceCache.getTile(coord);\n            // Skip tiles that have uncovered parents to avoid flickering; we don't need\n            // to use complex tile masking here because the change between zoom levels is subtle,\n            // so it's fine to simply render the parent until all its 4 children are loaded\n            if (sourceCache.hasRenderableParent(coord)) continue;\n            if (painter.renderPass === 'offscreen') {\n                prepareHeatmapTerrain(painter, tile, layer, coord);\n            } else if (painter.renderPass === 'translucent') {\n                renderHeatmapTerrain(painter, layer, coord);\n            }\n        }\n        context.viewport.set([0, 0, painter.width, painter.height]);\n    } else {\n        if (painter.renderPass === 'offscreen') {\n            prepareHeatmapFlat(painter, sourceCache, layer, tileIDs);\n        } else if (painter.renderPass === 'translucent') {\n            renderHeatmapFlat(painter, layer);\n        }\n\n    }\n}\n\nfunction prepareHeatmapFlat(painter: Painter, sourceCache: SourceCache, layer: HeatmapStyleLayer, coords: Array<OverscaledTileID>) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    // Allow kernels to be drawn across boundaries, so that\n    // large kernels are not clipped to tiles\n    const stencilMode = StencilMode.disabled;\n    // Turn on additive blending for kernels, which is a key aspect of kernel density estimation formula\n    const colorMode = new ColorMode([gl.ONE, gl.ONE], Color.transparent, [true, true, true, true]);\n\n    bindFramebuffer(context, painter, layer);\n\n    context.clear({color: Color.transparent});\n\n    for (let i = 0; i < coords.length; i++) {\n        const coord = coords[i];\n\n        // Skip tiles that have uncovered parents to avoid flickering; we don't need\n        // to use complex tile masking here because the change between zoom levels is subtle,\n        // so it's fine to simply render the parent until all its 4 children are loaded\n        if (sourceCache.hasRenderableParent(coord)) continue;\n\n        const tile = sourceCache.getTile(coord);\n        const bucket: HeatmapBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram('heatmap', programConfiguration);\n        const {zoom} = painter.transform;\n\n        program.draw(context, gl.TRIANGLES, DepthMode.disabled, stencilMode, colorMode, CullFaceMode.disabled,\n            heatmapUniformValues(coord.posMatrix, tile, zoom, layer.paint.get('heatmap-intensity')), null,\n            layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n            bucket.segments, layer.paint, painter.transform.zoom,\n            programConfiguration);\n    }\n\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\nfunction renderHeatmapFlat(painter: Painter, layer: HeatmapStyleLayer) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    context.setColorMode(painter.colorModeForRenderPass());\n\n    // Here we bind two different textures from which we'll sample in drawing\n    // heatmaps: the kernel texture, prepared in the offscreen pass, and a\n    // color ramp texture.\n    const fbo = layer.heatmapFbos.get(HEATMAP_FULL_RENDER_FBO_KEY);\n    if (!fbo) return;\n    context.activeTexture.set(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n\n    context.activeTexture.set(gl.TEXTURE1);\n    const colorRampTexture = getColorRampTexture(context, layer);\n    colorRampTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n    painter.useProgram('heatmapTexture').draw(context, gl.TRIANGLES,\n        DepthMode.disabled, StencilMode.disabled, painter.colorModeForRenderPass(), CullFaceMode.disabled,\n        heatmapTextureUniformValues(painter, layer, 0, 1), null,\n        layer.id, painter.viewportBuffer, painter.quadTriangleIndexBuffer,\n        painter.viewportSegments, layer.paint, painter.transform.zoom);\n}\n\nfunction prepareHeatmapTerrain(painter: Painter, tile: Tile, layer: HeatmapStyleLayer, coord: OverscaledTileID) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    const stencilMode = StencilMode.disabled;\n    // Turn on additive blending for kernels, which is a key aspect of kernel density estimation formula\n    const colorMode = new ColorMode([gl.ONE, gl.ONE], Color.transparent, [true, true, true, true]);\n\n    const bucket: HeatmapBucket = (tile.getBucket(layer) as any);\n    if (!bucket) return;\n\n    const tileKey = coord.key;\n    let fbo = layer.heatmapFbos.get(tileKey);\n    if (!fbo) {\n        fbo = createHeatmapFbo(context, tile.tileSize, tile.tileSize);\n        layer.heatmapFbos.set(tileKey, fbo);\n    }\n\n    context.bindFramebuffer.set(fbo.framebuffer);\n    context.viewport.set([0, 0, tile.tileSize, tile.tileSize]);\n\n    context.clear({color: Color.transparent});\n\n    const programConfiguration = bucket.programConfigurations.get(layer.id);\n    const program = painter.useProgram('heatmap', programConfiguration);\n\n    const terrainData = painter.style.map.terrain.getTerrainData(coord);\n    program.draw(context, gl.TRIANGLES, DepthMode.disabled, stencilMode, colorMode, CullFaceMode.disabled,\n        heatmapUniformValues(coord.posMatrix, tile, painter.transform.zoom, layer.paint.get('heatmap-intensity')), terrainData,\n        layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n        bucket.segments, layer.paint, painter.transform.zoom,\n        programConfiguration);\n}\n\nfunction renderHeatmapTerrain(painter: Painter, layer: HeatmapStyleLayer, coord: OverscaledTileID) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    context.setColorMode(painter.colorModeForRenderPass());\n\n    const colorRampTexture = getColorRampTexture(context, layer);\n\n    // Here we bind two different textures from which we'll sample in drawing\n    // heatmaps: the kernel texture, prepared in the offscreen pass, and a\n    // color ramp texture.\n    const tileKey = coord.key;\n    const fbo = layer.heatmapFbos.get(tileKey);\n    if (!fbo) return;\n\n    context.activeTexture.set(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n\n    context.activeTexture.set(gl.TEXTURE1);\n    colorRampTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n    painter.useProgram('heatmapTexture').draw(context, gl.TRIANGLES,\n        DepthMode.disabled, StencilMode.disabled, painter.colorModeForRenderPass(), CullFaceMode.disabled,\n        heatmapTextureUniformValues(painter, layer, 0, 1), null,\n        layer.id, painter.rasterBoundsBuffer, painter.quadTriangleIndexBuffer,\n        painter.rasterBoundsSegments, layer.paint, painter.transform.zoom);\n\n    // destroy the FBO after rendering\n    fbo.destroy();\n    layer.heatmapFbos.delete(tileKey);\n}\n\nfunction bindFramebuffer(context: Context, painter: Painter, layer: HeatmapStyleLayer) {\n    const gl = context.gl;\n    context.activeTexture.set(gl.TEXTURE1);\n\n    // Use a 4x downscaled screen texture for better performance\n    context.viewport.set([0, 0, painter.width / 4, painter.height / 4]);\n\n    let fbo = layer.heatmapFbos.get(HEATMAP_FULL_RENDER_FBO_KEY);\n\n    if (!fbo) {\n        fbo = createHeatmapFbo(context, painter.width / 4, painter.height / 4);\n        layer.heatmapFbos.set(HEATMAP_FULL_RENDER_FBO_KEY, fbo);\n    } else {\n        gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n        context.bindFramebuffer.set(fbo.framebuffer);\n    }\n}\n\nfunction createHeatmapFbo(context: Context, width: number, height: number): Framebuffer {\n    const gl = context.gl;\n    const texture = gl.createTexture();\n    gl.bindTexture(gl.TEXTURE_2D, texture);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n    gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n\n    // Use the higher precision half-float texture where available (producing much smoother looking heatmaps);\n    // Otherwise, fall back to a low precision texture\n    const numType = context.HALF_FLOAT ?? gl.UNSIGNED_BYTE;\n    const internalFormat = context.RGBA16F ?? gl.RGBA;\n\n    gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat, width, height, 0, gl.RGBA, numType, null);\n\n    const fbo = context.createFramebuffer(width, height, false, false);\n    fbo.colorAttachment.set(texture);\n\n    return fbo;\n}\n\nfunction getColorRampTexture(context: Context, layer: HeatmapStyleLayer): Texture {\n    if (!layer.colorRampTexture) {\n        layer.colorRampTexture = new Texture(context, layer.colorRamp, context.gl.RGBA);\n    }\n    return layer.colorRampTexture;\n}\n", "import type {CrossFaded} from '../style/properties';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\nimport type {Tile} from '../source/tile';\nimport type {ProgramConfiguration} from '../data/program_configuration';\nimport type {FillExtrusionStyleLayer} from '../style/style_layer/fill_extrusion_style_layer';\nimport type {FillStyleLayer} from '../style/style_layer/fill_style_layer';\n\n/**\n * A simple helper shared by draw_fill and draw_fill_extrusions to find the correct pattern positions AND update program.\n * For transitionable properties, especially 'fill-pattern' and 'fill-extrusion-pattern', while rendering certain frames\n * tile.imageAtlas has been updated by worker to hold the new pattern only, but rendering code is still looking for the previous image.\n * The mismatch was causing setConstantPatternPositions method not being called and pixelRatio was always the\n * default of 1, instead of actual values set by original map.addImage.\n *\n * @param programConfiguration - to be used to set pattern position and device pixel ratio.\n * @param propertyName - 'fill-pattern' or 'fill-extrusion-pattern' property key\n * @param constantPattern - either 'fill-pattern' or 'fill-extrusion-pattern' property value\n * @param tile - current tile being drawn\n * @param layer - current layer being rendered\n */\nexport function updatePatternPositionsInProgram(\n    programConfiguration: ProgramConfiguration,\n    propertyName: 'fill-pattern' | 'fill-extrusion-pattern',\n    constantPattern: CrossFaded<ResolvedImage>,\n    tile: Tile,\n    layer: FillStyleLayer | FillExtrusionStyleLayer): void {\n\n    if (!constantPattern || !tile || !tile.imageAtlas) {\n        return;\n    }\n\n    const patternPositions = tile.imageAtlas.patternPositions;\n    let posTo = patternPositions[constantPattern.to.toString()];\n    let posFrom = patternPositions[constantPattern.from.toString()];\n\n    // https://github.com/maplibre/maplibre-gl-js/issues/3377\n    if (!posTo && posFrom) posTo = posFrom;\n    if (!posFrom && posTo) posFrom = posTo;\n\n    // try again in case patternPositions has been updated by worker\n    if (!posTo || !posFrom) {\n        const transitioned = layer.getPaintProperty(propertyName) as string;\n        posTo = patternPositions[transitioned];\n        posFrom = patternPositions[transitioned];\n    }\n\n    if (posTo && posFrom) {\n        programConfiguration.setConstantPatternPositions(posTo, posFrom);\n    }\n}\n", "import {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {\n    fillUniformValues,\n    fillPatternUniformValues,\n    fillOutlineUniformValues,\n    fillOutlinePatternUniformValues\n} from './program/fill_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {FillStyleLayer} from '../style/style_layer/fill_style_layer';\nimport type {FillBucket} from '../data/bucket/fill_bucket';\nimport type {OverscaledTileID} from '../source/tile_id';\nimport {updatePatternPositionsInProgram} from './update_pattern_positions_in_program';\n\nexport function drawFill(painter: Painter, sourceCache: SourceCache, layer: FillStyleLayer, coords: Array<OverscaledTileID>) {\n    const color = layer.paint.get('fill-color');\n    const opacity = layer.paint.get('fill-opacity');\n\n    if (opacity.constantOr(1) === 0) {\n        return;\n    }\n\n    const colorMode = painter.colorModeForRenderPass();\n\n    const pattern = layer.paint.get('fill-pattern');\n    const pass = painter.opaquePassEnabledForLayer() &&\n        (!pattern.constantOr(1 as any) &&\n            color.constantOr(Color.transparent).a === 1 &&\n            opacity.constantOr(0) === 1) ? 'opaque' : 'translucent';\n\n    // Draw fill\n    if (painter.renderPass === pass) {\n        const depthMode = painter.depthModeForSublayer(\n            1, painter.renderPass === 'opaque' ? DepthMode.ReadWrite : DepthMode.ReadOnly);\n        drawFillTiles(painter, sourceCache, layer, coords, depthMode, colorMode, false);\n    }\n\n    // Draw stroke\n    if (painter.renderPass === 'translucent' && layer.paint.get('fill-antialias')) {\n\n        // If we defined a different color for the fill outline, we are\n        // going to ignore the bits in 0x07 and just care about the global\n        // clipping mask.\n        // Otherwise, we only want to drawFill the antialiased parts that are\n        // *outside* the current shape. This is important in case the fill\n        // or stroke color is translucent. If we wouldn't clip to outside\n        // the current shape, some pixels from the outline stroke overlapped\n        // the (non-antialiased) fill.\n        const depthMode = painter.depthModeForSublayer(\n            layer.getPaintProperty('fill-outline-color') ? 2 : 0, DepthMode.ReadOnly);\n        drawFillTiles(painter, sourceCache, layer, coords, depthMode, colorMode, true);\n    }\n}\n\nfunction drawFillTiles(\n    painter: Painter,\n    sourceCache: SourceCache,\n    layer: FillStyleLayer,\n    coords: Array<OverscaledTileID>,\n    depthMode: Readonly<DepthMode>,\n    colorMode: Readonly<ColorMode>,\n    isOutline: boolean) {\n    const gl = painter.context.gl;\n    const fillPropertyName = 'fill-pattern';\n    const patternProperty = layer.paint.get(fillPropertyName);\n    const image = patternProperty && patternProperty.constantOr(1 as any);\n    const crossfade = layer.getCrossfadeParameters();\n    let drawMode, programName, uniformValues, indexBuffer, segments;\n\n    if (!isOutline) {\n        programName = image ? 'fillPattern' : 'fill';\n        drawMode = gl.TRIANGLES;\n    } else {\n        programName = image && !layer.getPaintProperty('fill-outline-color') ? 'fillOutlinePattern' : 'fillOutline';\n        drawMode = gl.LINES;\n    }\n\n    const constantPattern = patternProperty.constantOr(null);\n\n    for (const coord of coords) {\n        const tile = sourceCache.getTile(coord);\n        if (image && !tile.patternsLoaded()) continue;\n\n        const bucket: FillBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram(programName, programConfiguration);\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n        if (image) {\n            painter.context.activeTexture.set(gl.TEXTURE0);\n            tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            programConfiguration.updatePaintBuffers(crossfade);\n        }\n\n        updatePatternPositionsInProgram(programConfiguration, fillPropertyName, constantPattern, tile, layer);\n\n        const terrainCoord = terrainData ? coord : null;\n        const posMatrix = terrainCoord ? terrainCoord.posMatrix : coord.posMatrix;\n        const tileMatrix = painter.translatePosMatrix(posMatrix, tile,\n            layer.paint.get('fill-translate'), layer.paint.get('fill-translate-anchor'));\n\n        if (!isOutline) {\n            indexBuffer = bucket.indexBuffer;\n            segments = bucket.segments;\n            uniformValues = image ?\n                fillPatternUniformValues(tileMatrix, painter, crossfade, tile) :\n                fillUniformValues(tileMatrix);\n        } else {\n            indexBuffer = bucket.indexBuffer2;\n            segments = bucket.segments2;\n            const drawingBufferSize = [gl.drawingBufferWidth, gl.drawingBufferHeight] as [number, number];\n            uniformValues = (programName === 'fillOutlinePattern' && image) ?\n                fillOutlinePatternUniformValues(tileMatrix, painter, crossfade, tile, drawingBufferSize) :\n                fillOutlineUniformValues(tileMatrix, drawingBufferSize);\n        }\n\n        program.draw(painter.context, drawMode, depthMode,\n            painter.stencilModeForClipping(coord), colorMode, CullFaceMode.disabled, uniformValues, terrainData,\n            layer.id, bucket.layoutVertexBuffer, indexBuffer, segments,\n            layer.paint, painter.transform.zoom, programConfiguration);\n    }\n}\n", "import {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {\n    fillExtrusionUniformValues,\n    fillExtrusionPatternUniformValues,\n} from './program/fill_extrusion_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {FillExtrusionStyleLayer} from '../style/style_layer/fill_extrusion_style_layer';\nimport type {FillExtrusionBucket} from '../data/bucket/fill_extrusion_bucket';\nimport type {OverscaledTileID} from '../source/tile_id';\n\nimport {updatePatternPositionsInProgram} from './update_pattern_positions_in_program';\n\nexport function drawFillExtrusion(painter: Painter, source: SourceCache, layer: FillExtrusionStyleLayer, coords: Array<OverscaledTileID>) {\n    const opacity = layer.paint.get('fill-extrusion-opacity');\n    if (opacity === 0) {\n        return;\n    }\n\n    if (painter.renderPass === 'translucent') {\n        const depthMode = new DepthMode(painter.context.gl.LEQUAL, DepthMode.ReadWrite, painter.depthRangeFor3D);\n\n        if (opacity === 1 && !layer.paint.get('fill-extrusion-pattern').constantOr(1 as any)) {\n            const colorMode = painter.colorModeForRenderPass();\n            drawExtrusionTiles(painter, source, layer, coords, depthMode, StencilMode.disabled, colorMode);\n\n        } else {\n            // Draw transparent buildings in two passes so that only the closest surface is drawn.\n            // First draw all the extrusions into only the depth buffer. No colors are drawn.\n            drawExtrusionTiles(painter, source, layer, coords, depthMode,\n                StencilMode.disabled,\n                ColorMode.disabled);\n\n            // Then draw all the extrusions a second type, only coloring fragments if they have the\n            // same depth value as the closest fragment in the previous pass. Use the stencil buffer\n            // to prevent the second draw in cases where we have coincident polygons.\n            drawExtrusionTiles(painter, source, layer, coords, depthMode,\n                painter.stencilModeFor3D(),\n                painter.colorModeForRenderPass());\n        }\n    }\n}\n\nfunction drawExtrusionTiles(\n    painter: Painter,\n    source: SourceCache,\n    layer: FillExtrusionStyleLayer,\n    coords: OverscaledTileID[],\n    depthMode: DepthMode,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>) {\n    const context = painter.context;\n    const gl = context.gl;\n    const fillPropertyName = 'fill-extrusion-pattern';\n    const patternProperty = layer.paint.get(fillPropertyName);\n    const image = patternProperty.constantOr(1 as any);\n    const crossfade = layer.getCrossfadeParameters();\n    const opacity = layer.paint.get('fill-extrusion-opacity');\n    const constantPattern = patternProperty.constantOr(null);\n    for (const coord of coords) {\n        const tile = source.getTile(coord);\n        const bucket: FillExtrusionBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram(image ? 'fillExtrusionPattern' : 'fillExtrusion', programConfiguration);\n\n        if (image) {\n            painter.context.activeTexture.set(gl.TEXTURE0);\n            tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            programConfiguration.updatePaintBuffers(crossfade);\n        }\n\n        updatePatternPositionsInProgram(programConfiguration, fillPropertyName, constantPattern, tile, layer);\n\n        const matrix = painter.translatePosMatrix(\n            coord.posMatrix,\n            tile,\n            layer.paint.get('fill-extrusion-translate'),\n            layer.paint.get('fill-extrusion-translate-anchor'));\n\n        const shouldUseVerticalGradient = layer.paint.get('fill-extrusion-vertical-gradient');\n        const uniformValues = image ?\n            fillExtrusionPatternUniformValues(matrix, painter, shouldUseVerticalGradient, opacity, coord, crossfade, tile) :\n            fillExtrusionUniformValues(matrix, painter, shouldUseVerticalGradient, opacity);\n\n        program.draw(context, context.gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.backCCW,\n            uniformValues, terrainData, layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer,\n            bucket.segments, layer.paint, painter.transform.zoom,\n            programConfiguration, painter.style.map.terrain && bucket.centroidVertexBuffer);\n    }\n}\n", "import {Texture} from './texture';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {Tile} from '../source/tile';\nimport {\n    hillshadeUniformValues,\n    hillshadeUniformPrepareValues\n} from './program/hillshade_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {HillshadeStyleLayer} from '../style/style_layer/hillshade_style_layer';\nimport type {OverscaledTileID} from '../source/tile_id';\n\nexport function drawHillshade(painter: Painter, sourceCache: SourceCache, layer: HillshadeStyleLayer, tileIDs: Array<OverscaledTileID>) {\n    if (painter.renderPass !== 'offscreen' && painter.renderPass !== 'translucent') return;\n\n    const context = painter.context;\n\n    const depthMode = painter.depthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    const [stencilModes, coords] = painter.renderPass === 'translucent' ?\n        painter.stencilConfigForOverlap(tileIDs) : [{}, tileIDs];\n\n    for (const coord of coords) {\n        const tile = sourceCache.getTile(coord);\n        if (typeof tile.needsHillshadePrepare !== 'undefined' && tile.needsHillshadePrepare && painter.renderPass === 'offscreen') {\n            prepareHillshade(painter, tile, layer, depthMode, StencilMode.disabled, colorMode);\n        } else if (painter.renderPass === 'translucent') {\n            renderHillshade(painter, coord, tile, layer, depthMode, stencilModes[coord.overscaledZ], colorMode);\n        }\n    }\n\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\nfunction renderHillshade(\n    painter: Painter,\n    coord: OverscaledTileID,\n    tile: Tile,\n    layer: HillshadeStyleLayer,\n    depthMode: Readonly<DepthMode>,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>) {\n    const context = painter.context;\n    const gl = context.gl;\n    const fbo = tile.fbo;\n    if (!fbo) return;\n\n    const program = painter.useProgram('hillshade');\n    const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n    context.activeTexture.set(gl.TEXTURE0);\n    gl.bindTexture(gl.TEXTURE_2D, fbo.colorAttachment.get());\n\n    const terrainCoord = terrainData ? coord : null;\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n        hillshadeUniformValues(painter, tile, layer, terrainCoord), terrainData, layer.id, painter.rasterBoundsBuffer,\n        painter.quadTriangleIndexBuffer, painter.rasterBoundsSegments);\n\n}\n\n// hillshade rendering is done in two steps. the prepare step first calculates the slope of the terrain in the x and y\n// directions for each pixel, and saves those values to a framebuffer texture in the r and g channels.\nfunction prepareHillshade(\n    painter: Painter,\n    tile: Tile,\n    layer: HillshadeStyleLayer,\n    depthMode: Readonly<DepthMode>,\n    stencilMode: Readonly<StencilMode>,\n    colorMode: Readonly<ColorMode>) {\n    const context = painter.context;\n    const gl = context.gl;\n    const dem = tile.dem;\n    if (dem && dem.data) {\n        const tileSize = dem.dim;\n        const textureStride = dem.stride;\n\n        const pixelData = dem.getPixels();\n        context.activeTexture.set(gl.TEXTURE1);\n\n        context.pixelStoreUnpackPremultiplyAlpha.set(false);\n        tile.demTexture = tile.demTexture || painter.getTileTexture(textureStride);\n        if (tile.demTexture) {\n            const demTexture = tile.demTexture;\n            demTexture.update(pixelData, {premultiply: false});\n            demTexture.bind(gl.NEAREST, gl.CLAMP_TO_EDGE);\n        } else {\n            tile.demTexture = new Texture(context, pixelData, gl.RGBA, {premultiply: false});\n            tile.demTexture.bind(gl.NEAREST, gl.CLAMP_TO_EDGE);\n        }\n\n        context.activeTexture.set(gl.TEXTURE0);\n\n        let fbo = tile.fbo;\n\n        if (!fbo) {\n            const renderTexture = new Texture(context, {width: tileSize, height: tileSize, data: null}, gl.RGBA);\n            renderTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n\n            fbo = tile.fbo = context.createFramebuffer(tileSize, tileSize, true, false);\n            fbo.colorAttachment.set(renderTexture.texture);\n        }\n\n        context.bindFramebuffer.set(fbo.framebuffer);\n        context.viewport.set([0, 0, tileSize, tileSize]);\n\n        painter.useProgram('hillshadePrepare').draw(context, gl.TRIANGLES,\n            depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n            hillshadeUniformPrepareValues(tile.tileID, dem),\n            null, layer.id, painter.rasterBoundsBuffer,\n            painter.quadTriangleIndexBuffer, painter.rasterBoundsSegments);\n\n        tile.needsHillshadePrepare = false;\n    }\n}\n", "import {clamp} from '../util/util';\n\nimport {ImageSource} from '../source/image_source';\nimport {browser} from '../util/browser';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {rasterUniformValues} from './program/raster_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {RasterStyleLayer} from '../style/style_layer/raster_style_layer';\nimport type {OverscaledTileID} from '../source/tile_id';\n\nexport function drawRaster(painter: Painter, sourceCache: SourceCache, layer: RasterStyleLayer, tileIDs: Array<OverscaledTileID>) {\n    if (painter.renderPass !== 'translucent') return;\n    if (layer.paint.get('raster-opacity') === 0) return;\n    if (!tileIDs.length) return;\n\n    const context = painter.context;\n    const gl = context.gl;\n    const source = sourceCache.getSource();\n    const program = painter.useProgram('raster');\n\n    const colorMode = painter.colorModeForRenderPass();\n\n    const [stencilModes, coords] = source instanceof ImageSource ? [{}, tileIDs] :\n        painter.stencilConfigForOverlap(tileIDs);\n\n    const minTileZ = coords[coords.length - 1].overscaledZ;\n\n    const align = !painter.options.moving;\n    for (const coord of coords) {\n        // Set the lower zoom level to sublayer 0, and higher zoom levels to higher sublayers\n        // Use gl.LESS to prevent double drawing in areas where tiles overlap.\n        const depthMode = painter.depthModeForSublayer(coord.overscaledZ - minTileZ,\n            layer.paint.get('raster-opacity') === 1 ? DepthMode.ReadWrite : DepthMode.ReadOnly, gl.LESS);\n\n        const tile = sourceCache.getTile(coord);\n\n        tile.registerFadeDuration(layer.paint.get('raster-fade-duration'));\n\n        const parentTile = sourceCache.findLoadedParent(coord, 0);\n        const siblingTile = sourceCache.findLoadedSibling(coord);\n        // Prefer parent tile if present\n        const fadeTileReference = parentTile || siblingTile || null;\n        const fade = getFadeValues(tile, fadeTileReference, sourceCache, layer, painter.transform, painter.style.map.terrain);\n\n        let parentScaleBy, parentTL;\n\n        const textureFilter = layer.paint.get('raster-resampling') === 'nearest' ?  gl.NEAREST : gl.LINEAR;\n\n        context.activeTexture.set(gl.TEXTURE0);\n        tile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n\n        context.activeTexture.set(gl.TEXTURE1);\n\n        if (parentTile) {\n            parentTile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n            parentScaleBy = Math.pow(2, parentTile.tileID.overscaledZ - tile.tileID.overscaledZ);\n            parentTL = [tile.tileID.canonical.x * parentScaleBy % 1, tile.tileID.canonical.y * parentScaleBy % 1];\n\n        } else {\n            tile.texture.bind(textureFilter, gl.CLAMP_TO_EDGE, gl.LINEAR_MIPMAP_NEAREST);\n        }\n\n        // Enable anisotropic filtering only when the pitch is greater than 20 degrees\n        // to preserve image sharpness on flat or slightly tilted maps.\n        if (tile.texture.useMipmap && context.extTextureFilterAnisotropic && painter.transform.pitch > 20) {\n            gl.texParameterf(gl.TEXTURE_2D, context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,\n                context.extTextureFilterAnisotropicMax);\n        }\n\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n        const terrainCoord = terrainData ? coord : null;\n        const posMatrix = terrainCoord ? terrainCoord.posMatrix : painter.transform.calculatePosMatrix(coord.toUnwrapped(), align);\n        const uniformValues = rasterUniformValues(posMatrix, parentTL || [0, 0], parentScaleBy || 1, fade, layer);\n\n        if (source instanceof ImageSource) {\n            program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.disabled,\n                uniformValues, terrainData, layer.id, source.boundsBuffer,\n                painter.quadTriangleIndexBuffer, source.boundsSegments);\n        } else {\n            program.draw(context, gl.TRIANGLES, depthMode, stencilModes[coord.overscaledZ], colorMode, CullFaceMode.disabled,\n                uniformValues, terrainData, layer.id, painter.rasterBoundsBuffer,\n                painter.quadTriangleIndexBuffer, painter.rasterBoundsSegments);\n        }\n    }\n}\n\nfunction getFadeValues(tile, parentTile, sourceCache, layer, transform, terrain) {\n    const fadeDuration = layer.paint.get('raster-fade-duration');\n\n    if (!terrain && fadeDuration > 0) {\n        const now = browser.now();\n        const sinceTile = (now - tile.timeAdded) / fadeDuration;\n        const sinceParent = parentTile ? (now - parentTile.timeAdded) / fadeDuration : -1;\n\n        const source = sourceCache.getSource();\n        const idealZ = transform.coveringZoomLevel({\n            tileSize: source.tileSize,\n            roundZoom: source.roundZoom\n        });\n\n        // if no parent or parent is older, fade in; if parent is younger, fade out\n        const fadeIn = !parentTile || Math.abs(parentTile.tileID.overscaledZ - idealZ) > Math.abs(tile.tileID.overscaledZ - idealZ);\n\n        const childOpacity = (fadeIn && tile.refreshedUponExpiration) ? 1 : clamp(fadeIn ? sinceTile : 1 - sinceParent, 0, 1);\n\n        // we don't crossfade tiles that were just refreshed upon expiring:\n        // once they're old enough to pass the crossfading threshold\n        // (fadeDuration), unset the `refreshedUponExpiration` flag so we don't\n        // incorrectly fail to crossfade them when zooming\n        if (tile.refreshedUponExpiration && sinceTile >= 1) tile.refreshedUponExpiration = false;\n\n        if (parentTile) {\n            return {\n                opacity: 1,\n                mix: 1 - childOpacity\n            };\n        } else {\n            return {\n                opacity: childOpacity,\n                mix: 0\n            };\n        }\n    } else {\n        return {\n            opacity: 1,\n            mix: 0\n        };\n    }\n}\n", "import {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {debugUniformValues} from './program/debug_program';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../gl/color_mode';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {OverscaledTileID} from '../source/tile_id';\nimport {Style} from '../style/style';\n\nconst topColor = new Color(1, 0, 0, 1);\nconst btmColor = new Color(0, 1, 0, 1);\nconst leftColor = new Color(0, 0, 1, 1);\nconst rightColor = new Color(1, 0, 1, 1);\nconst centerColor = new Color(0, 1, 1, 1);\n\nexport function drawDebugPadding(painter: Painter) {\n    const padding = painter.transform.padding;\n    const lineWidth = 3;\n    // Top\n    drawHorizontalLine(painter, painter.transform.height - (padding.top || 0), lineWidth, topColor);\n    // Bottom\n    drawHorizontalLine(painter, padding.bottom || 0, lineWidth, btmColor);\n    // Left\n    drawVerticalLine(painter, padding.left || 0, lineWidth, leftColor);\n    // Right\n    drawVerticalLine(painter, painter.transform.width - (padding.right || 0), lineWidth, rightColor);\n    // Center\n    const center = painter.transform.centerPoint;\n    drawCrosshair(painter, center.x, painter.transform.height - center.y, centerColor);\n}\n\nfunction drawCrosshair(painter: Painter, x: number, y: number, color: Color) {\n    const size = 20;\n    const lineWidth = 2;\n    //Vertical line\n    drawDebugSSRect(painter, x - lineWidth / 2, y - size / 2, lineWidth, size, color);\n    //Horizontal line\n    drawDebugSSRect(painter, x - size / 2, y - lineWidth / 2, size, lineWidth, color);\n}\n\nfunction drawHorizontalLine(painter: Painter, y: number, lineWidth: number, color: Color) {\n    drawDebugSSRect(painter, 0, y  + lineWidth / 2, painter.transform.width,  lineWidth, color);\n}\n\nfunction drawVerticalLine(painter: Painter, x: number, lineWidth: number, color: Color) {\n    drawDebugSSRect(painter, x - lineWidth / 2, 0, lineWidth,  painter.transform.height, color);\n}\n\nfunction drawDebugSSRect(painter: Painter, x: number, y: number, width: number, height: number, color: Color) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    gl.enable(gl.SCISSOR_TEST);\n    gl.scissor(x * painter.pixelRatio, y * painter.pixelRatio, width * painter.pixelRatio, height * painter.pixelRatio);\n    context.clear({color});\n    gl.disable(gl.SCISSOR_TEST);\n}\n\nexport function drawDebug(painter: Painter, sourceCache: SourceCache, coords: Array<OverscaledTileID>) {\n    for (let i = 0; i < coords.length; i++) {\n        drawDebugTile(painter, sourceCache, coords[i]);\n    }\n}\n\nfunction drawDebugTile(painter: Painter, sourceCache: SourceCache, coord: OverscaledTileID) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    const posMatrix = coord.posMatrix;\n    const program = painter.useProgram('debug');\n\n    const depthMode = DepthMode.disabled;\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n    const id = '$debug';\n    const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n\n    context.activeTexture.set(gl.TEXTURE0);\n\n    const tileRawData = sourceCache.getTileByID(coord.key).latestRawTileData;\n    const tileByteLength = (tileRawData && tileRawData.byteLength) || 0;\n    const tileSizeKb = Math.floor(tileByteLength / 1024);\n    const tileSize = sourceCache.getTile(coord).tileSize;\n    const scaleRatio = (512 / Math.min(tileSize, 512) * (coord.overscaledZ / painter.transform.zoom)) * 0.5;\n    let tileIdText = coord.canonical.toString();\n    if (coord.overscaledZ !== coord.canonical.z) {\n        tileIdText += ` => ${coord.overscaledZ}`;\n    }\n    const tileLabel = `${tileIdText} ${tileSizeKb}kB`;\n    drawTextToOverlay(painter, tileLabel);\n\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, ColorMode.alphaBlended, CullFaceMode.disabled,\n        debugUniformValues(posMatrix, Color.transparent, scaleRatio), null, id,\n        painter.debugBuffer, painter.quadTriangleIndexBuffer, painter.debugSegments);\n    program.draw(context, gl.LINE_STRIP, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n        debugUniformValues(posMatrix, Color.red), terrainData, id,\n        painter.debugBuffer, painter.tileBorderIndexBuffer, painter.debugSegments);\n}\n\nfunction drawTextToOverlay(painter: Painter, text: string) {\n    painter.initDebugOverlayCanvas();\n    const canvas = painter.debugOverlayCanvas;\n    const gl = painter.context.gl;\n    const ctx2d = painter.debugOverlayCanvas.getContext('2d');\n    ctx2d.clearRect(0, 0, canvas.width, canvas.height);\n\n    ctx2d.shadowColor = 'white';\n    ctx2d.shadowBlur = 2;\n    ctx2d.lineWidth = 1.5;\n    ctx2d.strokeStyle = 'white';\n    ctx2d.textBaseline = 'top';\n    ctx2d.font = `bold ${36}px Open Sans, sans-serif`;\n    ctx2d.fillText(text, 5, 5);\n    ctx2d.strokeText(text, 5, 5);\n\n    painter.debugOverlayTexture.update(canvas);\n    painter.debugOverlayTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n}\n\nexport function selectDebugSource(style: Style, zoom: number): SourceCache | null {\n    // Use vector source with highest maxzoom\n    // Else use source with highest maxzoom of any type\n    let selectedSource: SourceCache = null;\n    const layers = Object.values(style._layers);\n    const sources = layers.flatMap((layer) => {\n        if (layer.source && !layer.isHidden(zoom)) {\n            const sourceCache = style.sourceCaches[layer.source];\n            return [sourceCache];\n        } else {\n            return [];\n        }\n    });\n    const vectorSources = sources.filter((source) => source.getSource().type === 'vector');\n    const otherSources = sources.filter((source) => source.getSource().type !== 'vector');\n    const considerSource = (source: SourceCache) => {\n        if (!selectedSource || (selectedSource.getSource().maxzoom < source.getSource().maxzoom)) {\n            selectedSource = source;\n        }\n    };\n    vectorSources.forEach((source) => considerSource(source));\n    if (!selectedSource) {\n        otherSources.forEach((source) => considerSource(source));\n    }\n    return selectedSource;\n}\n", "import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {terrainUniformValues, terrainDepthUniformValues, terrainCoordsUniformValues} from './program/terrain_program';\nimport type {Painter} from './painter';\nimport type {Tile} from '../source/tile';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {ColorMode} from '../gl/color_mode';\nimport {Terrain} from './terrain';\n\n/**\n * Redraw the Depth Framebuffer\n * @param painter - the painter\n * @param terrain - the terrain\n */\nfunction drawDepth(painter: Painter, terrain: Terrain) {\n    const context = painter.context;\n    const gl = context.gl;\n    const colorMode = ColorMode.unblended;\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const mesh = terrain.getTerrainMesh();\n    const tiles = terrain.sourceCache.getRenderableTiles();\n    const program = painter.useProgram('terrainDepth');\n    context.bindFramebuffer.set(terrain.getFramebuffer('depth').framebuffer);\n    context.viewport.set([0, 0, painter.width  / devicePixelRatio, painter.height / devicePixelRatio]);\n    context.clear({color: Color.transparent, depth: 1});\n    for (const tile of tiles) {\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        const posMatrix = painter.transform.calculatePosMatrix(tile.tileID.toUnwrapped());\n        const uniformValues = terrainDepthUniformValues(posMatrix, terrain.getMeshFrameDelta(painter.transform.zoom));\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n    context.bindFramebuffer.set(null);\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\n/**\n * Redraw the Coords Framebuffers\n * @param painter - the painter\n * @param terrain - the terrain\n */\nfunction drawCoords(painter: Painter, terrain: Terrain) {\n    const context = painter.context;\n    const gl = context.gl;\n    const colorMode = ColorMode.unblended;\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const mesh = terrain.getTerrainMesh();\n    const coords = terrain.getCoordsTexture();\n    const tiles = terrain.sourceCache.getRenderableTiles();\n\n    // draw tile-coords into framebuffer\n    const program = painter.useProgram('terrainCoords');\n    context.bindFramebuffer.set(terrain.getFramebuffer('coords').framebuffer);\n    context.viewport.set([0, 0, painter.width  / devicePixelRatio, painter.height / devicePixelRatio]);\n    context.clear({color: Color.transparent, depth: 1});\n    terrain.coordsIndex = [];\n    for (const tile of tiles) {\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        context.activeTexture.set(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, coords.texture);\n        const posMatrix = painter.transform.calculatePosMatrix(tile.tileID.toUnwrapped());\n        const uniformValues = terrainCoordsUniformValues(posMatrix, 255 - terrain.coordsIndex.length, terrain.getMeshFrameDelta(painter.transform.zoom));\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n        terrain.coordsIndex.push(tile.tileID.key);\n    }\n    context.bindFramebuffer.set(null);\n    context.viewport.set([0, 0, painter.width, painter.height]);\n}\n\nfunction drawTerrain(painter: Painter, terrain: Terrain, tiles: Array<Tile>) {\n    const context = painter.context;\n    const gl = context.gl;\n    const colorMode = painter.colorModeForRenderPass();\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, painter.depthRangeFor3D);\n    const program = painter.useProgram('terrain');\n    const mesh = terrain.getTerrainMesh();\n\n    context.bindFramebuffer.set(null);\n    context.viewport.set([0, 0, painter.width, painter.height]);\n\n    for (const tile of tiles) {\n        const texture = painter.renderToTexture.getTexture(tile);\n        const terrainData = terrain.getTerrainData(tile.tileID);\n        context.activeTexture.set(gl.TEXTURE0);\n        gl.bindTexture(gl.TEXTURE_2D, texture.texture);\n        const posMatrix = painter.transform.calculatePosMatrix(tile.tileID.toUnwrapped());\n        const eleDelta = terrain.getMeshFrameDelta(painter.transform.zoom);\n        const fogMatrix = painter.transform.calculateFogMatrix(tile.tileID.toUnwrapped());\n        const uniformValues = terrainUniformValues(posMatrix, eleDelta, fogMatrix, painter.style.sky, painter.transform.pitch);\n        program.draw(context, gl.TRIANGLES, depthMode, StencilMode.disabled, colorMode, CullFaceMode.backCCW, uniformValues, terrainData, 'terrain', mesh.vertexBuffer, mesh.indexBuffer, mesh.segments);\n    }\n\n}\n\nexport {\n    drawTerrain,\n    drawDepth,\n    drawCoords\n};\n", "import {SegmentVector} from '../data/segment';\nimport {VertexBuffer} from '../gl/vertex_buffer';\nimport {IndexBuffer} from '../gl/index_buffer';\n\nexport class Mesh {\n    vertexBuffer: VertexBuffer;\n    indexBuffer: IndexBuffer;\n    segments: SegmentVector;\n\n    constructor(vertexBuffer: VertexBuffer, indexBuffer: IndexBuffer, segments: SegmentVector) {\n        this.vertexBuffer = vertexBuffer;\n        this.indexBuffer = indexBuffer;\n        this.segments = segments;\n    }\n\n    destroy(): void {\n        this.vertexBuffer.destroy();\n        this.indexBuffer.destroy();\n        this.segments.destroy();\n\n        this.vertexBuffer = null;\n        this.indexBuffer = null;\n        this.segments = null;\n    }\n}\n", "import {browser} from '../util/browser';\nimport {mat4, vec3} from 'gl-matrix';\nimport {SourceCache} from '../source/source_cache';\nimport {EXTENT} from '../data/extent';\nimport {pixelsToTileUnits} from '../source/pixels_to_tile_units';\nimport {SegmentVector} from '../data/segment';\nimport {RasterBoundsArray, PosArray, TriangleIndexArray, LineStripIndexArray} from '../data/array_types.g';\nimport rasterBoundsAttributes from '../data/raster_bounds_attributes';\nimport posAttributes from '../data/pos_attributes';\nimport {ProgramConfiguration} from '../data/program_configuration';\nimport {CrossTileSymbolIndex} from '../symbol/cross_tile_symbol_index';\nimport {shaders} from '../shaders/shaders';\nimport {Program} from './program';\nimport {programUniforms} from './program/program_uniforms';\nimport {Context} from '../gl/context';\nimport {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\nimport {ColorMode} from '../gl/color_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Texture} from './texture';\nimport {clippingMaskUniformValues} from './program/clipping_mask_program';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {drawSymbols} from './draw_symbol';\nimport {drawCircles} from './draw_circle';\nimport {drawHeatmap} from './draw_heatmap';\nimport {drawLine} from './draw_line';\nimport {drawFill} from './draw_fill';\nimport {drawFillExtrusion} from './draw_fill_extrusion';\nimport {drawHillshade} from './draw_hillshade';\nimport {drawRaster} from './draw_raster';\nimport {drawBackground} from './draw_background';\nimport {drawDebug, drawDebugPadding, selectDebugSource} from './draw_debug';\nimport {drawCustom} from './draw_custom';\nimport {drawDepth, drawCoords} from './draw_terrain';\nimport {OverscaledTileID} from '../source/tile_id';\nimport {RenderToTexture} from './render_to_texture';\nimport {drawSky} from './draw_sky';\n\nimport type {Transform} from '../geo/transform';\nimport type {Tile} from '../source/tile';\nimport type {Style} from '../style/style';\nimport type {StyleLayer} from '../style/style_layer';\nimport type {CrossFaded} from '../style/properties';\nimport type {LineAtlas} from './line_atlas';\nimport type {ImageManager} from './image_manager';\nimport type {GlyphManager} from './glyph_manager';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {DepthRangeType, DepthMaskType, DepthFuncType} from '../gl/types';\nimport type {ResolvedImage} from '@maplibre/maplibre-gl-style-spec';\n\nexport type RenderPass = 'offscreen' | 'opaque' | 'translucent';\n\ntype PainterOptions = {\n    showOverdrawInspector: boolean;\n    showTileBoundaries: boolean;\n    showPadding: boolean;\n    rotating: boolean;\n    zooming: boolean;\n    moving: boolean;\n    fadeDuration: number;\n};\n\n/**\n * @internal\n * Initialize a new painter object.\n */\nexport class Painter {\n    context: Context;\n    transform: Transform;\n    renderToTexture: RenderToTexture;\n    _tileTextures: {\n        [_: number]: Array<Texture>;\n    };\n    numSublayers: number;\n    depthEpsilon: number;\n    emptyProgramConfiguration: ProgramConfiguration;\n    width: number;\n    height: number;\n    pixelRatio: number;\n    tileExtentBuffer: VertexBuffer;\n    tileExtentSegments: SegmentVector;\n    debugBuffer: VertexBuffer;\n    debugSegments: SegmentVector;\n    rasterBoundsBuffer: VertexBuffer;\n    rasterBoundsSegments: SegmentVector;\n    viewportBuffer: VertexBuffer;\n    viewportSegments: SegmentVector;\n    quadTriangleIndexBuffer: IndexBuffer;\n    tileBorderIndexBuffer: IndexBuffer;\n    _tileClippingMaskIDs: {[_: string]: number};\n    stencilClearMode: StencilMode;\n    style: Style;\n    options: PainterOptions;\n    lineAtlas: LineAtlas;\n    imageManager: ImageManager;\n    glyphManager: GlyphManager;\n    depthRangeFor3D: DepthRangeType;\n    opaquePassCutoff: number;\n    renderPass: RenderPass;\n    currentLayer: number;\n    currentStencilSource: string;\n    nextStencilID: number;\n    id: string;\n    _showOverdrawInspector: boolean;\n    cache: {[_: string]: Program<any>};\n    crossTileSymbolIndex: CrossTileSymbolIndex;\n    symbolFadeChange: number;\n    debugOverlayTexture: Texture;\n    debugOverlayCanvas: HTMLCanvasElement;\n    // this object stores the current camera-matrix and the last render time\n    // of the terrain-facilitators. e.g. depth & coords framebuffers\n    // every time the camera-matrix changes the terrain-facilitators will be redrawn.\n    terrainFacilitator: {dirty: boolean; matrix: mat4; renderTime: number};\n\n    constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, transform: Transform) {\n        this.context = new Context(gl);\n        this.transform = transform;\n        this._tileTextures = {};\n        this.terrainFacilitator = {dirty: true, matrix: mat4.identity(new Float64Array(16) as any), renderTime: 0};\n\n        this.setup();\n\n        // Within each layer there are multiple distinct z-planes that can be drawn to.\n        // This is implemented using the WebGL depth buffer.\n        this.numSublayers = SourceCache.maxUnderzooming + SourceCache.maxOverzooming + 1;\n        this.depthEpsilon = 1 / Math.pow(2, 16);\n\n        this.crossTileSymbolIndex = new CrossTileSymbolIndex();\n    }\n\n    /*\n     * Update the GL viewport, projection matrix, and transforms to compensate\n     * for a new width and height value.\n     */\n    resize(width: number, height: number, pixelRatio: number) {\n        this.width = Math.floor(width * pixelRatio);\n        this.height = Math.floor(height * pixelRatio);\n        this.pixelRatio = pixelRatio;\n        this.context.viewport.set([0, 0, this.width, this.height]);\n\n        if (this.style) {\n            for (const layerId of this.style._order) {\n                this.style._layers[layerId].resize();\n            }\n        }\n    }\n\n    setup() {\n        const context = this.context;\n\n        const tileExtentArray = new PosArray();\n        tileExtentArray.emplaceBack(0, 0);\n        tileExtentArray.emplaceBack(EXTENT, 0);\n        tileExtentArray.emplaceBack(0, EXTENT);\n        tileExtentArray.emplaceBack(EXTENT, EXTENT);\n        this.tileExtentBuffer = context.createVertexBuffer(tileExtentArray, posAttributes.members);\n        this.tileExtentSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const debugArray = new PosArray();\n        debugArray.emplaceBack(0, 0);\n        debugArray.emplaceBack(EXTENT, 0);\n        debugArray.emplaceBack(0, EXTENT);\n        debugArray.emplaceBack(EXTENT, EXTENT);\n        this.debugBuffer = context.createVertexBuffer(debugArray, posAttributes.members);\n        this.debugSegments = SegmentVector.simpleSegment(0, 0, 4, 5);\n\n        const rasterBoundsArray = new RasterBoundsArray();\n        rasterBoundsArray.emplaceBack(0, 0, 0, 0);\n        rasterBoundsArray.emplaceBack(EXTENT, 0, EXTENT, 0);\n        rasterBoundsArray.emplaceBack(0, EXTENT, 0, EXTENT);\n        rasterBoundsArray.emplaceBack(EXTENT, EXTENT, EXTENT, EXTENT);\n        this.rasterBoundsBuffer = context.createVertexBuffer(rasterBoundsArray, rasterBoundsAttributes.members);\n        this.rasterBoundsSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const viewportArray = new PosArray();\n        viewportArray.emplaceBack(0, 0);\n        viewportArray.emplaceBack(1, 0);\n        viewportArray.emplaceBack(0, 1);\n        viewportArray.emplaceBack(1, 1);\n        this.viewportBuffer = context.createVertexBuffer(viewportArray, posAttributes.members);\n        this.viewportSegments = SegmentVector.simpleSegment(0, 0, 4, 2);\n\n        const tileLineStripIndices = new LineStripIndexArray();\n        tileLineStripIndices.emplaceBack(0);\n        tileLineStripIndices.emplaceBack(1);\n        tileLineStripIndices.emplaceBack(3);\n        tileLineStripIndices.emplaceBack(2);\n        tileLineStripIndices.emplaceBack(0);\n        this.tileBorderIndexBuffer = context.createIndexBuffer(tileLineStripIndices);\n\n        const quadTriangleIndices = new TriangleIndexArray();\n        quadTriangleIndices.emplaceBack(0, 1, 2);\n        quadTriangleIndices.emplaceBack(2, 1, 3);\n        this.quadTriangleIndexBuffer = context.createIndexBuffer(quadTriangleIndices);\n\n        const gl = this.context.gl;\n        this.stencilClearMode = new StencilMode({func: gl.ALWAYS, mask: 0}, 0x0, 0xFF, gl.ZERO, gl.ZERO, gl.ZERO);\n    }\n\n    /*\n     * Reset the drawing canvas by clearing the stencil buffer so that we can draw\n     * new tiles at the same location, while retaining previously drawn pixels.\n     */\n    clearStencil() {\n        const context = this.context;\n        const gl = context.gl;\n\n        this.nextStencilID = 1;\n        this.currentStencilSource = undefined;\n\n        // As a temporary workaround for https://github.com/mapbox/mapbox-gl-js/issues/5490,\n        // pending an upstream fix, we draw a fullscreen stencil=0 clipping mask here,\n        // effectively clearing the stencil buffer: once an upstream patch lands, remove\n        // this function in favor of context.clear({ stencil: 0x0 })\n\n        const matrix = mat4.create();\n        mat4.ortho(matrix, 0, this.width, this.height, 0, 0, 1);\n        mat4.scale(matrix, matrix, [gl.drawingBufferWidth, gl.drawingBufferHeight, 0]);\n\n        this.useProgram('clippingMask').draw(context, gl.TRIANGLES,\n            DepthMode.disabled, this.stencilClearMode, ColorMode.disabled, CullFaceMode.disabled,\n            clippingMaskUniformValues(matrix), null,\n            '$clipping', this.viewportBuffer,\n            this.quadTriangleIndexBuffer, this.viewportSegments);\n    }\n\n    _renderTileClippingMasks(layer: StyleLayer, tileIDs: Array<OverscaledTileID>) {\n        if (this.currentStencilSource === layer.source || !layer.isTileClipped() || !tileIDs || !tileIDs.length) return;\n\n        this.currentStencilSource = layer.source;\n\n        const context = this.context;\n        const gl = context.gl;\n\n        if (this.nextStencilID + tileIDs.length > 256) {\n            // we'll run out of fresh IDs so we need to clear and start from scratch\n            this.clearStencil();\n        }\n\n        context.setColorMode(ColorMode.disabled);\n        context.setDepthMode(DepthMode.disabled);\n\n        const program = this.useProgram('clippingMask');\n\n        this._tileClippingMaskIDs = {};\n\n        for (const tileID of tileIDs) {\n            const id = this._tileClippingMaskIDs[tileID.key] = this.nextStencilID++;\n            const terrainData = this.style.map.terrain && this.style.map.terrain.getTerrainData(tileID);\n\n            program.draw(context, gl.TRIANGLES, DepthMode.disabled,\n                // Tests will always pass, and ref value will be written to stencil buffer.\n                new StencilMode({func: gl.ALWAYS, mask: 0}, id, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE),\n                ColorMode.disabled, CullFaceMode.disabled, clippingMaskUniformValues(tileID.posMatrix),\n                terrainData, '$clipping', this.tileExtentBuffer,\n                this.quadTriangleIndexBuffer, this.tileExtentSegments);\n        }\n    }\n\n    stencilModeFor3D(): StencilMode {\n        this.currentStencilSource = undefined;\n\n        if (this.nextStencilID + 1 > 256) {\n            this.clearStencil();\n        }\n\n        const id = this.nextStencilID++;\n        const gl = this.context.gl;\n        return new StencilMode({func: gl.NOTEQUAL, mask: 0xFF}, id, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n    }\n\n    stencilModeForClipping(tileID: OverscaledTileID): StencilMode {\n        const gl = this.context.gl;\n        return new StencilMode({func: gl.EQUAL, mask: 0xFF}, this._tileClippingMaskIDs[tileID.key], 0x00, gl.KEEP, gl.KEEP, gl.REPLACE);\n    }\n\n    /*\n     * Sort coordinates by Z as drawing tiles is done in Z-descending order.\n     * All children with the same Z write the same stencil value.  Children\n     * stencil values are greater than parent's.  This is used only for raster\n     * and raster-dem tiles, which are already clipped to tile boundaries, to\n     * mask area of tile overlapped by children tiles.\n     * Stencil ref values continue range used in _tileClippingMaskIDs.\n     *\n     * Returns [StencilMode for tile overscaleZ map, sortedCoords].\n     */\n    stencilConfigForOverlap(tileIDs: Array<OverscaledTileID>): [{\n        [_: number]: Readonly<StencilMode>;\n    }, Array<OverscaledTileID>] {\n        const gl = this.context.gl;\n        const coords = tileIDs.sort((a, b) => b.overscaledZ - a.overscaledZ);\n        const minTileZ = coords[coords.length - 1].overscaledZ;\n        const stencilValues = coords[0].overscaledZ - minTileZ + 1;\n        if (stencilValues > 1) {\n            this.currentStencilSource = undefined;\n            if (this.nextStencilID + stencilValues > 256) {\n                this.clearStencil();\n            }\n            const zToStencilMode = {};\n            for (let i = 0; i < stencilValues; i++) {\n                zToStencilMode[i + minTileZ] = new StencilMode({func: gl.GEQUAL, mask: 0xFF}, i + this.nextStencilID, 0xFF, gl.KEEP, gl.KEEP, gl.REPLACE);\n            }\n            this.nextStencilID += stencilValues;\n            return [zToStencilMode, coords];\n        }\n        return [{[minTileZ]: StencilMode.disabled}, coords];\n    }\n\n    colorModeForRenderPass(): Readonly<ColorMode> {\n        const gl = this.context.gl;\n        if (this._showOverdrawInspector) {\n            const numOverdrawSteps = 8;\n            const a = 1 / numOverdrawSteps;\n\n            return new ColorMode([gl.CONSTANT_COLOR, gl.ONE], new Color(a, a, a, 0), [true, true, true, true]);\n        } else if (this.renderPass === 'opaque') {\n            return ColorMode.unblended;\n        } else {\n            return ColorMode.alphaBlended;\n        }\n    }\n\n    depthModeForSublayer(n: number, mask: DepthMaskType, func?: DepthFuncType | null): Readonly<DepthMode> {\n        if (!this.opaquePassEnabledForLayer()) return DepthMode.disabled;\n        const depth = 1 - ((1 + this.currentLayer) * this.numSublayers + n) * this.depthEpsilon;\n        return new DepthMode(func || this.context.gl.LEQUAL, mask, [depth, depth]);\n    }\n\n    /*\n     * The opaque pass and 3D layers both use the depth buffer.\n     * Layers drawn above 3D layers need to be drawn using the\n     * painter's algorithm so that they appear above 3D features.\n     * This returns true for layers that can be drawn using the\n     * opaque pass.\n     */\n    opaquePassEnabledForLayer() {\n        return this.currentLayer < this.opaquePassCutoff;\n    }\n\n    render(style: Style, options: PainterOptions) {\n        this.style = style;\n        this.options = options;\n\n        this.lineAtlas = style.lineAtlas;\n        this.imageManager = style.imageManager;\n        this.glyphManager = style.glyphManager;\n\n        this.symbolFadeChange = style.placement.symbolFadeChange(browser.now());\n\n        this.imageManager.beginFrame();\n\n        const layerIds = this.style._order;\n        const sourceCaches = this.style.sourceCaches;\n\n        const coordsAscending: {[_: string]: Array<OverscaledTileID>} = {};\n        const coordsDescending: {[_: string]: Array<OverscaledTileID>} = {};\n        const coordsDescendingSymbol: {[_: string]: Array<OverscaledTileID>} = {};\n\n        for (const id in sourceCaches) {\n            const sourceCache = sourceCaches[id];\n            if (sourceCache.used) {\n                sourceCache.prepare(this.context);\n            }\n\n            coordsAscending[id] = sourceCache.getVisibleCoordinates();\n            coordsDescending[id] = coordsAscending[id].slice().reverse();\n            coordsDescendingSymbol[id] = sourceCache.getVisibleCoordinates(true).reverse();\n        }\n\n        this.opaquePassCutoff = Infinity;\n        for (let i = 0; i < layerIds.length; i++) {\n            const layerId = layerIds[i];\n            if (this.style._layers[layerId].is3D()) {\n                this.opaquePassCutoff = i;\n                break;\n            }\n        }\n\n        this.maybeDrawDepthAndCoords(false);\n\n        if (this.renderToTexture) {\n            this.renderToTexture.prepareForRender(this.style, this.transform.zoom);\n            // this is disabled, because render-to-texture is rendering all layers from bottom to top.\n            this.opaquePassCutoff = 0;\n        }\n\n        // Offscreen pass ===============================================\n        // We first do all rendering that requires rendering to a separate\n        // framebuffer, and then save those for rendering back to the map\n        // later: in doing this we avoid doing expensive framebuffer restores.\n        this.renderPass = 'offscreen';\n\n        for (const layerId of layerIds) {\n            const layer = this.style._layers[layerId];\n            if (!layer.hasOffscreenPass() || layer.isHidden(this.transform.zoom)) continue;\n\n            const coords = coordsDescending[layer.source];\n            if (layer.type !== 'custom' && !coords.length) continue;\n\n            this.renderLayer(this, sourceCaches[layer.source], layer, coords);\n        }\n\n        // Rebind the main framebuffer now that all offscreen layers have been rendered:\n        this.context.bindFramebuffer.set(null);\n\n        // Clear buffers in preparation for drawing to the main framebuffer\n        this.context.clear({color: options.showOverdrawInspector ? Color.black : Color.transparent, depth: 1});\n        this.clearStencil();\n\n        // draw sky first to not overwrite symbols\n        if (this.style.sky) drawSky(this, this.style.sky);\n\n        this._showOverdrawInspector = options.showOverdrawInspector;\n        this.depthRangeFor3D = [0, 1 - ((style._order.length + 2) * this.numSublayers * this.depthEpsilon)];\n\n        // Opaque pass ===============================================\n        // Draw opaque layers top-to-bottom first.\n        if (!this.renderToTexture) {\n            this.renderPass = 'opaque';\n\n            for (this.currentLayer = layerIds.length - 1; this.currentLayer >= 0; this.currentLayer--) {\n                const layer = this.style._layers[layerIds[this.currentLayer]];\n                const sourceCache = sourceCaches[layer.source];\n                const coords = coordsAscending[layer.source];\n\n                this._renderTileClippingMasks(layer, coords);\n                this.renderLayer(this, sourceCache, layer, coords);\n            }\n        }\n\n        // Translucent pass ===============================================\n        // Draw all other layers bottom-to-top.\n        this.renderPass = 'translucent';\n\n        for (this.currentLayer = 0; this.currentLayer < layerIds.length; this.currentLayer++) {\n            const layer = this.style._layers[layerIds[this.currentLayer]];\n            const sourceCache = sourceCaches[layer.source];\n\n            if (this.renderToTexture && this.renderToTexture.renderLayer(layer)) continue;\n\n            // For symbol layers in the translucent pass, we add extra tiles to the renderable set\n            // for cross-tile symbol fading. Symbol layers don't use tile clipping, so no need to render\n            // separate clipping masks\n            const coords = (layer.type === 'symbol' ? coordsDescendingSymbol : coordsDescending)[layer.source];\n\n            this._renderTileClippingMasks(layer, coordsAscending[layer.source]);\n            this.renderLayer(this, sourceCache, layer, coords);\n        }\n\n        if (this.options.showTileBoundaries) {\n            const selectedSource = selectDebugSource(this.style, this.transform.zoom);\n            if (selectedSource) {\n                drawDebug(this, selectedSource, selectedSource.getVisibleCoordinates());\n            }\n        }\n\n        if (this.options.showPadding) {\n            drawDebugPadding(this);\n        }\n\n        // Set defaults for most GL values so that anyone using the state after the render\n        // encounters more expected values.\n        this.context.setDefault();\n    }\n\n    /**\n     * Update the depth and coords framebuffers, if the contents of those frame buffers is out of date.\n     * If requireExact is false, then the contents of those frame buffers is not updated if it is close\n     * to accurate (that is, the camera has not moved much since it was updated last).\n     */\n    maybeDrawDepthAndCoords(requireExact: boolean) {\n        if (!this.style || !this.style.map || !this.style.map.terrain) {\n            return;\n        }\n        const prevMatrix = this.terrainFacilitator.matrix;\n        const currMatrix = this.transform.modelViewProjectionMatrix;\n\n        // Update coords/depth-framebuffer on camera movement, or tile reloading\n        let doUpdate = this.terrainFacilitator.dirty;\n        doUpdate ||= requireExact ? !mat4.exactEquals(prevMatrix, currMatrix) : !mat4.equals(prevMatrix, currMatrix);\n        doUpdate ||= this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length > 0;\n\n        if (!doUpdate) {\n            return;\n        }\n\n        mat4.copy(prevMatrix, currMatrix);\n        this.terrainFacilitator.renderTime = Date.now();\n        this.terrainFacilitator.dirty = false;\n        drawDepth(this, this.style.map.terrain);\n        drawCoords(this, this.style.map.terrain);\n    }\n\n    renderLayer(painter: Painter, sourceCache: SourceCache, layer: StyleLayer, coords: Array<OverscaledTileID>) {\n        if (layer.isHidden(this.transform.zoom)) return;\n        if (layer.type !== 'background' && layer.type !== 'custom' && !(coords || []).length) return;\n        this.id = layer.id;\n\n        switch (layer.type) {\n            case 'symbol':\n                drawSymbols(painter, sourceCache, layer as any, coords, this.style.placement.variableOffsets);\n                break;\n            case 'circle':\n                drawCircles(painter, sourceCache, layer as any, coords);\n                break;\n            case 'heatmap':\n                drawHeatmap(painter, sourceCache, layer as any, coords);\n                break;\n            case 'line':\n                drawLine(painter, sourceCache, layer as any, coords);\n                break;\n            case 'fill':\n                drawFill(painter, sourceCache, layer as any, coords);\n                break;\n            case 'fill-extrusion':\n                drawFillExtrusion(painter, sourceCache, layer as any, coords);\n                break;\n            case 'hillshade':\n                drawHillshade(painter, sourceCache, layer as any, coords);\n                break;\n            case 'raster':\n                drawRaster(painter, sourceCache, layer as any, coords);\n                break;\n            case 'background':\n                drawBackground(painter, sourceCache, layer as any, coords);\n                break;\n            case 'custom':\n                drawCustom(painter, sourceCache, layer as any);\n                break;\n        }\n    }\n\n    /**\n     * Transform a matrix to incorporate the *-translate and *-translate-anchor properties into it.\n     * @param inViewportPixelUnitsUnits - True when the units accepted by the matrix are in viewport pixels instead of tile units.\n     * @returns matrix\n     */\n    translatePosMatrix(matrix: mat4, tile: Tile, translate: [number, number], translateAnchor: 'map' | 'viewport', inViewportPixelUnitsUnits?: boolean): mat4 {\n        if (!translate[0] && !translate[1]) return matrix;\n\n        const angle = inViewportPixelUnitsUnits ?\n            (translateAnchor === 'map' ? this.transform.angle : 0) :\n            (translateAnchor === 'viewport' ? -this.transform.angle : 0);\n\n        if (angle) {\n            const sinA = Math.sin(angle);\n            const cosA = Math.cos(angle);\n            translate = [\n                translate[0] * cosA - translate[1] * sinA,\n                translate[0] * sinA + translate[1] * cosA\n            ];\n        }\n\n        const translation = [\n            inViewportPixelUnitsUnits ? translate[0] : pixelsToTileUnits(tile, translate[0], this.transform.zoom),\n            inViewportPixelUnitsUnits ? translate[1] : pixelsToTileUnits(tile, translate[1], this.transform.zoom),\n            0\n        ] as vec3;\n\n        const translatedMatrix = new Float32Array(16);\n        mat4.translate(translatedMatrix, matrix, translation);\n        return translatedMatrix;\n    }\n\n    saveTileTexture(texture: Texture) {\n        const textures = this._tileTextures[texture.size[0]];\n        if (!textures) {\n            this._tileTextures[texture.size[0]] = [texture];\n        } else {\n            textures.push(texture);\n        }\n    }\n\n    getTileTexture(size: number) {\n        const textures = this._tileTextures[size];\n        return textures && textures.length > 0 ? textures.pop() : null;\n    }\n\n    /**\n     * Checks whether a pattern image is needed, and if it is, whether it is not loaded.\n     *\n     * @returns true if a needed image is missing and rendering needs to be skipped.\n     */\n    isPatternMissing(image?: CrossFaded<ResolvedImage> | null): boolean {\n        if (!image) return false;\n        if (!image.from || !image.to) return true;\n        const imagePosA = this.imageManager.getPattern(image.from.toString());\n        const imagePosB = this.imageManager.getPattern(image.to.toString());\n        return !imagePosA || !imagePosB;\n    }\n\n    useProgram(name: string, programConfiguration?: ProgramConfiguration | null): Program<any> {\n        this.cache = this.cache || {};\n        const key = name +\n            (programConfiguration ? programConfiguration.cacheKey : '') +\n            (this._showOverdrawInspector ? '/overdraw' : '') +\n            (this.style.map.terrain ? '/terrain' : '');\n        if (!this.cache[key]) {\n            this.cache[key] = new Program(\n                this.context,\n                shaders[name],\n                programConfiguration,\n                programUniforms[name],\n                this._showOverdrawInspector,\n                this.style.map.terrain\n            );\n        }\n        return this.cache[key];\n    }\n\n    /*\n     * Reset some GL state to default values to avoid hard-to-debug bugs\n     * in custom layers.\n     */\n    setCustomLayerDefaults() {\n        // Prevent custom layers from unintentionally modify the last VAO used.\n        // All other state is state is restored on it's own, but for VAOs it's\n        // simpler to unbind so that we don't have to track the state of VAOs.\n        this.context.unbindVAO();\n\n        // The default values for this state is meaningful and often expected.\n        // Leaving this state dirty could cause a lot of confusion for users.\n        this.context.cullFace.setDefault();\n        this.context.activeTexture.setDefault();\n        this.context.pixelStoreUnpack.setDefault();\n        this.context.pixelStoreUnpackPremultiplyAlpha.setDefault();\n        this.context.pixelStoreUnpackFlipY.setDefault();\n    }\n\n    /*\n     * Set GL state that is shared by all layers.\n     */\n    setBaseState() {\n        const gl = this.context.gl;\n        this.context.cullFace.set(false);\n        this.context.viewport.set([0, 0, this.width, this.height]);\n        this.context.blendEquation.set(gl.FUNC_ADD);\n    }\n\n    initDebugOverlayCanvas() {\n        if (this.debugOverlayCanvas == null) {\n            this.debugOverlayCanvas = document.createElement('canvas');\n            this.debugOverlayCanvas.width = 512;\n            this.debugOverlayCanvas.height = 512;\n            const gl = this.context.gl;\n            this.debugOverlayTexture = new Texture(this.context, this.debugOverlayCanvas, gl.RGBA);\n        }\n    }\n\n    destroy() {\n        if (this.debugOverlayTexture) {\n            this.debugOverlayTexture.destroy();\n        }\n    }\n\n    /*\n     * Return true if drawing buffer size is != from requested size.\n     * That means that we've reached GL limits somehow.\n     * Note: drawing buffer size changes only when canvas size changes\n     */\n    overLimit() {\n        const {drawingBufferWidth, drawingBufferHeight} = this.context.gl;\n        return this.width !== drawingBufferWidth || this.height !== drawingBufferHeight;\n    }\n}\n", "import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {PosArray, TriangleIndexArray} from '../data/array_types.g';\nimport posAttributes from '../data/pos_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {skyUniformValues} from './program/sky_program';\nimport {Sky} from '../style/sky';\nimport {Mesh} from './mesh';\nimport type {Painter} from './painter';\n\nexport function drawSky(painter: Painter, sky: Sky) {\n    const context = painter.context;\n    const gl = context.gl;\n\n    const skyUniforms = skyUniformValues(sky, painter.style.map.transform, painter.pixelRatio);\n\n    const depthMode = new DepthMode(gl.LEQUAL, DepthMode.ReadWrite, [0, 1]);\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n    const program = painter.useProgram('sky');\n\n    if (!sky.mesh) {\n        const vertexArray = new PosArray();\n        vertexArray.emplaceBack(-1, -1);\n        vertexArray.emplaceBack(1, -1);\n        vertexArray.emplaceBack(1, 1);\n        vertexArray.emplaceBack(-1, 1);\n\n        const indexArray = new TriangleIndexArray();\n        indexArray.emplaceBack(0, 1, 2);\n        indexArray.emplaceBack(0, 2, 3);\n\n        sky.mesh = new Mesh(\n            context.createVertexBuffer(vertexArray, posAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n    }\n\n    program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode,\n        CullFaceMode.disabled, skyUniforms, undefined, 'sky', sky.mesh.vertexBuffer,\n        sky.mesh.indexBuffer, sky.mesh.segments);\n}\n", "import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Program} from './program';\nimport {circleUniformValues} from './program/circle_program';\nimport {SegmentVector} from '../data/segment';\nimport {OverscaledTileID} from '../source/tile_id';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {CircleStyleLayer} from '../style/style_layer/circle_style_layer';\nimport type {CircleBucket} from '../data/bucket/circle_bucket';\nimport type {ProgramConfiguration} from '../data/program_configuration';\nimport type {VertexBuffer} from '../gl/vertex_buffer';\nimport type {IndexBuffer} from '../gl/index_buffer';\nimport type {UniformValues} from './uniform_binding';\nimport type {CircleUniformsType} from './program/circle_program';\nimport type {TerrainData} from '../render/terrain';\n\ntype TileRenderState = {\n    programConfiguration: ProgramConfiguration;\n    program: Program<any>;\n    layoutVertexBuffer: VertexBuffer;\n    indexBuffer: IndexBuffer;\n    uniformValues: UniformValues<CircleUniformsType>;\n    terrainData: TerrainData;\n};\n\ntype SegmentsTileRenderState = {\n    segments: SegmentVector;\n    sortKey: number;\n    state: TileRenderState;\n};\n\nexport function drawCircles(painter: Painter, sourceCache: SourceCache, layer: CircleStyleLayer, coords: Array<OverscaledTileID>) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const opacity = layer.paint.get('circle-opacity');\n    const strokeWidth = layer.paint.get('circle-stroke-width');\n    const strokeOpacity = layer.paint.get('circle-stroke-opacity');\n    const sortFeaturesByKey = !layer.layout.get('circle-sort-key').isConstant();\n\n    if (opacity.constantOr(1) === 0 && (strokeWidth.constantOr(1) === 0 || strokeOpacity.constantOr(1) === 0)) {\n        return;\n    }\n\n    const context = painter.context;\n    const gl = context.gl;\n\n    const depthMode = painter.depthModeForSublayer(0, DepthMode.ReadOnly);\n    // Turn off stencil testing to allow circles to be drawn across boundaries,\n    // so that large circles are not clipped to tiles\n    const stencilMode = StencilMode.disabled;\n    const colorMode = painter.colorModeForRenderPass();\n\n    const segmentsRenderStates: Array<SegmentsTileRenderState> = [];\n\n    for (let i = 0; i < coords.length; i++) {\n        const coord = coords[i];\n\n        const tile = sourceCache.getTile(coord);\n        const bucket: CircleBucket<any> = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const program = painter.useProgram('circle', programConfiguration);\n        const layoutVertexBuffer = bucket.layoutVertexBuffer;\n        const indexBuffer = bucket.indexBuffer;\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(coord);\n        const uniformValues = circleUniformValues(painter, coord, tile, layer);\n\n        const state: TileRenderState = {\n            programConfiguration,\n            program,\n            layoutVertexBuffer,\n            indexBuffer,\n            uniformValues,\n            terrainData\n        };\n\n        if (sortFeaturesByKey) {\n            const oldSegments = bucket.segments.get();\n            for (const segment of oldSegments) {\n                segmentsRenderStates.push({\n                    segments: new SegmentVector([segment]),\n                    sortKey: (segment.sortKey as any as number),\n                    state\n                });\n            }\n        } else {\n            segmentsRenderStates.push({\n                segments: bucket.segments,\n                sortKey: 0,\n                state\n            });\n        }\n\n    }\n\n    if (sortFeaturesByKey) {\n        segmentsRenderStates.sort((a, b) => a.sortKey - b.sortKey);\n    }\n\n    for (const segmentsState of segmentsRenderStates) {\n        const {programConfiguration, program, layoutVertexBuffer, indexBuffer, uniformValues, terrainData} = segmentsState.state;\n        const segments = segmentsState.segments;\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n            uniformValues, terrainData, layer.id,\n            layoutVertexBuffer, indexBuffer, segments,\n            layer.paint, painter.transform.zoom, programConfiguration);\n    }\n}\n", "import {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {Texture} from './texture';\nimport {\n    lineUniformValues,\n    linePatternUniformValues,\n    lineSDFUniformValues,\n    lineGradientUniformValues\n} from './program/line_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {LineStyleLayer} from '../style/style_layer/line_style_layer';\nimport type {LineBucket} from '../data/bucket/line_bucket';\nimport type {OverscaledTileID} from '../source/tile_id';\nimport {clamp, nextPowerOfTwo} from '../util/util';\nimport {renderColorRamp} from '../util/color_ramp';\nimport {EXTENT} from '../data/extent';\n\nexport function drawLine(painter: Painter, sourceCache: SourceCache, layer: LineStyleLayer, coords: Array<OverscaledTileID>) {\n    if (painter.renderPass !== 'translucent') return;\n\n    const opacity = layer.paint.get('line-opacity');\n    const width = layer.paint.get('line-width');\n    if (opacity.constantOr(1) === 0 || width.constantOr(1) === 0) return;\n\n    const depthMode = painter.depthModeForSublayer(0, DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n\n    const dasharray = layer.paint.get('line-dasharray');\n    const patternProperty = layer.paint.get('line-pattern');\n    const image = patternProperty.constantOr(1 as any);\n\n    const gradient = layer.paint.get('line-gradient');\n    const crossfade = layer.getCrossfadeParameters();\n\n    const programId =\n        image ? 'linePattern' :\n            dasharray ? 'lineSDF' :\n                gradient ? 'lineGradient' : 'line';\n\n    const context = painter.context;\n    const gl = context.gl;\n\n    let firstTile = true;\n\n    for (const coord of coords) {\n        const tile = sourceCache.getTile(coord);\n\n        if (image && !tile.patternsLoaded()) continue;\n\n        const bucket: LineBucket = (tile.getBucket(layer) as any);\n        if (!bucket) continue;\n\n        const programConfiguration = bucket.programConfigurations.get(layer.id);\n        const prevProgram = painter.context.program.get();\n        const program = painter.useProgram(programId, programConfiguration);\n        const programChanged = firstTile || program.program !== prevProgram;\n        const terrainData = painter.style.map.terrain &&  painter.style.map.terrain.getTerrainData(coord);\n\n        const constantPattern = patternProperty.constantOr(null);\n        if (constantPattern && tile.imageAtlas) {\n            const atlas = tile.imageAtlas;\n            const posTo = atlas.patternPositions[constantPattern.to.toString()];\n            const posFrom = atlas.patternPositions[constantPattern.from.toString()];\n            if (posTo && posFrom) programConfiguration.setConstantPatternPositions(posTo, posFrom);\n        }\n\n        const terrainCoord = terrainData ? coord : null;\n        const uniformValues = image ? linePatternUniformValues(painter, tile, layer, crossfade, terrainCoord) :\n            dasharray ? lineSDFUniformValues(painter, tile, layer, dasharray, crossfade, terrainCoord) :\n                gradient ? lineGradientUniformValues(painter, tile, layer, bucket.lineClipsArray.length, terrainCoord) :\n                    lineUniformValues(painter, tile, layer, terrainCoord);\n\n        if (image) {\n            context.activeTexture.set(gl.TEXTURE0);\n            tile.imageAtlasTexture.bind(gl.LINEAR, gl.CLAMP_TO_EDGE);\n            programConfiguration.updatePaintBuffers(crossfade);\n        } else if (dasharray && (programChanged || painter.lineAtlas.dirty)) {\n            context.activeTexture.set(gl.TEXTURE0);\n            painter.lineAtlas.bind(context);\n        } else if (gradient) {\n            const layerGradient = bucket.gradients[layer.id];\n            let gradientTexture = layerGradient.texture;\n            if (layer.gradientVersion !== layerGradient.version) {\n                let textureResolution = 256;\n                if (layer.stepInterpolant) {\n                    const sourceMaxZoom = sourceCache.getSource().maxzoom;\n                    const potentialOverzoom = coord.canonical.z === sourceMaxZoom ?\n                        Math.ceil(1 << (painter.transform.maxZoom - coord.canonical.z)) : 1;\n                    const lineLength = bucket.maxLineLength / EXTENT;\n                    // Logical pixel tile size is 512px, and 1024px right before current zoom + 1\n                    const maxTilePixelSize = 1024;\n                    // Maximum possible texture coverage heuristic, bound by hardware max texture size\n                    const maxTextureCoverage = lineLength * maxTilePixelSize * potentialOverzoom;\n                    textureResolution = clamp(nextPowerOfTwo(maxTextureCoverage), 256, context.maxTextureSize);\n                }\n                layerGradient.gradient = renderColorRamp({\n                    expression: layer.gradientExpression(),\n                    evaluationKey: 'lineProgress',\n                    resolution: textureResolution,\n                    image: layerGradient.gradient || undefined,\n                    clips: bucket.lineClipsArray\n                });\n                if (layerGradient.texture) {\n                    layerGradient.texture.update(layerGradient.gradient);\n                } else {\n                    layerGradient.texture = new Texture(context, layerGradient.gradient, gl.RGBA);\n                }\n                layerGradient.version = layer.gradientVersion;\n                gradientTexture = layerGradient.texture;\n            }\n            context.activeTexture.set(gl.TEXTURE0);\n            gradientTexture.bind(layer.stepInterpolant ? gl.NEAREST : gl.LINEAR, gl.CLAMP_TO_EDGE);\n        }\n\n        program.draw(context, gl.TRIANGLES, depthMode,\n            painter.stencilModeForClipping(coord), colorMode, CullFaceMode.disabled, uniformValues, terrainData,\n            layer.id, bucket.layoutVertexBuffer, bucket.indexBuffer, bucket.segments,\n            layer.paint, painter.transform.zoom, programConfiguration, bucket.layoutVertexBuffer2);\n\n        firstTile = false;\n        // once refactored so that bound texture state is managed, we'll also be able to remove this firstTile/programChanged logic\n    }\n}\n", "import {StencilMode} from '../gl/stencil_mode';\nimport {DepthMode} from '../gl/depth_mode';\nimport {CullFaceMode} from '../gl/cull_face_mode';\nimport {\n    backgroundUniformValues,\n    backgroundPatternUniformValues\n} from './program/background_program';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {BackgroundStyleLayer} from '../style/style_layer/background_style_layer';\nimport {OverscaledTileID} from '../source/tile_id';\n\nexport function drawBackground(painter: Painter, sourceCache: SourceCache, layer: BackgroundStyleLayer, coords?: Array<OverscaledTileID>) {\n    const color = layer.paint.get('background-color');\n    const opacity = layer.paint.get('background-opacity');\n\n    if (opacity === 0) return;\n\n    const context = painter.context;\n    const gl = context.gl;\n    const transform = painter.transform;\n    const tileSize = transform.tileSize;\n    const image = layer.paint.get('background-pattern');\n    if (painter.isPatternMissing(image)) return;\n\n    const pass = (!image && color.a === 1 && opacity === 1 && painter.opaquePassEnabledForLayer()) ? 'opaque' : 'translucent';\n    if (painter.renderPass !== pass) return;\n\n    const stencilMode = StencilMode.disabled;\n    const depthMode = painter.depthModeForSublayer(0, pass === 'opaque' ? DepthMode.ReadWrite : DepthMode.ReadOnly);\n    const colorMode = painter.colorModeForRenderPass();\n    const program = painter.useProgram(image ? 'backgroundPattern' : 'background');\n    const tileIDs = coords ? coords : transform.coveringTiles({tileSize, terrain: painter.style.map.terrain});\n\n    if (image) {\n        context.activeTexture.set(gl.TEXTURE0);\n        painter.imageManager.bind(painter.context);\n    }\n\n    const crossfade = layer.getCrossfadeParameters();\n    for (const tileID of tileIDs) {\n        const matrix = coords ? tileID.posMatrix : painter.transform.calculatePosMatrix(tileID.toUnwrapped());\n        const uniformValues = image ?\n            backgroundPatternUniformValues(matrix, opacity, painter, image, {tileID, tileSize}, crossfade) :\n            backgroundUniformValues(matrix, opacity, color);\n        const terrainData = painter.style.map.terrain && painter.style.map.terrain.getTerrainData(tileID);\n\n        program.draw(context, gl.TRIANGLES, depthMode, stencilMode, colorMode, CullFaceMode.disabled,\n            uniformValues, terrainData, layer.id, painter.tileExtentBuffer,\n            painter.quadTriangleIndexBuffer, painter.tileExtentSegments);\n    }\n}\n", "import {DepthMode} from '../gl/depth_mode';\nimport {StencilMode} from '../gl/stencil_mode';\n\nimport type {Painter} from './painter';\nimport type {SourceCache} from '../source/source_cache';\nimport type {CustomStyleLayer} from '../style/style_layer/custom_style_layer';\n\nexport function drawCustom(painter: Painter, sourceCache: SourceCache, layer: CustomStyleLayer) {\n\n    const context = painter.context;\n    const implementation = layer.implementation;\n\n    if (painter.renderPass === 'offscreen') {\n\n        const prerender = implementation.prerender;\n        if (prerender) {\n            painter.setCustomLayerDefaults();\n            context.setColorMode(painter.colorModeForRenderPass());\n\n            prerender.call(implementation, context.gl, painter.transform.customLayerMatrix());\n\n            context.setDirty();\n            painter.setBaseState();\n        }\n\n    } else if (painter.renderPass === 'translucent') {\n\n        painter.setCustomLayerDefaults();\n\n        context.setColorMode(painter.colorModeForRenderPass());\n        context.setStencilMode(StencilMode.disabled);\n\n        const depthMode = implementation.renderingMode === '3d' ?\n            new DepthMode(painter.context.gl.LEQUAL, DepthMode.ReadWrite, painter.depthRangeFor3D) :\n            painter.depthModeForSublayer(0, DepthMode.ReadOnly);\n\n        context.setDepthMode(depthMode);\n\n        implementation.render(context.gl, painter.transform.customLayerMatrix(), {farZ: painter.transform.farZ, nearZ: painter.transform.nearZ, fov: painter.transform._fov, modelViewProjectionMatrix: painter.transform.modelViewProjectionMatrix, projectionMatrix: painter.transform.projectionMatrix});\n\n        context.setDirty();\n        painter.setBaseState();\n        context.bindFramebuffer.set(null);\n    }\n}\n", "import {mat4, vec3, vec4} from 'gl-matrix';\n\nclass Frustum {\n\n    constructor(public points: vec4[], public planes: vec4[]) { }\n\n    public static fromInvProjectionMatrix(invProj: mat4, worldSize: number, zoom: number): Frustum {\n        const clipSpaceCorners = [\n            [-1, 1, -1, 1],\n            [1, 1, -1, 1],\n            [1, -1, -1, 1],\n            [-1, -1, -1, 1],\n            [-1, 1, 1, 1],\n            [1, 1, 1, 1],\n            [1, -1, 1, 1],\n            [-1, -1, 1, 1]\n        ];\n\n        const scale = Math.pow(2, zoom);\n\n        // Transform frustum corner points from clip space to tile space, Z to meters\n        const frustumCoords = clipSpaceCorners.map(v => {\n            v = vec4.transformMat4([] as any, v as any, invProj) as any;\n            const s = 1.0 / v[3] / worldSize * scale;\n            return vec4.mul(v as any, v as any, [s, s, 1.0 / v[3], s] as vec4);\n        });\n\n        const frustumPlanePointIndices = [\n            [0, 1, 2],  // near\n            [6, 5, 4],  // far\n            [0, 3, 7],  // left\n            [2, 1, 5],  // right\n            [3, 2, 6],  // bottom\n            [0, 4, 5]   // top\n        ];\n\n        const frustumPlanes = frustumPlanePointIndices.map((p: number[]) => {\n            const a = vec3.sub([] as any, frustumCoords[p[0]] as vec3, frustumCoords[p[1]] as vec3);\n            const b = vec3.sub([] as any, frustumCoords[p[2]] as vec3, frustumCoords[p[1]] as vec3);\n            const n = vec3.normalize([] as any, vec3.cross([] as any, a, b)) as any;\n            const d = -vec3.dot(n, frustumCoords[p[1]] as vec3);\n            return n.concat(d);\n        });\n\n        return new Frustum(frustumCoords, frustumPlanes);\n    }\n}\n\nclass Aabb {\n    min: vec3;\n    max: vec3;\n    center: vec3;\n\n    constructor(min_: vec3, max_: vec3) {\n        this.min = min_;\n        this.max = max_;\n        this.center = vec3.scale([] as any, vec3.add([] as any, this.min, this.max), 0.5);\n    }\n\n    quadrant(index: number): Aabb {\n        const split = [(index % 2) === 0, index < 2];\n        const qMin = vec3.clone(this.min);\n        const qMax = vec3.clone(this.max);\n        for (let axis = 0; axis < split.length; axis++) {\n            qMin[axis] = split[axis] ? this.min[axis] : this.center[axis];\n            qMax[axis] = split[axis] ? this.center[axis] : this.max[axis];\n        }\n        // Elevation is always constant, hence quadrant.max.z = this.max.z\n        qMax[2] = this.max[2];\n        return new Aabb(qMin, qMax);\n    }\n\n    distanceX(point: Array<number>): number {\n        const pointOnAabb = Math.max(Math.min(this.max[0], point[0]), this.min[0]);\n        return pointOnAabb - point[0];\n    }\n\n    distanceY(point: Array<number>): number {\n        const pointOnAabb = Math.max(Math.min(this.max[1], point[1]), this.min[1]);\n        return pointOnAabb - point[1];\n    }\n\n    // Performs a frustum-aabb intersection test. Returns 0 if there's no intersection,\n    // 1 if shapes are intersecting and 2 if the aabb if fully inside the frustum.\n    intersects(frustum: Frustum): number {\n        // Execute separating axis test between two convex objects to find intersections\n        // Each frustum plane together with 3 major axes define the separating axes\n\n        const aabbPoints = [\n            [this.min[0], this.min[1], this.min[2], 1],\n            [this.max[0], this.min[1], this.min[2], 1],\n            [this.max[0], this.max[1], this.min[2], 1],\n            [this.min[0], this.max[1], this.min[2], 1],\n            [this.min[0], this.min[1], this.max[2], 1],\n            [this.max[0], this.min[1], this.max[2], 1],\n            [this.max[0], this.max[1], this.max[2], 1],\n            [this.min[0], this.max[1], this.max[2], 1]\n        ];\n\n        let fullyInside = true;\n\n        for (let p = 0; p < frustum.planes.length; p++) {\n            const plane = frustum.planes[p];\n            let pointsInside = 0;\n\n            for (let i = 0; i < aabbPoints.length; i++) {\n                if (vec4.dot(plane, aabbPoints[i] as any) >= 0) {\n                    pointsInside++;\n                }\n            }\n\n            if (pointsInside === 0)\n                return 0;\n\n            if (pointsInside !== aabbPoints.length)\n                fullyInside = false;\n        }\n\n        if (fullyInside)\n            return 2;\n\n        for (let axis = 0; axis < 3; axis++) {\n            let projMin = Number.MAX_VALUE;\n            let projMax = -Number.MAX_VALUE;\n\n            for (let p = 0; p < frustum.points.length; p++) {\n                const projectedPoint = frustum.points[p][axis] - this.min[axis];\n\n                projMin = Math.min(projMin, projectedPoint);\n                projMax = Math.max(projMax, projectedPoint);\n            }\n\n            if (projMax < 0 || projMin > this.max[axis] - this.min[axis])\n                return 0;\n        }\n\n        return 1;\n    }\n}\nexport {\n    Aabb,\n    Frustum\n};\n", "import {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport Point from '@mapbox/point-geometry';\nimport {clamp} from '../util/util';\n\n/**\n * An `EdgeInset` object represents screen space padding applied to the edges of the viewport.\n * This shifts the apprent center or the vanishing point of the map. This is useful for adding floating UI elements\n * on top of the map and having the vanishing point shift as UI elements resize.\n *\n * @group Geography and Geometry\n */\nexport class EdgeInsets {\n    /**\n     * @defaultValue 0\n     */\n    top: number;\n    /**\n     * @defaultValue 0\n     */\n    bottom: number;\n    /**\n     * @defaultValue 0\n     */\n    left: number;\n    /**\n     * @defaultValue 0\n     */\n    right: number;\n\n    constructor(top: number = 0, bottom: number = 0, left: number = 0, right: number = 0) {\n        if (isNaN(top) || top < 0 ||\n            isNaN(bottom) || bottom < 0 ||\n            isNaN(left) || left < 0 ||\n            isNaN(right) || right < 0\n        ) {\n            throw new Error('Invalid value for edge-insets, top, bottom, left and right must all be numbers');\n        }\n\n        this.top = top;\n        this.bottom = bottom;\n        this.left = left;\n        this.right = right;\n    }\n\n    /**\n     * Interpolates the inset in-place.\n     * This maintains the current inset value for any inset not present in `target`.\n     * @param start - interpolation start\n     * @param target - interpolation target\n     * @param t - interpolation step/weight\n     * @returns the insets\n     */\n    interpolate(start: PaddingOptions | EdgeInsets, target: PaddingOptions, t: number): EdgeInsets {\n        if (target.top != null && start.top != null) this.top = interpolates.number(start.top, target.top, t);\n        if (target.bottom != null && start.bottom != null) this.bottom = interpolates.number(start.bottom, target.bottom, t);\n        if (target.left != null && start.left != null) this.left = interpolates.number(start.left, target.left, t);\n        if (target.right != null && start.right != null) this.right = interpolates.number(start.right, target.right, t);\n\n        return this;\n    }\n\n    /**\n     * Utility method that computes the new apprent center or vanishing point after applying insets.\n     * This is in pixels and with the top left being (0.0) and +y being downwards.\n     *\n     * @param width - the width\n     * @param height - the height\n     * @returns the point\n     */\n    getCenter(width: number, height: number): Point {\n        // Clamp insets so they never overflow width/height and always calculate a valid center\n        const x = clamp((this.left + width - this.right) / 2, 0, width);\n        const y = clamp((this.top + height - this.bottom) / 2, 0, height);\n\n        return new Point(x, y);\n    }\n\n    equals(other: PaddingOptions): boolean {\n        return this.top === other.top &&\n            this.bottom === other.bottom &&\n            this.left === other.left &&\n            this.right === other.right;\n    }\n\n    clone(): EdgeInsets {\n        return new EdgeInsets(this.top, this.bottom, this.left, this.right);\n    }\n\n    /**\n     * Returns the current state as json, useful when you want to have a\n     * read-only representation of the inset.\n     *\n     * @returns state as json\n     */\n    toJSON(): PaddingOptions {\n        return {\n            top: this.top,\n            bottom: this.bottom,\n            left: this.left,\n            right: this.right\n        };\n    }\n}\n\n/**\n * Options for setting padding on calls to methods such as {@link Map#fitBounds}, {@link Map#fitScreenCoordinates}, and {@link Map#setPadding}. Adjust these options to set the amount of padding in pixels added to the edges of the canvas. Set a uniform padding on all edges or individual values for each edge. All properties of this object must be\n * non-negative integers.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let bbox = [[-79, 43], [-73, 45]];\n * map.fitBounds(bbox, {\n *   padding: {top: 10, bottom:25, left: 15, right: 5}\n * });\n * ```\n *\n * @example\n * ```ts\n * let bbox = [[-79, 43], [-73, 45]];\n * map.fitBounds(bbox, {\n *   padding: 20\n * });\n * ```\n * @see [Fit to the bounds of a LineString](https://maplibre.org/maplibre-gl-js/docs/examples/zoomto-linestring/)\n * @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds/)\n */\nexport type PaddingOptions = {\n    /**\n     * Padding in pixels from the top of the map canvas.\n     */\n    top: number;\n    /**\n     * Padding in pixels from the bottom of the map canvas.\n     */\n    bottom: number;\n    /**\n     * Padding in pixels from the left of the map canvas.\n     */\n    right: number;\n    /**\n     * Padding in pixels from the right of the map canvas.\n     */\n    left: number;\n};\n", "import {LngLat} from './lng_lat';\nimport {LngLatBounds} from './lng_lat_bounds';\nimport {MercatorCoordinate, mercatorXfromLng, mercatorYfromLat, mercatorZfromAltitude} from './mercator_coordinate';\nimport Point from '@mapbox/point-geometry';\nimport {wrap, clamp} from '../util/util';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {EXTENT} from '../data/extent';\nimport {vec3, vec4, mat4, mat2, vec2} from 'gl-matrix';\nimport {Aabb, Frustum} from '../util/primitives';\nimport {EdgeInsets} from './edge_insets';\n\nimport {UnwrappedTileID, OverscaledTileID, CanonicalTileID} from '../source/tile_id';\nimport type {PaddingOptions} from './edge_insets';\nimport {Terrain} from '../render/terrain';\n\nexport const MAX_VALID_LATITUDE = 85.051129;\n\n/**\n * @internal\n * A single transform, generally used for a single tile to be\n * scaled, rotated, and zoomed.\n */\nexport class Transform {\n    tileSize: number;\n    tileZoom: number;\n    lngRange: [number, number];\n    latRange: [number, number];\n    scale: number;\n    width: number;\n    height: number;\n    angle: number;\n    rotationMatrix: mat2;\n    pixelsToGLUnits: [number, number];\n    cameraToCenterDistance: number;\n    mercatorMatrix: mat4;\n    projectionMatrix: mat4;\n    modelViewProjectionMatrix: mat4;\n    invModelViewProjectionMatrix: mat4;\n    alignedModelViewProjectionMatrix: mat4;\n    fogMatrix: mat4;\n    pixelMatrix: mat4;\n    pixelMatrix3D: mat4;\n    pixelMatrixInverse: mat4;\n    glCoordMatrix: mat4;\n    labelPlaneMatrix: mat4;\n    minElevationForCurrentTile: number;\n    _fov: number;\n    _pitch: number;\n    _zoom: number;\n    _unmodified: boolean;\n    _renderWorldCopies: boolean;\n    _minZoom: number;\n    _maxZoom: number;\n    _minPitch: number;\n    _maxPitch: number;\n    _center: LngLat;\n    _elevation: number;\n    _pixelPerMeter: number;\n    _edgeInsets: EdgeInsets;\n    _constraining: boolean;\n    _posMatrixCache: {[_: string]: mat4};\n    _alignedPosMatrixCache: {[_: string]: mat4};\n    _fogMatrixCache: {[_: string]: mat4};\n    /**\n     * This value represents the distance from the camera to the far clipping plane.\n     * It is used in the calculation of the projection matrix to determine which objects are visible.\n     * farZ should be larger than nearZ.\n     */\n    farZ: number;\n    /**\n     * This value represents the distance from the camera to the near clipping plane.\n     * It is used in the calculation of the projection matrix to determine which objects are visible.\n     * nearZ should be smaller than farZ.\n     */\n    nearZ: number;\n\n    constructor(minZoom?: number, maxZoom?: number, minPitch?: number, maxPitch?: number, renderWorldCopies?: boolean) {\n        this.tileSize = 512; // constant\n\n        this._renderWorldCopies = renderWorldCopies === undefined ? true : !!renderWorldCopies;\n        this._minZoom = minZoom || 0;\n        this._maxZoom = maxZoom || 22;\n\n        this._minPitch = (minPitch === undefined || minPitch === null) ? 0 : minPitch;\n        this._maxPitch = (maxPitch === undefined || maxPitch === null) ? 60 : maxPitch;\n\n        this.setMaxBounds();\n\n        this.width = 0;\n        this.height = 0;\n        this._center = new LngLat(0, 0);\n        this._elevation = 0;\n        this.zoom = 0;\n        this.angle = 0;\n        this._fov = 0.6435011087932844;\n        this._pitch = 0;\n        this._unmodified = true;\n        this._edgeInsets = new EdgeInsets();\n        this._posMatrixCache = {};\n        this._alignedPosMatrixCache = {};\n        this._fogMatrixCache = {};\n        this.minElevationForCurrentTile = 0;\n    }\n\n    clone(): Transform {\n        const clone = new Transform(this._minZoom, this._maxZoom, this._minPitch, this.maxPitch, this._renderWorldCopies);\n        clone.apply(this);\n        return clone;\n    }\n\n    apply(that: Transform) {\n        this.tileSize = that.tileSize;\n        this.latRange = that.latRange;\n        this.lngRange = that.lngRange;\n        this.width = that.width;\n        this.height = that.height;\n        this._center = that._center;\n        this._elevation = that._elevation;\n        this.minElevationForCurrentTile = that.minElevationForCurrentTile;\n        this.zoom = that.zoom;\n        this.angle = that.angle;\n        this._fov = that._fov;\n        this._pitch = that._pitch;\n        this._unmodified = that._unmodified;\n        this._edgeInsets = that._edgeInsets.clone();\n        this._calcMatrices();\n    }\n\n    get minZoom(): number { return this._minZoom; }\n    set minZoom(zoom: number) {\n        if (this._minZoom === zoom) return;\n        this._minZoom = zoom;\n        this.zoom = Math.max(this.zoom, zoom);\n    }\n\n    get maxZoom(): number { return this._maxZoom; }\n    set maxZoom(zoom: number) {\n        if (this._maxZoom === zoom) return;\n        this._maxZoom = zoom;\n        this.zoom = Math.min(this.zoom, zoom);\n    }\n\n    get minPitch(): number { return this._minPitch; }\n    set minPitch(pitch: number) {\n        if (this._minPitch === pitch) return;\n        this._minPitch = pitch;\n        this.pitch = Math.max(this.pitch, pitch);\n    }\n\n    get maxPitch(): number { return this._maxPitch; }\n    set maxPitch(pitch: number) {\n        if (this._maxPitch === pitch) return;\n        this._maxPitch = pitch;\n        this.pitch = Math.min(this.pitch, pitch);\n    }\n\n    get renderWorldCopies(): boolean { return this._renderWorldCopies; }\n    set renderWorldCopies(renderWorldCopies: boolean) {\n        if (renderWorldCopies === undefined) {\n            renderWorldCopies = true;\n        } else if (renderWorldCopies === null) {\n            renderWorldCopies = false;\n        }\n\n        this._renderWorldCopies = renderWorldCopies;\n    }\n\n    get worldSize(): number {\n        return this.tileSize * this.scale;\n    }\n\n    get centerOffset(): Point {\n        return this.centerPoint._sub(this.size._div(2));\n    }\n\n    get size(): Point {\n        return new Point(this.width, this.height);\n    }\n\n    get bearing(): number {\n        return -this.angle / Math.PI * 180;\n    }\n    set bearing(bearing: number) {\n        const b = -wrap(bearing, -180, 180) * Math.PI / 180;\n        if (this.angle === b) return;\n        this._unmodified = false;\n        this.angle = b;\n        this._calcMatrices();\n\n        // 2x2 matrix for rotating points\n        this.rotationMatrix = mat2.create();\n        mat2.rotate(this.rotationMatrix, this.rotationMatrix, this.angle);\n    }\n\n    get pitch(): number {\n        return this._pitch / Math.PI * 180;\n    }\n    set pitch(pitch: number) {\n        const p = clamp(pitch, this.minPitch, this.maxPitch) / 180 * Math.PI;\n        if (this._pitch === p) return;\n        this._unmodified = false;\n        this._pitch = p;\n        this._calcMatrices();\n    }\n\n    get fov(): number {\n        return this._fov / Math.PI * 180;\n    }\n    set fov(fov: number) {\n        fov = Math.max(0.01, Math.min(60, fov));\n        if (this._fov === fov) return;\n        this._unmodified = false;\n        this._fov = fov / 180 * Math.PI;\n        this._calcMatrices();\n    }\n\n    get zoom(): number { return this._zoom; }\n    set zoom(zoom: number) {\n        const constrainedZoom = Math.min(Math.max(zoom, this.minZoom), this.maxZoom);\n        if (this._zoom === constrainedZoom) return;\n        this._unmodified = false;\n        this._zoom = constrainedZoom;\n        this.tileZoom = Math.max(0, Math.floor(constrainedZoom));\n        this.scale = this.zoomScale(constrainedZoom);\n        this._constrain();\n        this._calcMatrices();\n    }\n\n    get center(): LngLat { return this._center; }\n    set center(center: LngLat) {\n        if (center.lat === this._center.lat && center.lng === this._center.lng) return;\n        this._unmodified = false;\n        this._center = center;\n        this._constrain();\n        this._calcMatrices();\n    }\n\n    /**\n     * Elevation at current center point, meters above sea level\n     */\n    get elevation(): number { return this._elevation; }\n    set elevation(elevation: number) {\n        if (elevation === this._elevation) return;\n        this._elevation = elevation;\n        this._constrain();\n        this._calcMatrices();\n    }\n\n    get padding(): PaddingOptions { return this._edgeInsets.toJSON(); }\n    set padding(padding: PaddingOptions) {\n        if (this._edgeInsets.equals(padding)) return;\n        this._unmodified = false;\n        //Update edge-insets in place\n        this._edgeInsets.interpolate(this._edgeInsets, padding, 1);\n        this._calcMatrices();\n    }\n\n    /**\n     * The center of the screen in pixels with the top-left corner being (0,0)\n     * and +y axis pointing downwards. This accounts for padding.\n     */\n    get centerPoint(): Point {\n        return this._edgeInsets.getCenter(this.width, this.height);\n    }\n\n    /**\n     * Returns if the padding params match\n     *\n     * @param padding - the padding to check against\n     * @returns true if they are equal, false otherwise\n     */\n    isPaddingEqual(padding: PaddingOptions): boolean {\n        return this._edgeInsets.equals(padding);\n    }\n\n    /**\n     * Helper method to update edge-insets in place\n     *\n     * @param start - the starting padding\n     * @param target - the target padding\n     * @param t - the step/weight\n     */\n    interpolatePadding(start: PaddingOptions, target: PaddingOptions, t: number) {\n        this._unmodified = false;\n        this._edgeInsets.interpolate(start, target, t);\n        this._constrain();\n        this._calcMatrices();\n    }\n\n    /**\n     * Return a zoom level that will cover all tiles the transform\n     * @param options - the options\n     * @returns zoom level An integer zoom level at which all tiles will be visible.\n     */\n    coveringZoomLevel(options: {\n        /**\n         * Target zoom level. If true, the value will be rounded to the closest integer. Otherwise the value will be floored.\n         */\n        roundZoom?: boolean;\n        /**\n         * Tile size, expressed in screen pixels.\n         */\n        tileSize: number;\n    }): number {\n        const z = (options.roundZoom ? Math.round : Math.floor)(\n            this.zoom + this.scaleZoom(this.tileSize / options.tileSize)\n        );\n        // At negative zoom levels load tiles from z0 because negative tile zoom levels don't exist.\n        return Math.max(0, z);\n    }\n\n    /**\n     * Return any \"wrapped\" copies of a given tile coordinate that are visible\n     * in the current view.\n     */\n    getVisibleUnwrappedCoordinates(tileID: CanonicalTileID) {\n        const result = [new UnwrappedTileID(0, tileID)];\n        if (this._renderWorldCopies) {\n            const utl = this.pointCoordinate(new Point(0, 0));\n            const utr = this.pointCoordinate(new Point(this.width, 0));\n            const ubl = this.pointCoordinate(new Point(this.width, this.height));\n            const ubr = this.pointCoordinate(new Point(0, this.height));\n            const w0 = Math.floor(Math.min(utl.x, utr.x, ubl.x, ubr.x));\n            const w1 = Math.floor(Math.max(utl.x, utr.x, ubl.x, ubr.x));\n\n            // Add an extra copy of the world on each side to properly render ImageSources and CanvasSources.\n            // Both sources draw outside the tile boundaries of the tile that \"contains them\" so we need\n            // to add extra copies on both sides in case offscreen tiles need to draw into on-screen ones.\n            const extraWorldCopy = 1;\n\n            for (let w = w0 - extraWorldCopy; w <= w1 + extraWorldCopy; w++) {\n                if (w === 0) continue;\n                result.push(new UnwrappedTileID(w, tileID));\n            }\n        }\n        return result;\n    }\n\n    /**\n     * Return all coordinates that could cover this transform for a covering\n     * zoom level.\n     * @param options - the options\n     * @returns OverscaledTileIDs\n     */\n    coveringTiles(\n        options: {\n            tileSize: number;\n            minzoom?: number;\n            maxzoom?: number;\n            roundZoom?: boolean;\n            reparseOverscaled?: boolean;\n            renderWorldCopies?: boolean;\n            terrain?: Terrain;\n        }\n    ): Array<OverscaledTileID> {\n        let z = this.coveringZoomLevel(options);\n        const actualZ = z;\n\n        if (options.minzoom !== undefined && z < options.minzoom) return [];\n        if (options.maxzoom !== undefined && z > options.maxzoom) z = options.maxzoom;\n\n        const cameraCoord = this.pointCoordinate(this.getCameraPoint());\n        const centerCoord = MercatorCoordinate.fromLngLat(this.center);\n        const numTiles = Math.pow(2, z);\n        const cameraPoint = [numTiles * cameraCoord.x, numTiles * cameraCoord.y, 0];\n        const centerPoint = [numTiles * centerCoord.x, numTiles * centerCoord.y, 0];\n        const cameraFrustum = Frustum.fromInvProjectionMatrix(this.invModelViewProjectionMatrix, this.worldSize, z);\n\n        // No change of LOD behavior for pitch lower than 60 and when there is no top padding: return only tile ids from the requested zoom level\n        let minZoom = options.minzoom || 0;\n        // Use 0.1 as an epsilon to avoid for explicit == 0.0 floating point checks\n        if (!options.terrain && this.pitch <= 60.0 && this._edgeInsets.top < 0.1)\n            minZoom = z;\n\n        // There should always be a certain number of maximum zoom level tiles surrounding the center location in 2D or in front of the camera in 3D\n        const radiusOfMaxLvlLodInTiles = options.terrain ? 2 / Math.min(this.tileSize, options.tileSize) * this.tileSize : 3;\n\n        const newRootTile = (wrap: number): any => {\n            return {\n                aabb: new Aabb([wrap * numTiles, 0, 0], [(wrap + 1) * numTiles, numTiles, 0]),\n                zoom: 0,\n                x: 0,\n                y: 0,\n                wrap,\n                fullyVisible: false\n            };\n        };\n\n        // Do a depth-first traversal to find visible tiles and proper levels of detail\n        const stack = [];\n        const result = [];\n        const maxZoom = z;\n        const overscaledZ = options.reparseOverscaled ? actualZ : z;\n\n        if (this._renderWorldCopies) {\n            // Render copy of the globe thrice on both sides\n            for (let i = 1; i <= 3; i++) {\n                stack.push(newRootTile(-i));\n                stack.push(newRootTile(i));\n            }\n        }\n\n        stack.push(newRootTile(0));\n\n        while (stack.length > 0) {\n            const it = stack.pop();\n            const x = it.x;\n            const y = it.y;\n            let fullyVisible = it.fullyVisible;\n\n            // Visibility of a tile is not required if any of its ancestor if fully inside the frustum\n            if (!fullyVisible) {\n                const intersectResult = it.aabb.intersects(cameraFrustum);\n\n                if (intersectResult === 0)\n                    continue;\n\n                fullyVisible = intersectResult === 2;\n            }\n\n            const refPoint = options.terrain ? cameraPoint : centerPoint;\n            const distanceX = it.aabb.distanceX(refPoint);\n            const distanceY = it.aabb.distanceY(refPoint);\n            const longestDim = Math.max(Math.abs(distanceX), Math.abs(distanceY));\n\n            // We're using distance based heuristics to determine if a tile should be split into quadrants or not.\n            // radiusOfMaxLvlLodInTiles defines that there's always a certain number of maxLevel tiles next to the map center.\n            // Using the fact that a parent node in quadtree is twice the size of its children (per dimension)\n            // we can define distance thresholds for each relative level:\n            // f(k) = offset + 2 + 4 + 8 + 16 + ... + 2^k. This is the same as \"offset+2^(k+1)-2\"\n            const distToSplit = radiusOfMaxLvlLodInTiles + (1 << (maxZoom - it.zoom)) - 2;\n\n            // Have we reached the target depth or is the tile too far away to be any split further?\n            if (it.zoom === maxZoom || (longestDim > distToSplit && it.zoom >= minZoom)) {\n                const dz = maxZoom - it.zoom, dx = cameraPoint[0] - 0.5 - (x << dz), dy = cameraPoint[1] - 0.5 - (y << dz);\n                result.push({\n                    tileID: new OverscaledTileID(it.zoom === maxZoom ? overscaledZ : it.zoom, it.wrap, it.zoom, x, y),\n                    distanceSq: vec2.sqrLen([centerPoint[0] - 0.5 - x, centerPoint[1] - 0.5 - y]),\n                    // this variable is currently not used, but may be important to reduce the amount of loaded tiles\n                    tileDistanceToCamera: Math.sqrt(dx * dx + dy * dy)\n                });\n                continue;\n            }\n\n            for (let i = 0; i < 4; i++) {\n                const childX = (x << 1) + (i % 2);\n                const childY = (y << 1) + (i >> 1);\n                const childZ = it.zoom + 1;\n                let quadrant = it.aabb.quadrant(i);\n                if (options.terrain) {\n                    const tileID = new OverscaledTileID(childZ, it.wrap, childZ, childX, childY);\n                    const minMax = options.terrain.getMinMaxElevation(tileID);\n                    const minElevation = minMax.minElevation ?? this.elevation;\n                    const maxElevation = minMax.maxElevation ?? this.elevation;\n                    quadrant = new Aabb(\n                        [quadrant.min[0], quadrant.min[1], minElevation] as vec3,\n                        [quadrant.max[0], quadrant.max[1], maxElevation] as vec3\n                    );\n                }\n                stack.push({aabb: quadrant, zoom: childZ, x: childX, y: childY, wrap: it.wrap, fullyVisible});\n            }\n        }\n\n        return result.sort((a, b) => a.distanceSq - b.distanceSq).map(a => a.tileID);\n    }\n\n    resize(width: number, height: number) {\n        this.width = width;\n        this.height = height;\n\n        this.pixelsToGLUnits = [2 / width, -2 / height];\n        this._constrain();\n        this._calcMatrices();\n    }\n\n    get unmodified(): boolean { return this._unmodified; }\n\n    zoomScale(zoom: number) { return Math.pow(2, zoom); }\n    scaleZoom(scale: number) { return Math.log(scale) / Math.LN2; }\n\n    /**\n     * Convert from LngLat to world coordinates (Mercator coordinates scaled by 512)\n     * @param lnglat - the lngLat\n     * @returns Point\n     */\n    project(lnglat: LngLat) {\n        const lat = clamp(lnglat.lat, -MAX_VALID_LATITUDE, MAX_VALID_LATITUDE);\n        return new Point(\n            mercatorXfromLng(lnglat.lng) * this.worldSize,\n            mercatorYfromLat(lat) * this.worldSize);\n    }\n\n    /**\n     * Convert from world coordinates ([0, 512],[0, 512]) to LngLat ([-180, 180], [-90, 90])\n     * @param point - world coordinate\n     * @returns LngLat\n     */\n    unproject(point: Point): LngLat {\n        return new MercatorCoordinate(point.x / this.worldSize, point.y / this.worldSize).toLngLat();\n    }\n\n    get point(): Point { return this.project(this.center); }\n\n    /**\n     * get the camera position in LngLat and altitudes in meter\n     * @returns An object with lngLat & altitude.\n     */\n    getCameraPosition(): {\n        lngLat: LngLat;\n        altitude: number;\n    } {\n        const lngLat = this.pointLocation(this.getCameraPoint());\n        const altitude = Math.cos(this._pitch) * this.cameraToCenterDistance / this._pixelPerMeter;\n        return {lngLat, altitude: altitude + this.elevation};\n    }\n\n    /**\n     * This method works in combination with freezeElevation activated.\n     * freezeElevation is enabled during map-panning because during this the camera should sit in constant height.\n     * After panning finished, call this method to recalculate the zoomlevel for the current camera-height in current terrain.\n     * @param terrain - the terrain\n     */\n    recalculateZoom(terrain: Terrain) {\n        const origElevation = this.elevation;\n        const origAltitude = Math.cos(this._pitch) * this.cameraToCenterDistance / this._pixelPerMeter;\n\n        // find position the camera is looking on\n        const center = this.pointLocation(this.centerPoint, terrain);\n        const elevation = terrain.getElevationForLngLatZoom(center, this.tileZoom);\n        const deltaElevation = this.elevation - elevation;\n        if (!deltaElevation) return;\n\n        // The camera's altitude off the ground + the ground's elevation = a constant:\n        // this means the camera stays at the same total height.\n        const requiredAltitude = origAltitude + origElevation - elevation;\n        // Since altitude = Math.cos(this._pitch) * this.cameraToCenterDistance / pixelPerMeter:\n        const requiredPixelPerMeter = Math.cos(this._pitch) * this.cameraToCenterDistance / requiredAltitude;\n        // Since pixelPerMeter = mercatorZfromAltitude(1, center.lat) * worldSize:\n        const requiredWorldSize = requiredPixelPerMeter / mercatorZfromAltitude(1, center.lat);\n        // Since worldSize = this.tileSize * scale:\n        const requiredScale = requiredWorldSize / this.tileSize;\n        const zoom = this.scaleZoom(requiredScale);\n\n        // update matrices\n        this._elevation = elevation;\n        this._center = center;\n        this.zoom = zoom;\n    }\n\n    setLocationAtPoint(lnglat: LngLat, point: Point) {\n        const a = this.pointCoordinate(point);\n        const b = this.pointCoordinate(this.centerPoint);\n        const loc = this.locationCoordinate(lnglat);\n        const newCenter = new MercatorCoordinate(\n            loc.x - (a.x - b.x),\n            loc.y - (a.y - b.y));\n        this.center = this.coordinateLocation(newCenter);\n        if (this._renderWorldCopies) {\n            this.center = this.center.wrap();\n        }\n    }\n\n    /**\n     * Given a LngLat location, return the screen point that corresponds to it\n     * @param lnglat - location\n     * @param terrain - optional terrain\n     * @returns screen point\n     */\n    locationPoint(lnglat: LngLat, terrain?: Terrain): Point {\n        return terrain ?\n            this.coordinatePoint(this.locationCoordinate(lnglat), terrain.getElevationForLngLatZoom(lnglat, this.tileZoom), this.pixelMatrix3D) :\n            this.coordinatePoint(this.locationCoordinate(lnglat));\n    }\n\n    /**\n     * Given a point on screen, return its lnglat\n     * @param p - screen point\n     * @param terrain - optional terrain\n     * @returns lnglat location\n     */\n    pointLocation(p: Point, terrain?: Terrain): LngLat {\n        return this.coordinateLocation(this.pointCoordinate(p, terrain));\n    }\n\n    /**\n     * Given a geographical lnglat, return an unrounded\n     * coordinate that represents it at low zoom level.\n     * @param lnglat - the location\n     * @returns The mercator coordinate\n     */\n    locationCoordinate(lnglat: LngLat): MercatorCoordinate {\n        return MercatorCoordinate.fromLngLat(lnglat);\n    }\n\n    /**\n     * Given a Coordinate, return its geographical position.\n     * @param coord - mercator coordinates\n     * @returns lng and lat\n     */\n    coordinateLocation(coord: MercatorCoordinate): LngLat {\n        return coord && coord.toLngLat();\n    }\n\n    /**\n     * Given a Point, return its mercator coordinate.\n     * @param p - the point\n     * @param terrain - optional terrain\n     * @returns lnglat\n     */\n    pointCoordinate(p: Point, terrain?: Terrain): MercatorCoordinate {\n        // get point-coordinate from terrain coordinates framebuffer\n        if (terrain) {\n            const coordinate = terrain.pointCoordinate(p);\n            if (coordinate != null) {\n                return coordinate;\n            }\n        }\n\n        // calculate point-coordinate on flat earth\n        const targetZ = 0;\n        // since we don't know the correct projected z value for the point,\n        // unproject two points to get a line and then find the point on that\n        // line with z=0\n\n        const coord0 = [p.x, p.y, 0, 1] as vec4;\n        const coord1 = [p.x, p.y, 1, 1] as vec4;\n\n        vec4.transformMat4(coord0, coord0, this.pixelMatrixInverse);\n        vec4.transformMat4(coord1, coord1, this.pixelMatrixInverse);\n\n        const w0 = coord0[3];\n        const w1 = coord1[3];\n        const x0 = coord0[0] / w0;\n        const x1 = coord1[0] / w1;\n        const y0 = coord0[1] / w0;\n        const y1 = coord1[1] / w1;\n        const z0 = coord0[2] / w0;\n        const z1 = coord1[2] / w1;\n\n        const t = z0 === z1 ? 0 : (targetZ - z0) / (z1 - z0);\n\n        return new MercatorCoordinate(\n            interpolates.number(x0, x1, t) / this.worldSize,\n            interpolates.number(y0, y1, t) / this.worldSize);\n    }\n\n    /**\n     * Given a coordinate, return the screen point that corresponds to it\n     * @param coord - the coordinates\n     * @param elevation - the elevation\n     * @param pixelMatrix - the pixel matrix\n     * @returns screen point\n     */\n    coordinatePoint(coord: MercatorCoordinate, elevation: number = 0, pixelMatrix = this.pixelMatrix): Point {\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, elevation, 1] as vec4;\n        vec4.transformMat4(p, p, pixelMatrix);\n        return new Point(p[0] / p[3], p[1] / p[3]);\n    }\n\n    /**\n     * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not\n     * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.\n     * @returns Returns a {@link LngLatBounds} object describing the map's geographical bounds.\n     */\n    getBounds(): LngLatBounds {\n        const top = Math.max(0, this.height / 2 - this.getHorizon());\n        return new LngLatBounds()\n            .extend(this.pointLocation(new Point(0, top)))\n            .extend(this.pointLocation(new Point(this.width, top)))\n            .extend(this.pointLocation(new Point(this.width, this.height)))\n            .extend(this.pointLocation(new Point(0, this.height)));\n    }\n\n    /**\n     * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.\n     * @returns max bounds\n     */\n    getMaxBounds(): LngLatBounds | null {\n        if (!this.latRange || this.latRange.length !== 2 ||\n            !this.lngRange || this.lngRange.length !== 2) return null;\n\n        return new LngLatBounds([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]);\n    }\n\n    /**\n     * Calculate pixel height of the visible horizon in relation to map-center (e.g. height/2),\n     * multiplied by a static factor to simulate the earth-radius.\n     * The calculated value is the horizontal line from the camera-height to sea-level.\n     * @returns Horizon above center in pixels.\n     */\n    getHorizon(): number {\n        return Math.tan(Math.PI / 2 - this._pitch) * this.cameraToCenterDistance * 0.85;\n    }\n\n    /**\n     * Sets or clears the map's geographical constraints.\n     * @param bounds - A {@link LngLatBounds} object describing the new geographic boundaries of the map.\n     */\n    setMaxBounds(bounds?: LngLatBounds | null) {\n        if (bounds) {\n            this.lngRange = [bounds.getWest(), bounds.getEast()];\n            this.latRange = [bounds.getSouth(), bounds.getNorth()];\n            this._constrain();\n        } else {\n            this.lngRange = null;\n            this.latRange = [-MAX_VALID_LATITUDE, MAX_VALID_LATITUDE];\n        }\n    }\n\n    calculateTileMatrix(unwrappedTileID: UnwrappedTileID): mat4 {\n        const canonical = unwrappedTileID.canonical;\n        const scale = this.worldSize / this.zoomScale(canonical.z);\n        const unwrappedX = canonical.x + Math.pow(2, canonical.z) * unwrappedTileID.wrap;\n\n        const worldMatrix = mat4.identity(new Float64Array(16) as any);\n        mat4.translate(worldMatrix, worldMatrix, [unwrappedX * scale, canonical.y * scale, 0]);\n        mat4.scale(worldMatrix, worldMatrix, [scale / EXTENT, scale / EXTENT, 1]);\n        return worldMatrix;\n    }\n\n    /**\n     * Calculate the posMatrix that, given a tile coordinate, would be used to display the tile on a map.\n     * @param unwrappedTileID - the tile ID\n     */\n    calculatePosMatrix(unwrappedTileID: UnwrappedTileID, aligned: boolean = false): mat4 {\n        const posMatrixKey = unwrappedTileID.key;\n        const cache = aligned ? this._alignedPosMatrixCache : this._posMatrixCache;\n        if (cache[posMatrixKey]) {\n            return cache[posMatrixKey];\n        }\n\n        const posMatrix = this.calculateTileMatrix(unwrappedTileID);\n        mat4.multiply(posMatrix, aligned ? this.alignedModelViewProjectionMatrix : this.modelViewProjectionMatrix, posMatrix);\n\n        cache[posMatrixKey] = new Float32Array(posMatrix);\n        return cache[posMatrixKey];\n    }\n\n    /**\n     * Calculate the fogMatrix that, given a tile coordinate, would be used to calculate fog on the map.\n     * @param unwrappedTileID - the tile ID\n     * @private\n     */\n    calculateFogMatrix(unwrappedTileID: UnwrappedTileID): mat4 {\n        const posMatrixKey = unwrappedTileID.key;\n        const cache = this._fogMatrixCache;\n        if (cache[posMatrixKey]) {\n            return cache[posMatrixKey];\n        }\n\n        const fogMatrix = this.calculateTileMatrix(unwrappedTileID);\n        mat4.multiply(fogMatrix, this.fogMatrix, fogMatrix);\n\n        cache[posMatrixKey] = new Float32Array(fogMatrix);\n        return cache[posMatrixKey];\n    }\n\n    customLayerMatrix(): mat4 {\n        return this.mercatorMatrix.slice() as any;\n    }\n\n    /**\n     * Get center lngLat and zoom to ensure that\n     * 1) everything beyond the bounds is excluded\n     * 2) a given lngLat is as near the center as possible\n     * Bounds are those set by maxBounds or North & South \"Poles\" and, if only 1 globe is displayed, antimeridian.\n     */\n    getConstrained(lngLat: LngLat, zoom: number): {center: LngLat; zoom: number} {\n        zoom = clamp(+zoom, this.minZoom, this.maxZoom);\n        const result = {\n            center: new LngLat(lngLat.lng, lngLat.lat),\n            zoom\n        };\n\n        let lngRange = this.lngRange;\n\n        if (!this._renderWorldCopies && lngRange === null) {\n            const almost180 = 180 - 1e-10;\n            lngRange = [-almost180, almost180];\n        }\n\n        const worldSize = this.tileSize * this.zoomScale(result.zoom); // A world size for the requested zoom level, not the current world size\n        let minY = 0;\n        let maxY = worldSize;\n        let minX = 0;\n        let maxX = worldSize;\n        let scaleY = 0;\n        let scaleX = 0;\n        const {x: screenWidth, y: screenHeight} = this.size;\n\n        if (this.latRange) {\n            const latRange = this.latRange;\n            minY = mercatorYfromLat(latRange[1]) * worldSize;\n            maxY = mercatorYfromLat(latRange[0]) * worldSize;\n            const shouldZoomIn = maxY - minY < screenHeight;\n            if (shouldZoomIn) scaleY = screenHeight / (maxY - minY);\n        }\n\n        if (lngRange) {\n            minX = wrap(\n                mercatorXfromLng(lngRange[0]) * worldSize,\n                0,\n                worldSize\n            );\n            maxX = wrap(\n                mercatorXfromLng(lngRange[1]) * worldSize,\n                0,\n                worldSize\n            );\n\n            if (maxX < minX) maxX += worldSize;\n\n            const shouldZoomIn = maxX - minX < screenWidth;\n            if (shouldZoomIn) scaleX = screenWidth / (maxX - minX);\n        }\n\n        const {x: originalX, y: originalY} = this.project.call({worldSize}, lngLat);\n        let modifiedX, modifiedY;\n\n        const scale = Math.max(scaleX || 0, scaleY || 0);\n\n        if (scale) {\n            // zoom in to exclude all beyond the given lng/lat ranges\n            const newPoint = new Point(\n                scaleX ? (maxX + minX) / 2 : originalX,\n                scaleY ? (maxY + minY) / 2 : originalY);\n            result.center = this.unproject.call({worldSize}, newPoint).wrap();\n            result.zoom += this.scaleZoom(scale);\n            return result;\n        }\n\n        if (this.latRange) {\n            const h2 = screenHeight / 2;\n            if (originalY - h2 < minY) modifiedY = minY + h2;\n            if (originalY + h2 > maxY) modifiedY = maxY - h2;\n        }\n\n        if (lngRange) {\n            const centerX = (minX + maxX) / 2;\n            let wrappedX = originalX;\n            if (this._renderWorldCopies) {\n                wrappedX = wrap(originalX, centerX - worldSize / 2, centerX + worldSize / 2);\n            }\n            const w2 = screenWidth / 2;\n\n            if (wrappedX - w2 < minX) modifiedX = minX + w2;\n            if (wrappedX + w2 > maxX) modifiedX = maxX - w2;\n        }\n\n        // pan the map if the screen goes off the range\n        if (modifiedX !== undefined || modifiedY !== undefined) {\n            const newPoint = new Point(modifiedX ?? originalX, modifiedY ?? originalY);\n            result.center = this.unproject.call({worldSize}, newPoint).wrap();\n        }\n\n        return result;\n    }\n\n    _constrain() {\n        if (!this.center || !this.width || !this.height || this._constraining) return;\n        this._constraining = true;\n        const unmodified = this._unmodified;\n        const {center, zoom} = this.getConstrained(this.center, this.zoom);\n        this.center = center;\n        this.zoom = zoom;\n        this._unmodified = unmodified;\n        this._constraining = false;\n    }\n\n    _calcMatrices() {\n        if (!this.height) return;\n\n        const halfFov = this._fov / 2;\n        const offset = this.centerOffset;\n        const x = this.point.x, y = this.point.y;\n        this.cameraToCenterDistance = 0.5 / Math.tan(halfFov) * this.height;\n        this._pixelPerMeter = mercatorZfromAltitude(1, this.center.lat) * this.worldSize;\n\n        let m = mat4.identity(new Float64Array(16) as any);\n        mat4.scale(m, m, [this.width / 2, -this.height / 2, 1]);\n        mat4.translate(m, m, [1, -1, 0]);\n        this.labelPlaneMatrix = m;\n\n        m = mat4.identity(new Float64Array(16) as any);\n        mat4.scale(m, m, [1, -1, 1]);\n        mat4.translate(m, m, [-1, -1, 0]);\n        mat4.scale(m, m, [2 / this.width, 2 / this.height, 1]);\n        this.glCoordMatrix = m;\n\n        // Calculate the camera to sea-level distance in pixel in respect of terrain\n        const cameraToSeaLevelDistance = this.cameraToCenterDistance + this._elevation * this._pixelPerMeter / Math.cos(this._pitch);\n        // In case of negative minimum elevation (e.g. the dead see, under the sea maps) use a lower plane for calculation\n        const minElevation = Math.min(this.elevation, this.minElevationForCurrentTile);\n        const cameraToLowestPointDistance = cameraToSeaLevelDistance - minElevation * this._pixelPerMeter / Math.cos(this._pitch);\n        const lowestPlane = minElevation < 0 ? cameraToLowestPointDistance : cameraToSeaLevelDistance;\n\n        // Find the distance from the center point [width/2 + offset.x, height/2 + offset.y] to the\n        // center top point [width/2 + offset.x, 0] in Z units, using the law of sines.\n        // 1 Z unit is equivalent to 1 horizontal px at the center of the map\n        // (the distance between[width/2, height/2] and [width/2 + 1, height/2])\n        const groundAngle = Math.PI / 2 + this._pitch;\n        const fovAboveCenter = this._fov * (0.5 + offset.y / this.height);\n        const topHalfSurfaceDistance = Math.sin(fovAboveCenter) * lowestPlane / Math.sin(clamp(Math.PI - groundAngle - fovAboveCenter, 0.01, Math.PI - 0.01));\n\n        // Find the distance from the center point to the horizon\n        const horizon = this.getHorizon();\n        const horizonAngle = Math.atan(horizon / this.cameraToCenterDistance);\n        const fovCenterToHorizon = 2 * horizonAngle * (0.5 + offset.y / (horizon * 2));\n        const topHalfSurfaceDistanceHorizon = Math.sin(fovCenterToHorizon) * lowestPlane / Math.sin(clamp(Math.PI - groundAngle - fovCenterToHorizon, 0.01, Math.PI - 0.01));\n\n        // Calculate z distance of the farthest fragment that should be rendered.\n        // Add a bit extra to avoid precision problems when a fragment's distance is exactly `furthestDistance`\n        const topHalfMinDistance = Math.min(topHalfSurfaceDistance, topHalfSurfaceDistanceHorizon);\n        this.farZ = (Math.cos(Math.PI / 2 - this._pitch) * topHalfMinDistance + lowestPlane) * 1.01;\n\n        // The larger the value of nearZ is\n        // - the more depth precision is available for features (good)\n        // - clipping starts appearing sooner when the camera is close to 3d features (bad)\n        //\n        // Other values work for mapbox-gl-js but deck.gl was encountering precision issues\n        // when rendering custom layers. This value was experimentally chosen and\n        // seems to solve z-fighting issues in deck.gl while not clipping buildings too close to the camera.\n        this.nearZ = this.height / 50;\n\n        // matrix for conversion from location to clip space(-1 .. 1)\n        m = new Float64Array(16) as any;\n        mat4.perspective(m, this._fov, this.width / this.height, this.nearZ, this.farZ);\n\n        // Apply center of perspective offset\n        m[8] = -offset.x * 2 / this.width;\n        m[9] = offset.y * 2 / this.height;\n        this.projectionMatrix = mat4.clone(m);\n\n        mat4.scale(m, m, [1, -1, 1]);\n        mat4.translate(m, m, [0, 0, -this.cameraToCenterDistance]);\n        mat4.rotateX(m, m, this._pitch);\n        mat4.rotateZ(m, m, this.angle);\n        mat4.translate(m, m, [-x, -y, 0]);\n\n        // The mercatorMatrix can be used to transform points from mercator coordinates\n        // ([0, 0] nw, [1, 1] se) to clip space.\n        this.mercatorMatrix = mat4.scale([] as any, m, [this.worldSize, this.worldSize, this.worldSize]);\n\n        // scale vertically to meters per pixel (inverse of ground resolution):\n        mat4.scale(m, m, [1, 1, this._pixelPerMeter]);\n\n        // matrix for conversion from world space to screen coordinates in 2D\n        this.pixelMatrix = mat4.multiply(new Float64Array(16) as any, this.labelPlaneMatrix, m);\n\n        // matrix for conversion from world space to clip space (-1 .. 1)\n        mat4.translate(m, m, [0, 0, -this.elevation]); // elevate camera over terrain\n        this.modelViewProjectionMatrix = m;\n        this.invModelViewProjectionMatrix = mat4.invert([] as any, m);\n\n        // create a fog matrix, same es proj-matrix but with near clipping-plane in mapcenter\n        // needed to calculate a correct z-value for fog calculation, because projMatrix z value is not\n        this.fogMatrix = new Float64Array(16) as any;\n        mat4.perspective(this.fogMatrix, this._fov, this.width / this.height, cameraToSeaLevelDistance, this.farZ);\n        this.fogMatrix[8] = -offset.x * 2 / this.width;\n        this.fogMatrix[9] = offset.y * 2 / this.height;\n        mat4.scale(this.fogMatrix, this.fogMatrix, [1, -1, 1]);\n        mat4.translate(this.fogMatrix, this.fogMatrix, [0, 0, -this.cameraToCenterDistance]);\n        mat4.rotateX(this.fogMatrix, this.fogMatrix, this._pitch);\n        mat4.rotateZ(this.fogMatrix, this.fogMatrix, this.angle);\n        mat4.translate(this.fogMatrix, this.fogMatrix, [-x, -y, 0]);\n        mat4.scale(this.fogMatrix, this.fogMatrix, [1, 1, this._pixelPerMeter]);\n        mat4.translate(this.fogMatrix, this.fogMatrix, [0, 0, -this.elevation]); // elevate camera over terrain\n\n        // matrix for conversion from world space to screen coordinates in 3D\n        this.pixelMatrix3D = mat4.multiply(new Float64Array(16) as any, this.labelPlaneMatrix, m);\n\n        // Make a second projection matrix that is aligned to a pixel grid for rendering raster tiles.\n        // We're rounding the (floating point) x/y values to achieve to avoid rendering raster images to fractional\n        // coordinates. Additionally, we adjust by half a pixel in either direction in case that viewport dimension\n        // is an odd integer to preserve rendering to the pixel grid. We're rotating this shift based on the angle\n        // of the transformation so that 0Â°, 90Â°, 180Â°, and 270Â° rasters are crisp, and adjust the shift so that\n        // it is always <= 0.5 pixels.\n        const xShift = (this.width % 2) / 2, yShift = (this.height % 2) / 2,\n            angleCos = Math.cos(this.angle), angleSin = Math.sin(this.angle),\n            dx = x - Math.round(x) + angleCos * xShift + angleSin * yShift,\n            dy = y - Math.round(y) + angleCos * yShift + angleSin * xShift;\n        const alignedM = new Float64Array(m) as any as mat4;\n        mat4.translate(alignedM, alignedM, [dx > 0.5 ? dx - 1 : dx, dy > 0.5 ? dy - 1 : dy, 0]);\n        this.alignedModelViewProjectionMatrix = alignedM;\n\n        // inverse matrix for conversion from screen coordinates to location\n        m = mat4.invert(new Float64Array(16) as any, this.pixelMatrix);\n        if (!m) throw new Error('failed to invert matrix');\n        this.pixelMatrixInverse = m;\n\n        this._posMatrixCache = {};\n        this._alignedPosMatrixCache = {};\n        this._fogMatrixCache = {};\n    }\n\n    maxPitchScaleFactor() {\n        // calcMatrices hasn't run yet\n        if (!this.pixelMatrixInverse) return 1;\n\n        const coord = this.pointCoordinate(new Point(0, 0));\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, 0, 1] as vec4;\n        const topPoint = vec4.transformMat4(p, p, this.pixelMatrix);\n        return topPoint[3] / this.cameraToCenterDistance;\n    }\n\n    /**\n     * The camera looks at the map from a 3D (lng, lat, altitude) location. Let's use `cameraLocation`\n     * as the name for the location under the camera and on the surface of the earth (lng, lat, 0).\n     * `cameraPoint` is the projected position of the `cameraLocation`.\n     *\n     * This point is useful to us because only fill-extrusions that are between `cameraPoint` and\n     * the query point on the surface of the earth can extend and intersect the query.\n     *\n     * When the map is not pitched the `cameraPoint` is equivalent to the center of the map because\n     * the camera is right above the center of the map.\n     */\n    getCameraPoint() {\n        const pitch = this._pitch;\n        const yOffset = Math.tan(pitch) * (this.cameraToCenterDistance || 1);\n        return this.centerPoint.add(new Point(0, yOffset));\n    }\n\n    /**\n     * When the map is pitched, some of the 3D features that intersect a query will not intersect\n     * the query at the surface of the earth. Instead the feature may be closer and only intersect\n     * the query because it extrudes into the air.\n     * @param queryGeometry - For point queries, the line from the query point to the \"camera point\",\n     * for other geometries, the envelope of the query geometry and the \"camera point\"\n     * @returns a geometry that includes all of the original query as well as all possible ares of the\n     * screen where the *base* of a visible extrusion could be.\n     *\n     */\n    getCameraQueryGeometry(queryGeometry: Array<Point>): Array<Point> {\n        const c = this.getCameraPoint();\n\n        if (queryGeometry.length === 1) {\n            return [queryGeometry[0], c];\n        } else {\n            let minX = c.x;\n            let minY = c.y;\n            let maxX = c.x;\n            let maxY = c.y;\n            for (const p of queryGeometry) {\n                minX = Math.min(minX, p.x);\n                minY = Math.min(minY, p.y);\n                maxX = Math.max(maxX, p.x);\n                maxY = Math.max(maxY, p.y);\n            }\n            return [\n                new Point(minX, minY),\n                new Point(maxX, minY),\n                new Point(maxX, maxY),\n                new Point(minX, maxY),\n                new Point(minX, minY)\n            ];\n        }\n    }\n    /**\n     * Return the distance to the camera in clip space from a LngLat.\n     * This can be compared to the value from the depth buffer (terrain.depthAtPoint)\n     * to determine whether a point is occluded.\n     * @param lngLat - the point\n     * @param elevation - the point's elevation\n     * @returns depth value in clip space (between 0 and 1)\n     */\n    lngLatToCameraDepth(lngLat: LngLat, elevation: number) {\n        const coord = this.locationCoordinate(lngLat);\n        const p = [coord.x * this.worldSize, coord.y * this.worldSize, elevation, 1] as vec4;\n        vec4.transformMat4(p, p, this.modelViewProjectionMatrix);\n        return (p[2] / p[3]);\n    }\n}\n", "import * as glMatrix from \"./common.js\";\n/**\n * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\n\nexport function create() {\n  var out = new glMatrix.ARRAY_TYPE(4);\n\n  if (glMatrix.ARRAY_TYPE != Float32Array) {\n    out[1] = 0;\n    out[2] = 0;\n  }\n\n  out[0] = 1;\n  out[3] = 1;\n  return out;\n}\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\n\nexport function clone(a) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function copy(out, a) {\n  out[0] = a[0];\n  out[1] = a[1];\n  out[2] = a[2];\n  out[3] = a[3];\n  return out;\n}\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\n\nexport function identity(out) {\n  out[0] = 1;\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = 1;\n  return out;\n}\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\n\nexport function fromValues(m00, m01, m10, m11) {\n  var out = new glMatrix.ARRAY_TYPE(4);\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m10;\n  out[3] = m11;\n  return out;\n}\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\n\nexport function set(out, m00, m01, m10, m11) {\n  out[0] = m00;\n  out[1] = m01;\n  out[2] = m10;\n  out[3] = m11;\n  return out;\n}\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function transpose(out, a) {\n  // If we are transposing ourselves we can skip a few steps but have to cache\n  // some values\n  if (out === a) {\n    var a1 = a[1];\n    out[1] = a[2];\n    out[2] = a1;\n  } else {\n    out[0] = a[0];\n    out[1] = a[2];\n    out[2] = a[1];\n    out[3] = a[3];\n  }\n\n  return out;\n}\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function invert(out, a) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3]; // Calculate the determinant\n\n  var det = a0 * a3 - a2 * a1;\n\n  if (!det) {\n    return null;\n  }\n\n  det = 1.0 / det;\n  out[0] = a3 * det;\n  out[1] = -a1 * det;\n  out[2] = -a2 * det;\n  out[3] = a0 * det;\n  return out;\n}\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nexport function adjoint(out, a) {\n  // Caching this value is nessecary if out == a\n  var a0 = a[0];\n  out[0] = a[3];\n  out[1] = -a[1];\n  out[2] = -a[2];\n  out[3] = a0;\n  return out;\n}\n/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\n\nexport function determinant(a) {\n  return a[0] * a[3] - a[2] * a[1];\n}\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nexport function multiply(out, a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  out[0] = a0 * b0 + a2 * b1;\n  out[1] = a1 * b0 + a3 * b1;\n  out[2] = a0 * b2 + a2 * b3;\n  out[3] = a1 * b2 + a3 * b3;\n  return out;\n}\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nexport function rotate(out, a, rad) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  out[0] = a0 * c + a2 * s;\n  out[1] = a1 * c + a3 * s;\n  out[2] = a0 * -s + a2 * c;\n  out[3] = a1 * -s + a3 * c;\n  return out;\n}\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\n\nexport function scale(out, a, v) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var v0 = v[0],\n      v1 = v[1];\n  out[0] = a0 * v0;\n  out[1] = a1 * v0;\n  out[2] = a2 * v1;\n  out[3] = a3 * v1;\n  return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n *     mat2.identity(dest);\n *     mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nexport function fromRotation(out, rad) {\n  var s = Math.sin(rad);\n  var c = Math.cos(rad);\n  out[0] = c;\n  out[1] = s;\n  out[2] = -s;\n  out[3] = c;\n  return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n *     mat2.identity(dest);\n *     mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2} out\n */\n\nexport function fromScaling(out, v) {\n  out[0] = v[0];\n  out[1] = 0;\n  out[2] = 0;\n  out[3] = v[1];\n  return out;\n}\n/**\n * Returns a string representation of a mat2\n *\n * @param {ReadonlyMat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nexport function str(a) {\n  return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nexport function frob(a) {\n  return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {ReadonlyMat2} L the lower triangular matrix\n * @param {ReadonlyMat2} D the diagonal matrix\n * @param {ReadonlyMat2} U the upper triangular matrix\n * @param {ReadonlyMat2} a the input matrix to factorize\n */\n\nexport function LDU(L, D, U, a) {\n  L[2] = a[2] / a[0];\n  U[0] = a[0];\n  U[1] = a[1];\n  U[3] = a[3] - L[2] * U[1];\n  return [L, D, U];\n}\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nexport function add(out, a, b) {\n  out[0] = a[0] + b[0];\n  out[1] = a[1] + b[1];\n  out[2] = a[2] + b[2];\n  out[3] = a[3] + b[3];\n  return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nexport function subtract(out, a, b) {\n  out[0] = a[0] - b[0];\n  out[1] = a[1] - b[1];\n  out[2] = a[2] - b[2];\n  out[3] = a[3] - b[3];\n  return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function exactEquals(a, b) {\n  return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nexport function equals(a, b) {\n  var a0 = a[0],\n      a1 = a[1],\n      a2 = a[2],\n      a3 = a[3];\n  var b0 = b[0],\n      b1 = b[1],\n      b2 = b[2],\n      b3 = b[3];\n  return Math.abs(a0 - b0) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= glMatrix.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\n\nexport function multiplyScalar(out, a, b) {\n  out[0] = a[0] * b;\n  out[1] = a[1] * b;\n  out[2] = a[2] * b;\n  out[3] = a[3] * b;\n  return out;\n}\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\n\nexport function multiplyScalarAndAdd(out, a, b, scale) {\n  out[0] = a[0] + b[0] * scale;\n  out[1] = a[1] + b[1] * scale;\n  out[2] = a[2] + b[2] * scale;\n  out[3] = a[3] + b[3] * scale;\n  return out;\n}\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\n\nexport var mul = multiply;\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\n\nexport var sub = subtract;", "/**\n * Throttle the given function to run at most every `period` milliseconds.\n */\nexport function throttle<T extends (...args: any) => void>(fn: T, time: number): (...args: Parameters<T>) => ReturnType<typeof setTimeout> {\n    let pending = false;\n    let timerId: ReturnType<typeof setTimeout> = null;\n    let lastCallContext = null;\n    let lastCallArgs: Parameters<T>;\n\n    const later = () => {\n        timerId = null;\n        if (pending) {\n            fn.apply(lastCallContext, lastCallArgs);\n            timerId = setTimeout(later, time);\n            pending = false;\n        }\n    };\n\n    return (...args: Parameters<T>) => {\n        pending = true;\n        lastCallContext = this;\n        lastCallArgs = args;\n        if (!timerId) {\n            later();\n        }\n        return timerId;\n    };\n}\n", "import {throttle} from '../util/throttle';\n\nimport type {Map} from './map';\n\n/**\n * Adds the map's position to its page's location hash.\n * Passed as an option to the map object.\n *\n * @group Markers and Controls\n */\nexport class Hash {\n    _map: Map;\n    _hashName: string;\n\n    constructor(hashName?: string | null) {\n        this._hashName = hashName && encodeURIComponent(hashName);\n    }\n\n    /**\n     * Map element to listen for coordinate changes\n     *\n     * @param map - The map object\n     */\n    addTo(map: Map) {\n        this._map = map;\n        addEventListener('hashchange', this._onHashChange, false);\n        this._map.on('moveend', this._updateHash);\n        return this;\n    }\n\n    /**\n     * Removes hash\n     */\n    remove() {\n        removeEventListener('hashchange', this._onHashChange, false);\n        this._map.off('moveend', this._updateHash);\n        clearTimeout(this._updateHash());\n        this._removeHash();\n\n        delete this._map;\n        return this;\n    }\n\n    getHashString(mapFeedback?: boolean) {\n        const center = this._map.getCenter(),\n            zoom = Math.round(this._map.getZoom() * 100) / 100,\n            // derived from equation: 512px * 2^z / 360 / 10^d < 0.5px\n            precision = Math.ceil((zoom * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10),\n            m = Math.pow(10, precision),\n            lng = Math.round(center.lng * m) / m,\n            lat = Math.round(center.lat * m) / m,\n            bearing = this._map.getBearing(),\n            pitch = this._map.getPitch();\n        let hash = '';\n        if (mapFeedback) {\n            // new map feedback site has some constraints that don't allow\n            // us to use the same hash format as we do for the Map hash option.\n            hash += `/${lng}/${lat}/${zoom}`;\n        } else {\n            hash += `${zoom}/${lat}/${lng}`;\n        }\n\n        if (bearing || pitch) hash += (`/${Math.round(bearing * 10) / 10}`);\n        if (pitch) hash += (`/${Math.round(pitch)}`);\n\n        if (this._hashName) {\n            const hashName = this._hashName;\n            let found = false;\n            const parts = window.location.hash.slice(1).split('&').map(part => {\n                const key = part.split('=')[0];\n                if (key === hashName) {\n                    found = true;\n                    return `${key}=${hash}`;\n                }\n                return part;\n            }).filter(a => a);\n            if (!found) {\n                parts.push(`${hashName}=${hash}`);\n            }\n            return `#${parts.join('&')}`;\n        }\n\n        return `#${hash}`;\n    }\n\n    _getCurrentHash = () => {\n        // Get the current hash from location, stripped from its number sign\n        const hash = window.location.hash.replace('#', '');\n        if (this._hashName) {\n            // Split the parameter-styled hash into parts and find the value we need\n            let keyval;\n            hash.split('&').map(\n                part => part.split('=')\n            ).forEach(part => {\n                if (part[0] === this._hashName) {\n                    keyval = part;\n                }\n            });\n            return (keyval ? keyval[1] || '' : '').split('/');\n        }\n        return hash.split('/');\n    };\n\n    _onHashChange = () => {\n        const loc = this._getCurrentHash();\n        if (loc.length >= 3 && !loc.some(v => isNaN(v))) {\n            const bearing = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(loc[3] || 0) : this._map.getBearing();\n            this._map.jumpTo({\n                center: [+loc[2], +loc[1]],\n                zoom: +loc[0],\n                bearing,\n                pitch: +(loc[4] || 0)\n            });\n            return true;\n        }\n        return false;\n    };\n\n    _updateHashUnthrottled = () => {\n        // Replace if already present, else append the updated hash string\n        const location = window.location.href.replace(/(#.*)?$/, this.getHashString());\n        window.history.replaceState(window.history.state, null, location);\n    };\n\n    _removeHash = () => {\n        const currentHash = this._getCurrentHash();\n        if (currentHash.length === 0) {\n            return;\n        }\n        const baseHash = currentHash.join('/');\n        let targetHash = baseHash;\n        if (targetHash.split('&').length > 0) {\n            targetHash = targetHash.split('&')[0]; // #3/1/2&foo=bar -> #3/1/2\n        }\n        if (this._hashName) {\n            targetHash = `${this._hashName}=${baseHash}`;\n        }\n        let replaceString = window.location.hash.replace(targetHash, '');\n        if (replaceString.startsWith('#&')) {\n            replaceString = replaceString.slice(0, 1) + replaceString.slice(2);\n        } else if (replaceString === '#') {\n            replaceString = '';\n        }\n        let location = window.location.href.replace(/(#.+)?$/, replaceString);\n        location = location.replace('&&', '&');\n        window.history.replaceState(window.history.state, null, location);\n    };\n\n    /**\n     * Mobile Safari doesn't allow updating the hash more than 100 times per 30 seconds.\n     */\n    _updateHash: () => ReturnType<typeof setTimeout> = throttle(this._updateHashUnthrottled, 30 * 1000 / 100);\n}\n", "import {browser} from '../util/browser';\nimport type {Map} from './map';\nimport {bezier, clamp, extend} from '../util/util';\nimport Point from '@mapbox/point-geometry';\nimport type {DragPanOptions} from './handler/shim/drag_pan';\n\nconst defaultInertiaOptions = {\n    linearity: 0.3,\n    easing: bezier(0, 0, 0.3, 1),\n};\n\nconst defaultPanInertiaOptions = extend({\n    deceleration: 2500,\n    maxSpeed: 1400\n}, defaultInertiaOptions);\n\nconst defaultZoomInertiaOptions = extend({\n    deceleration: 20,\n    maxSpeed: 1400\n}, defaultInertiaOptions);\n\nconst defaultBearingInertiaOptions = extend({\n    deceleration: 1000,\n    maxSpeed: 360\n}, defaultInertiaOptions);\n\nconst defaultPitchInertiaOptions = extend({\n    deceleration: 1000,\n    maxSpeed: 90\n}, defaultInertiaOptions);\n\nexport type InertiaOptions = {\n    linearity: number;\n    easing: (t: number) => number;\n    deceleration: number;\n    maxSpeed: number;\n};\n\nexport class HandlerInertia {\n    _map: Map;\n    _inertiaBuffer: Array<{\n        time: number;\n        settings: any;\n    }>;\n\n    constructor(map: Map) {\n        this._map = map;\n        this.clear();\n    }\n\n    clear() {\n        this._inertiaBuffer = [];\n    }\n\n    record(settings: any) {\n        this._drainInertiaBuffer();\n        this._inertiaBuffer.push({time: browser.now(), settings});\n    }\n\n    _drainInertiaBuffer() {\n        const inertia = this._inertiaBuffer,\n            now = browser.now(),\n            cutoff = 160;   //msec\n\n        while (inertia.length > 0 && now - inertia[0].time > cutoff)\n            inertia.shift();\n    }\n\n    _onMoveEnd(panInertiaOptions?: DragPanOptions | boolean) {\n        this._drainInertiaBuffer();\n        if (this._inertiaBuffer.length < 2) {\n            return;\n        }\n\n        const deltas = {\n            zoom: 0,\n            bearing: 0,\n            pitch: 0,\n            pan: new Point(0, 0),\n            pinchAround: undefined,\n            around: undefined\n        };\n\n        for (const {settings} of this._inertiaBuffer) {\n            deltas.zoom += settings.zoomDelta || 0;\n            deltas.bearing += settings.bearingDelta || 0;\n            deltas.pitch += settings.pitchDelta || 0;\n            if (settings.panDelta) deltas.pan._add(settings.panDelta);\n            if (settings.around) deltas.around = settings.around;\n            if (settings.pinchAround) deltas.pinchAround = settings.pinchAround;\n        }\n\n        const lastEntry = this._inertiaBuffer[this._inertiaBuffer.length - 1];\n        const duration = (lastEntry.time - this._inertiaBuffer[0].time);\n\n        const easeOptions = {} as any;\n\n        if (deltas.pan.mag()) {\n            const result = calculateEasing(deltas.pan.mag(), duration, extend({}, defaultPanInertiaOptions, panInertiaOptions || {}));\n            easeOptions.offset = deltas.pan.mult(result.amount / deltas.pan.mag());\n            easeOptions.center = this._map.transform.center;\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.zoom) {\n            const result = calculateEasing(deltas.zoom, duration, defaultZoomInertiaOptions);\n            easeOptions.zoom = this._map.transform.zoom + result.amount;\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.bearing) {\n            const result = calculateEasing(deltas.bearing, duration, defaultBearingInertiaOptions);\n            easeOptions.bearing = this._map.transform.bearing + clamp(result.amount, -179, 179);\n            extendDuration(easeOptions, result);\n        }\n\n        if (deltas.pitch) {\n            const result = calculateEasing(deltas.pitch, duration, defaultPitchInertiaOptions);\n            easeOptions.pitch = this._map.transform.pitch + result.amount;\n            extendDuration(easeOptions, result);\n        }\n\n        if (easeOptions.zoom || easeOptions.bearing) {\n            const last = deltas.pinchAround === undefined ? deltas.around : deltas.pinchAround;\n            easeOptions.around = last ? this._map.unproject(last) : this._map.getCenter();\n        }\n\n        this.clear();\n        return extend(easeOptions, {\n            noMoveStart: true\n        });\n\n    }\n}\n\n// Unfortunately zoom, bearing, etc can't have different durations and easings so\n// we need to choose one. We use the longest duration and it's corresponding easing.\nfunction extendDuration(easeOptions, result) {\n    if (!easeOptions.duration || easeOptions.duration < result.duration) {\n        easeOptions.duration = result.duration;\n        easeOptions.easing = result.easing;\n    }\n}\n\nfunction calculateEasing(amount, inertiaDuration: number, inertiaOptions) {\n    const {maxSpeed, linearity, deceleration} = inertiaOptions;\n    const speed = clamp(\n        amount * linearity / (inertiaDuration / 1000),\n        -maxSpeed,\n        maxSpeed);\n    const duration = Math.abs(speed) / (deceleration * linearity);\n    return {\n        easing: inertiaOptions.easing,\n        duration: duration * 1000,\n        amount: speed * (duration / 2)\n    };\n}\n", "import {Event} from '../util/evented';\n\nimport {DOM} from '../util/dom';\nimport Point from '@mapbox/point-geometry';\nimport {extend} from '../util/util';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\n\nimport type {Map} from './map';\nimport type {LngLat} from '../geo/lng_lat';\nimport type {SourceSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * An event from the mouse relevant to a specific layer.\n *\n * @group Event Related\n */\nexport type MapLayerMouseEvent = MapMouseEvent & { features?: MapGeoJSONFeature[] };\n\n/**\n * An event from a touch device relevant to a specific layer.\n *\n * @group Event Related\n */\nexport type MapLayerTouchEvent = MapTouchEvent & { features?: MapGeoJSONFeature[] };\n\n/**\n * The source event data type\n */\nexport type MapSourceDataType = 'content' | 'metadata' | 'visibility' | 'idle';\n\n/**\n * `MapLayerEventType` - a mapping between the event name and the event.\n * **Note:** These events are compatible with the optional `layerId` parameter.\n * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the\n * event action contains a visible portion of the specified layer.\n * The following example can be used for all the events.\n *\n * @group Event Related\n * @example\n * ```ts\n * // Initialize the map\n * let map = new Map({ // map options });\n * // Set an event listener for a specific layer\n * map.on('the-event-name', 'poi-label', (e) => {\n *   console.log('An event has occurred on a visible portion of the poi-label layer');\n * });\n * ```\n */\nexport type MapLayerEventType = {\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released contains a visible portion of the specified layer.\n     *\n     * @see [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-on-symbol/)\n     */\n    click: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released twice contains a visible portion of the specified layer.\n     *\n     * **Note:** Under normal conditions, this event will be preceded by two `click` events.\n     */\n    dblclick: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed while inside a visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    mousedown: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is released while inside a visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    mouseup: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved while the cursor is inside a visible portion of the specified layer.\n     * As you move the cursor across the layer, the event will fire every time the cursor changes position within that layer.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     */\n    mousemove: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from\n     * outside that layer or outside the map canvas.\n     *\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-on-symbol/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)\n     */\n    mouseenter: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves\n     * the map canvas.\n     *\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)\n     */\n    mouseleave: MapLayerMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved inside a visible portion of the specified layer.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     */\n    mouseover: MapLayerMouseEvent;\n    /**\n     * Fired when a point device (usually a mouse) leaves the visible portion of the specified layer.\n     */\n    mouseout: MapLayerMouseEvent;\n    /**\n     * Fired when the right button of the mouse is clicked or the context menu key is pressed within visible portion of the specified layer.\n     */\n    contextmenu: MapLayerMouseEvent;\n    /**\n     * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    touchstart: MapLayerTouchEvent;\n    /**\n     * Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    touchend: MapLayerTouchEvent;\n    /**\n     * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the visible portion of the specified layer.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    touchcancel: MapLayerTouchEvent;\n};\n\n/**\n * `MapEventType` - a mapping between the event name and the event value.\n * These events are used with the {@link Map#on} method.\n * When using a `layerId` with {@link Map#on} method, please refer to {@link MapLayerEventType}.\n * The following example can be used for all the events.\n *\n * @group Event Related\n * @example\n * ```ts\n * // Initialize the map\n * let map = new Map({ // map options });\n * // Set an event listener\n * map.on('the-event-name', () => {\n *   console.log('An event has occurred!');\n * });\n * ```\n */\nexport type MapEventType = {\n    /**\n     * Fired when an error occurs. This is GL JS's primary error reporting\n     * mechanism. We use an event instead of `throw` to better accommodate\n     * asynchronous operations. If no listeners are bound to the `error` event, the\n     * error will be printed to the console.\n     */\n    error: ErrorEvent;\n    /**\n     * Fired immediately after all necessary resources have been downloaded\n     * and the first visually complete rendering of the map has occurred.\n     *\n     * @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js/docs/examples/geojson-markers/)\n     * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/live-geojson/)\n     * @see [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-point-along-line/)\n     */\n    load: MapLibreEvent;\n    /**\n     * Fired after the last frame rendered before the map enters an\n     * \"idle\" state:\n     *\n     * - No camera transitions are in progress\n     * - All currently requested tiles have loaded\n     * - All fade/transition animations have completed\n     */\n    idle: MapLibreEvent;\n    /**\n     * Fired immediately after the map has been removed with {@link Map#remove}.\n     */\n    remove: MapLibreEvent;\n    /**\n     * Fired whenever the map is drawn to the screen, as the result of\n     *\n     * - a change to the map's position, zoom, pitch, or bearing\n     * - a change to the map's style\n     * - a change to a GeoJSON source\n     * - the loading of a vector tile, GeoJSON file, glyph, or sprite\n     */\n    render: MapLibreEvent;\n    /**\n     * Fired immediately after the map has been resized.\n     */\n    resize: MapLibreEvent;\n    /**\n     * Fired when the WebGL context is lost.\n     */\n    webglcontextlost: MapContextEvent;\n    /**\n     * Fired when the WebGL context is restored.\n     */\n    webglcontextrestored: MapContextEvent;\n    /**\n     * Fired when any map data (style, source, tile, etc) begins loading or\n     * changing asynchronously. All `dataloading` events are followed by a `data`,\n     * `dataabort` or `error` event.\n     */\n    dataloading: MapDataEvent;\n    /**\n     * Fired when any map data loads or changes. See {@link MapDataEvent} for more information.\n     * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js/docs/examples/cluster-html/)\n     */\n    data: MapDataEvent;\n    tiledataloading: MapDataEvent;\n    /**\n     * Fired when one of the map's sources begins loading or changing asynchronously.\n     * All `sourcedataloading` events are followed by a `sourcedata`, `sourcedataabort` or `error` event.\n     */\n    sourcedataloading: MapSourceDataEvent;\n    /**\n     * Fired when the map's style begins loading or changing asynchronously.\n     * All `styledataloading` events are followed by a `styledata`\n     * or `error` event.\n     */\n    styledataloading: MapStyleDataEvent;\n    /**\n     * Fired when one of the map's sources loads or changes, including if a tile belonging\n     * to a source loads or changes.\n     */\n    sourcedata: MapSourceDataEvent;\n    /**\n     * Fired when the map's style loads or changes.\n     */\n    styledata: MapStyleDataEvent;\n    /**\n     * Fired when an icon or pattern needed by the style is missing. The missing image can\n     * be added with {@link Map#addImage} within this event listener callback to prevent the image from\n     * being skipped. This event can be used to dynamically generate icons and patterns.\n     * @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-missing-generated/)\n     */\n    styleimagemissing: MapStyleImageMissingEvent;\n    /**\n     * Fired when a request for one of the map's sources' tiles or data is aborted.\n     */\n    dataabort: MapDataEvent;\n    /**\n     * Fired when a request for one of the map's sources' data is aborted.\n     */\n    sourcedataabort: MapSourceDataEvent;\n    /**\n     * Fired when the user cancels a \"box zoom\" interaction, or when the bounding box does not meet the minimum size threshold.\n     * See {@link BoxZoomHandler}.\n     */\n    boxzoomcancel: MapLibreZoomEvent;\n    /**\n     * Fired when a \"box zoom\" interaction starts. See {@link BoxZoomHandler}.\n     */\n    boxzoomstart: MapLibreZoomEvent;\n    /**\n     * Fired when a \"box zoom\" interaction ends.  See {@link BoxZoomHandler}.\n     */\n    boxzoomend: MapLibreZoomEvent;\n    /**\n     * Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.\n     */\n    touchcancel: MapTouchEvent;\n    /**\n     * Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    touchmove: MapTouchEvent;\n    /**\n     * Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    touchend: MapTouchEvent;\n    /**\n     * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    touchstart: MapTouchEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.\n     *\n     * @see [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-on-symbol/)\n     */\n    click: MapMouseEvent;\n    /**\n     * Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.\n     */\n    contextmenu: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on the map in rapid succession.\n     *\n     * **Note:** Under normal conditions, this event will be preceded by two `click` events.\n     */\n    dblclick: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.\n     * As you move the cursor across the map, the event will fire every time the cursor changes position within the map.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     */\n    mousemove: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is released within the map.\n     *\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    mouseup: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is pressed within the map.\n     *\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    mousedown: MapMouseEvent;\n    /**\n     * Fired when a point device (usually a mouse) leaves the map's canvas.\n     */\n    mouseout: MapMouseEvent;\n    /**\n     * Fired when a pointing device (usually a mouse) is moved within the map.\n     * As you move the cursor across a web page containing a map,\n     * the event will fire each time it enters the map or any child elements.\n     *\n     * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/mouse-position/)\n     * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     */\n    mouseover: MapMouseEvent;\n    /**\n     * Fired just before the map begins a transition from one\n     * view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.\n     *\n     */\n    movestart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired repeatedly during an animated transition from one view to\n     * another, as the result of either user interaction or methods such as {@link Map#flyTo}.\n     *\n     * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js/docs/examples/cluster-html/)\n     */\n    move: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired just after the map completes a transition from one\n     * view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.\n     *\n     * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js/docs/examples/cluster-html/)\n     */\n    moveend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired just before the map begins a transition from one zoom level to another,\n     * as the result of either user interaction or methods such as {@link Map#flyTo}.\n     */\n    zoomstart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired repeatedly during an animated transition from one zoom level to another,\n     * as the result of either user interaction or methods such as {@link Map#flyTo}.\n     */\n    zoom: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired just after the map completes a transition from one zoom level to another,\n     * as the result of either user interaction or methods such as {@link Map#flyTo}.\n     */\n    zoomend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;\n    /**\n     * Fired when a \"drag to rotate\" interaction starts. See {@link DragRotateHandler}.\n     */\n    rotatestart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired repeatedly during a \"drag to rotate\" interaction. See {@link DragRotateHandler}.\n     */\n    rotate: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a \"drag to rotate\" interaction ends. See {@link DragRotateHandler}.\n     */\n    rotateend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a \"drag to pan\" interaction starts. See {@link DragPanHandler}.\n     */\n    dragstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired repeatedly during a \"drag to pan\" interaction. See {@link DragPanHandler}.\n     */\n    drag: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a \"drag to pan\" interaction ends. See {@link DragPanHandler}.\n     * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-marker/)\n     */\n    dragend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired whenever the map's pitch (tilt) begins a change as\n     * the result of either user interaction or methods such as {@link Map#flyTo} .\n     */\n    pitchstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired repeatedly during the map's pitch (tilt) animation between\n     * one state and another as the result of either user interaction\n     * or methods such as {@link Map#flyTo}.\n     */\n    pitch: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired immediately after the map's pitch (tilt) finishes changing as\n     * the result of either user interaction or methods such as {@link Map#flyTo}.\n     */\n    pitchend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;\n    /**\n     * Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.\n     */\n    wheel: MapWheelEvent;\n    /**\n     * Fired when terrain is changed\n     */\n    terrain: MapTerrainEvent;\n    /**\n     * Fired whenever the cooperativeGestures option prevents a gesture from being handled by the map.\n     * This is useful for showing your own UI when this happens.\n     */\n    cooperativegestureprevented: MapLibreEvent<WheelEvent | TouchEvent> & {\n        gestureType: 'wheel_zoom' | 'touch_pan';\n    };\n};\n\n/**\n * The base event for MapLibre\n *\n * @group Event Related\n */\nexport type MapLibreEvent<TOrig = unknown> = {\n    type: keyof MapEventType | keyof MapLayerEventType;\n    target: Map;\n    originalEvent: TOrig;\n}\n\n/**\n * The style data event\n *\n * @group Event Related\n */\nexport type MapStyleDataEvent = MapLibreEvent & {\n    dataType: 'style';\n}\n\n/**\n * The source data event interface\n *\n * @group Event Related\n */\nexport type MapSourceDataEvent = MapLibreEvent & {\n    dataType: 'source';\n    /**\n     * True if the event has a `dataType` of `source` and the source has no outstanding network requests.\n     */\n    isSourceLoaded: boolean;\n    /**\n     * The [style spec representation of the source](https://maplibre.org/maplibre-style-spec/#sources) if the event has a `dataType` of `source`.\n     */\n    source: SourceSpecification;\n    sourceId: string;\n    sourceDataType: MapSourceDataType;\n    /**\n     * The tile being loaded or changed, if the event has a `dataType` of `source` and\n     * the event is related to loading of a tile.\n     */\n    tile: any;\n}\n/**\n * `MapMouseEvent` is the event type for mouse-related map events.\n *\n * @group Event Related\n *\n * @example\n * ```ts\n * // The `click` event is an example of a `MapMouseEvent`.\n * // Set up an event listener on the map.\n * map.on('click', (e) => {\n *   // The event object (e) contains information like the\n *   // coordinates of the point on the map that was clicked.\n *   console.log('A click event has occurred at ' + e.lngLat);\n * });\n * ```\n */\nexport class MapMouseEvent extends Event implements MapLibreEvent<MouseEvent> {\n    /**\n     * The event type\n     */\n    type: 'mousedown' | 'mouseup' | 'click' | 'dblclick' | 'mousemove' | 'mouseover' | 'mouseenter' | 'mouseleave' | 'mouseout' | 'contextmenu';\n\n    /**\n     * The `Map` object that fired the event.\n     */\n    target: Map;\n\n    /**\n     * The DOM event which caused the map event.\n     */\n    originalEvent: MouseEvent;\n\n    /**\n     * The pixel coordinates of the mouse cursor, relative to the map and measured from the top left corner.\n     */\n    point: Point;\n\n    /**\n     * The geographic location on the map of the mouse cursor.\n     */\n    lngLat: LngLat;\n\n    /**\n     * Prevents subsequent default processing of the event by the map.\n     *\n     * Calling this method will prevent the following default map behaviors:\n     *\n     *   * On `mousedown` events, the behavior of {@link DragPanHandler}\n     *   * On `mousedown` events, the behavior of {@link DragRotateHandler}\n     *   * On `mousedown` events, the behavior of {@link BoxZoomHandler}\n     *   * On `dblclick` events, the behavior of {@link DoubleClickZoomHandler}\n     *\n     */\n    preventDefault() {\n        this._defaultPrevented = true;\n    }\n\n    /**\n     * `true` if `preventDefault` has been called.\n     */\n    get defaultPrevented(): boolean {\n        return this._defaultPrevented;\n    }\n\n    _defaultPrevented: boolean;\n\n    constructor(type: string, map: Map, originalEvent: MouseEvent, data: any = {}) {\n        const point = DOM.mousePos(map.getCanvas(), originalEvent);\n        const lngLat = map.unproject(point);\n        super(type, extend({point, lngLat, originalEvent}, data));\n        this._defaultPrevented = false;\n        this.target = map;\n    }\n}\n\n/**\n * `MapTouchEvent` is the event type for touch-related map events.\n *\n * @group Event Related\n */\nexport class MapTouchEvent extends Event implements MapLibreEvent<TouchEvent> {\n    /**\n     * The event type.\n     */\n    type: 'touchstart' | 'touchmove' | 'touchend' | 'touchcancel';\n\n    /**\n     * The `Map` object that fired the event.\n     */\n    target: Map;\n\n    /**\n     * The DOM event which caused the map event.\n     */\n    originalEvent: TouchEvent;\n\n    /**\n     * The geographic location on the map of the center of the touch event points.\n     */\n    lngLat: LngLat;\n\n    /**\n     * The pixel coordinates of the center of the touch event points, relative to the map and measured from the top left\n     * corner.\n     */\n    point: Point;\n\n    /**\n     * The array of pixel coordinates corresponding to a\n     * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.\n     */\n    points: Array<Point>;\n\n    /**\n     * The geographical locations on the map corresponding to a\n     * [touch event's `touches`](https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/touches) property.\n     */\n    lngLats: Array<LngLat>;\n\n    /**\n     * Prevents subsequent default processing of the event by the map.\n     *\n     * Calling this method will prevent the following default map behaviors:\n     *\n     *   * On `touchstart` events, the behavior of {@link DragPanHandler}\n     *   * On `touchstart` events, the behavior of {@link TwoFingersTouchZoomRotateHandler}\n     *\n     */\n    preventDefault() {\n        this._defaultPrevented = true;\n    }\n\n    /**\n     * `true` if `preventDefault` has been called.\n     */\n    get defaultPrevented(): boolean {\n        return this._defaultPrevented;\n    }\n\n    _defaultPrevented: boolean;\n\n    constructor(type: string, map: Map, originalEvent: TouchEvent) {\n        const touches = type === 'touchend' ? originalEvent.changedTouches : originalEvent.touches;\n        const points = DOM.touchPos(map.getCanvasContainer(), touches);\n        const lngLats = points.map((t) => map.unproject(t));\n        const point = points.reduce((prev, curr, i, arr) => {\n            return prev.add(curr.div(arr.length));\n        }, new Point(0, 0));\n        const lngLat = map.unproject(point);\n        super(type, {points, point, lngLats, lngLat, originalEvent});\n        this._defaultPrevented = false;\n    }\n}\n\n/**\n * `MapWheelEvent` is the event type for the `wheel` map event.\n *\n * @group Event Related\n */\nexport class MapWheelEvent extends Event {\n    /**\n     * The event type.\n     */\n    type: 'wheel';\n\n    /**\n     * The `Map` object that fired the event.\n     */\n    target: Map;\n\n    /**\n     * The DOM event which caused the map event.\n     */\n    originalEvent: WheelEvent;\n\n    /**\n     * Prevents subsequent default processing of the event by the map.\n     *\n     * Calling this method will prevent the behavior of {@link ScrollZoomHandler}.\n     */\n    preventDefault() {\n        this._defaultPrevented = true;\n    }\n\n    /**\n     * `true` if `preventDefault` has been called.\n     */\n    get defaultPrevented(): boolean {\n        return this._defaultPrevented;\n    }\n\n    _defaultPrevented: boolean;\n\n    /** */\n    constructor(type: string, map: Map, originalEvent: WheelEvent) {\n        super(type, {originalEvent});\n        this._defaultPrevented = false;\n    }\n}\n\n/**\n * A `MapLibreZoomEvent` is the event type for the boxzoom-related map events emitted by the {@link BoxZoomHandler}.\n *\n * @group Event Related\n */\nexport type MapLibreZoomEvent = {\n    /**\n     * The type of boxzoom event. One of `boxzoomstart`, `boxzoomend` or `boxzoomcancel`\n     */\n    type: 'boxzoomstart' | 'boxzoomend' | 'boxzoomcancel';\n    /**\n     * The `Map` instance that triggered the event\n     */\n    target: Map;\n    /**\n     * The DOM event that triggered the boxzoom event. Can be a `MouseEvent` or `KeyboardEvent`\n     */\n    originalEvent: MouseEvent;\n};\n\n/**\n * A `MapDataEvent` object is emitted with the `data`\n * and `dataloading` events. Possible values for\n * `dataType`s are:\n *\n * - `'source'`: The non-tile data associated with any source\n * - `'style'`: The [style](https://maplibre.org/maplibre-style-spec/) used by the map\n *\n * Possible values for `sourceDataType`s are:\n *\n * - `'metadata'`: indicates that any necessary source metadata has been loaded (such as TileJSON) and it is ok to start loading tiles\n * - `'content'`: indicates the source data has changed (such as when source.setData() has been called on GeoJSONSource)\n * - `'visibility'`: send when the source becomes used when at least one of its layers becomes visible in style sense (inside the layer's zoom range and with layout.visibility set to 'visible')\n * - `'idle'`: indicates that no new source data has been fetched (but the source has done loading)\n *\n * @group Event Related\n *\n * @example\n * ```ts\n * // The sourcedata event is an example of MapDataEvent.\n * // Set up an event listener on the map.\n * map.on('sourcedata', (e) => {\n *    if (e.isSourceLoaded) {\n *        // Do something when the source has finished loading\n *    }\n * });\n * ```\n */\nexport type MapDataEvent = {\n    /**\n     * The event type.\n     */\n    type: string;\n    /**\n     * The type of data that has changed. One of `'source'`, `'style'`.\n     */\n    dataType: string;\n    /**\n     *  Included if the event has a `dataType` of `source` and the event signals that internal data has been received or changed. Possible values are `metadata`, `content`, `visibility` and `idle`.\n     */\n    sourceDataType: MapSourceDataType;\n};\n\n/**\n * The terrain event\n *\n * @group Event Related\n */\nexport type MapTerrainEvent = {\n    type: 'terrain';\n};\n\n/**\n * An event related to the web gl context\n *\n * @group Event Related\n */\nexport type MapContextEvent = {\n    type: 'webglcontextlost' | 'webglcontextrestored';\n    originalEvent: WebGLContextEvent;\n};\n\n/**\n * The style image missing event\n *\n * @group Event Related\n *\n * @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-missing-generated/)\n */\nexport type MapStyleImageMissingEvent = MapLibreEvent & {\n    type: 'styleimagemissing';\n    id: string;\n}\n", "import {MapMouseEvent, MapTouchEvent, MapWheelEvent} from '../events';\nimport {Handler} from '../handler_manager';\nimport type {Map} from '../map';\nimport type Point from '@mapbox/point-geometry';\n\nexport class MapEventHandler implements Handler {\n\n    _mousedownPos: Point;\n    _clickTolerance: number;\n    _map: Map;\n\n    constructor(map: Map, options: {\n        clickTolerance: number;\n    }) {\n        this._map = map;\n        this._clickTolerance = options.clickTolerance;\n    }\n\n    reset() {\n        delete this._mousedownPos;\n    }\n\n    wheel(e: WheelEvent) {\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - ScrollZoom\n        return this._firePreventable(new MapWheelEvent(e.type, this._map, e));\n    }\n\n    mousedown(e: MouseEvent, point: Point) {\n        this._mousedownPos = point;\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - MousePan\n        // - MouseRotate\n        // - MousePitch\n        // - DblclickHandler\n        return this._firePreventable(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mouseup(e: MouseEvent) {\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    click(e: MouseEvent, point: Point) {\n        if (this._mousedownPos && this._mousedownPos.dist(point) >= this._clickTolerance) return;\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    dblclick(e: MouseEvent) {\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - DblClickZoom\n        return this._firePreventable(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mouseover(e: MouseEvent) {\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mouseout(e: MouseEvent) {\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    touchstart(e: TouchEvent) {\n        // If mapEvent.preventDefault() is called by the user, prevent handlers such as:\n        // - TouchPan\n        // - TouchZoom\n        // - TouchRotate\n        // - TouchPitch\n        // - TapZoom\n        // - SwipeZoom\n        return this._firePreventable(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    touchmove(e: TouchEvent) {\n        this._map.fire(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    touchend(e: TouchEvent) {\n        this._map.fire(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    touchcancel(e: TouchEvent) {\n        this._map.fire(new MapTouchEvent(e.type, this._map, e));\n    }\n\n    _firePreventable(mapEvent: MapMouseEvent | MapTouchEvent | MapWheelEvent) {\n        this._map.fire(mapEvent);\n        if (mapEvent.defaultPrevented) {\n            // returning an object marks the handler as active and resets other handlers\n            return {};\n        }\n    }\n\n    isEnabled() {\n        return true;\n    }\n\n    isActive() {\n        return false;\n    }\n    enable() {}\n    disable() {}\n}\n\nexport class BlockableMapEventHandler {\n    _map: Map;\n    _delayContextMenu: boolean;\n    _ignoreContextMenu: boolean;\n    _contextMenuEvent: MouseEvent;\n\n    constructor(map: Map) {\n        this._map = map;\n    }\n\n    reset() {\n        this._delayContextMenu = false;\n        this._ignoreContextMenu = true;\n        delete this._contextMenuEvent;\n    }\n\n    mousemove(e: MouseEvent) {\n        // mousemove map events should not be fired when interaction handlers (pan, rotate, etc) are active\n        this._map.fire(new MapMouseEvent(e.type, this._map, e));\n    }\n\n    mousedown() {\n        this._delayContextMenu = true;\n        this._ignoreContextMenu = false;\n    }\n\n    mouseup() {\n        this._delayContextMenu = false;\n        if (this._contextMenuEvent) {\n            this._map.fire(new MapMouseEvent('contextmenu', this._map, this._contextMenuEvent));\n            delete this._contextMenuEvent;\n        }\n    }\n    contextmenu(e: MouseEvent) {\n        if (this._delayContextMenu) {\n            // Mac: contextmenu fired on mousedown; we save it until mouseup for consistency's sake\n            this._contextMenuEvent = e;\n        } else if (!this._ignoreContextMenu) {\n            // Windows: contextmenu fired on mouseup, so fire event now\n            this._map.fire(new MapMouseEvent(e.type, this._map, e));\n        }\n\n        // prevent browser context menu when necessary\n        if (this._map.listens('contextmenu')) {\n            e.preventDefault();\n        }\n    }\n\n    isEnabled() {\n        return true;\n    }\n\n    isActive() {\n        return false;\n    }\n    enable() {}\n    disable() {}\n}\n", "import type {Map} from '../map';\nimport type {PointLike} from '../camera';\nimport type {Transform} from '../../geo/transform';\nimport Point from '@mapbox/point-geometry';\nimport {LngLat} from '../../geo/lng_lat';\n\n/**\n * @internal\n * Shared utilities for the Handler classes to access the correct camera state.\n * If Camera.transformCameraUpdate is specified or terrain is enabled, the\n * \"desired state\" of camera may differ from the state used for rendering. The\n * handlers need the \"desired state\" to track accumulated changes.\n */\nexport class TransformProvider {\n    _map: Map;\n\n    constructor(map: Map) {\n        this._map = map;\n    }\n\n    get transform(): Transform {\n        return this._map._requestedCameraState || this._map.transform;\n    }\n\n    get center() {\n        return {lng: this.transform.center.lng, lat: this.transform.center.lat};\n    }\n\n    get zoom() {\n        return this.transform.zoom;\n    }\n\n    get pitch() {\n        return this.transform.pitch;\n    }\n\n    get bearing() {\n        return this.transform.bearing;\n    }\n\n    unproject(point: PointLike): LngLat {\n        return this.transform.pointLocation(Point.convert(point), this._map.terrain);\n    }\n}\n", "import {DOM} from '../../util/dom';\n\nimport {Event} from '../../util/evented';\nimport {TransformProvider} from './transform-provider';\n\nimport type {Map} from '../map';\nimport type Point from '@mapbox/point-geometry';\nimport {Handler} from '../handler_manager';\n\n/**\n * The `BoxZoomHandler` allows the user to zoom the map to fit within a bounding box.\n * The bounding box is defined by clicking and holding `shift` while dragging the cursor.\n *\n * @group Handlers\n */\nexport class BoxZoomHandler implements Handler {\n    _map: Map;\n    _tr: TransformProvider;\n    _el: HTMLElement;\n    _container: HTMLElement;\n    _enabled: boolean;\n    _active: boolean;\n    _startPos: Point;\n    _lastPos: Point;\n    _box: HTMLElement;\n    _clickTolerance: number;\n\n    /** @internal */\n    constructor(map: Map, options: {\n        clickTolerance: number;\n    }) {\n        this._map = map;\n        this._tr = new TransformProvider(map);\n        this._el = map.getCanvasContainer();\n        this._container = map.getContainer();\n        this._clickTolerance = options.clickTolerance || 1;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"box zoom\" interaction is enabled.\n     *\n     * @returns `true` if the \"box zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return !!this._enabled;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"box zoom\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"box zoom\" interaction is active.\n     */\n    isActive() {\n        return !!this._active;\n    }\n\n    /**\n     * Enables the \"box zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.boxZoom.enable();\n     * ```\n     */\n    enable() {\n        if (this.isEnabled()) return;\n        this._enabled = true;\n    }\n\n    /**\n     * Disables the \"box zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.boxZoom.disable();\n     * ```\n     */\n    disable() {\n        if (!this.isEnabled()) return;\n        this._enabled = false;\n    }\n\n    mousedown(e: MouseEvent, point: Point) {\n        if (!this.isEnabled()) return;\n        if (!(e.shiftKey && e.button === 0)) return;\n\n        DOM.disableDrag();\n        this._startPos = this._lastPos = point;\n        this._active = true;\n    }\n\n    mousemoveWindow(e: MouseEvent, point: Point) {\n        if (!this._active) return;\n\n        const pos = point;\n\n        if (this._lastPos.equals(pos) || (!this._box && pos.dist(this._startPos) < this._clickTolerance)) {\n            return;\n        }\n\n        const p0 = this._startPos;\n        this._lastPos = pos;\n\n        if (!this._box) {\n            this._box = DOM.create('div', 'maplibregl-boxzoom', this._container);\n            this._container.classList.add('maplibregl-crosshair');\n            this._fireEvent('boxzoomstart', e);\n        }\n\n        const minX = Math.min(p0.x, pos.x),\n            maxX = Math.max(p0.x, pos.x),\n            minY = Math.min(p0.y, pos.y),\n            maxY = Math.max(p0.y, pos.y);\n\n        DOM.setTransform(this._box, `translate(${minX}px,${minY}px)`);\n\n        this._box.style.width = `${maxX - minX}px`;\n        this._box.style.height = `${maxY - minY}px`;\n    }\n\n    mouseupWindow(e: MouseEvent, point: Point) {\n        if (!this._active) return;\n\n        if (e.button !== 0) return;\n\n        const p0 = this._startPos,\n            p1 = point;\n\n        this.reset();\n\n        DOM.suppressClick();\n\n        if (p0.x === p1.x && p0.y === p1.y) {\n            this._fireEvent('boxzoomcancel', e);\n        } else {\n            this._map.fire(new Event('boxzoomend', {originalEvent: e}));\n            return {\n                cameraAnimation: map => map.fitScreenCoordinates(p0, p1, this._tr.bearing, {linear: true})\n            };\n        }\n    }\n\n    keydown(e: KeyboardEvent) {\n        if (!this._active) return;\n\n        if (e.keyCode === 27) {\n            this.reset();\n            this._fireEvent('boxzoomcancel', e);\n        }\n    }\n\n    reset() {\n        this._active = false;\n\n        this._container.classList.remove('maplibregl-crosshair');\n\n        if (this._box) {\n            DOM.remove(this._box);\n            this._box = null;\n        }\n\n        DOM.enableDrag();\n\n        delete this._startPos;\n        delete this._lastPos;\n    }\n\n    _fireEvent(type: string, e: any) {\n        return this._map.fire(new Event(type, {originalEvent: e}));\n    }\n}\n", "import Point from '@mapbox/point-geometry';\n\nexport function indexTouches(touches: Array<Touch>, points: Array<Point>) {\n    if (touches.length !== points.length) throw new Error(`The number of touches and points are not equal - touches ${touches.length}, points ${points.length}`);\n    const obj = {};\n    for (let i = 0; i < touches.length; i++) {\n        obj[touches[i].identifier] = points[i];\n    }\n    return obj;\n}\n", "import Point from '@mapbox/point-geometry';\nimport {indexTouches} from './handler_util';\n\nfunction getCentroid(points: Array<Point>) {\n    const sum = new Point(0, 0);\n    for (const point of points) {\n        sum._add(point);\n    }\n    return sum.div(points.length);\n}\n\nexport const MAX_TAP_INTERVAL = 500;\nconst MAX_TOUCH_TIME = 500;\nexport const MAX_DIST = 30;\n\nexport class SingleTapRecognizer {\n\n    numTouches: number;\n    centroid: Point;\n    startTime: number;\n    aborted: boolean;\n    touches: {\n        [k in number | string]: Point;\n    };\n\n    constructor(options: {\n        numTouches: number;\n    }) {\n        this.reset();\n        this.numTouches = options.numTouches;\n    }\n\n    reset() {\n        delete this.centroid;\n        delete this.startTime;\n        delete this.touches;\n        this.aborted = false;\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n\n        if (this.centroid || mapTouches.length > this.numTouches) {\n            this.aborted = true;\n        }\n        if (this.aborted) {\n            return;\n        }\n\n        if (this.startTime === undefined) {\n            this.startTime = e.timeStamp;\n        }\n\n        if (mapTouches.length === this.numTouches) {\n            this.centroid = getCentroid(points);\n            this.touches = indexTouches(mapTouches, points);\n        }\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (this.aborted || !this.centroid) return;\n\n        const newTouches = indexTouches(mapTouches, points);\n        for (const id in this.touches) {\n            const prevPos = this.touches[id];\n            const pos = newTouches[id];\n            if (!pos || pos.dist(prevPos) > MAX_DIST) {\n                this.aborted = true;\n            }\n        }\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this.centroid || e.timeStamp - this.startTime > MAX_TOUCH_TIME) {\n            this.aborted = true;\n        }\n\n        if (mapTouches.length === 0) {\n            const centroid = !this.aborted && this.centroid;\n            this.reset();\n            if (centroid) return centroid;\n        }\n    }\n\n}\n\nexport class TapRecognizer {\n\n    singleTap: SingleTapRecognizer;\n    numTaps: number;\n    lastTime: number;\n    lastTap: Point;\n    count: number;\n\n    constructor(options: {\n        numTaps: number;\n        numTouches: number;\n    }) {\n        this.singleTap = new SingleTapRecognizer(options);\n        this.numTaps = options.numTaps;\n        this.reset();\n    }\n\n    reset() {\n        this.lastTime = Infinity;\n        delete this.lastTap;\n        this.count = 0;\n        this.singleTap.reset();\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this.singleTap.touchstart(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this.singleTap.touchmove(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        const tap = this.singleTap.touchend(e, points, mapTouches);\n        if (tap) {\n            const soonEnough = e.timeStamp - this.lastTime < MAX_TAP_INTERVAL;\n            const closeEnough = !this.lastTap || this.lastTap.dist(tap) < MAX_DIST;\n\n            if (!soonEnough || !closeEnough) {\n                this.reset();\n            }\n\n            this.count++;\n            this.lastTime = e.timeStamp;\n            this.lastTap = tap;\n\n            if (this.count === this.numTaps) {\n                this.reset();\n                return tap;\n            }\n        }\n    }\n}\n", "import {TapRecognizer} from './tap_recognizer';\nimport type Point from '@mapbox/point-geometry';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\nimport {Handler} from '../handler_manager';\n\n/**\n * A `TapZoomHandler` allows the user to zoom the map at a point by double tapping\n */\nexport class TapZoomHandler implements Handler {\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n    _zoomIn: TapRecognizer;\n    _zoomOut: TapRecognizer;\n\n    constructor(map: Map) {\n        this._tr = new TransformProvider(map);\n        this._zoomIn = new TapRecognizer({\n            numTouches: 1,\n            numTaps: 2\n        });\n\n        this._zoomOut = new TapRecognizer({\n            numTouches: 2,\n            numTaps: 1\n        });\n\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n        this._zoomIn.reset();\n        this._zoomOut.reset();\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this._zoomIn.touchstart(e, points, mapTouches);\n        this._zoomOut.touchstart(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this._zoomIn.touchmove(e, points, mapTouches);\n        this._zoomOut.touchmove(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        const zoomInPoint = this._zoomIn.touchend(e, points, mapTouches);\n        const zoomOutPoint = this._zoomOut.touchend(e, points, mapTouches);\n        const tr = this._tr;\n\n        if (zoomInPoint) {\n            this._active = true;\n            e.preventDefault();\n            setTimeout(() => this.reset(), 0);\n            return {\n                cameraAnimation: (map: Map) => map.easeTo({\n                    duration: 300,\n                    zoom: tr.zoom + 1,\n                    around: tr.unproject(zoomInPoint)\n                }, {originalEvent: e})\n            };\n        } else if (zoomOutPoint) {\n            this._active = true;\n            e.preventDefault();\n            setTimeout(() => this.reset(), 0);\n            return {\n                cameraAnimation: (map: Map) => map.easeTo({\n                    duration: 300,\n                    zoom: tr.zoom - 1,\n                    around: tr.unproject(zoomOutPoint)\n                }, {originalEvent: e})\n            };\n        }\n    }\n\n    touchcancel() {\n        this.reset();\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n", "import {DOM} from '../../util/dom';\nimport type Point from '@mapbox/point-geometry';\nimport {DragMoveStateManager} from './drag_move_state_manager';\nimport {Handler} from '../handler_manager';\n\ninterface DragMovementResult {\n    bearingDelta?: number;\n    pitchDelta?: number;\n    around?: Point;\n    panDelta?: Point;\n}\n\nexport interface DragPanResult extends DragMovementResult {\n    around: Point;\n    panDelta: Point;\n}\n\nexport interface DragRotateResult extends DragMovementResult {\n    bearingDelta: number;\n}\n\nexport interface DragPitchResult extends DragMovementResult {\n    pitchDelta: number;\n}\n\ntype DragMoveFunction<T extends DragMovementResult> = (lastPoint: Point, point: Point) => T;\n\nexport interface DragMoveHandler<T extends DragMovementResult, E extends Event> extends Handler {\n    dragStart: (e: E, point: Point) => void;\n    dragMove: (e: E, point: Point) => T | void;\n    dragEnd: (e: E) => void;\n    getClickTolerance: () => number;\n}\n\nexport type DragMoveHandlerOptions<T, E extends Event> = {\n    /**\n     * If the movement is shorter than this value, consider it a click.\n     */\n    clickTolerance: number;\n    /**\n     * The move function to run on a valid movement.\n     */\n    move: DragMoveFunction<T>;\n    /**\n     * A class used to manage the state of the drag event - start, checking valid moves, end. See the class documentation for more details.\n     */\n    moveStateManager: DragMoveStateManager<E>;\n    /**\n     * A method used to assign the dragStart, dragMove, and dragEnd methods to the relevant event handlers, as well as assigning the contextmenu handler\n     * @param handler - the handler\n     */\n    assignEvents: (handler: DragMoveHandler<T, E>) => void;\n    /**\n     * Should the move start on the \"start\" event, or should it start on the first valid move.\n     */\n    activateOnStart?: boolean;\n    /**\n     * If true, handler will be enabled during construction\n     */\n    enable?: boolean;\n}\n\n/**\n * A generic class to create handlers for drag events, from both mouse and touch events.\n */\nexport class DragHandler<T extends DragMovementResult, E extends Event> implements DragMoveHandler<T, E> {\n    // Event handlers that may be assigned by the implementations of this class\n    contextmenu?: Handler['contextmenu'];\n    mousedown?: Handler['mousedown'];\n    mousemoveWindow?: Handler['mousemoveWindow'];\n    mouseup?: Handler['mouseup'];\n    touchstart?: Handler['touchstart'];\n    touchmoveWindow?: Handler['touchmoveWindow'];\n    touchend?: Handler['touchend'];\n\n    _clickTolerance: number;\n    _moveFunction: DragMoveFunction<T>;\n    _activateOnStart: boolean;\n    _active: boolean;\n    _enabled: boolean;\n    _moved: boolean;\n    _lastPoint: Point | null;\n    _moveStateManager: DragMoveStateManager<E>;\n\n    constructor(options: DragMoveHandlerOptions<T, E>) {\n        this._enabled = !!options.enable;\n        this._moveStateManager = options.moveStateManager;\n        this._clickTolerance = options.clickTolerance || 1;\n        this._moveFunction = options.move;\n        this._activateOnStart = !!options.activateOnStart;\n\n        options.assignEvents(this);\n\n        this.reset();\n    }\n\n    reset(e?: E) {\n        this._active = false;\n        this._moved = false;\n        delete this._lastPoint;\n        this._moveStateManager.endMove(e);\n    }\n\n    _move(...params: Parameters<DragMoveFunction<T>>) {\n        const move = this._moveFunction(...params);\n        if (move.bearingDelta || move.pitchDelta || move.around || move.panDelta) {\n            this._active = true;\n            return move;\n        }\n    }\n\n    dragStart(e: E, point: Point);\n    dragStart(e: E, point: Point[]);\n    dragStart(e: E, point: Point | Point[]) {\n        if (!this.isEnabled() || this._lastPoint) return;\n\n        if (!this._moveStateManager.isValidStartEvent(e)) return;\n        this._moveStateManager.startMove(e);\n\n        this._lastPoint = point['length'] ? point[0] : point;\n\n        if (this._activateOnStart && this._lastPoint) this._active = true;\n    }\n\n    dragMove(e: E, point: Point);\n    dragMove(e: E, point: Point[]);\n    dragMove(e: E, point: Point | Point[]) {\n        if (!this.isEnabled()) return;\n        const lastPoint = this._lastPoint;\n        if (!lastPoint) return;\n        e.preventDefault();\n\n        if (!this._moveStateManager.isValidMoveEvent(e)) {\n            this.reset(e);\n            return;\n        }\n\n        const movePoint = point['length'] ? point[0] : point;\n\n        if (!this._moved && movePoint.dist(lastPoint) < this._clickTolerance) return;\n        this._moved = true;\n        this._lastPoint = movePoint;\n\n        return this._move(lastPoint, movePoint);\n    }\n\n    dragEnd(e: E) {\n        if (!this.isEnabled() || !this._lastPoint) return;\n        if (!this._moveStateManager.isValidEndEvent(e)) return;\n        if (this._moved) DOM.suppressClick();\n        this.reset(e);\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n\n    getClickTolerance() {\n        return this._clickTolerance;\n    }\n}\n", "import {DOM} from '../../util/dom';\n\nconst LEFT_BUTTON = 0;\nconst RIGHT_BUTTON = 2;\n\n// the values for each button in MouseEvent.buttons\nconst BUTTONS_FLAGS = {\n    [LEFT_BUTTON]: 1,\n    [RIGHT_BUTTON]: 2\n};\n\nfunction buttonNoLongerPressed(e: MouseEvent, button: number) {\n    const flag = BUTTONS_FLAGS[button];\n    return e.buttons === undefined || (e.buttons & flag) !== flag;\n}\n\n/*\n * Drag events are initiated by specific interaction which needs to be tracked until it ends.\n * This requires some state management:\n * 1. registering the initiating event,\n * 2. tracking that it was not canceled / not confusing it with another event firing.\n * 3. recognizing the ending event and cleaning up any internal state\n *\n * Concretely, we implement two state managers:\n * 1. MouseMoveStateManager\n *      Receives a functions that is used to recognize mouse events that should be registered as the\n *      relevant drag interactions - i.e. dragging with the right mouse button, or while CTRL is pressed.\n * 2. OneFingerTouchMoveStateManager\n *      Checks if a drag event is using one finger, and continuously tracking that this is the same event\n *      (i.e. to make sure not additional finger has started interacting with the screen before raising\n *      the first finger).\n */\nexport interface DragMoveStateManager<E extends Event> {\n    startMove: (e: E) => void;\n    endMove: (e?: E) => void;\n    isValidStartEvent: (e: E) => boolean;\n    isValidMoveEvent: (e: E) => boolean;\n    isValidEndEvent: (e?: E) => boolean;\n}\n\nexport class MouseMoveStateManager implements DragMoveStateManager<MouseEvent> {\n    _eventButton: number | undefined;\n    _correctEvent: (e: MouseEvent) => boolean;\n\n    constructor(options: {\n        checkCorrectEvent: (e: MouseEvent) => boolean;\n    }) {\n        this._correctEvent = options.checkCorrectEvent;\n    }\n\n    startMove(e: MouseEvent) {\n        const eventButton = DOM.mouseButton(e);\n        this._eventButton = eventButton;\n    }\n\n    endMove(_e?: MouseEvent) {\n        delete this._eventButton;\n    }\n\n    isValidStartEvent(e: MouseEvent) {\n        return this._correctEvent(e);\n    }\n\n    isValidMoveEvent(e: MouseEvent) {\n        // Some browsers don't fire a `mouseup` when the mouseup occurs outside\n        // the window or iframe:\n        // https://github.com/mapbox/mapbox-gl-js/issues/4622\n        //\n        // If the button is no longer pressed during this `mousemove` it may have\n        // been released outside of the window or iframe.\n        return !buttonNoLongerPressed(e, this._eventButton);\n    }\n\n    isValidEndEvent(e: MouseEvent) {\n        const eventButton = DOM.mouseButton(e);\n        return eventButton === this._eventButton;\n    }\n}\n\nexport class OneFingerTouchMoveStateManager implements DragMoveStateManager<TouchEvent> {\n    _firstTouch: number | undefined;\n\n    constructor() {\n        this._firstTouch = undefined;\n    }\n\n    _isOneFingerTouch(e: TouchEvent) {\n        return e.targetTouches.length === 1;\n    }\n\n    _isSameTouchEvent(e: TouchEvent) {\n        return e.targetTouches[0].identifier === this._firstTouch;\n    }\n\n    startMove(e: TouchEvent) {\n        const firstTouch = e.targetTouches[0].identifier;\n        this._firstTouch = firstTouch;\n    }\n\n    endMove(_e?: TouchEvent) {\n        delete this._firstTouch;\n    }\n\n    isValidStartEvent(e: TouchEvent) {\n        return this._isOneFingerTouch(e);\n    }\n\n    isValidMoveEvent(e: TouchEvent) {\n        return this._isOneFingerTouch(e) && this._isSameTouchEvent(e);\n    }\n\n    isValidEndEvent(e: TouchEvent) {\n        return this._isOneFingerTouch(e) && this._isSameTouchEvent(e);\n    }\n}\n", "import type Point from '@mapbox/point-geometry';\n\nimport {DOM} from '../../util/dom';\nimport {DragMoveHandler, DragPanResult, DragRotateResult, DragPitchResult, DragHandler} from './drag_handler';\nimport {MouseMoveStateManager} from './drag_move_state_manager';\n\n/**\n * `MousePanHandler` allows the user to pan the map by clicking and dragging\n */\nexport interface MousePanHandler extends DragMoveHandler<DragPanResult, MouseEvent> {}\n/**\n * `MouseRotateHandler` allows the user to rotate the map by clicking and dragging\n */\nexport interface MouseRotateHandler extends DragMoveHandler<DragRotateResult, MouseEvent> {}\n/**\n * `MousePitchHandler` allows the user to zoom the map by pitching\n */\nexport interface MousePitchHandler extends DragMoveHandler<DragPitchResult, MouseEvent> {}\n\nconst LEFT_BUTTON = 0;\nconst RIGHT_BUTTON = 2;\n\nconst assignEvents = (handler: DragHandler<DragPanResult, MouseEvent>) => {\n    handler.mousedown = handler.dragStart;\n    handler.mousemoveWindow = handler.dragMove;\n    handler.mouseup = handler.dragEnd;\n    handler.contextmenu = (e: MouseEvent) => {\n        e.preventDefault();\n    };\n};\n\nexport const generateMousePanHandler = ({enable, clickTolerance,}: {\n    clickTolerance: number;\n    enable?: boolean;\n}): MousePanHandler => {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent) => DOM.mouseButton(e) === LEFT_BUTTON && !e.ctrlKey,\n    });\n    return new DragHandler<DragPanResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) =>\n            ({around: point, panDelta: point.sub(lastPoint)}),\n        activateOnStart: true,\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n\nexport const generateMouseRotationHandler = ({enable, clickTolerance, bearingDegreesPerPixelMoved = 0.8}: {\n    clickTolerance: number;\n    bearingDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}): MouseRotateHandler => {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (DOM.mouseButton(e) === LEFT_BUTTON && e.ctrlKey) ||\n            (DOM.mouseButton(e) === RIGHT_BUTTON),\n    });\n    return new DragHandler<DragRotateResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) =>\n            ({bearingDelta: (point.x - lastPoint.x) * bearingDegreesPerPixelMoved}),\n        // prevent browser context menu when necessary; we don't allow it with rotation\n        // because we can't discern rotation gesture start from contextmenu on Mac\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n\nexport const generateMousePitchHandler = ({enable, clickTolerance, pitchDegreesPerPixelMoved = -0.5}: {\n    clickTolerance: number;\n    pitchDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}): MousePitchHandler => {\n    const mouseMoveStateManager = new MouseMoveStateManager({\n        checkCorrectEvent: (e: MouseEvent): boolean =>\n            (DOM.mouseButton(e) === LEFT_BUTTON && e.ctrlKey) ||\n            (DOM.mouseButton(e) === RIGHT_BUTTON),\n    });\n    return new DragHandler<DragPitchResult, MouseEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) =>\n            ({pitchDelta: (point.y - lastPoint.y) * pitchDegreesPerPixelMoved}),\n        // prevent browser context menu when necessary; we don't allow it with rotation\n        // because we can't discern rotation gesture start from contextmenu on Mac\n        moveStateManager: mouseMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n", "import Point from '@mapbox/point-geometry';\nimport {indexTouches} from './handler_util';\nimport {Handler} from '../handler_manager';\nimport type {Map} from '../map';\n\n/**\n * A `TouchPanHandler` allows the user to pan the map using touch gestures.\n */\nexport class TouchPanHandler implements Handler {\n\n    _enabled: boolean;\n    _active: boolean;\n    _touches: {\n        [k in string | number]: Point;\n    };\n    _clickTolerance: number;\n    _sum: Point;\n    _map: Map;\n\n    constructor(options: {clickTolerance: number}, map: Map) {\n        this._clickTolerance = options.clickTolerance || 1;\n        this._map = map;\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n        this._touches = {};\n        this._sum = new Point(0, 0);\n    }\n\n    _shouldBePrevented(touchesCount: number) {\n        const minTouches = this._map.cooperativeGestures.isEnabled() ? 2 : 1;\n        return touchesCount < minTouches;\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        return this._calculateTransform(e, points, mapTouches);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this._active) return;\n        if (this._shouldBePrevented(mapTouches.length)) {\n            this._map.cooperativeGestures.notifyGestureBlocked('touch_pan', e);\n            return;\n        }\n        e.preventDefault();\n        return this._calculateTransform(e, points, mapTouches);\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        this._calculateTransform(e, points, mapTouches);\n\n        if (this._active && this._shouldBePrevented(mapTouches.length)) {\n            this.reset();\n        }\n    }\n\n    touchcancel() {\n        this.reset();\n    }\n\n    _calculateTransform(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (mapTouches.length > 0) this._active = true;\n\n        const touches = indexTouches(mapTouches, points);\n\n        const touchPointSum = new Point(0, 0);\n        const touchDeltaSum = new Point(0, 0);\n        let touchDeltaCount = 0;\n\n        for (const identifier in touches) {\n            const point = touches[identifier];\n            const prevPoint = this._touches[identifier];\n            if (prevPoint) {\n                touchPointSum._add(point);\n                touchDeltaSum._add(point.sub(prevPoint));\n                touchDeltaCount++;\n                touches[identifier] = point;\n            }\n        }\n\n        this._touches = touches;\n\n        if (this._shouldBePrevented(touchDeltaCount) || !touchDeltaSum.mag()) return;\n\n        const panDelta = touchDeltaSum.div(touchDeltaCount);\n        this._sum._add(panDelta);\n        if (this._sum.mag() < this._clickTolerance) return;\n\n        const around = touchPointSum.div(touchDeltaCount);\n\n        return {\n            around,\n            panDelta\n        };\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n", "import Point from '@mapbox/point-geometry';\nimport {DOM} from '../../util/dom';\nimport type {Map} from '../map';\nimport {Handler, HandlerResult} from '../handler_manager';\n\n/**\n * An options object sent to the enable function of some of the handlers\n */\nexport type AroundCenterOptions = {\n    /**\n     * If \"center\" is passed, map will zoom around the center of map\n     */\n    around: 'center';\n}\n\n/**\n * The `TwoFingersTouchHandler`s allows the user to zoom, pitch and rotate the map using two fingers\n *\n */\nabstract class TwoFingersTouchHandler implements Handler {\n\n    _enabled?: boolean;\n    _active?: boolean;\n    _firstTwoTouches?: [number, number];\n    _vector?: Point;\n    _startVector?: Point;\n    _aroundCenter?: boolean;\n\n    /** @internal */\n    constructor() {\n        this.reset();\n    }\n\n    reset(): void {\n        this._active = false;\n        delete this._firstTwoTouches;\n    }\n\n    abstract _start(points: [Point, Point]): void;\n    abstract _move(points: [Point, Point], pinchAround: Point | null, e: TouchEvent): HandlerResult | void;\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void {\n        //log('touchstart', points, e.target.innerHTML, e.targetTouches.length ? e.targetTouches[0].target.innerHTML: undefined);\n        if (this._firstTwoTouches || mapTouches.length < 2) return;\n\n        this._firstTwoTouches = [\n            mapTouches[0].identifier,\n            mapTouches[1].identifier\n        ];\n\n        // implemented by child classes\n        this._start([points[0], points[1]]);\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): HandlerResult | void {\n        if (!this._firstTwoTouches) return;\n\n        e.preventDefault();\n\n        const [idA, idB] = this._firstTwoTouches;\n        const a = getTouchById(mapTouches, points, idA);\n        const b = getTouchById(mapTouches, points, idB);\n        if (!a || !b) return;\n        const pinchAround = this._aroundCenter ? null : a.add(b).div(2);\n\n        // implemented by child classes\n        return this._move([a, b], pinchAround, e);\n\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void {\n        if (!this._firstTwoTouches) return;\n\n        const [idA, idB] = this._firstTwoTouches;\n        const a = getTouchById(mapTouches, points, idA);\n        const b = getTouchById(mapTouches, points, idB);\n        if (a && b) return;\n\n        if (this._active) DOM.suppressClick();\n\n        this.reset();\n    }\n\n    touchcancel(): void {\n        this.reset();\n    }\n\n    /**\n     * Enables the \"drag to pitch\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchPitch.enable();\n     * ```\n     */\n    enable(options?: AroundCenterOptions | boolean | null): void {\n        this._enabled = true;\n        this._aroundCenter = !!options && (options as AroundCenterOptions).around === 'center';\n    }\n\n    /**\n     * Disables the \"drag to pitch\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchPitch.disable();\n     * ```\n     */\n    disable(): void {\n        this._enabled = false;\n        this.reset();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pitch\" interaction is enabled.\n     *\n     * @returns  `true` if the \"drag to pitch\" interaction is enabled.\n     */\n    isEnabled(): boolean {\n        return !!this._enabled;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pitch\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"drag to pitch\" interaction is active.\n     */\n    isActive(): boolean {\n        return !!this._active;\n    }\n}\n\nfunction getTouchById(mapTouches: Array<Touch>, points: Array<Point>, identifier: number): Point | undefined {\n    for (let i = 0; i < mapTouches.length; i++) {\n        if (mapTouches[i].identifier === identifier) return points[i];\n    }\n    return undefined;\n}\n\n/* ZOOM */\n\nconst ZOOM_THRESHOLD = 0.1;\n\nfunction getZoomDelta(distance: number, lastDistance: number): number {\n    return Math.log(distance / lastDistance) / Math.LN2;\n}\n\n/**\n * The `TwoFingersTouchHandler`s allows the user to zoom the map two fingers\n *\n * @group Handlers\n */\nexport class TwoFingersTouchZoomHandler extends TwoFingersTouchHandler {\n\n    _distance?: number;\n    _startDistance?: number;\n\n    reset() {\n        super.reset();\n        delete this._distance;\n        delete this._startDistance;\n    }\n\n    _start(points: [Point, Point]): void {\n        this._startDistance = this._distance = points[0].dist(points[1]);\n    }\n\n    _move(points: [Point, Point], pinchAround: Point | null): HandlerResult | void {\n        const lastDistance = this._distance!;\n        this._distance = points[0].dist(points[1]);\n        if (!this._active && Math.abs(getZoomDelta(this._distance, this._startDistance!)) < ZOOM_THRESHOLD) return;\n        this._active = true;\n        return {\n            zoomDelta: getZoomDelta(this._distance, lastDistance),\n            pinchAround\n        };\n    }\n}\n\n/* ROTATE */\n\nconst ROTATION_THRESHOLD = 25; // pixels along circumference of touch circle\n\nfunction getBearingDelta(a: Point, b: Point): number {\n    return a.angleWith(b) * 180 / Math.PI;\n}\n\n/**\n * The `TwoFingersTouchHandler`s allows the user to rotate the map two fingers\n *\n * @group Handlers\n */\nexport class TwoFingersTouchRotateHandler extends TwoFingersTouchHandler {\n    _minDiameter?: number;\n\n    reset(): void {\n        super.reset();\n        delete this._minDiameter;\n        delete this._startVector;\n        delete this._vector;\n    }\n\n    _start(points: [Point, Point]): void {\n        this._startVector = this._vector = points[0].sub(points[1]);\n        this._minDiameter = points[0].dist(points[1]);\n    }\n\n    _move(points: [Point, Point], pinchAround: Point | null, _e: TouchEvent): HandlerResult | void {\n        const lastVector = this._vector!;\n        this._vector = points[0].sub(points[1]);\n\n        if (!this._active && this._isBelowThreshold(this._vector)) return;\n        this._active = true;\n\n        return {\n            bearingDelta: getBearingDelta(this._vector, lastVector),\n            pinchAround\n        };\n    }\n\n    _isBelowThreshold(vector: Point): boolean {\n        /*\n         * The threshold before a rotation actually happens is configured in\n         * pixels along the circumference of the circle formed by the two fingers.\n         * This makes the threshold in degrees larger when the fingers are close\n         * together and smaller when the fingers are far apart.\n         *\n         * Use the smallest diameter from the whole gesture to reduce sensitivity\n         * when pinching in and out.\n         */\n\n        this._minDiameter = Math.min(this._minDiameter!, vector.mag());\n        const circumference = Math.PI * this._minDiameter;\n        const threshold = ROTATION_THRESHOLD / circumference * 360;\n\n        const bearingDeltaSinceStart = getBearingDelta(vector, this._startVector!);\n        return Math.abs(bearingDeltaSinceStart) < threshold;\n    }\n}\n\n/* PITCH */\n\nfunction isVertical(vector: Point): boolean {\n    return Math.abs(vector.y) > Math.abs(vector.x);\n}\n\nconst ALLOWED_SINGLE_TOUCH_TIME = 100;\n\n/**\n * The `TwoFingersTouchPitchHandler` allows the user to pitch the map by dragging up and down with two fingers.\n *\n * @group Handlers\n */\nexport class TwoFingersTouchPitchHandler extends TwoFingersTouchHandler {\n\n    _valid?: boolean;\n    _firstMove?: number;\n    _lastPoints?: [Point, Point];\n    _map: Map;\n    _currentTouchCount: number = 0;\n\n    constructor(map: Map) {\n        super();\n        this._map = map;\n    }\n\n    reset(): void {\n        super.reset();\n        this._valid = undefined;\n        delete this._firstMove;\n        delete this._lastPoints;\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void {\n        super.touchstart(e, points, mapTouches);\n        this._currentTouchCount = mapTouches.length;\n    }\n\n    _start(points: [Point, Point]): void {\n        this._lastPoints = points;\n        if (isVertical(points[0].sub(points[1]))) {\n            // fingers are more horizontal than vertical\n            this._valid = false;\n        }\n    }\n\n    _move(points: [Point, Point], center: Point | null, e: TouchEvent): HandlerResult | void {\n        // If cooperative gestures is enabled, we need a 3-finger minimum for this gesture to register\n        if (this._map.cooperativeGestures.isEnabled() && this._currentTouchCount < 3) {\n            return;\n        }\n\n        const vectorA = points[0].sub(this._lastPoints![0]);\n        const vectorB = points[1].sub(this._lastPoints![1]);\n\n        this._valid = this.gestureBeginsVertically(vectorA, vectorB, e.timeStamp);\n        if (!this._valid) return;\n\n        this._lastPoints = points;\n        this._active = true;\n        const yDeltaAverage = (vectorA.y + vectorB.y) / 2;\n        const degreesPerPixelMoved = -0.5;\n        return {\n            pitchDelta: yDeltaAverage * degreesPerPixelMoved\n        };\n    }\n\n    gestureBeginsVertically(vectorA: Point, vectorB: Point, timeStamp: number): boolean | undefined {\n        if (this._valid !== undefined) return this._valid;\n\n        const threshold = 2;\n        const movedA = vectorA.mag() >= threshold;\n        const movedB = vectorB.mag() >= threshold;\n\n        // neither finger has moved a meaningful amount, wait\n        if (!movedA && !movedB) return;\n\n        // One finger has moved and the other has not.\n        // If enough time has passed, decide it is not a pitch.\n        if (!movedA || !movedB) {\n            if (this._firstMove === undefined) {\n                this._firstMove = timeStamp;\n            }\n\n            if (timeStamp - this._firstMove < ALLOWED_SINGLE_TOUCH_TIME) {\n                // still waiting for a movement from the second finger\n                return undefined;\n            } else {\n                return false;\n            }\n        }\n\n        const isSameDirection = vectorA.y > 0 === vectorB.y > 0;\n        return isVertical(vectorA) && isVertical(vectorB) && isSameDirection;\n    }\n}\n", "import {Handler} from '../handler_manager';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\n\nconst defaultOptions = {\n    panStep: 100,\n    bearingStep: 15,\n    pitchStep: 10\n};\n\n/**\n * The `KeyboardHandler` allows the user to zoom, rotate, and pan the map using\n * the following keyboard shortcuts:\n *\n * - `=` / `+`: Increase the zoom level by 1.\n * - `Shift-=` / `Shift-+`: Increase the zoom level by 2.\n * - `-`: Decrease the zoom level by 1.\n * - `Shift--`: Decrease the zoom level by 2.\n * - Arrow keys: Pan by 100 pixels.\n * - `Shift+â¢`: Increase the rotation by 15 degrees.\n * - `Shift+â `: Decrease the rotation by 15 degrees.\n * - `Shift+â¡`: Increase the pitch by 10 degrees.\n * - `Shift+â£`: Decrease the pitch by 10 degrees.\n *\n * @group Handlers\n */\nexport class KeyboardHandler implements Handler {\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n    _panStep: number;\n    _bearingStep: number;\n    _pitchStep: number;\n    _rotationDisabled: boolean;\n\n    /** @internal */\n    constructor(map: Map) {\n        this._tr = new TransformProvider(map);\n        const stepOptions = defaultOptions;\n        this._panStep = stepOptions.panStep;\n        this._bearingStep = stepOptions.bearingStep;\n        this._pitchStep = stepOptions.pitchStep;\n        this._rotationDisabled = false;\n    }\n\n    reset() {\n        this._active = false;\n    }\n\n    keydown(e: KeyboardEvent) {\n        if (e.altKey || e.ctrlKey || e.metaKey) return;\n\n        let zoomDir = 0;\n        let bearingDir = 0;\n        let pitchDir = 0;\n        let xDir = 0;\n        let yDir = 0;\n\n        switch (e.keyCode) {\n            case 61:\n            case 107:\n            case 171:\n            case 187:\n                zoomDir = 1;\n                break;\n\n            case 189:\n            case 109:\n            case 173:\n                zoomDir = -1;\n                break;\n\n            case 37:\n                if (e.shiftKey) {\n                    bearingDir = -1;\n                } else {\n                    e.preventDefault();\n                    xDir = -1;\n                }\n                break;\n\n            case 39:\n                if (e.shiftKey) {\n                    bearingDir = 1;\n                } else {\n                    e.preventDefault();\n                    xDir = 1;\n                }\n                break;\n\n            case 38:\n                if (e.shiftKey) {\n                    pitchDir = 1;\n                } else {\n                    e.preventDefault();\n                    yDir = -1;\n                }\n                break;\n\n            case 40:\n                if (e.shiftKey) {\n                    pitchDir = -1;\n                } else {\n                    e.preventDefault();\n                    yDir = 1;\n                }\n                break;\n\n            default:\n                return;\n        }\n\n        if (this._rotationDisabled) {\n            bearingDir = 0;\n            pitchDir = 0;\n        }\n\n        return {\n            cameraAnimation: (map: Map) => {\n                const tr = this._tr;\n                map.easeTo({\n                    duration: 300,\n                    easeId: 'keyboardHandler',\n                    easing: easeOut,\n\n                    zoom: zoomDir ? Math.round(tr.zoom) + zoomDir * (e.shiftKey ? 2 : 1) : tr.zoom,\n                    bearing: tr.bearing + bearingDir * this._bearingStep,\n                    pitch: tr.pitch + pitchDir * this._pitchStep,\n                    offset: [-xDir * this._panStep, -yDir * this._panStep],\n                    center: tr.center\n                }, {originalEvent: e});\n            }\n        };\n    }\n\n    /**\n     * Enables the \"keyboard rotate and zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.enable();\n     * ```\n     */\n    enable() {\n        this._enabled = true;\n    }\n\n    /**\n     * Disables the \"keyboard rotate and zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.disable();\n     * ```\n     */\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"keyboard rotate and zoom\"\n     * interaction is enabled.\n     *\n     * @returns `true` if the \"keyboard rotate and zoom\"\n     * interaction is enabled.\n     */\n    isEnabled() {\n        return this._enabled;\n    }\n\n    /**\n     * Returns true if the handler is enabled and has detected the start of a\n     * zoom/rotate gesture.\n     *\n     * @returns `true` if the handler is enabled and has detected the\n     * start of a zoom/rotate gesture.\n     */\n    isActive() {\n        return this._active;\n    }\n\n    /**\n     * Disables the \"keyboard pan/rotate\" interaction, leaving the\n     * \"keyboard zoom\" interaction enabled.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.disableRotation();\n     * ```\n     */\n    disableRotation() {\n        this._rotationDisabled = true;\n    }\n\n    /**\n     * Enables the \"keyboard pan/rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.keyboard.enable();\n     * map.keyboard.enableRotation();\n     * ```\n     */\n    enableRotation() {\n        this._rotationDisabled = false;\n    }\n}\n\nfunction easeOut(t: number) {\n    return t * (2 - t);\n}\n", "import {DOM} from '../../util/dom';\n\nimport {defaultEasing, bezier} from '../../util/util';\nimport {browser} from '../../util/browser';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {LngLat} from '../../geo/lng_lat';\nimport {TransformProvider} from './transform-provider';\n\nimport type {Map} from '../map';\nimport type Point from '@mapbox/point-geometry';\nimport type {AroundCenterOptions} from './two_fingers_touch';\nimport {Handler} from '../handler_manager';\n\n// deltaY value for mouse scroll wheel identification\nconst wheelZoomDelta = 4.000244140625;\n\n// These magic numbers control the rate of zoom. Trackpad events fire at a greater\n// frequency than mouse scroll wheel, so reduce the zoom rate per wheel tick\nconst defaultZoomRate = 1 / 100;\nconst wheelZoomRate = 1 / 450;\n\n// upper bound on how much we scale the map in any single render frame; this\n// is used to limit zoom rate in the case of very fast scrolling\nconst maxScalePerFrame = 2;\n\n/**\n * The `ScrollZoomHandler` allows the user to zoom the map by scrolling.\n *\n * @group Handlers\n */\nexport class ScrollZoomHandler implements Handler {\n    _map: Map;\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n    _zooming: boolean;\n    _aroundCenter: boolean;\n    _around: LngLat;\n    _aroundPoint: Point;\n    _type: 'wheel' | 'trackpad' | null;\n    _lastValue: number;\n    _timeout: ReturnType<typeof setTimeout>; // used for delayed-handling of a single wheel movement\n    _finishTimeout: ReturnType<typeof setTimeout>; // used to delay final '{move,zoom}end' events\n\n    _lastWheelEvent: any;\n    _lastWheelEventTime: number;\n\n    _startZoom: number;\n    _targetZoom: number;\n    _delta: number;\n    _easing: ((a: number) => number);\n    _prevEase: {\n        start: number;\n        duration: number;\n        easing: (_: number) => number;\n    };\n\n    _frameId: boolean;\n    _triggerRenderFrame: () => void;\n\n    _defaultZoomRate: number;\n    _wheelZoomRate: number;\n\n    /** @internal */\n    constructor(map: Map, triggerRenderFrame: () => void) {\n        this._map = map;\n        this._tr = new TransformProvider(map);\n        this._triggerRenderFrame = triggerRenderFrame;\n\n        this._delta = 0;\n\n        this._defaultZoomRate = defaultZoomRate;\n        this._wheelZoomRate = wheelZoomRate;\n    }\n\n    /**\n     * Set the zoom rate of a trackpad\n     * @param zoomRate - 1/100 The rate used to scale trackpad movement to a zoom value.\n     * @example\n     * Speed up trackpad zoom\n     * ```ts\n     * map.scrollZoom.setZoomRate(1/25);\n     * ```\n     */\n    setZoomRate(zoomRate: number) {\n        this._defaultZoomRate = zoomRate;\n    }\n\n    /**\n     * Set the zoom rate of a mouse wheel\n     * @param wheelZoomRate - 1/450 The rate used to scale mouse wheel movement to a zoom value.\n     * @example\n     * Slow down zoom of mouse wheel\n     * ```ts\n     * map.scrollZoom.setWheelZoomRate(1/600);\n     * ```\n     */\n    setWheelZoomRate(wheelZoomRate: number) {\n        this._wheelZoomRate = wheelZoomRate;\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"scroll to zoom\" interaction is enabled.\n     * @returns `true` if the \"scroll to zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return !!this._enabled;\n    }\n\n    /*\n    * Active state is turned on and off with every scroll wheel event and is set back to false before the map\n    * render is called, so _active is not a good candidate for determining if a scroll zoom animation is in\n    * progress.\n    */\n    isActive() {\n        return !!this._active || this._finishTimeout !== undefined;\n    }\n\n    isZooming() {\n        return !!this._zooming;\n    }\n\n    /**\n     * Enables the \"scroll to zoom\" interaction.\n     *\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.scrollZoom.enable();\n     * map.scrollZoom.enable({ around: 'center' })\n     * ```\n     */\n    enable(options?: AroundCenterOptions | boolean) {\n        if (this.isEnabled()) return;\n        this._enabled = true;\n        this._aroundCenter = !!options && (options as AroundCenterOptions).around === 'center';\n    }\n\n    /**\n     * Disables the \"scroll to zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.scrollZoom.disable();\n     * ```\n     */\n    disable() {\n        if (!this.isEnabled()) return;\n        this._enabled = false;\n    }\n\n    /**\n     * Determines whether or not the gesture is blocked due to cooperativeGestures.\n     */\n    _shouldBePrevented(e: WheelEvent) {\n        if (!this._map.cooperativeGestures.isEnabled()) {\n            return false;\n        }\n\n        const isTrackpadPinch = e.ctrlKey;\n        const isBypassed = isTrackpadPinch || this._map.cooperativeGestures.isBypassed(e);\n\n        return !isBypassed;\n    }\n\n    wheel(e: WheelEvent) {\n        if (!this.isEnabled()) return;\n        if (this._shouldBePrevented(e)) {\n            this._map.cooperativeGestures.notifyGestureBlocked('wheel_zoom', e);\n            return;\n        }\n        let value = e.deltaMode === WheelEvent.DOM_DELTA_LINE ? e.deltaY * 40 : e.deltaY;\n        const now = browser.now(),\n            timeDelta = now - (this._lastWheelEventTime || 0);\n\n        this._lastWheelEventTime = now;\n\n        if (value !== 0 && (value % wheelZoomDelta) === 0) {\n            // This one is definitely a mouse wheel event.\n            this._type = 'wheel';\n\n        } else if (value !== 0 && Math.abs(value) < 4) {\n            // This one is definitely a trackpad event because it is so small.\n            this._type = 'trackpad';\n\n        } else if (timeDelta > 400) {\n            // This is likely a new scroll action.\n            this._type = null;\n            this._lastValue = value;\n\n            // Start a timeout in case this was a singular event, and delay it by up to 40ms.\n            this._timeout = setTimeout(this._onTimeout, 40, e);\n\n        } else if (!this._type) {\n            // This is a repeating event, but we don't know the type of event just yet.\n            // If the delta per time is small, we assume it's a fast trackpad; otherwise we switch into wheel mode.\n            this._type = (Math.abs(timeDelta * value) < 200) ? 'trackpad' : 'wheel';\n\n            // Make sure our delayed event isn't fired again, because we accumulate\n            // the previous event (which was less than 40ms ago) into this event.\n            if (this._timeout) {\n                clearTimeout(this._timeout);\n                this._timeout = null;\n                value += this._lastValue;\n            }\n        }\n\n        // Slow down zoom if shift key is held for more precise zooming\n        if (e.shiftKey && value) value = value / 4;\n\n        // Only fire the callback if we actually know what type of scrolling device the user uses.\n        if (this._type) {\n            this._lastWheelEvent = e;\n            this._delta -= value;\n            if (!this._active) {\n                this._start(e);\n            }\n        }\n\n        e.preventDefault();\n    }\n\n    _onTimeout = (initialEvent: MouseEvent) => {\n        this._type = 'wheel';\n        this._delta -= this._lastValue;\n        if (!this._active) {\n            this._start(initialEvent);\n        }\n    };\n\n    _start(e: MouseEvent) {\n        if (!this._delta) return;\n\n        if (this._frameId) {\n            this._frameId = null;\n        }\n\n        this._active = true;\n        if (!this.isZooming()) {\n            this._zooming = true;\n        }\n\n        if (this._finishTimeout) {\n            clearTimeout(this._finishTimeout);\n            delete this._finishTimeout;\n        }\n\n        const pos = DOM.mousePos(this._map.getCanvas(), e);\n        const tr = this._tr;\n\n        if (pos.y > tr.transform.height / 2 - tr.transform.getHorizon()) {\n            this._around = LngLat.convert(this._aroundCenter ? tr.center : tr.unproject(pos));\n        } else {\n            // Do not use current cursor position if above the horizon to avoid 'unproject' this point\n            // as it is not mapped into 'coords' framebuffer or inversible with 'pixelMatrixInverse'.\n            this._around = LngLat.convert(tr.center);\n        }\n\n        this._aroundPoint = tr.transform.locationPoint(this._around);\n        if (!this._frameId) {\n            this._frameId = true;\n            this._triggerRenderFrame();\n        }\n    }\n\n    renderFrame() {\n        if (!this._frameId) return;\n        this._frameId = null;\n\n        if (!this.isActive()) return;\n        const tr = this._tr.transform;\n\n        // if we've had scroll events since the last render frame, consume the\n        // accumulated delta, and update the target zoom level accordingly\n        if (this._delta !== 0) {\n            // For trackpad events and single mouse wheel ticks, use the default zoom rate\n            const zoomRate = (this._type === 'wheel' && Math.abs(this._delta) > wheelZoomDelta) ? this._wheelZoomRate : this._defaultZoomRate;\n            // Scale by sigmoid of scroll wheel delta.\n            let scale = maxScalePerFrame / (1 + Math.exp(-Math.abs(this._delta * zoomRate)));\n\n            if (this._delta < 0 && scale !== 0) {\n                scale = 1 / scale;\n            }\n\n            const fromScale = typeof this._targetZoom === 'number' ? tr.zoomScale(this._targetZoom) : tr.scale;\n            this._targetZoom = Math.min(tr.maxZoom, Math.max(tr.minZoom, tr.scaleZoom(fromScale * scale)));\n\n            // if this is a mouse wheel, refresh the starting zoom and easing\n            // function we're using to smooth out the zooming between wheel\n            // events\n            if (this._type === 'wheel') {\n                this._startZoom = tr.zoom;\n                this._easing = this._smoothOutEasing(200);\n            }\n\n            this._delta = 0;\n        }\n\n        const targetZoom = typeof this._targetZoom === 'number' ?\n            this._targetZoom : tr.zoom;\n        const startZoom = this._startZoom;\n        const easing = this._easing;\n\n        let finished = false;\n        let zoom;\n\n        const lastWheelEventTimeDiff = browser.now() - this._lastWheelEventTime;\n        if (this._type === 'wheel' && startZoom && easing && lastWheelEventTimeDiff) {\n            const t = Math.min(lastWheelEventTimeDiff / 200, 1);\n\n            const k = easing(t);\n            zoom = interpolates.number(startZoom, targetZoom, k);\n            if (t < 1) {\n                if (!this._frameId) {\n                    this._frameId = true;\n                }\n            } else {\n                finished = true;\n            }\n        } else {\n            zoom = targetZoom;\n            finished = true;\n        }\n\n        this._active = true;\n\n        if (finished) {\n            this._active = false;\n            this._finishTimeout = setTimeout(() => {\n                this._zooming = false;\n                this._triggerRenderFrame();\n                delete this._targetZoom;\n                delete this._finishTimeout;\n            }, 200);\n        }\n\n        return {\n            noInertia: true,\n            needsRenderFrame: !finished,\n            zoomDelta: zoom - tr.zoom,\n            around: this._aroundPoint,\n            originalEvent: this._lastWheelEvent\n        };\n    }\n\n    _smoothOutEasing(duration: number) {\n        let easing = defaultEasing;\n\n        if (this._prevEase) {\n            const currentEase = this._prevEase;\n            const t = (browser.now() - currentEase.start) / currentEase.duration;\n            const speed = currentEase.easing(t + 0.01) - currentEase.easing(t);\n\n            // Quick hack to make new bezier that is continuous with last\n            const x = 0.27 / Math.sqrt(speed * speed + 0.0001) * 0.01;\n            const y = Math.sqrt(0.27 * 0.27 - x * x);\n\n            easing = bezier(x, y, 0.25, 1);\n        }\n\n        this._prevEase = {\n            start: browser.now(),\n            duration,\n            easing\n        };\n\n        return easing;\n    }\n\n    reset() {\n        this._active = false;\n        this._zooming = false;\n        delete this._targetZoom;\n        if (this._finishTimeout) {\n            clearTimeout(this._finishTimeout);\n            delete this._finishTimeout;\n        }\n    }\n}\n", "import type {ClickZoomHandler} from '../click_zoom';\nimport type {TapZoomHandler} from './../tap_zoom';\n\n/**\n * The `DoubleClickZoomHandler` allows the user to zoom the map at a point by\n * double clicking or double tapping.\n *\n * @group Handlers\n */\nexport class DoubleClickZoomHandler {\n\n    _clickZoom: ClickZoomHandler;\n    _tapZoom: TapZoomHandler;\n\n    /** @internal */\n    constructor(clickZoom: ClickZoomHandler, TapZoom: TapZoomHandler) {\n        this._clickZoom = clickZoom;\n        this._tapZoom = TapZoom;\n    }\n\n    /**\n     * Enables the \"double click to zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.doubleClickZoom.enable();\n     * ```\n     */\n    enable() {\n        this._clickZoom.enable();\n        this._tapZoom.enable();\n    }\n\n    /**\n     * Disables the \"double click to zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.doubleClickZoom.disable();\n     * ```\n     */\n    disable() {\n        this._clickZoom.disable();\n        this._tapZoom.disable();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"double click to zoom\" interaction is enabled.\n     *\n     * @returns `true` if the \"double click to zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._clickZoom.isEnabled() && this._tapZoom.isEnabled();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"double click to zoom\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"double click to zoom\" interaction is active.\n     */\n    isActive() {\n        return this._clickZoom.isActive() || this._tapZoom.isActive();\n    }\n}\n", "import type Point from '@mapbox/point-geometry';\nimport type {Map} from '../map';\nimport {TransformProvider} from './transform-provider';\nimport {Handler} from '../handler_manager';\n\n/**\n * The `ClickZoomHandler` allows the user to zoom the map at a point by double clicking\n * It is used by other handlers\n */\nexport class ClickZoomHandler implements Handler {\n\n    _tr: TransformProvider;\n    _enabled: boolean;\n    _active: boolean;\n\n    /** @internal */\n    constructor(map: Map) {\n        this._tr = new TransformProvider(map);\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n    }\n\n    dblclick(e: MouseEvent, point: Point) {\n        e.preventDefault();\n        return {\n            cameraAnimation: (map: Map) => {\n                map.easeTo({\n                    duration: 300,\n                    zoom: this._tr.zoom + (e.shiftKey ? -1 : 1),\n                    around: this._tr.unproject(point)\n                }, {originalEvent: e});\n            }\n        };\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n", "import {Handler} from '../handler_manager';\nimport {TapRecognizer, MAX_TAP_INTERVAL, MAX_DIST} from './tap_recognizer';\nimport type Point from '@mapbox/point-geometry';\n\n/**\n * A `TapDragZoomHandler` allows the user to zoom the map at a point by double tapping. It also allows the user pan the map by dragging.\n */\nexport class TapDragZoomHandler implements Handler {\n\n    _enabled: boolean;\n    _active: boolean;\n    _swipePoint: Point;\n    _swipeTouch: number;\n    _tapTime: number;\n    _tapPoint: Point;\n    _tap: TapRecognizer;\n\n    constructor() {\n\n        this._tap = new TapRecognizer({\n            numTouches: 1,\n            numTaps: 1\n        });\n\n        this.reset();\n    }\n\n    reset() {\n        this._active = false;\n        delete this._swipePoint;\n        delete this._swipeTouch;\n        delete this._tapTime;\n        delete this._tapPoint;\n        this._tap.reset();\n    }\n\n    touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (this._swipePoint) return;\n\n        if (!this._tapTime) {\n            this._tap.touchstart(e, points, mapTouches);\n        } else {\n            const swipePoint = points[0];\n\n            const soonEnough = e.timeStamp - this._tapTime < MAX_TAP_INTERVAL;\n            const closeEnough =  this._tapPoint.dist(swipePoint) < MAX_DIST;\n\n            if (!soonEnough || !closeEnough) {\n                this.reset();\n            } else if (mapTouches.length > 0) {\n                this._swipePoint = swipePoint;\n                this._swipeTouch = mapTouches[0].identifier;\n            }\n        }\n    }\n\n    touchmove(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this._tapTime) {\n            this._tap.touchmove(e, points, mapTouches);\n        } else if (this._swipePoint) {\n            if (mapTouches[0].identifier !== this._swipeTouch) {\n                return;\n            }\n\n            const newSwipePoint = points[0];\n            const dist = newSwipePoint.y - this._swipePoint.y;\n            this._swipePoint = newSwipePoint;\n\n            e.preventDefault();\n            this._active = true;\n\n            return {\n                zoomDelta: dist / 128\n            };\n        }\n    }\n\n    touchend(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) {\n        if (!this._tapTime) {\n            const point = this._tap.touchend(e, points, mapTouches);\n            if (point) {\n                this._tapTime = e.timeStamp;\n                this._tapPoint = point;\n            }\n        } else if (this._swipePoint) {\n            if (mapTouches.length === 0) {\n                this.reset();\n            }\n        }\n    }\n\n    touchcancel() {\n        this.reset();\n    }\n\n    enable() {\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this.reset();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isActive() {\n        return this._active;\n    }\n}\n", "import type {MousePanHandler} from '../mouse';\nimport type {TouchPanHandler} from './../touch_pan';\n\n/**\n * A {@link DragPanHandler} options object\n */\nexport type DragPanOptions = {\n    /**\n     * factor used to scale the drag velocity\n     * @defaultValue 0\n     */\n    linearity?: number;\n    /**\n     * easing function applied to `map.panTo` when applying the drag.\n     * @param t - the easing function\n     * @defaultValue bezier(0, 0, 0.3, 1)\n     */\n    easing?: (t: number) => number;\n    /**\n     * the maximum value of the drag velocity.\n     * @defaultValue 1400\n     */\n    deceleration?: number;\n    /**\n     * the rate at which the speed reduces after the pan ends.\n     * @defaultValue 2500\n     */\n    maxSpeed?: number;\n};\n\n/**\n * The `DragPanHandler` allows the user to pan the map by clicking and dragging\n * the cursor.\n *\n * @group Handlers\n */\nexport class DragPanHandler {\n\n    _el: HTMLElement;\n    _mousePan: MousePanHandler;\n    _touchPan: TouchPanHandler;\n    _inertiaOptions: DragPanOptions | boolean;\n\n    /** @internal */\n    constructor(el: HTMLElement, mousePan: MousePanHandler, touchPan: TouchPanHandler) {\n        this._el = el;\n        this._mousePan = mousePan;\n        this._touchPan = touchPan;\n    }\n\n    /**\n     * Enables the \"drag to pan\" interaction.\n     *\n     * @param options - Options object\n     * @example\n     * ```ts\n     *   map.dragPan.enable();\n     *   map.dragPan.enable({\n     *      linearity: 0.3,\n     *      easing: bezier(0, 0, 0.3, 1),\n     *      maxSpeed: 1400,\n     *      deceleration: 2500,\n     *   });\n     * ```\n     */\n    enable(options?: DragPanOptions | boolean) {\n        this._inertiaOptions = options || {};\n        this._mousePan.enable();\n        this._touchPan.enable();\n        this._el.classList.add('maplibregl-touch-drag-pan');\n    }\n\n    /**\n     * Disables the \"drag to pan\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.dragPan.disable();\n     * ```\n     */\n    disable() {\n        this._mousePan.disable();\n        this._touchPan.disable();\n        this._el.classList.remove('maplibregl-touch-drag-pan');\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pan\" interaction is enabled.\n     *\n     * @returns `true` if the \"drag to pan\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._mousePan.isEnabled() && this._touchPan.isEnabled();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to pan\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"drag to pan\" interaction is active.\n     */\n    isActive() {\n        return this._mousePan.isActive() || this._touchPan.isActive();\n    }\n}\n", "import type {MousePitchHandler, MouseRotateHandler} from '../mouse';\n\n/**\n * Options object for `DragRotateHandler`.\n */\nexport type DragRotateHandlerOptions = {\n    /**\n     * Control the map pitch in addition to the bearing\n     * @defaultValue true\n     */\n    pitchWithRotate: boolean;\n}\n\n/**\n * The `DragRotateHandler` allows the user to rotate the map by clicking and\n * dragging the cursor while holding the right mouse button or `ctrl` key.\n *\n * @group Handlers\n */\nexport class DragRotateHandler {\n\n    _mouseRotate: MouseRotateHandler;\n    _mousePitch: MousePitchHandler;\n    _pitchWithRotate: boolean;\n\n    /** @internal */\n    constructor(options: DragRotateHandlerOptions, mouseRotate: MouseRotateHandler, mousePitch: MousePitchHandler) {\n        this._pitchWithRotate = options.pitchWithRotate;\n        this._mouseRotate = mouseRotate;\n        this._mousePitch = mousePitch;\n    }\n\n    /**\n     * Enables the \"drag to rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.dragRotate.enable();\n     * ```\n     */\n    enable() {\n        this._mouseRotate.enable();\n        if (this._pitchWithRotate) this._mousePitch.enable();\n    }\n\n    /**\n     * Disables the \"drag to rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.dragRotate.disable();\n     * ```\n     */\n    disable() {\n        this._mouseRotate.disable();\n        this._mousePitch.disable();\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to rotate\" interaction is enabled.\n     *\n     * @returns `true` if the \"drag to rotate\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._mouseRotate.isEnabled() && (!this._pitchWithRotate || this._mousePitch.isEnabled());\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"drag to rotate\" interaction is active, i.e. currently being used.\n     *\n     * @returns `true` if the \"drag to rotate\" interaction is active.\n     */\n    isActive() {\n        return this._mouseRotate.isActive() || this._mousePitch.isActive();\n    }\n}\n", "import type {TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, AroundCenterOptions} from '../two_fingers_touch';\nimport type {TapDragZoomHandler} from '../tap_drag_zoom';\n\n/**\n * The `TwoFingersTouchZoomRotateHandler` allows the user to zoom and rotate the map by\n * pinching on a touchscreen.\n *\n * They can zoom with one finger by double tapping and dragging. On the second tap,\n * hold the finger down and drag up or down to zoom in or out.\n *\n * @group Handlers\n */\nexport class TwoFingersTouchZoomRotateHandler {\n\n    _el: HTMLElement;\n    _touchZoom: TwoFingersTouchZoomHandler;\n    _touchRotate: TwoFingersTouchRotateHandler;\n    _tapDragZoom: TapDragZoomHandler;\n    _rotationDisabled: boolean;\n    _enabled: boolean;\n\n    /** @internal */\n    constructor(el: HTMLElement, touchZoom: TwoFingersTouchZoomHandler, touchRotate: TwoFingersTouchRotateHandler, tapDragZoom: TapDragZoomHandler) {\n        this._el = el;\n        this._touchZoom = touchZoom;\n        this._touchRotate = touchRotate;\n        this._tapDragZoom = tapDragZoom;\n        this._rotationDisabled = false;\n        this._enabled = true;\n    }\n\n    /**\n     * Enables the \"pinch to rotate and zoom\" interaction.\n     *\n     * @param options - Options object.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.enable();\n     * map.touchZoomRotate.enable({ around: 'center' });\n     * ```\n     */\n    enable(options?: AroundCenterOptions | boolean | null) {\n        this._touchZoom.enable(options);\n        if (!this._rotationDisabled) this._touchRotate.enable(options);\n        this._tapDragZoom.enable();\n        this._el.classList.add('maplibregl-touch-zoom-rotate');\n    }\n\n    /**\n     * Disables the \"pinch to rotate and zoom\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.disable();\n     * ```\n     */\n    disable() {\n        this._touchZoom.disable();\n        this._touchRotate.disable();\n        this._tapDragZoom.disable();\n        this._el.classList.remove('maplibregl-touch-zoom-rotate');\n    }\n\n    /**\n     * Returns a Boolean indicating whether the \"pinch to rotate and zoom\" interaction is enabled.\n     *\n     * @returns `true` if the \"pinch to rotate and zoom\" interaction is enabled.\n     */\n    isEnabled() {\n        return this._touchZoom.isEnabled() &&\n            (this._rotationDisabled || this._touchRotate.isEnabled()) &&\n            this._tapDragZoom.isEnabled();\n    }\n\n    /**\n     * Returns true if the handler is enabled and has detected the start of a zoom/rotate gesture.\n     *\n     * @returns `true` if the handler is active, `false` otherwise\n     */\n    isActive() {\n        return this._touchZoom.isActive() || this._touchRotate.isActive() || this._tapDragZoom.isActive();\n    }\n\n    /**\n     * Disables the \"pinch to rotate\" interaction, leaving the \"pinch to zoom\"\n     * interaction enabled.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.disableRotation();\n     * ```\n     */\n    disableRotation() {\n        this._rotationDisabled = true;\n        this._touchRotate.disable();\n    }\n\n    /**\n     * Enables the \"pinch to rotate\" interaction.\n     *\n     * @example\n     * ```ts\n     * map.touchZoomRotate.enable();\n     * map.touchZoomRotate.enableRotation();\n     * ```\n     */\n    enableRotation() {\n        this._rotationDisabled = false;\n        if (this._touchZoom.isEnabled()) this._touchRotate.enable();\n    }\n}\n", "import {DOM} from '../../util/dom';\nimport {Event} from '../../util/evented';\nimport {Handler} from '../handler_manager';\n\nimport type {Map} from '../map';\n\n/**\n * The {@link CooperativeGesturesHandler} options object for the gesture settings\n */\nexport type GestureOptions = boolean;\n\n/**\n * A `CooperativeGestureHandler` is a control that adds cooperative gesture info when user tries to zoom in/out.\n *\n * When the CooperativeGestureHandler blocks a gesture, it will emit a `cooperativegestureprevented` event.\n *\n * @group Handlers\n *\n * @example\n * ```ts\n * const map = new Map({\n *   cooperativeGestures: true\n * });\n * ```\n * @see [Example: cooperative gestures](https://maplibre.org/maplibre-gl-js/docs/examples/cooperative-gestures/)\n **/\nexport class CooperativeGesturesHandler implements Handler {\n    _options: GestureOptions;\n    _map: Map;\n    _container: HTMLElement;\n    /**\n     * This is the key that will allow to bypass the cooperative gesture protection\n     */\n    _bypassKey: 'metaKey' | 'ctrlKey' = navigator.userAgent.indexOf('Mac') !== -1 ? 'metaKey' : 'ctrlKey';\n    _enabled: boolean;\n\n    constructor(map: Map, options: GestureOptions) {\n        this._map = map;\n        this._options = options;\n        this._enabled = false;\n    }\n    isActive(): boolean {\n        return false;\n    }\n    reset(): void {}\n\n    _setupUI() {\n        if (this._container) return;\n        const mapCanvasContainer = this._map.getCanvasContainer();\n        // Add a cooperative gestures class (enable touch-action: pan-x pan-y;)\n        mapCanvasContainer.classList.add('maplibregl-cooperative-gestures');\n        this._container = DOM.create('div', 'maplibregl-cooperative-gesture-screen', mapCanvasContainer);\n        let desktopMessage = this._map._getUIString('CooperativeGesturesHandler.WindowsHelpText');\n        if (this._bypassKey === 'metaKey') {\n            desktopMessage = this._map._getUIString('CooperativeGesturesHandler.MacHelpText');\n        }\n        const mobileMessage = this._map._getUIString('CooperativeGesturesHandler.MobileHelpText');\n        // Create and append the desktop message div\n        const desktopDiv = document.createElement('div');\n        desktopDiv.className = 'maplibregl-desktop-message';\n        desktopDiv.textContent = desktopMessage;\n        this._container.appendChild(desktopDiv);\n        // Create and append the mobile message div\n        const mobileDiv = document.createElement('div');\n        mobileDiv.className = 'maplibregl-mobile-message';\n        mobileDiv.textContent = mobileMessage;\n        this._container.appendChild(mobileDiv);\n        // Remove cooperative gesture screen from the accessibility tree since screenreaders cannot interact with the map using gestures\n        this._container.setAttribute('aria-hidden', 'true');\n    }\n\n    _destroyUI() {\n        if (this._container) {\n            DOM.remove(this._container);\n            const mapCanvasContainer = this._map.getCanvasContainer();\n            mapCanvasContainer.classList.remove('maplibregl-cooperative-gestures');\n        }\n        delete this._container;\n    }\n\n    enable() {\n        this._setupUI();\n        this._enabled = true;\n    }\n\n    disable() {\n        this._enabled = false;\n        this._destroyUI();\n    }\n\n    isEnabled() {\n        return this._enabled;\n    }\n\n    isBypassed(event: MouseEvent | WheelEvent | PointerEvent) {\n        return event[this._bypassKey];\n    }\n\n    notifyGestureBlocked(gestureType: 'wheel_zoom' | 'touch_pan', originalEvent: Event) {\n        if (!this._enabled) return;\n\n        // notify subscribers that a cooperative gesture was prevented\n        this._map.fire(new Event('cooperativegestureprevented', {gestureType, originalEvent}));\n\n        // Alert user how to scroll/pan\n        this._container.classList.add('maplibregl-show');\n        setTimeout(() => {\n            this._container.classList.remove('maplibregl-show');\n        }, 100);\n    }\n}\n", "import {Event} from '../util/evented';\nimport {DOM} from '../util/dom';\nimport {Map, CompleteMapOptions} from './map';\nimport {HandlerInertia} from './handler_inertia';\nimport {MapEventHandler, BlockableMapEventHandler} from './handler/map_event';\nimport {BoxZoomHandler} from './handler/box_zoom';\nimport {TapZoomHandler} from './handler/tap_zoom';\nimport {generateMouseRotationHandler, generateMousePitchHandler, generateMousePanHandler} from './handler/mouse';\nimport {TouchPanHandler} from './handler/touch_pan';\nimport {TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, TwoFingersTouchPitchHandler} from './handler/two_fingers_touch';\nimport {KeyboardHandler} from './handler/keyboard';\nimport {ScrollZoomHandler} from './handler/scroll_zoom';\nimport {DoubleClickZoomHandler} from './handler/shim/dblclick_zoom';\nimport {ClickZoomHandler} from './handler/click_zoom';\nimport {TapDragZoomHandler} from './handler/tap_drag_zoom';\nimport {DragPanHandler} from './handler/shim/drag_pan';\nimport {DragRotateHandler} from './handler/shim/drag_rotate';\nimport {TwoFingersTouchZoomRotateHandler} from './handler/shim/two_fingers_touch';\nimport {CooperativeGesturesHandler} from './handler/cooperative_gestures';\nimport {extend} from '../util/util';\nimport {browser} from '../util/browser';\nimport Point from '@mapbox/point-geometry';\n\nconst isMoving = (p: EventsInProgress) => p.zoom || p.drag || p.pitch || p.rotate;\n\nclass RenderFrameEvent extends Event {\n    type: 'renderFrame';\n    timeStamp: number;\n}\n\n/**\n * Handlers interpret dom events and return camera changes that should be\n * applied to the map (`HandlerResult`s). The camera changes are all deltas.\n * The handler itself should have no knowledge of the map's current state.\n * This makes it easier to merge multiple results and keeps handlers simpler.\n * For example, if there is a mousedown and mousemove, the mousePan handler\n * would return a `panDelta` on the mousemove.\n */\nexport interface Handler {\n    enable(): void;\n    disable(): void;\n    isEnabled(): boolean;\n    /**\n     * This is used to indicate if the handler is currently active or not.\n     * In case a handler is active, it will block other handlers from getting the relevant events.\n     * There is an allow list of handlers that can be active at the same time, which is configured when adding a handler.\n     */\n    isActive(): boolean;\n    /**\n     * `reset` can be called by the manager at any time and must reset everything to it's original state\n     */\n    reset(): void;\n    // Handlers can optionally implement these methods.\n    // They are called with dom events whenever those dom evens are received.\n    readonly touchstart?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchmove?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchmoveWindow?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchend?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly touchcancel?: (e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>) => HandlerResult | void;\n    readonly mousedown?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mousemove?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mousemoveWindow?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mouseup?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly mouseupWindow?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly dblclick?: (e: MouseEvent, point: Point) => HandlerResult | void;\n    readonly contextmenu?: (e: MouseEvent) => HandlerResult | void;\n    readonly wheel?: (e: WheelEvent, point: Point) => HandlerResult | void;\n    readonly keydown?: (e: KeyboardEvent) => HandlerResult | void;\n    readonly keyup?: (e: KeyboardEvent) => HandlerResult | void;\n    /**\n     * `renderFrame` is the only non-dom event. It is called during render\n     * frames and can be used to smooth camera changes (see scroll handler).\n     */\n    readonly renderFrame?: () => HandlerResult | void;\n}\n\n/**\n * All handler methods that are called with events can optionally return a `HandlerResult`.\n */\nexport type HandlerResult = {\n    panDelta?: Point;\n    zoomDelta?: number;\n    bearingDelta?: number;\n    pitchDelta?: number;\n    /**\n     * the point to not move when changing the camera\n     */\n    around?: Point | null;\n    /**\n     * same as above, except for pinch actions, which are given higher priority\n     */\n    pinchAround?: Point | null;\n    /**\n     * A method that can fire a one-off easing by directly changing the map's camera.\n     */\n    cameraAnimation?: (map: Map) => any;\n    /**\n     * The last three properties are needed by only one handler: scrollzoom.\n     * The DOM event to be used as the `originalEvent` on any camera change events.\n     */\n    originalEvent?: Event;\n    /**\n     * Makes the manager trigger a frame, allowing the handler to return multiple results over time (see scrollzoom).\n     */\n    needsRenderFrame?: boolean;\n    /**\n     * The camera changes won't get recorded for inertial zooming.\n     */\n    noInertia?: boolean;\n};\n\nexport type EventInProgress = {\n    handlerName: string;\n    originalEvent: Event;\n}\n\nexport type EventsInProgress = {\n    zoom?: EventInProgress;\n    pitch?: EventInProgress;\n    rotate?: EventInProgress;\n    drag?: EventInProgress;\n}\n\nfunction hasChange(result: HandlerResult) {\n    return (result.panDelta && result.panDelta.mag()) || result.zoomDelta || result.bearingDelta || result.pitchDelta;\n}\n\nexport class HandlerManager {\n    _map: Map;\n    _el: HTMLElement;\n    _handlers: Array<{\n        handlerName: string;\n        handler: Handler;\n        allowed: Array<string>;\n    }>;\n    _eventsInProgress: EventsInProgress;\n    _frameId: number;\n    _inertia: HandlerInertia;\n    _bearingSnap: number;\n    _handlersById: {[x: string]: Handler};\n    _updatingCamera: boolean;\n    _changes: Array<[HandlerResult, EventsInProgress, {[handlerName: string]: Event}]>;\n    _terrainMovement: boolean;\n    _zoom: {handlerName: string};\n    _previousActiveHandlers: {[x: string]: Handler};\n    _listeners: Array<[Window | Document | HTMLElement, string, {\n        passive?: boolean;\n        capture?: boolean;\n    } | undefined]>;\n\n    constructor(map: Map, options: CompleteMapOptions) {\n        this._map = map;\n        this._el = this._map.getCanvasContainer();\n        this._handlers = [];\n        this._handlersById = {};\n        this._changes = [];\n\n        this._inertia = new HandlerInertia(map);\n        this._bearingSnap = options.bearingSnap;\n        this._previousActiveHandlers = {};\n\n        // Track whether map is currently moving, to compute start/move/end events\n        this._eventsInProgress = {};\n\n        this._addDefaultHandlers(options);\n\n        const el = this._el;\n\n        this._listeners = [\n            // This needs to be `passive: true` so that a double tap fires two\n            // pairs of touchstart/end events in iOS Safari 13. If this is set to\n            // `passive: false` then the second pair of events is only fired if\n            // preventDefault() is called on the first touchstart. Calling preventDefault()\n            // undesirably prevents click events.\n            [el, 'touchstart', {passive: true}],\n            // This needs to be `passive: false` so that scrolls and pinches can be\n            // prevented in browsers that don't support `touch-actions: none`, for example iOS Safari 12.\n            [el, 'touchmove', {passive: false}],\n            [el, 'touchend', undefined],\n            [el, 'touchcancel', undefined],\n\n            [el, 'mousedown', undefined],\n            [el, 'mousemove', undefined],\n            [el, 'mouseup', undefined],\n\n            // Bind window-level event listeners for move and up/end events. In the absence of\n            // the pointer capture API, which is not supported by all necessary platforms,\n            // window-level event listeners give us the best shot at capturing events that\n            // fall outside the map canvas element. Use `{capture: true}` for the move event\n            // to prevent map move events from being fired during a drag.\n            [document, 'mousemove', {capture: true}],\n            [document, 'mouseup', undefined],\n\n            [el, 'mouseover', undefined],\n            [el, 'mouseout', undefined],\n            [el, 'dblclick', undefined],\n            [el, 'click', undefined],\n\n            [el, 'keydown', {capture: false}],\n            [el, 'keyup', undefined],\n\n            [el, 'wheel', {passive: false}],\n            [el, 'contextmenu', undefined],\n\n            [window, 'blur', undefined]\n        ];\n\n        for (const [target, type, listenerOptions] of this._listeners) {\n            DOM.addEventListener(target, type, target === document ? this.handleWindowEvent : this.handleEvent, listenerOptions);\n        }\n    }\n\n    destroy() {\n        for (const [target, type, listenerOptions] of this._listeners) {\n            DOM.removeEventListener(target, type, target === document ? this.handleWindowEvent : this.handleEvent, listenerOptions);\n        }\n    }\n\n    _addDefaultHandlers(options: CompleteMapOptions) {\n        const map = this._map;\n        const el = map.getCanvasContainer();\n        this._add('mapEvent', new MapEventHandler(map, options));\n\n        const boxZoom = map.boxZoom = new BoxZoomHandler(map, options);\n        this._add('boxZoom', boxZoom);\n        if (options.interactive && options.boxZoom) {\n            boxZoom.enable();\n        }\n\n        const cooperativeGestures = map.cooperativeGestures = new CooperativeGesturesHandler(map, options.cooperativeGestures);\n        this._add('cooperativeGestures', cooperativeGestures);\n        if (options.cooperativeGestures) {\n            cooperativeGestures.enable();\n        }\n\n        const tapZoom = new TapZoomHandler(map);\n        const clickZoom = new ClickZoomHandler(map);\n        map.doubleClickZoom = new DoubleClickZoomHandler(clickZoom, tapZoom);\n        this._add('tapZoom', tapZoom);\n        this._add('clickZoom', clickZoom);\n        if (options.interactive && options.doubleClickZoom) {\n            map.doubleClickZoom.enable();\n        }\n\n        const tapDragZoom = new TapDragZoomHandler();\n        this._add('tapDragZoom', tapDragZoom);\n\n        const touchPitch = map.touchPitch = new TwoFingersTouchPitchHandler(map);\n        this._add('touchPitch', touchPitch);\n        if (options.interactive && options.touchPitch) {\n            map.touchPitch.enable(options.touchPitch);\n        }\n\n        const mouseRotate = generateMouseRotationHandler(options);\n        const mousePitch = generateMousePitchHandler(options);\n        map.dragRotate = new DragRotateHandler(options, mouseRotate, mousePitch);\n        this._add('mouseRotate', mouseRotate, ['mousePitch']);\n        this._add('mousePitch', mousePitch, ['mouseRotate']);\n        if (options.interactive && options.dragRotate) {\n            map.dragRotate.enable();\n        }\n\n        const mousePan = generateMousePanHandler(options);\n        const touchPan = new TouchPanHandler(options, map);\n        map.dragPan = new DragPanHandler(el, mousePan, touchPan);\n        this._add('mousePan', mousePan);\n        this._add('touchPan', touchPan, ['touchZoom', 'touchRotate']);\n        if (options.interactive && options.dragPan) {\n            map.dragPan.enable(options.dragPan);\n        }\n\n        const touchRotate = new TwoFingersTouchRotateHandler();\n        const touchZoom = new TwoFingersTouchZoomHandler();\n        map.touchZoomRotate = new TwoFingersTouchZoomRotateHandler(el, touchZoom, touchRotate, tapDragZoom);\n        this._add('touchRotate', touchRotate, ['touchPan', 'touchZoom']);\n        this._add('touchZoom', touchZoom, ['touchPan', 'touchRotate']);\n        if (options.interactive && options.touchZoomRotate) {\n            map.touchZoomRotate.enable(options.touchZoomRotate);\n        }\n\n        const scrollZoom = map.scrollZoom = new ScrollZoomHandler(map, () => this._triggerRenderFrame());\n        this._add('scrollZoom', scrollZoom, ['mousePan']);\n        if (options.interactive && options.scrollZoom) {\n            map.scrollZoom.enable(options.scrollZoom);\n        }\n\n        const keyboard = map.keyboard = new KeyboardHandler(map);\n        this._add('keyboard', keyboard);\n        if (options.interactive && options.keyboard) {\n            map.keyboard.enable();\n        }\n\n        this._add('blockableMapEvent', new BlockableMapEventHandler(map));\n    }\n\n    _add(handlerName: string, handler: Handler, allowed?: Array<string>) {\n        this._handlers.push({handlerName, handler, allowed});\n        this._handlersById[handlerName] = handler;\n    }\n\n    stop(allowEndAnimation: boolean) {\n        // do nothing if this method was triggered by a gesture update\n        if (this._updatingCamera) return;\n\n        for (const {handler} of this._handlers) {\n            handler.reset();\n        }\n        this._inertia.clear();\n        this._fireEvents({}, {}, allowEndAnimation);\n        this._changes = [];\n    }\n\n    isActive() {\n        for (const {handler} of this._handlers) {\n            if (handler.isActive()) return true;\n        }\n        return false;\n    }\n\n    isZooming() {\n        return !!this._eventsInProgress.zoom || this._map.scrollZoom.isZooming();\n    }\n    isRotating() {\n        return !!this._eventsInProgress.rotate;\n    }\n\n    isMoving() {\n        return Boolean(isMoving(this._eventsInProgress)) || this.isZooming();\n    }\n\n    _blockedByActive(activeHandlers: {[x: string]: Handler}, allowed: Array<string>, myName: string) {\n        for (const name in activeHandlers) {\n            if (name === myName) continue;\n            if (!allowed || allowed.indexOf(name) < 0) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    handleWindowEvent = (e: { type: 'mousemove' | 'mouseup' | 'touchmove'}) => {\n        this.handleEvent(e, `${e.type}Window`);\n    };\n\n    _getMapTouches(touches: TouchList) {\n        const mapTouches = [];\n        for (const t of touches) {\n            const target = (t.target as any as Node);\n            if (this._el.contains(target)) {\n                mapTouches.push(t);\n            }\n        }\n        return mapTouches as any as TouchList;\n    }\n\n    handleEvent = (e: Event, eventName?: keyof Handler) => {\n\n        if (e.type === 'blur') {\n            this.stop(true);\n            return;\n        }\n\n        this._updatingCamera = true;\n\n        const inputEvent = e.type === 'renderFrame' ? undefined : e as UIEvent;\n\n        /*\n         * We don't call e.preventDefault() for any events by default.\n         * Handlers are responsible for calling it where necessary.\n         */\n\n        const mergedHandlerResult: HandlerResult = {needsRenderFrame: false};\n        const eventsInProgress: EventsInProgress = {};\n        const activeHandlers = {};\n        const eventTouches = (e as TouchEvent).touches;\n\n        const mapTouches = eventTouches ? this._getMapTouches(eventTouches) : undefined;\n        const points = mapTouches ?\n            DOM.touchPos(this._map.getCanvas(), mapTouches) :\n            DOM.mousePos(this._map.getCanvas(), ((e as MouseEvent)));\n\n        for (const {handlerName, handler, allowed} of this._handlers) {\n            if (!handler.isEnabled()) continue;\n\n            let data: HandlerResult;\n            if (this._blockedByActive(activeHandlers, allowed, handlerName)) {\n                handler.reset();\n\n            } else {\n                if (handler[eventName || e.type]) {\n                    data = handler[eventName || e.type](e, points, mapTouches);\n                    this.mergeHandlerResult(mergedHandlerResult, eventsInProgress, data, handlerName, inputEvent);\n                    if (data && data.needsRenderFrame) {\n                        this._triggerRenderFrame();\n                    }\n                }\n            }\n\n            if (data || handler.isActive()) {\n                activeHandlers[handlerName] = handler;\n            }\n        }\n\n        const deactivatedHandlers: {[handlerName: string]: Event} = {};\n        for (const name in this._previousActiveHandlers) {\n            if (!activeHandlers[name]) {\n                deactivatedHandlers[name] = inputEvent;\n            }\n        }\n        this._previousActiveHandlers = activeHandlers;\n\n        if (Object.keys(deactivatedHandlers).length || hasChange(mergedHandlerResult)) {\n            this._changes.push([mergedHandlerResult, eventsInProgress, deactivatedHandlers]);\n            this._triggerRenderFrame();\n        }\n\n        if (Object.keys(activeHandlers).length || hasChange(mergedHandlerResult)) {\n            this._map._stop(true);\n        }\n\n        this._updatingCamera = false;\n\n        const {cameraAnimation} = mergedHandlerResult;\n        if (cameraAnimation) {\n            this._inertia.clear();\n            this._fireEvents({}, {}, true);\n            this._changes = [];\n            cameraAnimation(this._map);\n        }\n    };\n\n    mergeHandlerResult(mergedHandlerResult: HandlerResult,\n        eventsInProgress: EventsInProgress,\n        handlerResult: HandlerResult,\n        name: string,\n        e?: UIEvent) {\n        if (!handlerResult) return;\n\n        extend(mergedHandlerResult, handlerResult);\n\n        const eventData = {handlerName: name, originalEvent: handlerResult.originalEvent || e};\n\n        // track which handler changed which camera property\n        if (handlerResult.zoomDelta !== undefined) {\n            eventsInProgress.zoom = eventData;\n        }\n        if (handlerResult.panDelta !== undefined) {\n            eventsInProgress.drag = eventData;\n        }\n        if (handlerResult.pitchDelta !== undefined) {\n            eventsInProgress.pitch = eventData;\n        }\n        if (handlerResult.bearingDelta !== undefined) {\n            eventsInProgress.rotate = eventData;\n        }\n\n    }\n\n    _applyChanges() {\n        const combined: HandlerResult = {};\n        const combinedEventsInProgress: EventsInProgress = {};\n        const combinedDeactivatedHandlers = {};\n\n        for (const [change, eventsInProgress, deactivatedHandlers] of this._changes) {\n\n            if (change.panDelta) combined.panDelta = (combined.panDelta || new Point(0, 0))._add(change.panDelta);\n            if (change.zoomDelta) combined.zoomDelta = (combined.zoomDelta || 0) + change.zoomDelta;\n            if (change.bearingDelta) combined.bearingDelta = (combined.bearingDelta || 0) + change.bearingDelta;\n            if (change.pitchDelta) combined.pitchDelta = (combined.pitchDelta || 0) + change.pitchDelta;\n            if (change.around !== undefined) combined.around = change.around;\n            if (change.pinchAround !== undefined) combined.pinchAround = change.pinchAround;\n            if (change.noInertia) combined.noInertia = change.noInertia;\n\n            extend(combinedEventsInProgress, eventsInProgress);\n            extend(combinedDeactivatedHandlers, deactivatedHandlers);\n        }\n\n        this._updateMapTransform(combined, combinedEventsInProgress, combinedDeactivatedHandlers);\n        this._changes = [];\n    }\n\n    _updateMapTransform(combinedResult: HandlerResult,\n        combinedEventsInProgress: EventsInProgress,\n        deactivatedHandlers: {[handlerName: string]: Event}) {\n        const map = this._map;\n        const tr = map._getTransformForUpdate();\n        const terrain = map.terrain;\n\n        if (!hasChange(combinedResult) && !(terrain && this._terrainMovement)) {\n            return this._fireEvents(combinedEventsInProgress, deactivatedHandlers, true);\n        }\n\n        let {panDelta, zoomDelta, bearingDelta, pitchDelta, around, pinchAround} = combinedResult;\n\n        if (pinchAround !== undefined) {\n            around = pinchAround;\n        }\n\n        // stop any ongoing camera animations (easeTo, flyTo)\n        map._stop(true);\n\n        around = around || map.transform.centerPoint;\n        const loc = tr.pointLocation(panDelta ? around.sub(panDelta) : around);\n        if (bearingDelta) tr.bearing += bearingDelta;\n        if (pitchDelta) tr.pitch += pitchDelta;\n        if (zoomDelta) tr.zoom += zoomDelta;\n\n        if (!terrain) {\n            tr.setLocationAtPoint(loc, around);\n        } else {\n            // when 3d-terrain is enabled act a little different:\n            //    - dragging do not drag the picked point itself, instead it drags the map by pixel-delta.\n            //      With this approach it is no longer possible to pick a point from somewhere near\n            //      the horizon to the center in one move.\n            //      So this logic avoids the problem, that in such cases you easily loose orientation.\n            if (!this._terrainMovement &&\n                (combinedEventsInProgress.drag || combinedEventsInProgress.zoom)) {\n                // When starting to drag or move, flag it and register moveend to clear flagging\n                this._terrainMovement = true;\n                this._map._elevationFreeze = true;\n                tr.setLocationAtPoint(loc, around);\n            } else if (combinedEventsInProgress.drag && this._terrainMovement) {\n                // drag map\n                tr.center = tr.pointLocation(tr.centerPoint.sub(panDelta));\n            } else {\n                tr.setLocationAtPoint(loc, around);\n            }\n        }\n\n        map._applyUpdatedTransform(tr);\n\n        this._map._update();\n        if (!combinedResult.noInertia) this._inertia.record(combinedResult);\n        this._fireEvents(combinedEventsInProgress, deactivatedHandlers, true);\n\n    }\n\n    _fireEvents(newEventsInProgress: EventsInProgress, deactivatedHandlers: {[handlerName: string]: Event}, allowEndAnimation: boolean) {\n\n        const wasMoving = isMoving(this._eventsInProgress);\n        const nowMoving = isMoving(newEventsInProgress);\n\n        const startEvents = {};\n\n        for (const eventName in newEventsInProgress) {\n            const {originalEvent} = newEventsInProgress[eventName];\n            if (!this._eventsInProgress[eventName]) {\n                startEvents[`${eventName}start`] = originalEvent;\n            }\n            this._eventsInProgress[eventName] = newEventsInProgress[eventName];\n        }\n\n        // fire start events only after this._eventsInProgress has been updated\n        if (!wasMoving && nowMoving) {\n            this._fireEvent('movestart', nowMoving.originalEvent);\n        }\n\n        for (const name in startEvents) {\n            this._fireEvent(name, startEvents[name]);\n        }\n\n        if (nowMoving) {\n            this._fireEvent('move', nowMoving.originalEvent);\n        }\n\n        for (const eventName in newEventsInProgress) {\n            const {originalEvent} = newEventsInProgress[eventName];\n            this._fireEvent(eventName, originalEvent);\n        }\n\n        const endEvents = {};\n\n        let originalEndEvent;\n        for (const eventName in this._eventsInProgress) {\n            const {handlerName, originalEvent} = this._eventsInProgress[eventName];\n            if (!this._handlersById[handlerName].isActive()) {\n                delete this._eventsInProgress[eventName];\n                originalEndEvent = deactivatedHandlers[handlerName] || originalEvent;\n                endEvents[`${eventName}end`] = originalEndEvent;\n            }\n        }\n\n        for (const name in endEvents) {\n            this._fireEvent(name, endEvents[name]);\n        }\n\n        const stillMoving = isMoving(this._eventsInProgress);\n        const finishedMoving = (wasMoving || nowMoving) && !stillMoving;\n        if (finishedMoving && this._terrainMovement) {\n            this._map._elevationFreeze = false;\n            this._terrainMovement = false;\n            const tr = this._map._getTransformForUpdate();\n            tr.recalculateZoom(this._map.terrain);\n            this._map._applyUpdatedTransform(tr);\n        }\n        if (allowEndAnimation && finishedMoving) {\n            this._updatingCamera = true;\n            const inertialEase = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions);\n\n            const shouldSnapToNorth = bearing => bearing !== 0 && -this._bearingSnap < bearing && bearing < this._bearingSnap;\n\n            if (inertialEase && (inertialEase.essential || !browser.prefersReducedMotion)) {\n                if (shouldSnapToNorth(inertialEase.bearing || this._map.getBearing())) {\n                    inertialEase.bearing = 0;\n                }\n                inertialEase.freezeElevation = true;\n                this._map.easeTo(inertialEase, {originalEvent: originalEndEvent});\n            } else {\n                this._map.fire(new Event('moveend', {originalEvent: originalEndEvent}));\n                if (shouldSnapToNorth(this._map.getBearing())) {\n                    this._map.resetNorth();\n                }\n            }\n            this._updatingCamera = false;\n        }\n\n    }\n\n    _fireEvent(type: string, e?: Event) {\n        this._map.fire(new Event(type, e ? {originalEvent: e} : {}));\n    }\n\n    _requestFrame() {\n        this._map.triggerRepaint();\n        return this._map._renderTaskQueue.add(timeStamp => {\n            delete this._frameId;\n            this.handleEvent(new RenderFrameEvent('renderFrame', {timeStamp}));\n            this._applyChanges();\n        });\n    }\n\n    _triggerRenderFrame() {\n        if (this._frameId === undefined) {\n            this._frameId = this._requestFrame();\n        }\n    }\n}\n", "import {extend, warnOnce, clamp, wrap, defaultEasing, pick, degreesToRadians} from '../util/util';\nimport {interpolates} from '@maplibre/maplibre-gl-style-spec';\nimport {browser} from '../util/browser';\nimport {LngLat} from '../geo/lng_lat';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {Event, Evented} from '../util/evented';\nimport {Terrain} from '../render/terrain';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\n\nimport type {Transform} from '../geo/transform';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {LngLatBoundsLike} from '../geo/lng_lat_bounds';\nimport type {TaskID} from '../util/task_queue';\nimport type {PaddingOptions} from '../geo/edge_insets';\nimport type {HandlerManager} from './handler_manager';\n/**\n * A [Point](https://github.com/mapbox/point-geometry) or an array of two numbers representing `x` and `y` screen coordinates in pixels.\n *\n * @group Geography and Geometry\n *\n * @example\n * ```ts\n * let p1 = new Point(-77, 38); // a PointLike which is a Point\n * let p2 = [-77, 38]; // a PointLike which is an array of two numbers\n * ```\n */\nexport type PointLike = Point | [number, number];\n\n/**\n * A helper to allow require of at least one property\n */\nexport type RequireAtLeastOne<T> = { [K in keyof T]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<keyof T, K>>>; }[keyof T];\n\n/**\n * Options common to {@link Map#jumpTo}, {@link Map#easeTo}, and {@link Map#flyTo}, controlling the desired location,\n * zoom, bearing, and pitch of the camera. All properties are optional, and when a property is omitted, the current\n * camera value for that property will remain unchanged.\n *\n * @example\n * Set the map's initial perspective with CameraOptions\n * ```ts\n * let map = new Map({\n *   container: 'map',\n *   style: 'https://demotiles.maplibre.org/style.json',\n *   center: [-73.5804, 45.53483],\n *   pitch: 60,\n *   bearing: -60,\n *   zoom: 10\n * });\n * ```\n * @see [Set pitch and bearing](https://maplibre.org/maplibre-gl-js/docs/examples/set-perspective/)\n * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to/)\n * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto/)\n * @see [Display buildings in 3D](https://maplibre.org/maplibre-gl-js/docs/examples/3d-buildings/)\n */\nexport type CameraOptions = CenterZoomBearing & {\n    /**\n     * The desired pitch in degrees. The pitch is the angle towards the horizon\n     * measured in degrees with a range between 0 and 60 degrees. For example, pitch: 0 provides the appearance\n     * of looking straight down at the map, while pitch: 60 tilts the user's perspective towards the horizon.\n     * Increasing the pitch value is often used to display 3D objects.\n     */\n    pitch?: number;\n    /**\n     * If `zoom` is specified, `around` determines the point around which the zoom is centered.\n     */\n    around?: LngLatLike;\n};\n\n/**\n * Holds center, zoom and bearing properties\n */\nexport type CenterZoomBearing = {\n    /**\n     * The desired center.\n     */\n    center?: LngLatLike;\n    /**\n     * The desired zoom level.\n     */\n    zoom?: number;\n    /**\n     * The desired bearing in degrees. The bearing is the compass direction that\n     * is \"up\". For example, `bearing: 90` orients the map so that east is up.\n     */\n    bearing?: number;\n}\n\n/**\n * The options object related to the {@link Map#jumpTo} method\n */\nexport type JumpToOptions = CameraOptions & {\n    /**\n     * Dimensions in pixels applied on each side of the viewport for shifting the vanishing point.\n     */\n    padding?: PaddingOptions;\n}\n\n/**\n * A options object for the {@link Map#cameraForBounds} method\n */\nexport type CameraForBoundsOptions = CameraOptions & {\n    /**\n     * The amount of padding in pixels to add to the given bounds.\n     */\n    padding?: number | RequireAtLeastOne<PaddingOptions>;\n    /**\n     * The center of the given bounds relative to the map's center, measured in pixels.\n     * @defaultValue [0, 0]\n     */\n    offset?: PointLike;\n    /**\n     * The maximum zoom level to allow when the camera would transition to the specified bounds.\n     */\n    maxZoom?: number;\n}\n\n/**\n * The {@link Map#flyTo} options object\n */\nexport type FlyToOptions = AnimationOptions & CameraOptions & {\n    /**\n     * The zooming \"curve\" that will occur along the\n     * flight path. A high value maximizes zooming for an exaggerated animation, while a low\n     * value minimizes zooming for an effect closer to {@link Map#easeTo}. 1.42 is the average\n     * value selected by participants in the user study discussed in\n     * [van Wijk (2003)](https://www.win.tue.nl/~vanwijk/zoompan.pdf). A value of\n     * `Math.pow(6, 0.25)` would be equivalent to the root mean squared average velocity. A\n     * value of 1 would produce a circular motion.\n     * @defaultValue 1.42\n     */\n    curve?: number;\n    /**\n     * The zero-based zoom level at the peak of the flight path. If\n     * `options.curve` is specified, this option is ignored.\n     */\n    minZoom?: number;\n    /**\n     * The average speed of the animation defined in relation to\n     * `options.curve`. A speed of 1.2 means that the map appears to move along the flight path\n     * by 1.2 times `options.curve` screenfuls every second. A _screenful_ is the map's visible span.\n     * It does not correspond to a fixed physical distance, but varies by zoom level.\n     * @defaultValue 1.2\n     */\n    speed?: number;\n    /**\n     * The average speed of the animation measured in screenfuls\n     * per second, assuming a linear timing curve. If `options.speed` is specified, this option is ignored.\n     */\n    screenSpeed?: number;\n    /**\n     * The animation's maximum duration, measured in milliseconds.\n     * If duration exceeds maximum duration, it resets to 0.\n     */\n    maxDuration?: number;\n    /**\n     * The amount of padding in pixels to add to the given bounds.\n     */\n    padding?: number | RequireAtLeastOne<PaddingOptions>;\n}\n\nexport type EaseToOptions = AnimationOptions & CameraOptions & {\n    delayEndEvents?: number;\n    padding?: number | RequireAtLeastOne<PaddingOptions>;\n}\n\n/**\n * Options for {@link Map#fitBounds} method\n */\nexport type FitBoundsOptions = FlyToOptions & {\n    /**\n     * If `true`, the map transitions using {@link Map#easeTo}. If `false`, the map transitions using {@link Map#flyTo}.\n     * See those functions and {@link AnimationOptions} for information about options available.\n     * @defaultValue false\n     */\n    linear?: boolean;\n    /**\n     * The center of the given bounds relative to the map's center, measured in pixels.\n     * @defaultValue [0, 0]\n     */\n    offset?: PointLike;\n    /**\n     * The maximum zoom level to allow when the map view transitions to the specified bounds.\n     */\n    maxZoom?: number;\n}\n\n/**\n * Options common to map movement methods that involve animation, such as {@link Map#panBy} and\n * {@link Map#easeTo}, controlling the duration and easing function of the animation. All properties\n * are optional.\n *\n */\nexport type AnimationOptions = {\n    /**\n     * The animation's duration, measured in milliseconds.\n     */\n    duration?: number;\n    /**\n     * A function taking a time in the range 0..1 and returning a number where 0 is\n     * the initial state and 1 is the final state.\n     */\n    easing?: (_: number) => number;\n    /**\n     * of the target center relative to real map container center at the end of animation.\n     */\n    offset?: PointLike;\n    /**\n     * If `false`, no animation will occur.\n     */\n    animate?: boolean;\n    /**\n     * If `true`, then the animation is considered essential and will not be affected by\n     * [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/\\@media/prefers-reduced-motion).\n     */\n    essential?: boolean;\n    /**\n     * Default false. Needed in 3D maps to let the camera stay in a constant\n     * height based on sea-level. After the animation finished the zoom-level will be recalculated in respect of\n     * the distance from the camera to the center-coordinate-altitude.\n     */\n    freezeElevation?: boolean;\n};\n\n/**\n * A callback hook that allows manipulating the camera and being notified about camera updates before they happen\n */\nexport type CameraUpdateTransformFunction =  (next: {\n    center: LngLat;\n    zoom: number;\n    pitch: number;\n    bearing: number;\n    elevation: number;\n}) => {\n    center?: LngLat;\n    zoom?: number;\n    pitch?: number;\n    bearing?: number;\n    elevation?: number;\n};\n\nexport abstract class Camera extends Evented {\n    transform: Transform;\n    terrain: Terrain;\n    handlers: HandlerManager;\n\n    _moving: boolean;\n    _zooming: boolean;\n    _rotating: boolean;\n    _pitching: boolean;\n    _padding: boolean;\n\n    _bearingSnap: number;\n    _easeStart: number;\n    _easeOptions: {\n        duration?: number;\n        easing?: (_: number) => number;\n    };\n    _easeId: string | void;\n\n    _onEaseFrame: (_: number) => void;\n    _onEaseEnd: (easeId?: string) => void;\n    _easeFrameId: TaskID;\n\n    /**\n     * @internal\n     * holds the geographical coordinate of the target\n     */\n    _elevationCenter: LngLat;\n    /**\n     * @internal\n     * holds the targ altitude value, = center elevation of the target.\n     * This value may changes during flight, because new terrain-tiles loads during flight.\n     */\n    _elevationTarget: number;\n    /**\n     * @internal\n     * holds the start altitude value, = center elevation before animation begins\n     * this value will recalculated during flight in respect of changing _elevationTarget values,\n     * so the linear interpolation between start and target keeps smooth and without jumps.\n     */\n    _elevationStart: number;\n    /**\n     * @internal\n     * Saves the current state of the elevation freeze - this is used during map movement to prevent \"rocky\" camera movement.\n     */\n    _elevationFreeze: boolean;\n    /**\n     * @internal\n     * Used to track accumulated changes during continuous interaction\n     */\n    _requestedCameraState?: Transform;\n    /**\n     * A callback used to defer camera updates or apply arbitrary constraints.\n     * If specified, this Camera instance can be used as a stateless component in React etc.\n     */\n    transformCameraUpdate: CameraUpdateTransformFunction | null;\n\n    abstract _requestRenderFrame(a: () => void): TaskID;\n    abstract _cancelRenderFrame(_: TaskID): void;\n\n    constructor(transform: Transform, options: {\n        bearingSnap: number;\n    }) {\n        super();\n        this._moving = false;\n        this._zooming = false;\n        this.transform = transform;\n        this._bearingSnap = options.bearingSnap;\n\n        this.on('moveend', () => {\n            delete this._requestedCameraState;\n        });\n    }\n\n    /**\n     * Returns the map's geographical centerpoint.\n     *\n     * @returns The map's geographical centerpoint.\n     * @example\n     * Return a LngLat object such as `{lng: 0, lat: 0}`\n     * ```ts\n     * let center = map.getCenter();\n     * // access longitude and latitude values directly\n     * let {lng, lat} = map.getCenter();\n     * ```\n     */\n    getCenter(): LngLat { return new LngLat(this.transform.center.lng, this.transform.center.lat); }\n\n    /**\n     * Sets the map's geographical centerpoint. Equivalent to `jumpTo({center: center})`.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param center - The centerpoint to set.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * map.setCenter([-74, 38]);\n     * ```\n     */\n    setCenter(center: LngLatLike, eventData?: any) {\n        return this.jumpTo({center}, eventData);\n    }\n\n    /**\n     * Pans the map by the specified offset.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param offset - `x` and `y` coordinates by which to pan the map.\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)\n     */\n    panBy(offset: PointLike, options?: AnimationOptions, eventData?: any): this {\n        offset = Point.convert(offset).mult(-1);\n        return this.panTo(this.transform.center, extend({offset}, options), eventData);\n    }\n\n    /**\n     * Pans the map to the specified location with an animated transition.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param lnglat - The location to pan the map to.\n     * @param options - Options describing the destination and animation of the transition.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * map.panTo([-74, 38]);\n     * // Specify that the panTo animation should last 5000 milliseconds.\n     * map.panTo([-74, 38], {duration: 5000});\n     * ```\n     * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/live-update-feature/)\n     */\n    panTo(lnglat: LngLatLike, options?: AnimationOptions, eventData?: any): this {\n        return this.easeTo(extend({\n            center: lnglat\n        }, options), eventData);\n    }\n\n    /**\n     * Returns the map's current zoom level.\n     *\n     * @returns The map's current zoom level.\n     * @example\n     * ```ts\n     * map.getZoom();\n     * ```\n     */\n    getZoom(): number { return this.transform.zoom; }\n\n    /**\n     * Sets the map's zoom level. Equivalent to `jumpTo({zoom: zoom})`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param zoom - The zoom level to set (0-20).\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Zoom to the zoom level 5 without an animated transition\n     * ```ts\n     * map.setZoom(5);\n     * ```\n     */\n    setZoom(zoom: number, eventData?: any): this {\n        this.jumpTo({zoom}, eventData);\n        return this;\n    }\n\n    /**\n     * Zooms the map to the specified zoom level, with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param zoom - The zoom level to transition to.\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * // Zoom to the zoom level 5 without an animated transition\n     * map.zoomTo(5);\n     * // Zoom to the zoom level 8 with an animated transition\n     * map.zoomTo(8, {\n     *   duration: 2000,\n     *   offset: [100, 50]\n     * });\n     * ```\n     */\n    zoomTo(zoom: number, options?: AnimationOptions | null, eventData?: any): this {\n        return this.easeTo(extend({\n            zoom\n        }, options), eventData);\n    }\n\n    /**\n     * Increases the map's zoom level by 1.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Zoom the map in one level with a custom animation duration\n     * ```ts\n     * map.zoomIn({duration: 1000});\n     * ```\n     */\n    zoomIn(options?: AnimationOptions, eventData?: any): this {\n        this.zoomTo(this.getZoom() + 1, options, eventData);\n        return this;\n    }\n\n    /**\n     * Decreases the map's zoom level by 1.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, and `zoomend`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Zoom the map out one level with a custom animation offset\n     * ```ts\n     * map.zoomOut({offset: [80, 60]});\n     * ```\n     */\n    zoomOut(options?: AnimationOptions, eventData?: any): this {\n        this.zoomTo(this.getZoom() - 1, options, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the map's current bearing. The bearing is the compass direction that is \"up\"; for example, a bearing\n     * of 90Â° orients the map so that east is up.\n     *\n     * @returns The map's current bearing.\n     * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)\n     */\n    getBearing(): number { return this.transform.bearing; }\n\n    /**\n     * Sets the map's bearing (rotation). The bearing is the compass direction that is \"up\"; for example, a bearing\n     * of 90Â° orients the map so that east is up.\n     *\n     * Equivalent to `jumpTo({bearing: bearing})`.\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param bearing - The desired bearing.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Rotate the map to 90 degrees\n     * ```ts\n     * map.setBearing(90);\n     * ```\n     */\n    setBearing(bearing: number, eventData?: any): this {\n        this.jumpTo({bearing}, eventData);\n        return this;\n    }\n\n    /**\n     * Returns the current padding applied around the map viewport.\n     *\n     * @returns The current padding around the map viewport.\n     */\n    getPadding(): PaddingOptions { return this.transform.padding; }\n\n    /**\n     * Sets the padding in pixels around the viewport.\n     *\n     * Equivalent to `jumpTo({padding: padding})`.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param padding - The desired padding.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * Sets a left padding of 300px, and a top padding of 50px\n     * ```ts\n     * map.setPadding({ left: 300, top: 50 });\n     * ```\n     */\n    setPadding(padding: PaddingOptions, eventData?: any): this {\n        this.jumpTo({padding}, eventData);\n        return this;\n    }\n\n    /**\n     * Rotates the map to the specified bearing, with an animated transition. The bearing is the compass direction\n     * that is \"up\"; for example, a bearing of 90Â° orients the map so that east is up.\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param bearing - The desired bearing.\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    rotateTo(bearing: number, options?: AnimationOptions, eventData?: any): this {\n        return this.easeTo(extend({\n            bearing\n        }, options), eventData);\n    }\n\n    /**\n     * Rotates the map so that north is up (0Â° bearing), with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    resetNorth(options?: AnimationOptions, eventData?: any): this {\n        this.rotateTo(0, extend({duration: 1000}, options), eventData);\n        return this;\n    }\n\n    /**\n     * Rotates and pitches the map so that north is up (0Â° bearing) and pitch is 0Â°, with an animated transition.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `pitchstart`, `pitch`, `pitchend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    resetNorthPitch(options?: AnimationOptions, eventData?: any): this {\n        this.easeTo(extend({\n            bearing: 0,\n            pitch: 0,\n            duration: 1000\n        }, options), eventData);\n        return this;\n    }\n\n    /**\n     * Snaps the map so that north is up (0Â° bearing), if the current bearing is close enough to it (i.e. within the\n     * `bearingSnap` threshold).\n     *\n     * Triggers the following events: `movestart`, `moveend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    snapToNorth(options?: AnimationOptions, eventData?: any): this {\n        if (Math.abs(this.getBearing()) < this._bearingSnap) {\n            return this.resetNorth(options, eventData);\n        }\n        return this;\n    }\n\n    /**\n     * Returns the map's current pitch (tilt).\n     *\n     * @returns The map's current pitch, measured in degrees away from the plane of the screen.\n     */\n    getPitch(): number { return this.transform.pitch; }\n\n    /**\n     * Sets the map's pitch (tilt). Equivalent to `jumpTo({pitch: pitch})`.\n     *\n     * Triggers the following events: `movestart`, `moveend`, `pitchstart`, and `pitchend`.\n     *\n     * @param pitch - The pitch to set, measured in degrees away from the plane of the screen (0-60).\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     */\n    setPitch(pitch: number, eventData?: any): this {\n        this.jumpTo({pitch}, eventData);\n        return this;\n    }\n\n    /**\n     * @param bounds - Calculate the center for these bounds in the viewport and use\n     * the highest zoom level up to and including `Map#getMaxZoom()` that fits\n     * in the viewport. LngLatBounds represent a box that is always axis-aligned with bearing 0.\n     * Bounds will be taken in [sw, ne] order. Southwest point will always be to the left of the northeast point.\n     * @param options - Options object\n     * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.\n     * If map is unable to fit, method will warn and return undefined.\n     * @example\n     * ```ts\n     * let bbox = [[-79, 43], [-73, 45]];\n     * let newCameraTransform = map.cameraForBounds(bbox, {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     */\n    cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CenterZoomBearing | undefined {\n        bounds = LngLatBounds.convert(bounds).adjustAntiMeridian();\n        const bearing = options && options.bearing || 0;\n\n        return this._cameraForBoxAndBearing(bounds.getNorthWest(), bounds.getSouthEast(), bearing, options);\n    }\n\n    /**\n     * @internal\n     * Calculate the center of these two points in the viewport and use\n     * the highest zoom level up to and including `Map#getMaxZoom()` that fits\n     * the points in the viewport at the specified bearing.\n     * @param p0 - First point\n     * @param p1 - Second point\n     * @param bearing - Desired map bearing at end of animation, in degrees\n     * @param options - the camera options\n     * @returns If map is able to fit to provided bounds, returns `center`, `zoom`, and `bearing`.\n     *      If map is unable to fit, method will warn and return undefined.\n     * @example\n     * ```ts\n     * let p0 = [-79, 43];\n     * let p1 = [-73, 45];\n     * let bearing = 90;\n     * let newCameraTransform = map._cameraForBoxAndBearing(p0, p1, bearing, {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     */\n    _cameraForBoxAndBearing(p0: LngLatLike, p1: LngLatLike, bearing: number, options?: CameraForBoundsOptions): CenterZoomBearing | undefined {\n        const defaultPadding = {\n            top: 0,\n            bottom: 0,\n            right: 0,\n            left: 0\n        };\n        options = extend({\n            padding: defaultPadding,\n            offset: [0, 0],\n            maxZoom: this.transform.maxZoom\n        }, options);\n\n        if (typeof options.padding === 'number') {\n            const p = options.padding;\n            options.padding = {\n                top: p,\n                bottom: p,\n                right: p,\n                left: p\n            };\n        }\n\n        options.padding = extend(defaultPadding, options.padding) as PaddingOptions;\n        const tr = this.transform;\n        const edgePadding = tr.padding;\n\n        // Consider all corners of the rotated bounding box derived from the given points\n        // when find the camera position that fits the given points.\n        const bounds = new LngLatBounds(p0, p1);\n        const nwWorld = tr.project(bounds.getNorthWest());\n        const neWorld = tr.project(bounds.getNorthEast());\n        const seWorld = tr.project(bounds.getSouthEast());\n        const swWorld = tr.project(bounds.getSouthWest());\n\n        const bearingRadians = degreesToRadians(-bearing);\n\n        const nwRotatedWorld = nwWorld.rotate(bearingRadians);\n        const neRotatedWorld = neWorld.rotate(bearingRadians);\n        const seRotatedWorld = seWorld.rotate(bearingRadians);\n        const swRotatedWorld = swWorld.rotate(bearingRadians);\n\n        const upperRight = new Point(\n            Math.max(nwRotatedWorld.x, neRotatedWorld.x, swRotatedWorld.x, seRotatedWorld.x),\n            Math.max(nwRotatedWorld.y, neRotatedWorld.y, swRotatedWorld.y, seRotatedWorld.y)\n        );\n\n        const lowerLeft = new Point(\n            Math.min(nwRotatedWorld.x, neRotatedWorld.x, swRotatedWorld.x, seRotatedWorld.x),\n            Math.min(nwRotatedWorld.y, neRotatedWorld.y, swRotatedWorld.y, seRotatedWorld.y)\n        );\n\n        // Calculate zoom: consider the original bbox and padding.\n        const size = upperRight.sub(lowerLeft);\n        const scaleX = (tr.width - (edgePadding.left + edgePadding.right + options.padding.left + options.padding.right)) / size.x;\n        const scaleY = (tr.height - (edgePadding.top + edgePadding.bottom + options.padding.top + options.padding.bottom)) / size.y;\n\n        if (scaleY < 0 || scaleX < 0) {\n            warnOnce(\n                'Map cannot fit within canvas with the given bounds, padding, and/or offset.'\n            );\n            return undefined;\n        }\n\n        const zoom = Math.min(tr.scaleZoom(tr.scale * Math.min(scaleX, scaleY)), options.maxZoom);\n\n        // Calculate center: apply the zoom, the configured offset, as well as offset that exists as a result of padding.\n        const offset = Point.convert(options.offset);\n        const paddingOffsetX = (options.padding.left - options.padding.right) / 2;\n        const paddingOffsetY = (options.padding.top - options.padding.bottom) / 2;\n        const paddingOffset = new Point(paddingOffsetX, paddingOffsetY);\n        const rotatedPaddingOffset = paddingOffset.rotate(degreesToRadians(bearing));\n        const offsetAtInitialZoom = offset.add(rotatedPaddingOffset);\n        const offsetAtFinalZoom = offsetAtInitialZoom.mult(tr.scale / tr.zoomScale(zoom));\n\n        const center = tr.unproject(\n            // either world diagonal can be used (NW-SE or NE-SW)\n            nwWorld.add(seWorld).div(2).sub(offsetAtFinalZoom)\n        );\n\n        return {\n            center,\n            zoom,\n            bearing\n        };\n    }\n\n    /**\n     * Pans and zooms the map to contain its visible area within the specified geographical bounds.\n     * This function will also reset the map's bearing to 0 if bearing is nonzero.\n     *\n     * Triggers the following events: `movestart` and `moveend`.\n     *\n     * @param bounds - Center these bounds in the viewport and use the highest\n     * zoom level up to and including `Map#getMaxZoom()` that fits them in the viewport.\n     * Bounds will be taken in [sw, ne] order. Southwest point will always be to the left of the northeast point.\n     * @param options - Options supports all properties from {@link AnimationOptions} and {@link CameraOptions} in addition to the fields below.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * let bbox = [[-79, 43], [-73, 45]];\n     * map.fitBounds(bbox, {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     * @see [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds/)\n     */\n    fitBounds(bounds: LngLatBoundsLike, options?: FitBoundsOptions, eventData?: any): this {\n        return this._fitInternal(\n            this.cameraForBounds(bounds, options),\n            options,\n            eventData);\n    }\n\n    /**\n     * Pans, rotates and zooms the map to to fit the box made by points p0 and p1\n     * once the map is rotated to the specified bearing. To zoom without rotating,\n     * pass in the current map bearing.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend` and `rotate`.\n     *\n     * @param p0 - First point on screen, in pixel coordinates\n     * @param p1 - Second point on screen, in pixel coordinates\n     * @param bearing - Desired map bearing at end of animation, in degrees\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * let p0 = [220, 400];\n     * let p1 = [500, 900];\n     * map.fitScreenCoordinates(p0, p1, map.getBearing(), {\n     *   padding: {top: 10, bottom:25, left: 15, right: 5}\n     * });\n     * ```\n     * @see Used by {@link BoxZoomHandler}\n     */\n    fitScreenCoordinates(p0: PointLike, p1: PointLike, bearing: number, options?: FitBoundsOptions, eventData?: any): this {\n        return this._fitInternal(\n            this._cameraForBoxAndBearing(\n                this.transform.pointLocation(Point.convert(p0)),\n                this.transform.pointLocation(Point.convert(p1)),\n                bearing,\n                options),\n            options,\n            eventData);\n    }\n\n    _fitInternal(calculatedOptions?: CenterZoomBearing, options?: FitBoundsOptions, eventData?: any): this {\n        // cameraForBounds warns + returns undefined if unable to fit:\n        if (!calculatedOptions) return this;\n\n        options = extend(calculatedOptions, options);\n        // Explicitly remove the padding field because, calculatedOptions already accounts for padding by setting zoom and center accordingly.\n        delete options.padding;\n\n        return options.linear ?\n            this.easeTo(options, eventData) :\n            this.flyTo(options, eventData);\n    }\n\n    /**\n     * Changes any combination of center, zoom, bearing, and pitch, without\n     * an animated transition. The map will retain its current values for any\n     * details not specified in `options`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,\n     * `pitch`, `pitchend`, and `rotate`.\n     *\n     * @param options - Options object\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * // jump to coordinates at current zoom\n     * map.jumpTo({center: [0, 0]});\n     * // jump with zoom, pitch, and bearing options\n     * map.jumpTo({\n     *   center: [0, 0],\n     *   zoom: 8,\n     *   pitch: 45,\n     *   bearing: 90\n     * });\n     * ```\n     * @see [Jump to a series of locations](https://maplibre.org/maplibre-gl-js/docs/examples/jump-to/)\n     * @see [Update a feature in realtime](https://maplibre.org/maplibre-gl-js/docs/examples/live-update-feature/)\n     */\n    jumpTo(options: JumpToOptions, eventData?: any): this {\n        this.stop();\n\n        const tr = this._getTransformForUpdate();\n        let zoomChanged = false,\n            bearingChanged = false,\n            pitchChanged = false;\n\n        if ('zoom' in options && tr.zoom !== +options.zoom) {\n            zoomChanged = true;\n            tr.zoom = +options.zoom;\n        }\n\n        if (options.center !== undefined) {\n            tr.center = LngLat.convert(options.center);\n        }\n\n        if ('bearing' in options && tr.bearing !== +options.bearing) {\n            bearingChanged = true;\n            tr.bearing = +options.bearing;\n        }\n\n        if ('pitch' in options && tr.pitch !== +options.pitch) {\n            pitchChanged = true;\n            tr.pitch = +options.pitch;\n        }\n\n        if (options.padding != null && !tr.isPaddingEqual(options.padding)) {\n            tr.padding = options.padding;\n        }\n        this._applyUpdatedTransform(tr);\n\n        this.fire(new Event('movestart', eventData))\n            .fire(new Event('move', eventData));\n\n        if (zoomChanged) {\n            this.fire(new Event('zoomstart', eventData))\n                .fire(new Event('zoom', eventData))\n                .fire(new Event('zoomend', eventData));\n        }\n\n        if (bearingChanged) {\n            this.fire(new Event('rotatestart', eventData))\n                .fire(new Event('rotate', eventData))\n                .fire(new Event('rotateend', eventData));\n        }\n\n        if (pitchChanged) {\n            this.fire(new Event('pitchstart', eventData))\n                .fire(new Event('pitch', eventData))\n                .fire(new Event('pitchend', eventData));\n        }\n\n        return this.fire(new Event('moveend', eventData));\n    }\n\n    /**\n     * Calculates pitch, zoom and bearing for looking at `newCenter` with the camera position being `newCenter`\n     * and returns them as {@link CameraOptions}.\n     * @param from - The camera to look from\n     * @param altitudeFrom - The altitude of the camera to look from\n     * @param to - The center to look at\n     * @param altitudeTo - Optional altitude of the center to look at. If none given the ground height will be used.\n     * @returns the calculated camera options\n     */\n    calculateCameraOptionsFromTo(from: LngLat, altitudeFrom: number, to: LngLat, altitudeTo: number = 0): CameraOptions {\n        const fromMerc = MercatorCoordinate.fromLngLat(from, altitudeFrom);\n        const toMerc = MercatorCoordinate.fromLngLat(to, altitudeTo);\n        const dx = toMerc.x - fromMerc.x;\n        const dy = toMerc.y - fromMerc.y;\n        const dz = toMerc.z - fromMerc.z;\n\n        const distance3D = Math.hypot(dx, dy, dz);\n        if (distance3D === 0) throw new Error('Can\\'t calculate camera options with same From and To');\n\n        const groundDistance = Math.hypot(dx, dy);\n\n        const zoom = this.transform.scaleZoom(this.transform.cameraToCenterDistance / distance3D / this.transform.tileSize);\n        const bearing = (Math.atan2(dx, -dy) * 180) / Math.PI;\n        let pitch = (Math.acos(groundDistance / distance3D) * 180) / Math.PI;\n        pitch = dz < 0 ? 90 - pitch : 90 + pitch;\n\n        return {\n            center: toMerc.toLngLat(),\n            zoom,\n            pitch,\n            bearing\n        };\n    }\n\n    /**\n     * Changes any combination of `center`, `zoom`, `bearing`, `pitch`, and `padding` with an animated transition\n     * between old and new values. The map will retain its current values for any\n     * details not specified in `options`.\n     *\n     * Note: The transition will happen instantly if the user has enabled\n     * the `reduced motion` accessibility feature enabled in their operating system,\n     * unless `options` includes `essential: true`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,\n     * `pitch`, `pitchend`, and `rotate`.\n     *\n     * @param options - Options describing the destination and animation of the transition.\n     * Accepts {@link CameraOptions} and {@link AnimationOptions}.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @see [Navigate the map with game-like controls](https://maplibre.org/maplibre-gl-js/docs/examples/game-controls/)\n     */\n    easeTo(options: EaseToOptions & {\n        easeId?: string;\n        noMoveStart?: boolean;\n    }, eventData?: any): this {\n        this._stop(false, options.easeId);\n\n        options = extend({\n            offset: [0, 0],\n            duration: 500,\n            easing: defaultEasing\n        }, options);\n\n        if (options.animate === false || (!options.essential && browser.prefersReducedMotion)) options.duration = 0;\n\n        const tr = this._getTransformForUpdate(),\n            startZoom = tr.zoom,\n            startBearing = tr.bearing,\n            startPitch = tr.pitch,\n            startPadding = tr.padding,\n\n            bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing,\n            pitch = 'pitch' in options ? +options.pitch : startPitch,\n            padding = 'padding' in options ? options.padding : tr.padding;\n\n        const offsetAsPoint = Point.convert(options.offset);\n        let pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n        const locationAtOffset = tr.pointLocation(pointAtOffset);\n\n        const {center, zoom} = tr.getConstrained(\n            LngLat.convert(options.center || locationAtOffset),\n            options.zoom ?? startZoom\n        );\n        this._normalizeCenter(center, tr);\n\n        const from = tr.project(locationAtOffset);\n        const delta = tr.project(center).sub(from);\n        const finalScale = tr.zoomScale(zoom - startZoom);\n\n        let around, aroundPoint;\n\n        if (options.around) {\n            around = LngLat.convert(options.around);\n            aroundPoint = tr.locationPoint(around);\n        }\n\n        const currently = {\n            moving: this._moving,\n            zooming: this._zooming,\n            rotating: this._rotating,\n            pitching: this._pitching\n        };\n\n        this._zooming = this._zooming || (zoom !== startZoom);\n        this._rotating = this._rotating || (startBearing !== bearing);\n        this._pitching = this._pitching || (pitch !== startPitch);\n        this._padding = !tr.isPaddingEqual(padding as PaddingOptions);\n\n        this._easeId = options.easeId;\n        this._prepareEase(eventData, options.noMoveStart, currently);\n        if (this.terrain) this._prepareElevation(center);\n\n        this._ease((k) => {\n            if (this._zooming) {\n                tr.zoom = interpolates.number(startZoom, zoom, k);\n            }\n            if (this._rotating) {\n                tr.bearing = interpolates.number(startBearing, bearing, k);\n            }\n            if (this._pitching) {\n                tr.pitch = interpolates.number(startPitch, pitch, k);\n            }\n            if (this._padding) {\n                tr.interpolatePadding(startPadding, padding as PaddingOptions, k);\n                // When padding is being applied, Transform#centerPoint is changing continuously,\n                // thus we need to recalculate offsetPoint every frame\n                pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n            }\n\n            if (this.terrain && !options.freezeElevation) this._updateElevation(k);\n\n            if (around) {\n                tr.setLocationAtPoint(around, aroundPoint);\n            } else {\n                const scale = tr.zoomScale(tr.zoom - startZoom);\n                const base = zoom > startZoom ?\n                    Math.min(2, finalScale) :\n                    Math.max(0.5, finalScale);\n                const speedup = Math.pow(base, 1 - k);\n                const newCenter = tr.unproject(from.add(delta.mult(k * speedup)).mult(scale));\n                tr.setLocationAtPoint(tr.renderWorldCopies ? newCenter.wrap() : newCenter, pointAtOffset);\n            }\n\n            this._applyUpdatedTransform(tr);\n\n            this._fireMoveEvents(eventData);\n\n        }, (interruptingEaseId?: string) => {\n            if (this.terrain && options.freezeElevation) this._finalizeElevation();\n            this._afterEase(eventData, interruptingEaseId);\n        }, options as any);\n\n        return this;\n    }\n\n    _prepareEase(eventData: any, noMoveStart: boolean, currently: any = {}) {\n        this._moving = true;\n        if (!noMoveStart && !currently.moving) {\n            this.fire(new Event('movestart', eventData));\n        }\n        if (this._zooming && !currently.zooming) {\n            this.fire(new Event('zoomstart', eventData));\n        }\n        if (this._rotating && !currently.rotating) {\n            this.fire(new Event('rotatestart', eventData));\n        }\n        if (this._pitching && !currently.pitching) {\n            this.fire(new Event('pitchstart', eventData));\n        }\n    }\n\n    _prepareElevation(center: LngLat) {\n        this._elevationCenter = center;\n        this._elevationStart = this.transform.elevation;\n        this._elevationTarget = this.terrain.getElevationForLngLatZoom(center, this.transform.tileZoom);\n        this._elevationFreeze = true;\n    }\n\n    _updateElevation(k: number) {\n        this.transform.minElevationForCurrentTile = this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter, this.transform.tileZoom);\n        const elevation = this.terrain.getElevationForLngLatZoom(this._elevationCenter, this.transform.tileZoom);\n        // target terrain updated during flight, slowly move camera to new height\n        if (k < 1 && elevation !== this._elevationTarget) {\n            const pitch1 = this._elevationTarget - this._elevationStart;\n            const pitch2 = (elevation - (pitch1 * k + this._elevationStart)) / (1 - k);\n            this._elevationStart += k * (pitch1 - pitch2);\n            this._elevationTarget = elevation;\n        }\n        this.transform.elevation = interpolates.number(this._elevationStart, this._elevationTarget, k);\n    }\n\n    _finalizeElevation() {\n        this._elevationFreeze = false;\n        this.transform.recalculateZoom(this.terrain);\n    }\n\n    /**\n     * @internal\n     * Called when the camera is about to be manipulated.\n     * If `transformCameraUpdate` is specified or terrain is enabled, a copy of\n     * the current transform is created to track the accumulated changes.\n     * This underlying transform represents the \"desired state\" proposed by input handlers / animations / UI controls.\n     * It may differ from the state used for rendering (`this.transform`).\n     * @returns Transform to apply changes to\n     */\n    _getTransformForUpdate(): Transform {\n        if (!this.transformCameraUpdate && !this.terrain) return this.transform;\n\n        if (!this._requestedCameraState) {\n            this._requestedCameraState = this.transform.clone();\n        }\n        return this._requestedCameraState;\n    }\n\n    /**\n     * @internal\n     * Checks the given transform for the camera being below terrain surface and\n     * returns new pitch and zoom to fix that.\n     *\n     * With the new pitch and zoom, the camera will be at the same ground\n     * position but at higher altitude. It will still point to the same spot on\n     * the map.\n     *\n     * @param tr - The transform to check.\n     */\n    _elevateCameraIfInsideTerrain(tr: Transform) : { pitch?: number; zoom?: number } {\n        const camera = tr.getCameraPosition();\n        const minAltitude = this.terrain.getElevationForLngLatZoom(camera.lngLat, tr.zoom);\n        if (camera.altitude < minAltitude) {\n            const newCamera = this.calculateCameraOptionsFromTo(\n                camera.lngLat, minAltitude, tr.center, tr.elevation);\n            return {\n                pitch: newCamera.pitch,\n                zoom: newCamera.zoom,\n            };\n        }\n        return {};\n    }\n\n    /**\n     * @internal\n     * Called after the camera is done being manipulated.\n     * @param tr - the requested camera end state\n     * If the camera is inside terrain, it gets elevated.\n     * Call `transformCameraUpdate` if present, and then apply the \"approved\" changes.\n     */\n    _applyUpdatedTransform(tr: Transform) {\n        const modifiers : ((tr: Transform) => ReturnType<CameraUpdateTransformFunction>)[] = [];\n        if (this.terrain) {\n            modifiers.push(tr => this._elevateCameraIfInsideTerrain(tr));\n        }\n        if (this.transformCameraUpdate) {\n            modifiers.push(tr => this.transformCameraUpdate(tr));\n        }\n        if (!modifiers.length) {\n            return;\n        }\n        const finalTransform = tr.clone();\n        for (const modifier of modifiers) {\n            const nextTransform = finalTransform.clone();\n            const {\n                center,\n                zoom,\n                pitch,\n                bearing,\n                elevation\n            } = modifier(nextTransform);\n            if (center) nextTransform.center = center;\n            if (zoom !== undefined) nextTransform.zoom = zoom;\n            if (pitch !== undefined) nextTransform.pitch = pitch;\n            if (bearing !== undefined) nextTransform.bearing = bearing;\n            if (elevation !== undefined) nextTransform.elevation = elevation;\n            finalTransform.apply(nextTransform);\n        }\n        this.transform.apply(finalTransform);\n    }\n\n    _fireMoveEvents(eventData?: any) {\n        this.fire(new Event('move', eventData));\n        if (this._zooming) {\n            this.fire(new Event('zoom', eventData));\n        }\n        if (this._rotating) {\n            this.fire(new Event('rotate', eventData));\n        }\n        if (this._pitching) {\n            this.fire(new Event('pitch', eventData));\n        }\n    }\n\n    _afterEase(eventData?: any, easeId?: string) {\n        // if this easing is being stopped to start another easing with\n        // the same id then don't fire any events to avoid extra start/stop events\n        if (this._easeId && easeId && this._easeId === easeId) {\n            return;\n        }\n        delete this._easeId;\n\n        const wasZooming = this._zooming;\n        const wasRotating = this._rotating;\n        const wasPitching = this._pitching;\n        this._moving = false;\n        this._zooming = false;\n        this._rotating = false;\n        this._pitching = false;\n        this._padding = false;\n\n        if (wasZooming) {\n            this.fire(new Event('zoomend', eventData));\n        }\n        if (wasRotating) {\n            this.fire(new Event('rotateend', eventData));\n        }\n        if (wasPitching) {\n            this.fire(new Event('pitchend', eventData));\n        }\n        this.fire(new Event('moveend', eventData));\n    }\n\n    /**\n     * Changes any combination of center, zoom, bearing, and pitch, animating the transition along a curve that\n     * evokes flight. The animation seamlessly incorporates zooming and panning to help\n     * the user maintain her bearings even after traversing a great distance.\n     *\n     * Note: The animation will be skipped, and this will behave equivalently to `jumpTo`\n     * if the user has the `reduced motion` accessibility feature enabled in their operating system,\n     * unless 'options' includes `essential: true`.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, `zoomstart`, `zoom`, `zoomend`, `pitchstart`,\n     * `pitch`, `pitchend`, and `rotate`.\n     *\n     * @param options - Options describing the destination and animation of the transition.\n     * Accepts {@link CameraOptions}, {@link AnimationOptions},\n     * and the following additional options.\n     * @param eventData - Additional properties to be added to event objects of events triggered by this method.\n     * @example\n     * ```ts\n     * // fly with default options to null island\n     * map.flyTo({center: [0, 0], zoom: 9});\n     * // using flyTo options\n     * map.flyTo({\n     *   center: [0, 0],\n     *   zoom: 9,\n     *   speed: 0.2,\n     *   curve: 1,\n     *   easing(t) {\n     *     return t;\n     *   }\n     * });\n     * ```\n     * @see [Fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto/)\n     * @see [Slowly fly to a location](https://maplibre.org/maplibre-gl-js/docs/examples/flyto-options/)\n     * @see [Fly to a location based on scroll position](https://maplibre.org/maplibre-gl-js/docs/examples/scroll-fly-to/)\n     */\n    flyTo(options: FlyToOptions, eventData?: any): this {\n        // Fall through to jumpTo if user has set prefers-reduced-motion\n        if (!options.essential && browser.prefersReducedMotion) {\n            const coercedOptions = pick(options, ['center', 'zoom', 'bearing', 'pitch', 'around']) as CameraOptions;\n            return this.jumpTo(coercedOptions, eventData);\n        }\n\n        // This method implements an âoptimal pathâ animation, as detailed in:\n        //\n        // Van Wijk, Jarke J.; Nuij, Wim A. A. âSmooth and efficient zooming and panning.â INFOVIS\n        //   â03. pp. 15â22. <https://www.win.tue.nl/~vanwijk/zoompan.pdf#page=5>.\n        //\n        // Where applicable, local variable documentation begins with the associated variable or\n        // function in van Wijk (2003).\n\n        this.stop();\n\n        options = extend({\n            offset: [0, 0],\n            speed: 1.2,\n            curve: 1.42,\n            easing: defaultEasing\n        }, options);\n\n        const tr = this._getTransformForUpdate(),\n            startZoom = tr.zoom,\n            startBearing = tr.bearing,\n            startPitch = tr.pitch,\n            startPadding = tr.padding;\n\n        const bearing = 'bearing' in options ? this._normalizeBearing(options.bearing, startBearing) : startBearing;\n        const pitch = 'pitch' in options ? +options.pitch : startPitch;\n        const padding = 'padding' in options ? options.padding : tr.padding;\n\n        const offsetAsPoint = Point.convert(options.offset);\n        let pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n        const locationAtOffset = tr.pointLocation(pointAtOffset);\n\n        const {center, zoom} = tr.getConstrained(\n            LngLat.convert(options.center || locationAtOffset),\n            options.zoom ?? startZoom\n        );\n        this._normalizeCenter(center, tr);\n        const scale = tr.zoomScale(zoom - startZoom);\n\n        const from = tr.project(locationAtOffset);\n        const delta = tr.project(center).sub(from);\n\n        let rho = options.curve;\n\n        // wâ: Initial visible span, measured in pixels at the initial scale.\n        const w0 = Math.max(tr.width, tr.height),\n            // wâ: Final visible span, measured in pixels with respect to the initial scale.\n            w1 = w0 / scale,\n            // Length of the flight path as projected onto the ground plane, measured in pixels from\n            // the world image origin at the initial scale.\n            u1 = delta.mag();\n\n        if ('minZoom' in options) {\n            const minZoom = clamp(Math.min(options.minZoom, startZoom, zoom), tr.minZoom, tr.maxZoom);\n            // w<sub>m</sub>: Maximum visible span, measured in pixels with respect to the initial\n            // scale.\n            const wMax = w0 / tr.zoomScale(minZoom - startZoom);\n            rho = Math.sqrt(wMax / u1 * 2);\n        }\n\n        // ÏÂ²\n        const rho2 = rho * rho;\n\n        /**\n         * ráµ¢: Returns the zoom-out factor at one end of the animation.\n         *\n         * @param descent - `true` for the descent, `false` for the ascent\n         */\n        function zoomOutFactor(descent: boolean) {\n            const b = (w1 * w1 - w0 * w0 + (descent ? -1 : 1) * rho2 * rho2 * u1 * u1) / (2 * (descent ? w1 : w0) * rho2 * u1);\n            return Math.log(Math.sqrt(b * b + 1) - b);\n        }\n\n        function sinh(n) { return (Math.exp(n) - Math.exp(-n)) / 2; }\n        function cosh(n) { return (Math.exp(n) + Math.exp(-n)) / 2; }\n        function tanh(n) { return sinh(n) / cosh(n); }\n\n        // râ: Zoom-out factor during ascent.\n        const r0 = zoomOutFactor(false);\n\n        // w(s): Returns the visible span on the ground, measured in pixels with respect to the\n        // initial scale. Assumes an angular field of view of 2 arctan Â½ â 53Â°.\n        let w: (_: number) => number = function (s) {\n            return (cosh(r0) / cosh(r0 + rho * s));\n        };\n\n        // u(s): Returns the distance along the flight path as projected onto the ground plane,\n        // measured in pixels from the world image origin at the initial scale.\n        let u: (_: number) => number = function (s) {\n            return w0 * ((cosh(r0) * tanh(r0 + rho * s) - sinh(r0)) / rho2) / u1;\n        };\n\n        // S: Total length of the flight path, measured in Ï-screenfuls.\n        let S = (zoomOutFactor(true) - r0) / rho;\n\n        // When uâ = uâ, the optimal path doesnât require both ascent and descent.\n        if (Math.abs(u1) < 0.000001 || !isFinite(S)) {\n            // Perform a more or less instantaneous transition if the path is too short.\n            if (Math.abs(w0 - w1) < 0.000001) return this.easeTo(options, eventData);\n\n            const k = w1 < w0 ? -1 : 1;\n            S = Math.abs(Math.log(w1 / w0)) / rho;\n\n            u = () => 0;\n            w = (s) => Math.exp(k * rho * s);\n        }\n\n        if ('duration' in options) {\n            options.duration = +options.duration;\n        } else {\n            const V = 'screenSpeed' in options ? +options.screenSpeed / rho : +options.speed;\n            options.duration = 1000 * S / V;\n        }\n\n        if (options.maxDuration && options.duration > options.maxDuration) {\n            options.duration = 0;\n        }\n\n        this._zooming = true;\n        this._rotating = (startBearing !== bearing);\n        this._pitching = (pitch !== startPitch);\n        this._padding = !tr.isPaddingEqual(padding as PaddingOptions);\n\n        this._prepareEase(eventData, false);\n        if (this.terrain) this._prepareElevation(center);\n\n        this._ease((k) => {\n            // s: The distance traveled along the flight path, measured in Ï-screenfuls.\n            const s = k * S;\n            const scale = 1 / w(s);\n            tr.zoom = k === 1 ? zoom : startZoom + tr.scaleZoom(scale);\n\n            if (this._rotating) {\n                tr.bearing = interpolates.number(startBearing, bearing, k);\n            }\n            if (this._pitching) {\n                tr.pitch = interpolates.number(startPitch, pitch, k);\n            }\n            if (this._padding) {\n                tr.interpolatePadding(startPadding, padding as PaddingOptions, k);\n                // When padding is being applied, Transform#centerPoint is changing continuously,\n                // thus we need to recalculate offsetPoint every frame\n                pointAtOffset = tr.centerPoint.add(offsetAsPoint);\n            }\n\n            if (this.terrain && !options.freezeElevation) this._updateElevation(k);\n\n            const newCenter = k === 1 ? center : tr.unproject(from.add(delta.mult(u(s))).mult(scale));\n            tr.setLocationAtPoint(tr.renderWorldCopies ? newCenter.wrap() : newCenter, pointAtOffset);\n\n            this._applyUpdatedTransform(tr);\n\n            this._fireMoveEvents(eventData);\n\n        }, () => {\n            if (this.terrain && options.freezeElevation) this._finalizeElevation();\n            this._afterEase(eventData);\n        }, options);\n\n        return this;\n    }\n\n    isEasing() {\n        return !!this._easeFrameId;\n    }\n\n    /**\n     * Stops any animated transition underway.\n     */\n    stop(): this {\n        return this._stop();\n    }\n\n    _stop(allowGestures?: boolean, easeId?: string): this {\n        if (this._easeFrameId) {\n            this._cancelRenderFrame(this._easeFrameId);\n            delete this._easeFrameId;\n            delete this._onEaseFrame;\n        }\n\n        if (this._onEaseEnd) {\n            // The _onEaseEnd function might emit events which trigger new\n            // animation, which sets a new _onEaseEnd. Ensure we don't delete\n            // it unintentionally.\n            const onEaseEnd = this._onEaseEnd;\n            delete this._onEaseEnd;\n            onEaseEnd.call(this, easeId);\n        }\n        if (!allowGestures) {\n            this.handlers?.stop(false);\n        }\n        return this;\n    }\n\n    _ease(frame: (_: number) => void,\n        finish: () => void,\n        options: {\n            animate?: boolean;\n            duration?: number;\n            easing?: (_: number) => number;\n        }) {\n        if (options.animate === false || options.duration === 0) {\n            frame(1);\n            finish();\n        } else {\n            this._easeStart = browser.now();\n            this._easeOptions = options;\n            this._onEaseFrame = frame;\n            this._onEaseEnd = finish;\n            this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback);\n        }\n    }\n\n    // Callback for map._requestRenderFrame\n    _renderFrameCallback = () => {\n        const t = Math.min((browser.now() - this._easeStart) / this._easeOptions.duration, 1);\n        this._onEaseFrame(this._easeOptions.easing(t));\n\n        // if _stop is called during _onEaseFrame from _fireMoveEvents we should avoid a new _requestRenderFrame, checking it by ensuring _easeFrameId was not deleted\n        if (t < 1 && this._easeFrameId) {\n            this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback);\n        } else {\n            this.stop();\n        }\n    };\n\n    // convert bearing so that it's numerically close to the current one so that it interpolates properly\n    _normalizeBearing(bearing: number, currentBearing: number) {\n        bearing = wrap(bearing, -180, 180);\n        const diff = Math.abs(bearing - currentBearing);\n        if (Math.abs(bearing - 360 - currentBearing) < diff) bearing -= 360;\n        if (Math.abs(bearing + 360 - currentBearing) < diff) bearing += 360;\n        return bearing;\n    }\n\n    // If a path crossing the antimeridian would be shorter, extend the final coordinate so that\n    // interpolating between the two endpoints will cross it.\n    _normalizeCenter(center: LngLat, tr: Transform) {\n        if (!tr.renderWorldCopies || tr.lngRange) return;\n\n        const delta = center.lng - tr.center.lng;\n        center.lng +=\n            delta > 180 ? -360 :\n                delta < -180 ? 360 : 0;\n    }\n\n    /**\n     * Get the elevation difference between a given point\n     * and a point that is currently in the middle of the screen.\n     * This method should be used for proper positioning of custom 3d objects, as explained [here](https://maplibre.org/maplibre-gl-js/docs/examples/add-3d-model-with-terrain/)\n     * Returns null if terrain is not enabled.\n     * This method is subject to change in Maplibre GL JS v5.\n     * @param lngLatLike - [x,y] or LngLat coordinates of the location\n     * @returns elevation offset in meters\n     */\n    queryTerrainElevation(lngLatLike: LngLatLike): number | null {\n        if (!this.terrain) {\n            return null;\n        }\n        const elevation = this.terrain.getElevationForLngLatZoom(LngLat.convert(lngLatLike), this.transform.tileZoom);\n        return elevation - this.transform.elevation;\n    }\n}\n", "import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {ControlPosition, IControl} from './control';\nimport type {MapDataEvent} from '../events';\nimport type {StyleSpecification} from '@maplibre/maplibre-gl-style-spec';\n/**\n * The {@link AttributionControl} options object\n */\nexport type AttributionControlOptions = {\n    /**\n     * If `true`, the attribution control will always collapse when moving the map. If `false`,\n     * force the expanded attribution control. The default is a responsive attribution that collapses when the user moves the map on maps less than 640 pixels wide.\n     * **Attribution should not be collapsed if it can comfortably fit on the map. `compact` should only be used to modify default attribution when map size makes it impossible to fit default attribution and when the automatic compact resizing for default settings are not sufficient.**\n     */\n    compact?: boolean;\n    /**\n     * Attributions to show in addition to any other attributions.\n     */\n    customAttribution?: string | Array<string>;\n};\n\nexport const defaultAttributionControlOptions: AttributionControlOptions = {\n    compact: true,\n    customAttribution: '<a href=\"https://maplibre.org/\" target=\"_blank\">MapLibre</a>'\n};\n\n/**\n * An `AttributionControl` control presents the map's attribution information. By default, the attribution control is expanded (regardless of map width).\n * @group Markers and Controls\n * @example\n * ```ts\n * let map = new Map({attributionControl: false})\n *     .addControl(new AttributionControl({\n *         compact: true\n *     }));\n * ```\n */\nexport class AttributionControl implements IControl {\n    options: AttributionControlOptions;\n    _map: Map;\n    _compact: boolean | undefined;\n    _container: HTMLElement;\n    _innerContainer: HTMLElement;\n    _compactButton: HTMLElement;\n    _editLink: HTMLAnchorElement;\n    _attribHTML: string;\n    styleId: string;\n    styleOwner: string;\n\n    /**\n     * @param options - the attribution options\n     */\n    constructor(options: AttributionControlOptions = defaultAttributionControlOptions) {\n        this.options = options;\n    }\n\n    getDefaultPosition(): ControlPosition {\n        return 'bottom-right';\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._compact = this.options.compact;\n        this._container = DOM.create('details', 'maplibregl-ctrl maplibregl-ctrl-attrib');\n        this._compactButton = DOM.create('summary', 'maplibregl-ctrl-attrib-button', this._container);\n        this._compactButton.addEventListener('click', this._toggleAttribution);\n        this._setElementTitle(this._compactButton, 'ToggleAttribution');\n        this._innerContainer = DOM.create('div', 'maplibregl-ctrl-attrib-inner', this._container);\n\n        this._updateAttributions();\n        this._updateCompact();\n\n        this._map.on('styledata', this._updateData);\n        this._map.on('sourcedata', this._updateData);\n        this._map.on('terrain', this._updateData);\n        this._map.on('resize', this._updateCompact);\n        this._map.on('drag', this._updateCompactMinimize);\n\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n\n        this._map.off('styledata', this._updateData);\n        this._map.off('sourcedata', this._updateData);\n        this._map.off('terrain', this._updateData);\n        this._map.off('resize', this._updateCompact);\n        this._map.off('drag', this._updateCompactMinimize);\n\n        this._map = undefined;\n        this._compact = undefined;\n        this._attribHTML = undefined;\n    }\n\n    _setElementTitle(element: HTMLElement, title: 'ToggleAttribution' | 'MapFeedback') {\n        const str = this._map._getUIString(`AttributionControl.${title}`);\n        element.title = str;\n        element.setAttribute('aria-label', str);\n    }\n\n    _toggleAttribution = () => {\n        if (this._container.classList.contains('maplibregl-compact')) {\n            if (this._container.classList.contains('maplibregl-compact-show')) {\n                this._container.setAttribute('open', '');\n                this._container.classList.remove('maplibregl-compact-show');\n            } else {\n                this._container.classList.add('maplibregl-compact-show');\n                this._container.removeAttribute('open');\n            }\n        }\n    };\n\n    _updateData = (e: MapDataEvent) => {\n        if (e && (e.sourceDataType === 'metadata' || e.sourceDataType === 'visibility' || e.dataType === 'style' || e.type === 'terrain')) {\n            this._updateAttributions();\n        }\n    };\n\n    _updateAttributions() {\n        if (!this._map.style) return;\n        let attributions: Array<string> = [];\n        if (this.options.customAttribution) {\n            if (Array.isArray(this.options.customAttribution)) {\n                attributions = attributions.concat(\n                    this.options.customAttribution.map(attribution => {\n                        if (typeof attribution !== 'string') return '';\n                        return attribution;\n                    })\n                );\n            } else if (typeof this.options.customAttribution === 'string') {\n                attributions.push(this.options.customAttribution);\n            }\n        }\n\n        if (this._map.style.stylesheet) {\n            const stylesheet = this._map.style.stylesheet as StyleSpecification & { owner: string; id: string };\n            this.styleOwner = stylesheet.owner;\n            this.styleId = stylesheet.id;\n        }\n\n        const sourceCaches = this._map.style.sourceCaches;\n        for (const id in sourceCaches) {\n            const sourceCache = sourceCaches[id];\n            if (sourceCache.used || sourceCache.usedForTerrain) {\n                const source = sourceCache.getSource();\n                if (source.attribution && attributions.indexOf(source.attribution) < 0) {\n                    attributions.push(source.attribution);\n                }\n            }\n        }\n\n        // remove any entries that are whitespace\n        attributions = attributions.filter(e => String(e).trim());\n\n        // remove any entries that are substrings of another entry.\n        // first sort by length so that substrings come first\n        attributions.sort((a, b) => a.length - b.length);\n        attributions = attributions.filter((attrib, i) => {\n            for (let j = i + 1; j < attributions.length; j++) {\n                if (attributions[j].indexOf(attrib) >= 0) { return false; }\n            }\n            return true;\n        });\n\n        // check if attribution string is different to minimize DOM changes\n        const attribHTML = attributions.join(' | ');\n        if (attribHTML === this._attribHTML) return;\n\n        this._attribHTML = attribHTML;\n\n        if (attributions.length) {\n            this._innerContainer.innerHTML = attribHTML;\n            this._container.classList.remove('maplibregl-attrib-empty');\n        } else {\n            this._container.classList.add('maplibregl-attrib-empty');\n        }\n        this._updateCompact();\n        // remove old DOM node from _editLink\n        this._editLink = null;\n    }\n\n    _updateCompact = () => {\n        if (this._map.getCanvasContainer().offsetWidth <= 640 || this._compact) {\n            if (this._compact === false) {\n                this._container.setAttribute('open', '');\n            } else if (!this._container.classList.contains('maplibregl-compact') && !this._container.classList.contains('maplibregl-attrib-empty')) {\n                this._container.setAttribute('open', '');\n                this._container.classList.add('maplibregl-compact', 'maplibregl-compact-show');\n            }\n        } else {\n            this._container.setAttribute('open', '');\n            if (this._container.classList.contains('maplibregl-compact')) {\n                this._container.classList.remove('maplibregl-compact', 'maplibregl-compact-show');\n            }\n        }\n    };\n\n    _updateCompactMinimize = () => {\n        if (this._container.classList.contains('maplibregl-compact')) {\n            if (this._container.classList.contains('maplibregl-compact-show')) {\n                this._container.classList.remove('maplibregl-compact-show');\n            }\n        }\n    };\n}\n", "import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {ControlPosition, IControl} from './control';\n\n/**\n * The {@link LogoControl} options object\n */\ntype LogoControlOptions = {\n    /**\n     * If `true`, force a compact logo.\n     * If `false`, force the full logo. The default is a responsive logo that collapses when the map is less than 640 pixels wide.\n     */\n    compact?: boolean;\n};\n\n/**\n * A `LogoControl` is a control that adds the watermark.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * map.addControl(new LogoControl({compact: false}));\n * ```\n **/\nexport class LogoControl implements IControl {\n    options: LogoControlOptions;\n    _map: Map;\n    _compact: boolean;\n    _container: HTMLElement;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: LogoControlOptions = {}) {\n        this.options = options;\n    }\n\n    getDefaultPosition(): ControlPosition {\n        return 'bottom-left';\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._compact = this.options && this.options.compact;\n        this._container = DOM.create('div', 'maplibregl-ctrl');\n        const anchor = DOM.create('a', 'maplibregl-ctrl-logo');\n        anchor.target = '_blank';\n        anchor.rel = 'noopener nofollow';\n        anchor.href = 'https://maplibre.org/';\n        anchor.setAttribute('aria-label', this._map._getUIString('LogoControl.Title'));\n        anchor.setAttribute('rel', 'noopener nofollow');\n        this._container.appendChild(anchor);\n        this._container.style.display = 'block';\n\n        this._map.on('resize', this._updateCompact);\n        this._updateCompact();\n\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('resize', this._updateCompact);\n        this._map = undefined;\n        this._compact = undefined;\n    }\n\n    _updateCompact = () => {\n        const containerChildren = this._container.children;\n        if (containerChildren.length) {\n            const anchor = containerChildren[0];\n            if (this._map.getCanvasContainer().offsetWidth <= 640 || this._compact) {\n                if (this._compact !== false) {\n                    anchor.classList.add('maplibregl-compact');\n                }\n            } else {\n                anchor.classList.remove('maplibregl-compact');\n            }\n        }\n    };\n\n}\n", "export type TaskID = number;\n\ntype Task = {\n    callback: (timeStamp: number) => void;\n    id: TaskID;\n    cancelled: boolean;\n};\n\nexport class TaskQueue {\n    _queue: Array<Task>;\n    _id: TaskID;\n    _cleared: boolean;\n    _currentlyRunning: Array<Task> | false;\n\n    constructor()  {\n        this._queue = [];\n        this._id = 0;\n        this._cleared = false;\n        this._currentlyRunning = false;\n    }\n\n    add(callback: (timeStamp: number) => void): TaskID {\n        const id = ++this._id;\n        const queue = this._queue;\n        queue.push({callback, id, cancelled: false});\n        return id;\n    }\n\n    remove(id: TaskID) {\n        const running = this._currentlyRunning;\n        const queue = running ? this._queue.concat(running) : this._queue;\n        for (const task of queue) {\n            if (task.id === id) {\n                task.cancelled = true;\n                return;\n            }\n        }\n    }\n\n    run(timeStamp: number = 0) {\n        if (this._currentlyRunning) throw new Error('Attempting to run(), but is already running.');\n        const queue = this._currentlyRunning = this._queue;\n\n        // Tasks queued by callbacks in the current queue should be executed\n        // on the next run, not the current run.\n        this._queue = [];\n\n        for (const task of queue) {\n            if (task.cancelled) continue;\n            task.callback(timeStamp);\n            if (this._cleared) break;\n        }\n\n        this._cleared = false;\n        this._currentlyRunning = false;\n    }\n\n    clear() {\n        if (this._currentlyRunning) {\n            this._cleared = true;\n        }\n        this._queue = [];\n    }\n}\n", "import {createLayout} from '../util/struct_array';\n\nexport default createLayout([\n    {name: 'a_pos3d', type: 'Int16', components: 3}\n]);\n", "import {OverscaledTileID} from './tile_id';\nimport {Tile} from './tile';\nimport {EXTENT} from '../data/extent';\nimport {mat4} from 'gl-matrix';\nimport {Evented} from '../util/evented';\nimport type {Transform} from '../geo/transform';\nimport type {SourceCache} from '../source/source_cache';\nimport {Terrain} from '../render/terrain';\n\n/**\n * @internal\n * This class is a helper for the Terrain-class, it:\n *\n * - loads raster-dem tiles\n * - manages all renderToTexture tiles.\n * - caches previous rendered tiles.\n * - finds all necessary renderToTexture tiles for a OverscaledTileID area\n * - finds the corresponding raster-dem tile for OverscaledTileID\n */\nexport class TerrainSourceCache extends Evented {\n    /**\n     * source-cache for the raster-dem source.\n     */\n    sourceCache: SourceCache;\n    /**\n     * stores all render-to-texture tiles.\n     */\n    _tiles: {[_: string]: Tile};\n    /**\n     * contains a list of tileID-keys for the current scene. (only for performance)\n     */\n    _renderableTilesKeys: Array<string>;\n    /**\n     * raster-dem-tile for a TileID cache.\n     */\n    _sourceTileCache: {[_: string]: string};\n    /**\n     * minimum zoomlevel to render the terrain.\n     */\n    minzoom: number;\n    /**\n     * maximum zoomlevel to render the terrain.\n     */\n    maxzoom: number;\n    /**\n     * render-to-texture tileSize in scene.\n     */\n    tileSize: number;\n    /**\n     * raster-dem tiles will load for performance the actualZoom - deltaZoom zoom-level.\n     */\n    deltaZoom: number;\n\n    constructor(sourceCache: SourceCache) {\n        super();\n        this.sourceCache = sourceCache;\n        this._tiles = {};\n        this._renderableTilesKeys = [];\n        this._sourceTileCache = {};\n        this.minzoom = 0;\n        this.maxzoom = 22;\n        this.tileSize = 512;\n        this.deltaZoom = 1;\n        sourceCache.usedForTerrain = true;\n        sourceCache.tileSize = this.tileSize * 2 ** this.deltaZoom;\n    }\n\n    destruct() {\n        this.sourceCache.usedForTerrain = false;\n        this.sourceCache.tileSize = null;\n    }\n\n    /**\n     * Load Terrain Tiles, create internal render-to-texture tiles, free GPU memory.\n     * @param transform - the operation to do\n     * @param terrain - the terrain\n     */\n    update(transform: Transform, terrain: Terrain): void {\n        // load raster-dem tiles for the current scene.\n        this.sourceCache.update(transform, terrain);\n        // create internal render-to-texture tiles for the current scene.\n        this._renderableTilesKeys = [];\n        const keys = {};\n        for (const tileID of transform.coveringTiles({\n            tileSize: this.tileSize,\n            minzoom: this.minzoom,\n            maxzoom: this.maxzoom,\n            reparseOverscaled: false,\n            terrain\n        })) {\n            keys[tileID.key] = true;\n            this._renderableTilesKeys.push(tileID.key);\n            if (!this._tiles[tileID.key]) {\n                tileID.posMatrix = new Float64Array(16) as any;\n                mat4.ortho(tileID.posMatrix, 0, EXTENT, 0, EXTENT, 0, 1);\n                this._tiles[tileID.key] = new Tile(tileID, this.tileSize);\n            }\n        }\n        // free unused tiles\n        for (const key in this._tiles) {\n            if (!keys[key]) delete this._tiles[key];\n        }\n    }\n\n    /**\n     * Free render to texture cache\n     * @param tileID - optional, free only corresponding to tileID.\n     */\n    freeRtt(tileID?: OverscaledTileID) {\n        for (const key in this._tiles) {\n            const tile = this._tiles[key];\n            if (!tileID || tile.tileID.equals(tileID) || tile.tileID.isChildOf(tileID) || tileID.isChildOf(tile.tileID))\n                tile.rtt = [];\n        }\n    }\n\n    /**\n     * get a list of tiles, which are loaded and should be rendered in the current scene\n     * @returns the renderable tiles\n     */\n    getRenderableTiles(): Array<Tile> {\n        return this._renderableTilesKeys.map(key => this.getTileByID(key));\n    }\n\n    /**\n     * get terrain tile by the TileID key\n     * @param id - the tile id\n     * @returns the tile\n     */\n    getTileByID(id: string): Tile {\n        return this._tiles[id];\n    }\n\n    /**\n     * Searches for the corresponding current renderable terrain-tiles\n     * @param tileID - the tile to look for\n     * @returns the tiles that were found\n     */\n    getTerrainCoords(tileID: OverscaledTileID): Record<string, OverscaledTileID> {\n        const coords = {};\n        for (const key of this._renderableTilesKeys) {\n            const _tileID = this._tiles[key].tileID;\n            if (_tileID.canonical.equals(tileID.canonical)) {\n                const coord = tileID.clone();\n                coord.posMatrix = new Float64Array(16) as any;\n                mat4.ortho(coord.posMatrix, 0, EXTENT, 0, EXTENT, 0, 1);\n                coords[key] = coord;\n            } else if (_tileID.canonical.isChildOf(tileID.canonical)) {\n                const coord = tileID.clone();\n                coord.posMatrix = new Float64Array(16) as any;\n                const dz = _tileID.canonical.z - tileID.canonical.z;\n                const dx = _tileID.canonical.x - (_tileID.canonical.x >> dz << dz);\n                const dy = _tileID.canonical.y - (_tileID.canonical.y >> dz << dz);\n                const size = EXTENT >> dz;\n                mat4.ortho(coord.posMatrix, 0, size, 0, size, 0, 1);\n                mat4.translate(coord.posMatrix, coord.posMatrix, [-dx * size, -dy * size, 0]);\n                coords[key] = coord;\n            } else if (tileID.canonical.isChildOf(_tileID.canonical)) {\n                const coord = tileID.clone();\n                coord.posMatrix = new Float64Array(16) as any;\n                const dz = tileID.canonical.z - _tileID.canonical.z;\n                const dx = tileID.canonical.x - (tileID.canonical.x >> dz << dz);\n                const dy = tileID.canonical.y - (tileID.canonical.y >> dz << dz);\n                const size = EXTENT >> dz;\n                mat4.ortho(coord.posMatrix, 0, EXTENT, 0, EXTENT, 0, 1);\n                mat4.translate(coord.posMatrix, coord.posMatrix, [dx * size, dy * size, 0]);\n                mat4.scale(coord.posMatrix, coord.posMatrix, [1 / (2 ** dz), 1 / (2 ** dz), 0]);\n                coords[key] = coord;\n            }\n        }\n        return coords;\n    }\n\n    /**\n     * find the covering raster-dem tile\n     * @param tileID - the tile to look for\n     * @param searchForDEM - Optional parameter to search for (parent) sourcetiles with loaded dem.\n     * @returns the tile\n     */\n    getSourceTile(tileID: OverscaledTileID, searchForDEM?: boolean): Tile {\n        const source = this.sourceCache._source;\n        let z = tileID.overscaledZ - this.deltaZoom;\n        if (z > source.maxzoom) z = source.maxzoom;\n        if (z < source.minzoom) return null;\n        // cache for tileID to terrain-tileID\n        if (!this._sourceTileCache[tileID.key])\n            this._sourceTileCache[tileID.key] = tileID.scaledTo(z).key;\n        let tile = this.sourceCache.getTileByID(this._sourceTileCache[tileID.key]);\n        // during tile-loading phase look if parent tiles (with loaded dem) are available.\n        if (!(tile && tile.dem) && searchForDEM)\n            while (z >= source.minzoom && !(tile && tile.dem))\n                tile = this.sourceCache.getTileByID(tileID.scaledTo(z--).key);\n        return tile;\n    }\n\n    /**\n     * get a list of tiles, loaded after a specific time. This is used to update depth & coords framebuffers.\n     * @param time - the time\n     * @returns the relevant tiles\n     */\n    tilesAfterTime(time = Date.now()): Array<Tile> {\n        return Object.values(this._tiles).filter(t => t.timeAdded >= time);\n    }\n}\n", "\nimport {Tile} from '../source/tile';\nimport {mat4, vec2} from 'gl-matrix';\nimport {OverscaledTileID} from '../source/tile_id';\nimport {RGBAImage} from '../util/image';\nimport {warnOnce} from '../util/util';\nimport {Pos3dArray, TriangleIndexArray} from '../data/array_types.g';\nimport pos3dAttributes from '../data/pos3d_attributes';\nimport {SegmentVector} from '../data/segment';\nimport {Painter} from './painter';\nimport {Texture} from '../render/texture';\nimport type {Framebuffer} from '../gl/framebuffer';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from '../geo/mercator_coordinate';\nimport {TerrainSourceCache} from '../source/terrain_source_cache';\nimport {SourceCache} from '../source/source_cache';\nimport {EXTENT} from '../data/extent';\nimport type {TerrainSpecification} from '@maplibre/maplibre-gl-style-spec';\nimport {LngLat, earthRadius} from '../geo/lng_lat';\nimport {Mesh} from './mesh';\nimport {isInBoundsForZoomLngLat} from '../util/world_bounds';\n\n/**\n * @internal\n * A terrain GPU related object\n */\nexport type TerrainData = {\n    'u_depth': number;\n    'u_terrain': number;\n    'u_terrain_dim': number;\n    'u_terrain_matrix': mat4;\n    'u_terrain_unpack': number[];\n    'u_terrain_exaggeration': number;\n    texture: WebGLTexture;\n    depthTexture: WebGLTexture;\n    tile: Tile;\n}\n\n/**\n * @internal\n * This is the main class which handles most of the 3D Terrain logic. It has the following topics:\n *\n * 1. loads raster-dem tiles via the internal sourceCache this.sourceCache\n * 2. creates a depth-framebuffer, which is used to calculate the visibility of coordinates\n * 3. creates a coords-framebuffer, which is used the get to tile-coordinate for a screen-pixel\n * 4. stores all render-to-texture tiles in the this.sourceCache._tiles\n * 5. calculates the elevation for a specific tile-coordinate\n * 6. creates a terrain-mesh\n *\n * A note about the GPU resource-usage:\n *\n * Framebuffers:\n *\n * - one for the depth & coords framebuffer with the size of the map-div.\n * - one for rendering a tile to texture with the size of tileSize (= 512x512).\n *\n * Textures:\n *\n * - one texture for an empty raster-dem tile with size 1x1\n * - one texture for an empty depth-buffer, when terrain is disabled with size 1x1\n * - one texture for an each loaded raster-dem with size of the source.tileSize\n * - one texture for the coords-framebuffer with the size of the map-div.\n * - one texture for the depth-framebuffer with the size of the map-div.\n * - one texture for the encoded tile-coords with the size 2*tileSize (=1024x1024)\n * - finally for each render-to-texture tile (= this._tiles) a set of textures\n * for each render stack (The stack-concept is documented in painter.ts).\n *\n * Normally there exists 1-3 Textures per tile, depending on the stylesheet.\n * Each Textures has the size 2*tileSize (= 1024x1024). Also there exists a\n * cache of the last 150 newest rendered tiles.\n *\n */\nexport class Terrain {\n    /**\n     * The style this terrain corresponds to\n     */\n    painter: Painter;\n    /**\n     * the sourcecache this terrain is based on\n     */\n    sourceCache: TerrainSourceCache;\n    /**\n     * the TerrainSpecification object passed to this instance\n     */\n    options: TerrainSpecification;\n    /**\n     * define the meshSize per tile.\n     */\n    meshSize: number;\n    /**\n     * multiplicator for the elevation. Used to make terrain more \"extreme\".\n     */\n    exaggeration: number;\n    /**\n     * to not see pixels in the render-to-texture tiles it is good to render them bigger\n     * this number is the multiplicator (must be a power of 2) for the current tileSize.\n     * So to get good results with not too much memory footprint a value of 2 should be fine.\n     */\n    qualityFactor: number;\n    /**\n     * holds the framebuffer object in size of the screen to render the coords & depth into a texture.\n     */\n    _fbo: Framebuffer;\n    _fboCoordsTexture: Texture;\n    _fboDepthTexture: Texture;\n    _emptyDepthTexture: Texture;\n    /**\n     * GL Objects for the terrain-mesh\n     * The mesh is a regular mesh, which has the advantage that it can be reused for all tiles.\n     */\n    _mesh: Mesh;\n    /**\n     * coords index contains a list of tileID.keys. This index is used to identify\n     * the tile via the alpha-cannel in the coords-texture.\n     * As the alpha-channel has 1 Byte a max of 255 tiles can rendered without an error.\n     */\n    coordsIndex: Array<string>;\n    /**\n     * tile-coords encoded in the rgb channel, _coordsIndex is in the alpha-channel.\n     */\n    _coordsTexture: Texture;\n    /**\n     * accuracy of the coords. 2 * tileSize should be enough.\n     */\n    _coordsTextureSize: number;\n    /**\n     * variables for an empty dem texture, which is used while the raster-dem tile is loading.\n     */\n    _emptyDemUnpack: number[];\n    _emptyDemTexture: Texture;\n    _emptyDemMatrix: mat4;\n    /**\n     * as of overzooming of raster-dem tiles in high zoomlevels, this cache contains\n     * matrices to transform from vector-tile coords to raster-dem-tile coords.\n     */\n    _demMatrixCache: {[_: string]: { matrix: mat4; coord: OverscaledTileID }};\n\n    constructor(painter: Painter, sourceCache: SourceCache, options: TerrainSpecification) {\n        this.painter = painter;\n        this.sourceCache = new TerrainSourceCache(sourceCache);\n        this.options = options;\n        this.exaggeration = typeof options.exaggeration === 'number' ? options.exaggeration : 1.0;\n        this.qualityFactor = 2;\n        this.meshSize = 128;\n        this._demMatrixCache = {};\n        this.coordsIndex = [];\n        this._coordsTextureSize = 1024;\n    }\n\n    /**\n     * get the elevation-value from original dem-data for a given tile-coordinate\n     * @param tileID - the tile to get elevation for\n     * @param x - between 0 .. EXTENT\n     * @param y - between 0 .. EXTENT\n     * @param extent - optional, default 8192\n     * @returns the elevation\n     */\n    getDEMElevation(tileID: OverscaledTileID, x: number, y: number, extent: number = EXTENT): number {\n        if (!(x >= 0 && x < extent && y >= 0 && y < extent)) return 0;\n        const terrain = this.getTerrainData(tileID);\n        const dem = terrain.tile?.dem;\n        if (!dem)\n            return 0;\n\n        const pos = vec2.transformMat4([] as any, [x / extent * EXTENT, y / extent * EXTENT], terrain.u_terrain_matrix);\n        const coord = [pos[0] * dem.dim, pos[1] * dem.dim];\n\n        // bilinear interpolation\n        const cx = Math.floor(coord[0]),\n            cy = Math.floor(coord[1]),\n            tx = coord[0] - cx,\n            ty = coord[1] - cy;\n        return (\n            dem.get(cx, cy) * (1 - tx) * (1 - ty) +\n            dem.get(cx + 1, cy) * (tx) * (1 - ty) +\n            dem.get(cx, cy + 1) * (1 - tx) * (ty) +\n            dem.get(cx + 1, cy + 1) * (tx) * (ty)\n        );\n    }\n\n    /**\n     * Get the elevation for given {@link LngLat} in respect of exaggeration.\n     * @param lnglat - the location\n     * @param zoom - the zoom\n     * @returns the elevation\n     */\n    getElevationForLngLatZoom(lnglat: LngLat, zoom: number) {\n        if (!isInBoundsForZoomLngLat(zoom, lnglat.wrap())) return 0;\n        const {tileID, mercatorX, mercatorY} = this._getOverscaledTileIDFromLngLatZoom(lnglat, zoom);\n        return this.getElevation(tileID, mercatorX % EXTENT, mercatorY % EXTENT, EXTENT);\n    }\n\n    /**\n     * Get the elevation for given coordinate in respect of exaggeration.\n     * @param tileID - the tile id\n     * @param x - between 0 .. EXTENT\n     * @param y - between 0 .. EXTENT\n     * @param extent - optional, default 8192\n     * @returns the elevation\n     */\n    getElevation(tileID: OverscaledTileID, x: number, y: number, extent: number = EXTENT): number {\n        return this.getDEMElevation(tileID, x, y, extent) * this.exaggeration;\n    }\n\n    /**\n     * returns a Terrain Object for a tile. Unless the tile corresponds to data (e.g. tile is loading), return a flat dem object\n     * @param tileID - the tile to get the terrain for\n     * @returns the terrain data to use in the program\n     */\n    getTerrainData(tileID: OverscaledTileID): TerrainData {\n        // create empty DEM Objects, which will used while raster-dem tiles are loading.\n        // creates an empty depth-buffer texture which is needed, during the initialization process of the 3d mesh..\n        if (!this._emptyDemTexture) {\n            const context = this.painter.context;\n            const image = new RGBAImage({width: 1, height: 1}, new Uint8Array(1 * 4));\n            this._emptyDepthTexture = new Texture(context, image, context.gl.RGBA, {premultiply: false});\n            this._emptyDemUnpack = [0, 0, 0, 0];\n            this._emptyDemTexture = new Texture(context, new RGBAImage({width: 1, height: 1}), context.gl.RGBA, {premultiply: false});\n            this._emptyDemTexture.bind(context.gl.NEAREST, context.gl.CLAMP_TO_EDGE);\n            this._emptyDemMatrix = mat4.identity([] as any);\n        }\n        // find covering dem tile and prepare demTexture\n        const sourceTile = this.sourceCache.getSourceTile(tileID, true);\n        if (sourceTile && sourceTile.dem && (!sourceTile.demTexture || sourceTile.needsTerrainPrepare)) {\n            const context = this.painter.context;\n            sourceTile.demTexture = this.painter.getTileTexture(sourceTile.dem.stride);\n            if (sourceTile.demTexture) sourceTile.demTexture.update(sourceTile.dem.getPixels(), {premultiply: false});\n            else sourceTile.demTexture = new Texture(context, sourceTile.dem.getPixels(), context.gl.RGBA, {premultiply: false});\n            sourceTile.demTexture.bind(context.gl.NEAREST, context.gl.CLAMP_TO_EDGE);\n            sourceTile.needsTerrainPrepare = false;\n        }\n        // create matrix for lookup in dem data\n        const matrixKey = sourceTile && (sourceTile + sourceTile.tileID.key) + tileID.key;\n        if (matrixKey && !this._demMatrixCache[matrixKey]) {\n            const maxzoom = this.sourceCache.sourceCache._source.maxzoom;\n            let dz = tileID.canonical.z - sourceTile.tileID.canonical.z;\n            if (tileID.overscaledZ > tileID.canonical.z) {\n                if (tileID.canonical.z >= maxzoom) dz =  tileID.canonical.z - maxzoom;\n                else warnOnce('cannot calculate elevation if elevation maxzoom > source.maxzoom');\n            }\n            const dx = tileID.canonical.x - (tileID.canonical.x >> dz << dz);\n            const dy = tileID.canonical.y - (tileID.canonical.y >> dz << dz);\n            const demMatrix = mat4.fromScaling(new Float64Array(16) as any, [1 / (EXTENT << dz), 1 / (EXTENT << dz), 0]);\n            mat4.translate(demMatrix, demMatrix, [dx * EXTENT, dy * EXTENT, 0]);\n            this._demMatrixCache[tileID.key] = {matrix: demMatrix, coord: tileID};\n        }\n        // return uniform values & textures\n        return {\n            'u_depth': 2,\n            'u_terrain': 3,\n            'u_terrain_dim': sourceTile && sourceTile.dem && sourceTile.dem.dim || 1,\n            'u_terrain_matrix': matrixKey ? this._demMatrixCache[tileID.key].matrix : this._emptyDemMatrix,\n            'u_terrain_unpack': sourceTile && sourceTile.dem && sourceTile.dem.getUnpackVector() || this._emptyDemUnpack,\n            'u_terrain_exaggeration': this.exaggeration,\n            texture: (sourceTile && sourceTile.demTexture || this._emptyDemTexture).texture,\n            depthTexture: (this._fboDepthTexture || this._emptyDepthTexture).texture,\n            tile: sourceTile\n        };\n    }\n\n    /**\n     * get a framebuffer as big as the map-div, which will be used to render depth & coords into a texture\n     * @param texture - the texture\n     * @returns the frame buffer\n     */\n    getFramebuffer(texture: string): Framebuffer {\n        const painter = this.painter;\n        const width = painter.width / devicePixelRatio;\n        const height = painter.height / devicePixelRatio;\n        if (this._fbo && (this._fbo.width !== width || this._fbo.height !== height)) {\n            this._fbo.destroy();\n            this._fboCoordsTexture.destroy();\n            this._fboDepthTexture.destroy();\n            delete this._fbo;\n            delete this._fboDepthTexture;\n            delete this._fboCoordsTexture;\n        }\n        if (!this._fboCoordsTexture) {\n            this._fboCoordsTexture = new Texture(painter.context, {width, height, data: null}, painter.context.gl.RGBA, {premultiply: false});\n            this._fboCoordsTexture.bind(painter.context.gl.NEAREST, painter.context.gl.CLAMP_TO_EDGE);\n        }\n        if (!this._fboDepthTexture) {\n            this._fboDepthTexture = new Texture(painter.context, {width, height, data: null}, painter.context.gl.RGBA, {premultiply: false});\n            this._fboDepthTexture.bind(painter.context.gl.NEAREST, painter.context.gl.CLAMP_TO_EDGE);\n        }\n        if (!this._fbo) {\n            this._fbo = painter.context.createFramebuffer(width, height, true, false);\n            this._fbo.depthAttachment.set(painter.context.createRenderbuffer(painter.context.gl.DEPTH_COMPONENT16, width, height));\n        }\n        this._fbo.colorAttachment.set(texture === 'coords' ? this._fboCoordsTexture.texture : this._fboDepthTexture.texture);\n        return this._fbo;\n    }\n\n    /**\n     * create coords texture, needed to grab coordinates from canvas\n     * encode coords coordinate into 4 bytes:\n     *   - 8 lower bits for x\n     *   - 8 lower bits for y\n     *   - 4 higher bits for x\n     *   - 4 higher bits for y\n     *   - 8 bits for coordsIndex (1 .. 255) (= number of terraintile), is later setted in draw_terrain uniform value\n     * @returns the texture\n     */\n    getCoordsTexture(): Texture {\n        const context = this.painter.context;\n        if (this._coordsTexture) return this._coordsTexture;\n        const data = new Uint8Array(this._coordsTextureSize * this._coordsTextureSize * 4);\n        for (let y = 0, i = 0; y < this._coordsTextureSize; y++) for (let x = 0; x < this._coordsTextureSize; x++, i += 4) {\n            data[i + 0] = x & 255;\n            data[i + 1] = y & 255;\n            data[i + 2] = ((x >> 8) << 4) | (y >> 8);\n            data[i + 3] = 0;\n        }\n        const image = new RGBAImage({width: this._coordsTextureSize, height: this._coordsTextureSize}, new Uint8Array(data.buffer));\n        const texture = new Texture(context, image, context.gl.RGBA, {premultiply: false});\n        texture.bind(context.gl.NEAREST, context.gl.CLAMP_TO_EDGE);\n        this._coordsTexture = texture;\n        return texture;\n    }\n\n    /**\n     * Reads a pixel from the coords-framebuffer and translate this to mercator.\n     * @param p - Screen-Coordinate\n     * @returns mercator coordinate for a screen pixel\n     */\n    pointCoordinate(p: Point): MercatorCoordinate {\n        // First, ensure the coords framebuffer is up to date.\n        this.painter.maybeDrawDepthAndCoords(true);\n\n        const rgba = new Uint8Array(4);\n        const context = this.painter.context, gl = context.gl;\n        const px = Math.round(p.x * this.painter.pixelRatio / devicePixelRatio);\n        const py = Math.round(p.y * this.painter.pixelRatio / devicePixelRatio);\n        const fbHeight = Math.round(this.painter.height / devicePixelRatio);\n        // grab coordinate pixel from coordinates framebuffer\n        context.bindFramebuffer.set(this.getFramebuffer('coords').framebuffer);\n        gl.readPixels(px, fbHeight - py - 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, rgba);\n        context.bindFramebuffer.set(null);\n        // decode coordinates (encoding see getCoordsTexture)\n        const x = rgba[0] + ((rgba[2] >> 4) << 8);\n        const y = rgba[1] + ((rgba[2] & 15) << 8);\n        const tileID = this.coordsIndex[255 - rgba[3]];\n        const tile = tileID && this.sourceCache.getTileByID(tileID);\n        if (!tile) return null;\n        const coordsSize = this._coordsTextureSize;\n        const worldSize = (1 << tile.tileID.canonical.z) * coordsSize;\n        return new MercatorCoordinate(\n            (tile.tileID.canonical.x * coordsSize + x) / worldSize + tile.tileID.wrap,\n            (tile.tileID.canonical.y * coordsSize + y) / worldSize,\n            this.getElevation(tile.tileID, x, y, coordsSize)\n        );\n    }\n\n    /**\n     * Reads the depth value from the depth-framebuffer at a given screen pixel\n     * @param p - Screen coordinate\n     * @returns depth value in clip space (between 0 and 1)\n     */\n\n    depthAtPoint(p: Point): number {\n        const rgba = new Uint8Array(4);\n        const context = this.painter.context, gl = context.gl;\n        context.bindFramebuffer.set(this.getFramebuffer('depth').framebuffer);\n        gl.readPixels(p.x, this.painter.height / devicePixelRatio - p.y - 1, 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, rgba);\n        context.bindFramebuffer.set(null);\n        // decode coordinates (encoding see terran_depth.fragment.glsl)\n        const depthValue = (rgba[0] / (256 * 256 * 256) + rgba[1] / (256 * 256) + rgba[2] / 256 + rgba[3]) / 256;\n        return depthValue;\n    }\n\n    /**\n     * create a regular mesh which will be used by all terrain-tiles\n     * @returns the created regular mesh\n     */\n    getTerrainMesh(): Mesh {\n        if (this._mesh) return this._mesh;\n        const context = this.painter.context;\n        const vertexArray = new Pos3dArray();\n        const indexArray = new TriangleIndexArray();\n        const meshSize = this.meshSize;\n        const delta = EXTENT / meshSize;\n        const meshSize2 = meshSize * meshSize;\n        for (let y = 0; y <= meshSize; y++) for (let x = 0; x <= meshSize; x++)\n            vertexArray.emplaceBack(x * delta, y * delta, 0);\n        for (let y = 0; y < meshSize2; y += meshSize + 1) for (let x = 0; x < meshSize; x++) {\n            indexArray.emplaceBack(x + y, meshSize + x + y + 1, meshSize + x + y + 2);\n            indexArray.emplaceBack(x + y, meshSize + x + y + 2, x + y + 1);\n        }\n        // add an extra frame around the mesh to avoid stiching on tile boundaries with different zoomlevels\n        // first code-block is for top-bottom frame and second for left-right frame\n        const offsetTop = vertexArray.length, offsetBottom = offsetTop + (meshSize + 1) * 2;\n        for (const y of [0, 1]) for (let x = 0; x <= meshSize; x++) for (const z of [0, 1])\n            vertexArray.emplaceBack(x * delta, y * EXTENT, z);\n        for (let x = 0; x < meshSize * 2; x += 2) {\n            indexArray.emplaceBack(offsetBottom + x, offsetBottom + x + 1, offsetBottom + x + 3);\n            indexArray.emplaceBack(offsetBottom + x, offsetBottom + x + 3, offsetBottom + x + 2);\n            indexArray.emplaceBack(offsetTop + x, offsetTop + x + 3, offsetTop + x + 1);\n            indexArray.emplaceBack(offsetTop + x, offsetTop + x + 2, offsetTop + x + 3);\n        }\n        const offsetLeft = vertexArray.length, offsetRight = offsetLeft + (meshSize + 1) * 2;\n        for (const x of [0, 1]) for (let y = 0; y <= meshSize; y++) for (const z of [0, 1])\n            vertexArray.emplaceBack(x * EXTENT, y * delta, z);\n        for (let y = 0; y < meshSize * 2; y += 2) {\n            indexArray.emplaceBack(offsetLeft + y, offsetLeft + y + 1, offsetLeft + y + 3);\n            indexArray.emplaceBack(offsetLeft + y, offsetLeft + y + 3, offsetLeft + y + 2);\n            indexArray.emplaceBack(offsetRight + y, offsetRight + y + 3, offsetRight + y + 1);\n            indexArray.emplaceBack(offsetRight + y, offsetRight + y + 2, offsetRight + y + 3);\n        }\n        this._mesh = new Mesh(\n            context.createVertexBuffer(vertexArray, pos3dAttributes.members),\n            context.createIndexBuffer(indexArray),\n            SegmentVector.simpleSegment(0, 0, vertexArray.length, indexArray.length)\n        );\n        return this._mesh;\n    }\n\n    /**\n     * Calculates a height of the frame around the terrain-mesh to avoid stiching between\n     * tile boundaries in different zoomlevels.\n     * @param zoom - current zoomlevel\n     * @returns the elevation delta in meters\n     */\n    getMeshFrameDelta(zoom: number): number {\n        // divide by 5 is evaluated by trial & error to get a frame in the right height\n        return 2 * Math.PI * earthRadius / Math.pow(2, zoom) / 5;\n    }\n\n    getMinTileElevationForLngLatZoom(lnglat: LngLat, zoom: number) {\n        const {tileID} = this._getOverscaledTileIDFromLngLatZoom(lnglat, zoom);\n        return this.getMinMaxElevation(tileID).minElevation ?? 0;\n    }\n\n    /**\n     * Get the minimum and maximum elevation contained in a tile. This includes any\n     * exaggeration included in the terrain.\n     *\n     * @param tileID - ID of the tile to be used as a source for the min/max elevation\n     * @returns the minimum and maximum elevation found in the tile, including the terrain's\n     * exaggeration\n     */\n    getMinMaxElevation(tileID: OverscaledTileID): {minElevation: number | null; maxElevation: number | null} {\n        const tile = this.getTerrainData(tileID).tile;\n        const minMax = {minElevation: null, maxElevation: null};\n        if (tile && tile.dem) {\n            minMax.minElevation = tile.dem.min * this.exaggeration;\n            minMax.maxElevation = tile.dem.max * this.exaggeration;\n        }\n        return minMax;\n    }\n\n    _getOverscaledTileIDFromLngLatZoom(lnglat: LngLat, zoom: number): { tileID: OverscaledTileID; mercatorX: number; mercatorY: number} {\n        const mercatorCoordinate = MercatorCoordinate.fromLngLat(lnglat.wrap());\n        const worldSize = (1 << zoom) * EXTENT;\n        const mercatorX = mercatorCoordinate.x * worldSize;\n        const mercatorY = mercatorCoordinate.y * worldSize;\n        const tileX = Math.floor(mercatorX / EXTENT), tileY = Math.floor(mercatorY / EXTENT);\n        const tileID = new OverscaledTileID(zoom, 0, zoom, tileX, tileY);\n        return {\n            tileID,\n            mercatorX,\n            mercatorY\n        };\n    }\n}\n", "import {Texture} from '../render/texture';\nimport {Context} from './context';\nimport {Framebuffer} from './framebuffer';\n\nexport type PoolObject = {\n    id: number;\n    fbo: Framebuffer;\n    texture: Texture;\n    stamp: number;\n    inUse: boolean;\n};\n/**\n * @internal\n * `RenderPool` is a resource pool for textures and framebuffers\n */\nexport class RenderPool {\n    private _objects: Array<PoolObject>;\n    /**\n     * An index array of recently used pool objects.\n     * Items that are used recently are last in the array\n     */\n    private _recentlyUsed: Array<number>;\n    private _stamp: number;\n\n    constructor(\n        private readonly _context: Context,\n        private readonly _size: number,\n        private readonly _tileSize: number) {\n        this._objects = [];\n        this._recentlyUsed = [];\n        this._stamp = 0;\n    }\n\n    public destruct() {\n        for (const obj of this._objects) {\n            obj.texture.destroy();\n            obj.fbo.destroy();\n        }\n    }\n\n    private _createObject(id: number): PoolObject {\n        const fbo = this._context.createFramebuffer(this._tileSize, this._tileSize, true, true);\n        const texture = new Texture(this._context, {width: this._tileSize, height: this._tileSize, data: null}, this._context.gl.RGBA);\n        texture.bind(this._context.gl.LINEAR, this._context.gl.CLAMP_TO_EDGE);\n        fbo.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL, this._tileSize, this._tileSize));\n        fbo.colorAttachment.set(texture.texture);\n        return {id, fbo, texture, stamp: -1, inUse: false};\n    }\n\n    public getObjectForId(id: number): PoolObject {\n        return this._objects[id];\n    }\n\n    public useObject(obj: PoolObject) {\n        obj.inUse = true;\n        this._recentlyUsed = this._recentlyUsed.filter(id => obj.id !== id);\n        this._recentlyUsed.push(obj.id);\n    }\n\n    public stampObject(obj: PoolObject) {\n        obj.stamp = ++this._stamp;\n    }\n\n    public getOrCreateFreeObject(): PoolObject {\n        // check for free existing object\n        for (const id of this._recentlyUsed) {\n            if (!this._objects[id].inUse)\n                return this._objects[id];\n        }\n        if (this._objects.length >= this._size)\n            throw new Error('No free RenderPool available, call freeAllObjects() required!');\n        // create new object\n        const obj = this._createObject(this._objects.length);\n        this._objects.push(obj);\n        return obj;\n    }\n\n    public freeObject(obj: PoolObject) {\n        obj.inUse = false;\n    }\n\n    public freeAllObjects() {\n        for (const obj of this._objects)\n            this.freeObject(obj);\n    }\n\n    public isFull(): boolean {\n        if (this._objects.length < this._size) {\n            return false;\n        }\n        return this._objects.some(o => !o.inUse) === false;\n    }\n}\n", "import {Painter} from './painter';\nimport {Tile} from '../source/tile';\nimport {Color} from '@maplibre/maplibre-gl-style-spec';\nimport {OverscaledTileID} from '../source/tile_id';\nimport {drawTerrain} from './draw_terrain';\nimport {Style} from '../style/style';\nimport {Terrain} from './terrain';\nimport {RenderPool} from '../gl/render_pool';\nimport {Texture} from './texture';\nimport type {StyleLayer} from '../style/style_layer';\n\n/**\n * lookup table which layers should rendered to texture\n */\nconst LAYERS: { [keyof in StyleLayer['type']]?: boolean } = {\n    background: true,\n    fill: true,\n    line: true,\n    raster: true,\n    hillshade: true\n};\n\n/**\n * @internal\n * A helper class to help define what should be rendered to texture and how\n */\nexport class RenderToTexture {\n    painter: Painter;\n    terrain: Terrain;\n    pool: RenderPool;\n    /**\n     * coordsDescendingInv contains a list of all tiles which should be rendered for one render-to-texture tile\n     * e.g. render 4 raster-tiles with size 256px to the 512px render-to-texture tile\n     */\n    _coordsDescendingInv: {[_: string]: {[_:string]: Array<OverscaledTileID>}};\n    /**\n     * create a string representation of all to tiles rendered to render-to-texture tiles\n     * this string representation is used to check if tile should be re-rendered.\n     */\n    _coordsDescendingInvStr: {[_: string]: {[_:string]: string}};\n    /**\n     * store for render-stacks\n     * a render stack is a set of layers which should be rendered into one texture\n     * every stylesheet can have multiple stacks. A new stack is created if layers which should\n     * not rendered to texture sit between layers which should rendered to texture. e.g. hillshading or symbols\n     */\n    _stacks: Array<Array<string>>;\n    /**\n     * remember the previous processed layer to check if a new stack is needed\n     */\n    _prevType: string;\n    /**\n     * a list of tiles that can potentially rendered\n     */\n    _renderableTiles: Array<Tile>;\n    /**\n     * a list of tiles that should be rendered to screen in the next render-call\n     */\n    _rttTiles: Array<Tile>;\n    /**\n     * a list of all layer-ids which should be rendered\n     */\n    _renderableLayerIds: Array<string>;\n\n    constructor(painter: Painter, terrain: Terrain) {\n        this.painter = painter;\n        this.terrain = terrain;\n        this.pool = new RenderPool(painter.context, 30, terrain.sourceCache.tileSize * terrain.qualityFactor);\n    }\n\n    destruct() {\n        this.pool.destruct();\n    }\n\n    getTexture(tile: Tile): Texture {\n        return this.pool.getObjectForId(tile.rtt[this._stacks.length - 1].id).texture;\n    }\n\n    prepareForRender(style: Style, zoom: number) {\n        this._stacks = [];\n        this._prevType = null;\n        this._rttTiles = [];\n        this._renderableTiles = this.terrain.sourceCache.getRenderableTiles();\n        this._renderableLayerIds = style._order.filter(id => !style._layers[id].isHidden(zoom));\n\n        this._coordsDescendingInv = {};\n        for (const id in style.sourceCaches) {\n            this._coordsDescendingInv[id] = {};\n            const tileIDs = style.sourceCaches[id].getVisibleCoordinates();\n            for (const tileID of tileIDs) {\n                const keys = this.terrain.sourceCache.getTerrainCoords(tileID);\n                for (const key in keys) {\n                    if (!this._coordsDescendingInv[id][key]) this._coordsDescendingInv[id][key] = [];\n                    this._coordsDescendingInv[id][key].push(keys[key]);\n                }\n            }\n        }\n\n        this._coordsDescendingInvStr = {};\n        for (const id of style._order) {\n            const layer = style._layers[id], source = layer.source;\n            if (LAYERS[layer.type]) {\n                if (!this._coordsDescendingInvStr[source]) {\n                    this._coordsDescendingInvStr[source] = {};\n                    for (const key in this._coordsDescendingInv[source])\n                        this._coordsDescendingInvStr[source][key] = this._coordsDescendingInv[source][key].map(c => c.key).sort().join();\n                }\n            }\n        }\n\n        // check tiles to render\n        for (const tile of this._renderableTiles) {\n            for (const source in this._coordsDescendingInvStr) {\n                // rerender if there are more coords to render than in the last rendering\n                const coords = this._coordsDescendingInvStr[source][tile.tileID.key];\n                if (coords && coords !== tile.rttCoords[source]) tile.rtt = [];\n            }\n        }\n    }\n\n    /**\n     * due that switching textures is relatively slow, the render\n     * layer-by-layer context is not practicable. To bypass this problem\n     * this lines of code stack all layers and later render all at once.\n     * Because of the stylesheet possibility to mixing render-to-texture layers\n     * and 'live'-layers (f.e. symbols) it is necessary to create more stacks. For example\n     * a symbol-layer is in between of fill-layers.\n     * @param layer - the layer to render\n     * @returns if true layer is rendered to texture, otherwise false\n     */\n    renderLayer(layer: StyleLayer): boolean {\n        if (layer.isHidden(this.painter.transform.zoom)) return false;\n\n        const type = layer.type;\n        const painter = this.painter;\n        const isLastLayer = this._renderableLayerIds[this._renderableLayerIds.length - 1] === layer.id;\n\n        // remember background, fill, line & raster layer to render into a stack\n        if (LAYERS[type]) {\n            // create a new stack if previous layer was not rendered to texture (f.e. symbols)\n            if (!this._prevType || !LAYERS[this._prevType]) this._stacks.push([]);\n            // push current render-to-texture layer to render-stack\n            this._prevType = type;\n            this._stacks[this._stacks.length - 1].push(layer.id);\n            // rendering is done later, all in once\n            if (!isLastLayer) return true;\n        }\n\n        // in case a stack is finished render all collected stack-layers into a texture\n        if (LAYERS[this._prevType] || (LAYERS[type] && isLastLayer)) {\n            this._prevType = type;\n            const stack = this._stacks.length - 1, layers = this._stacks[stack] || [];\n            for (const tile of this._renderableTiles) {\n                // if render pool is full draw current tiles to screen and free pool\n                if (this.pool.isFull()) {\n                    drawTerrain(this.painter, this.terrain, this._rttTiles);\n                    this._rttTiles = [];\n                    this.pool.freeAllObjects();\n                }\n                this._rttTiles.push(tile);\n                // check for cached PoolObject\n                if (tile.rtt[stack]) {\n                    const obj = this.pool.getObjectForId(tile.rtt[stack].id);\n                    if (obj.stamp === tile.rtt[stack].stamp) {\n                        this.pool.useObject(obj);\n                        continue;\n                    }\n                }\n                // get free PoolObject\n                const obj = this.pool.getOrCreateFreeObject();\n                this.pool.useObject(obj);\n                this.pool.stampObject(obj);\n                tile.rtt[stack] = {id: obj.id, stamp: obj.stamp};\n                // prepare PoolObject for rendering\n                painter.context.bindFramebuffer.set(obj.fbo.framebuffer);\n                painter.context.clear({color: Color.transparent, stencil: 0});\n                painter.currentStencilSource = undefined;\n                for (let l = 0; l < layers.length; l++) {\n                    const layer = painter.style._layers[layers[l]];\n                    const coords = layer.source ? this._coordsDescendingInv[layer.source][tile.tileID.key] : [tile.tileID];\n                    painter.context.viewport.set([0, 0, obj.fbo.width, obj.fbo.height]);\n                    painter._renderTileClippingMasks(layer, coords);\n                    painter.renderLayer(painter, painter.style.sourceCaches[layer.source], layer, coords);\n                    if (layer.source) tile.rttCoords[layer.source] = this._coordsDescendingInvStr[layer.source][tile.tileID.key];\n                }\n            }\n            drawTerrain(this.painter, this.terrain, this._rttTiles);\n            this._rttTiles = [];\n            this.pool.freeAllObjects();\n\n            return LAYERS[type];\n        }\n\n        return false;\n    }\n\n}\n", "export const defaultLocale = {\n    'AttributionControl.ToggleAttribution': 'Toggle attribution',\n    'AttributionControl.MapFeedback': 'Map feedback',\n    'FullscreenControl.Enter': 'Enter fullscreen',\n    'FullscreenControl.Exit': 'Exit fullscreen',\n    'GeolocateControl.FindMyLocation': 'Find my location',\n    'GeolocateControl.LocationNotAvailable': 'Location not available',\n    'LogoControl.Title': 'MapLibre logo',\n    'Map.Title': 'Map',\n    'Marker.Title': 'Map marker',\n    'NavigationControl.ResetBearing': 'Reset bearing to north',\n    'NavigationControl.ZoomIn': 'Zoom in',\n    'NavigationControl.ZoomOut': 'Zoom out',\n    'Popup.Close': 'Close popup',\n    'ScaleControl.Feet': 'ft',\n    'ScaleControl.Meters': 'm',\n    'ScaleControl.Kilometers': 'km',\n    'ScaleControl.Miles': 'mi',\n    'ScaleControl.NauticalMiles': 'nm',\n    'TerrainControl.Enable': 'Enable terrain',\n    'TerrainControl.Disable': 'Disable terrain',\n    'CooperativeGesturesHandler.WindowsHelpText': 'Use Ctrl + scroll to zoom the map',\n    'CooperativeGesturesHandler.MacHelpText': 'Use â + scroll to zoom the map',\n    'CooperativeGesturesHandler.MobileHelpText': 'Use two fingers to move the map',\n};\n", "import {extend, warnOnce, uniqueId, isImageBitmap, Complete} from '../util/util';\nimport {browser} from '../util/browser';\nimport {DOM} from '../util/dom';\nimport packageJSON from '../../package.json' with {type: 'json'};\nimport {GetResourceResponse, getJSON} from '../util/ajax';\nimport {ImageRequest} from '../util/image_request';\nimport {RequestManager, ResourceType} from '../util/request_manager';\nimport {Style, StyleSwapOptions} from '../style/style';\nimport {EvaluationParameters} from '../style/evaluation_parameters';\nimport {Painter} from '../render/painter';\nimport {Transform} from '../geo/transform';\nimport {Hash} from './hash';\nimport {HandlerManager} from './handler_manager';\nimport {Camera, CameraOptions, CameraUpdateTransformFunction, FitBoundsOptions} from './camera';\nimport {LngLat} from '../geo/lng_lat';\nimport {LngLatBounds} from '../geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {AttributionControl, AttributionControlOptions, defaultAttributionControlOptions} from './control/attribution_control';\nimport {LogoControl} from './control/logo_control';\nimport {RGBAImage} from '../util/image';\nimport {Event, ErrorEvent, Listener} from '../util/evented';\nimport {MapEventType, MapLayerEventType, MapMouseEvent, MapSourceDataEvent, MapStyleDataEvent} from './events';\nimport {TaskQueue} from '../util/task_queue';\nimport {throttle} from '../util/throttle';\nimport {webpSupported} from '../util/webp_supported';\nimport {PerformanceMarkers, PerformanceUtils} from '../util/performance';\nimport {Source} from '../source/source';\nimport {StyleLayer} from '../style/style_layer';\nimport {Terrain} from '../render/terrain';\nimport {RenderToTexture} from '../render/render_to_texture';\nimport {config} from '../util/config';\nimport {defaultLocale} from './default_locale';\n\nimport type {RequestTransformFunction} from '../util/request_manager';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {LngLatBoundsLike} from '../geo/lng_lat_bounds';\nimport type {AddLayerObject, FeatureIdentifier, StyleOptions, StyleSetterOptions} from '../style/style';\nimport type {MapDataEvent} from './events';\nimport type {StyleImage, StyleImageInterface, StyleImageMetadata} from '../style/style_image';\nimport type {PointLike} from './camera';\nimport type {ScrollZoomHandler} from './handler/scroll_zoom';\nimport type {BoxZoomHandler} from './handler/box_zoom';\nimport type {AroundCenterOptions, TwoFingersTouchPitchHandler} from './handler/two_fingers_touch';\nimport type {DragRotateHandler} from './handler/shim/drag_rotate';\nimport type {DragPanHandler, DragPanOptions} from './handler/shim/drag_pan';\nimport type {CooperativeGesturesHandler, GestureOptions} from './handler/cooperative_gestures';\nimport type {KeyboardHandler} from './handler/keyboard';\nimport type {DoubleClickZoomHandler} from './handler/shim/dblclick_zoom';\nimport type {TwoFingersTouchZoomRotateHandler} from './handler/shim/two_fingers_touch';\nimport type {TaskID} from '../util/task_queue';\nimport type {\n    FilterSpecification,\n    StyleSpecification,\n    LightSpecification,\n    SourceSpecification,\n    TerrainSpecification,\n    SkySpecification\n} from '@maplibre/maplibre-gl-style-spec';\nimport type {CanvasSourceSpecification} from '../source/canvas_source';\nimport type {MapGeoJSONFeature} from '../util/vectortile_to_geojson';\nimport type {ControlPosition, IControl} from './control/control';\nimport type {QueryRenderedFeaturesOptions, QuerySourceFeatureOptions} from '../source/query_features';\n\nconst version = packageJSON.version;\n\n/**\n * The {@link Map} options object.\n */\nexport type MapOptions = {\n    /**\n     * If `true`, the map's position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page's URL.\n     * For example, `http://path/to/my/page.html#2.59/39.26/53.07/-24.1/60`.\n     * An additional string may optionally be provided to indicate a parameter-styled hash,\n     * e.g. http://path/to/my/page.html#map=2.59/39.26/53.07/-24.1/60&foo=bar, where foo\n     * is a custom parameter and bar is an arbitrary hash distinct from the map hash.\n     * @defaultValue false\n     */\n    hash?: boolean | string;\n    /**\n     * If `false`, no mouse, touch, or keyboard listeners will be attached to the map, so it will not respond to interaction.\n     * @defaultValue true\n     */\n    interactive?: boolean;\n    /**\n     * The HTML element in which MapLibre GL JS will render the map, or the element's string `id`. The specified element must have no children.\n     */\n    container: HTMLElement | string;\n    /**\n     * The threshold, measured in degrees, that determines when the map's\n     * bearing will snap to north. For example, with a `bearingSnap` of 7, if the user rotates\n     * the map within 7 degrees of north, the map will automatically snap to exact north.\n     * @defaultValue 7\n     */\n    bearingSnap?: number;\n    /**\n     * If set, an {@link AttributionControl} will be added to the map with the provided options.\n     * To disable the attribution control, pass `false`.\n     * Note: showing the logo of MapLibre is not required for using MapLibre.\n     * @defaultValue compact: true, customAttribution: \"MapLibre ...\".\n     */\n    attributionControl?: false | AttributionControlOptions;\n    /**\n     * If `true`, the MapLibre logo will be shown.\n     */\n    maplibreLogo?: boolean;\n    /**\n     * A string representing the position of the MapLibre wordmark on the map. Valid options are `top-left`,`top-right`, `bottom-left`, or `bottom-right`.\n     * @defaultValue 'bottom-left'\n     */\n    logoPosition?: ControlPosition;\n    /**\n     * If `true`, map creation will fail if the performance of MapLibre GL JS would be dramatically worse than expected\n     * (i.e. a software renderer would be used).\n     * @defaultValue false\n     */\n    failIfMajorPerformanceCaveat?: boolean;\n    /**\n     * If `true`, the map's canvas can be exported to a PNG using `map.getCanvas().toDataURL()`. This is `false` by default as a performance optimization.\n     * @defaultValue false\n     */\n    preserveDrawingBuffer?: boolean;\n    /**\n     * If `true`, the gl context will be created with MSAA antialiasing, which can be useful for antialiasing custom layers.\n     * Disabled by default as a performance optimization.\n     */\n    antialias?: boolean;\n    /**\n     * If `false`, the map won't attempt to re-request tiles once they expire per their HTTP `cacheControl`/`expires` headers.\n     * @defaultValue true\n     */\n    refreshExpiredTiles?: boolean;\n    /**\n     * If set, the map will be constrained to the given bounds.\n     */\n    maxBounds?: LngLatBoundsLike;\n    /**\n     * If `true`, the \"scroll to zoom\" interaction is enabled. {@link AroundCenterOptions} are passed as options to {@link ScrollZoomHandler#enable}.\n     * @defaultValue true\n     */\n    scrollZoom?: boolean | AroundCenterOptions;\n    /**\n     * The minimum zoom level of the map (0-24).\n     * @defaultValue 0\n     */\n    minZoom?: number | null;\n    /**\n     * The maximum zoom level of the map (0-24).\n     * @defaultValue 22\n     */\n    maxZoom?: number | null;\n    /**\n     * The minimum pitch of the map (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * @defaultValue 0\n     */\n    minPitch?: number | null;\n    /**\n     * The maximum pitch of the map (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * @defaultValue 60\n     */\n    maxPitch?: number | null;\n    /**\n     * If `true`, the \"box zoom\" interaction is enabled (see {@link BoxZoomHandler}).\n     * @defaultValue true\n     */\n    boxZoom?: boolean;\n    /**\n     * If `true`, the \"drag to rotate\" interaction is enabled (see {@link DragRotateHandler}).\n     * @defaultValue true\n     */\n    dragRotate?: boolean;\n    /**\n     * If `true`, the \"drag to pan\" interaction is enabled. An `Object` value is passed as options to {@link DragPanHandler#enable}.\n     * @defaultValue true\n     */\n    dragPan?: boolean | DragPanOptions;\n    /**\n     * If `true`, keyboard shortcuts are enabled (see {@link KeyboardHandler}).\n     * @defaultValue true\n     */\n    keyboard?: boolean;\n    /**\n     * If `true`, the \"double click to zoom\" interaction is enabled (see {@link DoubleClickZoomHandler}).\n     * @defaultValue true\n     */\n    doubleClickZoom?: boolean;\n    /**\n     * If `true`, the \"pinch to rotate and zoom\" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchZoomRotateHandler#enable}.\n     * @defaultValue true\n     */\n    touchZoomRotate?: boolean | AroundCenterOptions;\n    /**\n     * If `true`, the \"drag to pitch\" interaction is enabled. An `Object` value is passed as options to {@link TwoFingersTouchPitchHandler#enable}.\n     * @defaultValue true\n     */\n    touchPitch?: boolean | AroundCenterOptions;\n    /**\n     * If `true` or set to an options object, the map is only accessible on desktop while holding Command/Ctrl and only accessible on mobile with two fingers. Interacting with the map using normal gestures will trigger an informational screen. With this option enabled, \"drag to pitch\" requires a three-finger gesture. Cooperative gestures are disabled when a map enters fullscreen using {@link FullscreenControl}.\n     * @defaultValue false\n     */\n    cooperativeGestures?: GestureOptions;\n    /**\n     * If `true`, the map will automatically resize when the browser window resizes.\n     * @defaultValue true\n     */\n    trackResize?: boolean;\n    /**\n     * The initial geographical centerpoint of the map. If `center` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `[0, 0]` Note: MapLibre GL JS uses longitude, latitude coordinate order (as opposed to latitude, longitude) to match GeoJSON.\n     * @defaultValue [0, 0]\n     */\n    center?: LngLatLike;\n    /**\n     * The initial zoom level of the map. If `zoom` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.\n     * @defaultValue 0\n     */\n    zoom?: number;\n    /**\n     * The initial bearing (rotation) of the map, measured in degrees counter-clockwise from north. If `bearing` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`.\n     * @defaultValue 0\n     */\n    bearing?: number;\n    /**\n     * The initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-85). If `pitch` is not specified in the constructor options, MapLibre GL JS will look for it in the map's style object. If it is not specified in the style, either, it will default to `0`. Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * @defaultValue 0\n     */\n    pitch?: number;\n    /**\n     * If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:\n     *\n     * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire\n     * container, there will be blank space beyond 180 and -180 degrees longitude.\n     * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the\n     * map and the other on the left edge of the map) at every zoom level.\n     * @defaultValue true\n     */\n    renderWorldCopies?: boolean;\n    /**\n     * The maximum number of tiles stored in the tile cache for a given source. If omitted, the cache will be dynamically sized based on the current viewport which can be set using `maxTileCacheZoomLevels` constructor options.\n     * @defaultValue null\n     */\n    maxTileCacheSize?: number | null;\n    /**\n     * The maximum number of zoom levels for which to store tiles for a given source. Tile cache dynamic size is calculated by multiplying `maxTileCacheZoomLevels` with the approximate number of tiles in the viewport for a given source.\n     * @defaultValue 5\n     */\n    maxTileCacheZoomLevels?: number;\n    /**\n     * A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.\n     * Expected to return an object with a `url` property and optionally `headers` and `credentials` properties.\n     * @defaultValue null\n     */\n    transformRequest?: RequestTransformFunction | null;\n    /**\n     * A callback run before the map's camera is moved due to user input or animation. The callback can be used to modify the new center, zoom, pitch and bearing.\n     * Expected to return an object containing center, zoom, pitch or bearing values to overwrite.\n     * @defaultValue null\n     */\n    transformCameraUpdate?: CameraUpdateTransformFunction | null;\n    /**\n     * A patch to apply to the default localization table for UI strings, e.g. control tooltips. The `locale` object maps namespaced UI string IDs to translated strings in the target language; see `src/ui/default_locale.js` for an example with all supported string IDs. The object may specify all UI strings (thereby adding support for a new translation) or only a subset of strings (thereby patching the default translation table).\n     * @defaultValue null\n     */\n    locale?: any;\n    /**\n     * Controls the duration of the fade-in/fade-out animation for label collisions after initial map load, in milliseconds. This setting affects all symbol layers. This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.\n     * @defaultValue 300\n     */\n    fadeDuration?: number;\n    /**\n     * If `true`, symbols from multiple sources can collide with each other during collision detection. If `false`, collision detection is run separately for the symbols in each source.\n     * @defaultValue true\n     */\n    crossSourceCollisions?: boolean;\n    /**\n     * If `true`, Resource Timing API information will be collected for requests made by GeoJSON and Vector Tile web workers (this information is normally inaccessible from the main Javascript thread). Information will be returned in a `resourceTiming` property of relevant `data` events.\n     * @defaultValue false\n     */\n    collectResourceTiming?: boolean;\n    /**\n     * The max number of pixels a user can shift the mouse pointer during a click for it to be considered a valid click (as opposed to a mouse drag).\n     * @defaultValue 3\n     */\n    clickTolerance?: number;\n    /**\n     * The initial bounds of the map. If `bounds` is specified, it overrides `center` and `zoom` constructor options.\n     */\n    bounds?: LngLatBoundsLike;\n    /**\n     * A {@link FitBoundsOptions} options object to use _only_ when fitting the initial `bounds` provided above.\n     */\n    fitBoundsOptions?: FitBoundsOptions;\n    /**\n     * Defines a CSS\n     * font-family for locally overriding generation of Chinese, Japanese, and Korean characters.\n     * For these characters, font settings from the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).\n     * Set to `false`, to enable font settings from the map's style for these glyph ranges.\n     * The purpose of this option is to avoid bandwidth-intensive glyph server requests. (See [Use locally generated ideographs](https://maplibre.org/maplibre-gl-js/docs/examples/local-ideographs).)\n     * @defaultValue 'sans-serif'\n     */\n    localIdeographFontFamily?: string | false;\n    /**\n     * The map's MapLibre style. This must be a JSON object conforming to\n     * the schema described in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/),\n     * or a URL to such JSON.\n     * When the style is not specified, calling {@link Map#setStyle} is required to render the map.\n     */\n    style?: StyleSpecification | string;\n    /**\n     * If `false`, the map's pitch (tilt) control with \"drag to rotate\" interaction will be disabled.\n     * @defaultValue true\n     */\n    pitchWithRotate?: boolean;\n    /**\n     * The pixel ratio.\n     * The canvas' `width` attribute will be `container.clientWidth * pixelRatio` and its `height` attribute will be `container.clientHeight * pixelRatio`. Defaults to `devicePixelRatio` if not specified.\n     */\n    pixelRatio?: number;\n    /**\n     * If false, style validation will be skipped. Useful in production environment.\n     * @defaultValue true\n     */\n    validateStyle?: boolean;\n    /**\n     * The canvas' `width` and `height` max size. The values are passed as an array where the first element is max width and the second element is max height.\n     * You shouldn't set this above WebGl `MAX_TEXTURE_SIZE`.\n     * @defaultValue [4096, 4096].\n     */\n    maxCanvasSize?: [number, number];\n    /**\n     * Determines whether to cancel, or retain, tiles from the current viewport which are still loading but which belong to a farther (smaller) zoom level than the current one.\n     * * If `true`, when zooming in, tiles which didn't manage to load for previous zoom levels will become canceled. This might save some computing resources for slower devices, but the map details might appear more abruptly at the end of the zoom.\n     * * If `false`, when zooming in, the previous zoom level(s) tiles will progressively appear, giving a smoother map details experience. However, more tiles will be rendered in a short period of time.\n     * @defaultValue true\n     */\n    cancelPendingTileRequestsWhileZooming?: boolean;\n};\n\nexport type AddImageOptions = {\n\n}\n\n// This type is used inside map since all properties are assigned a default value.\nexport type CompleteMapOptions = Complete<MapOptions>;\n\ntype DelegatedListener = {\n    layers: string[];\n    listener: Listener;\n    delegates: {[E in keyof MapEventType]?: Delegate<MapEventType[E]>};\n}\n\ntype Delegate<E extends Event = Event> = (e: E) => void;\n\nconst defaultMinZoom = -2;\nconst defaultMaxZoom = 22;\n\n// the default values, but also the valid range\nconst defaultMinPitch = 0;\nconst defaultMaxPitch = 60;\n\n// use this variable to check maxPitch for validity\nconst maxPitchThreshold = 85;\n\nconst defaultOptions: Readonly<Partial<MapOptions>> = {\n    hash: false,\n    interactive: true,\n    bearingSnap: 7,\n    attributionControl: defaultAttributionControlOptions,\n    maplibreLogo: false,\n    failIfMajorPerformanceCaveat: false,\n    preserveDrawingBuffer: false,\n    refreshExpiredTiles: true,\n\n    scrollZoom: true,\n    minZoom: defaultMinZoom,\n    maxZoom: defaultMaxZoom,\n    minPitch: defaultMinPitch,\n    maxPitch: defaultMaxPitch,\n\n    boxZoom: true,\n    dragRotate: true,\n    dragPan: true,\n    keyboard: true,\n    doubleClickZoom: true,\n    touchZoomRotate: true,\n    touchPitch: true,\n    cooperativeGestures: false,\n\n    trackResize: true,\n\n    center: [0, 0],\n    zoom: 0,\n    bearing: 0,\n    pitch: 0,\n\n    renderWorldCopies: true,\n    maxTileCacheSize: null,\n    maxTileCacheZoomLevels: config.MAX_TILE_CACHE_ZOOM_LEVELS,\n    transformRequest: null,\n    transformCameraUpdate: null,\n    fadeDuration: 300,\n    crossSourceCollisions: true,\n    clickTolerance: 3,\n    localIdeographFontFamily: 'sans-serif',\n    pitchWithRotate: true,\n    validateStyle: true,\n    /**Because GL MAX_TEXTURE_SIZE is usually at least 4096px. */\n    maxCanvasSize: [4096, 4096],\n    cancelPendingTileRequestsWhileZooming: true\n};\n\n/**\n * The `Map` object represents the map on your page. It exposes methods\n * and properties that enable you to programmatically change the map,\n * and fires events as users interact with it.\n *\n * You create a `Map` by specifying a `container` and other options, see {@link MapOptions} for the full list.\n * Then MapLibre GL JS initializes the map on the page and returns your `Map` object.\n *\n * @group Main\n *\n * @example\n * ```ts\n * let map = new Map({\n *   container: 'map',\n *   center: [-122.420679, 37.772537],\n *   zoom: 13,\n *   style: style_object,\n *   hash: true,\n *   transformRequest: (url, resourceType)=> {\n *     if(resourceType === 'Source' && url.startsWith('http://myHost')) {\n *       return {\n *        url: url.replace('http', 'https'),\n *        headers: { 'my-custom-header': true},\n *        credentials: 'include'  // Include cookies for cross-origin requests\n *      }\n *     }\n *   }\n * });\n * ```\n * @see [Display a map](https://maplibre.org/maplibre-gl-js/docs/examples/simple-map/)\n */\nexport class Map extends Camera {\n    style: Style;\n    painter: Painter;\n\n    _container: HTMLElement;\n    _canvasContainer: HTMLElement;\n    _controlContainer: HTMLElement;\n    _controlPositions: Record<string, HTMLElement>;\n    _interactive: boolean;\n    _showTileBoundaries: boolean;\n    _showCollisionBoxes: boolean;\n    _showPadding: boolean;\n    _showOverdrawInspector: boolean;\n    _repaint: boolean;\n    _vertices: boolean;\n    _canvas: HTMLCanvasElement;\n    _maxTileCacheSize: number | null;\n    _maxTileCacheZoomLevels: number;\n    _frameRequest: AbortController;\n    _styleDirty: boolean;\n    _sourcesDirty: boolean;\n    _placementDirty: boolean;\n\n    _loaded: boolean;\n    _idleTriggered = false;\n    // accounts for placement finishing as well\n    _fullyLoaded: boolean;\n    _trackResize: boolean;\n    _resizeObserver: ResizeObserver;\n    _preserveDrawingBuffer: boolean;\n    _failIfMajorPerformanceCaveat: boolean;\n    _antialias: boolean;\n    _refreshExpiredTiles: boolean;\n    _hash: Hash;\n    _delegatedListeners: Record<string, DelegatedListener[]>;\n    _fadeDuration: number;\n    _crossSourceCollisions: boolean;\n    _crossFadingFactor = 1;\n    _collectResourceTiming: boolean;\n    _renderTaskQueue = new TaskQueue();\n    _controls: Array<IControl> = [];\n    _mapId = uniqueId();\n    _localIdeographFontFamily: string | false;\n    _validateStyle: boolean;\n    _requestManager: RequestManager;\n    _locale: typeof defaultLocale;\n    _removed: boolean;\n    _clickTolerance: number;\n    _overridePixelRatio: number | null | undefined;\n    _maxCanvasSize: [number, number];\n    _terrainDataCallback: (e: MapStyleDataEvent | MapSourceDataEvent) => void;\n\n    /**\n     * @internal\n     * image queue throttling handle. To be used later when clean up\n     */\n    _imageQueueHandle: number;\n\n    /**\n     * The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.\n     * Find more details and examples using `scrollZoom` in the {@link ScrollZoomHandler} section.\n     */\n    scrollZoom: ScrollZoomHandler;\n\n    /**\n     * The map's {@link BoxZoomHandler}, which implements zooming using a drag gesture with the Shift key pressed.\n     * Find more details and examples using `boxZoom` in the {@link BoxZoomHandler} section.\n     */\n    boxZoom: BoxZoomHandler;\n\n    /**\n     * The map's {@link DragRotateHandler}, which implements rotating the map while dragging with the right\n     * mouse button or with the Control key pressed. Find more details and examples using `dragRotate`\n     * in the {@link DragRotateHandler} section.\n     */\n    dragRotate: DragRotateHandler;\n\n    /**\n     * The map's {@link DragPanHandler}, which implements dragging the map with a mouse or touch gesture.\n     * Find more details and examples using `dragPan` in the {@link DragPanHandler} section.\n     */\n    dragPan: DragPanHandler;\n\n    /**\n     * The map's {@link KeyboardHandler}, which allows the user to zoom, rotate, and pan the map using keyboard\n     * shortcuts. Find more details and examples using `keyboard` in the {@link KeyboardHandler} section.\n     */\n    keyboard: KeyboardHandler;\n\n    /**\n     * The map's {@link DoubleClickZoomHandler}, which allows the user to zoom by double clicking.\n     * Find more details and examples using `doubleClickZoom` in the {@link DoubleClickZoomHandler} section.\n     */\n    doubleClickZoom: DoubleClickZoomHandler;\n\n    /**\n     * The map's {@link TwoFingersTouchZoomRotateHandler}, which allows the user to zoom or rotate the map with touch gestures.\n     * Find more details and examples using `touchZoomRotate` in the {@link TwoFingersTouchZoomRotateHandler} section.\n     */\n    touchZoomRotate: TwoFingersTouchZoomRotateHandler;\n\n    /**\n     * The map's {@link TwoFingersTouchPitchHandler}, which allows the user to pitch the map with touch gestures.\n     * Find more details and examples using `touchPitch` in the {@link TwoFingersTouchPitchHandler} section.\n     */\n    touchPitch: TwoFingersTouchPitchHandler;\n\n    /**\n     * The map's {@link CooperativeGesturesHandler}, which allows the user to see cooperative gesture info when user tries to zoom in/out.\n     * Find more details and examples using `cooperativeGestures` in the {@link CooperativeGesturesHandler} section.\n     */\n    cooperativeGestures: CooperativeGesturesHandler;\n\n    /**\n     * The map's property which determines whether to cancel, or retain, tiles from the current viewport which are still loading but which belong to a farther (smaller) zoom level than the current one.\n     * * If `true`, when zooming in, tiles which didn't manage to load for previous zoom levels will become canceled. This might save some computing resources for slower devices, but the map details might appear more abruptly at the end of the zoom.\n     * * If `false`, when zooming in, the previous zoom level(s) tiles will progressively appear, giving a smoother map details experience. However, more tiles will be rendered in a short period of time.\n     * @defaultValue true\n     */\n    cancelPendingTileRequestsWhileZooming: boolean;\n\n    constructor(options: MapOptions) {\n        PerformanceUtils.mark(PerformanceMarkers.create);\n\n        const resolvedOptions = {...defaultOptions, ...options} as CompleteMapOptions;\n\n        if (resolvedOptions.minZoom != null && resolvedOptions.maxZoom != null && resolvedOptions.minZoom > resolvedOptions.maxZoom) {\n            throw new Error('maxZoom must be greater than or equal to minZoom');\n        }\n\n        if (resolvedOptions.minPitch != null && resolvedOptions.maxPitch != null && resolvedOptions.minPitch > resolvedOptions.maxPitch) {\n            throw new Error('maxPitch must be greater than or equal to minPitch');\n        }\n\n        if (resolvedOptions.minPitch != null && resolvedOptions.minPitch < defaultMinPitch) {\n            throw new Error(`minPitch must be greater than or equal to ${defaultMinPitch}`);\n        }\n\n        if (resolvedOptions.maxPitch != null && resolvedOptions.maxPitch > maxPitchThreshold) {\n            throw new Error(`maxPitch must be less than or equal to ${maxPitchThreshold}`);\n        }\n\n        const transform = new Transform(resolvedOptions.minZoom, resolvedOptions.maxZoom, resolvedOptions.minPitch, resolvedOptions.maxPitch, resolvedOptions.renderWorldCopies);\n        super(transform, {bearingSnap: resolvedOptions.bearingSnap});\n\n        this._interactive = resolvedOptions.interactive;\n        this._maxTileCacheSize = resolvedOptions.maxTileCacheSize;\n        this._maxTileCacheZoomLevels = resolvedOptions.maxTileCacheZoomLevels;\n        this._failIfMajorPerformanceCaveat = resolvedOptions.failIfMajorPerformanceCaveat === true;\n        this._preserveDrawingBuffer = resolvedOptions.preserveDrawingBuffer === true;\n        this._antialias = resolvedOptions.antialias === true;\n        this._trackResize = resolvedOptions.trackResize === true;\n        this._bearingSnap = resolvedOptions.bearingSnap;\n        this._refreshExpiredTiles = resolvedOptions.refreshExpiredTiles === true;\n        this._fadeDuration = resolvedOptions.fadeDuration;\n        this._crossSourceCollisions = resolvedOptions.crossSourceCollisions === true;\n        this._collectResourceTiming = resolvedOptions.collectResourceTiming === true;\n        this._locale = {...defaultLocale, ...resolvedOptions.locale};\n        this._clickTolerance = resolvedOptions.clickTolerance;\n        this._overridePixelRatio = resolvedOptions.pixelRatio;\n        this._maxCanvasSize = resolvedOptions.maxCanvasSize;\n        this.transformCameraUpdate = resolvedOptions.transformCameraUpdate;\n        this.cancelPendingTileRequestsWhileZooming = resolvedOptions.cancelPendingTileRequestsWhileZooming === true;\n\n        this._imageQueueHandle = ImageRequest.addThrottleControl(() => this.isMoving());\n\n        this._requestManager = new RequestManager(resolvedOptions.transformRequest);\n\n        if (typeof resolvedOptions.container === 'string') {\n            this._container = document.getElementById(resolvedOptions.container);\n            if (!this._container) {\n                throw new Error(`Container '${resolvedOptions.container}' not found.`);\n            }\n        } else if (resolvedOptions.container instanceof HTMLElement) {\n            this._container = resolvedOptions.container;\n        } else {\n            throw new Error('Invalid type: \\'container\\' must be a String or HTMLElement.');\n        }\n\n        if (resolvedOptions.maxBounds) {\n            this.setMaxBounds(resolvedOptions.maxBounds);\n        }\n\n        this._setupContainer();\n        this._setupPainter();\n\n        this.on('move', () => this._update(false))\n            .on('moveend', () => this._update(false))\n            .on('zoom', () => this._update(true))\n            .on('terrain', () => {\n                this.painter.terrainFacilitator.dirty = true;\n                this._update(true);\n            })\n            .once('idle', () => { this._idleTriggered = true; });\n\n        if (typeof window !== 'undefined') {\n            addEventListener('online', this._onWindowOnline, false);\n            let initialResizeEventCaptured = false;\n            const throttledResizeCallback = throttle((entries: ResizeObserverEntry[]) => {\n                if (this._trackResize && !this._removed) {\n                    this.resize(entries);\n                    this.redraw();\n                }\n            }, 50);\n            this._resizeObserver = new ResizeObserver((entries) => {\n                if (!initialResizeEventCaptured) {\n                    initialResizeEventCaptured = true;\n                    return;\n                }\n                throttledResizeCallback(entries);\n            });\n            this._resizeObserver.observe(this._container);\n        }\n\n        this.handlers = new HandlerManager(this, resolvedOptions);\n\n        const hashName = (typeof resolvedOptions.hash === 'string' && resolvedOptions.hash) || undefined;\n        this._hash = resolvedOptions.hash && (new Hash(hashName)).addTo(this);\n        // don't set position from options if set through hash\n        if (!this._hash || !this._hash._onHashChange()) {\n            this.jumpTo({\n                center: resolvedOptions.center,\n                zoom: resolvedOptions.zoom,\n                bearing: resolvedOptions.bearing,\n                pitch: resolvedOptions.pitch\n            });\n\n            if (resolvedOptions.bounds) {\n                this.resize();\n                this.fitBounds(resolvedOptions.bounds, extend({}, resolvedOptions.fitBoundsOptions, {duration: 0}));\n            }\n        }\n\n        this.resize();\n\n        this._localIdeographFontFamily = resolvedOptions.localIdeographFontFamily;\n        this._validateStyle = resolvedOptions.validateStyle;\n\n        if (resolvedOptions.style) this.setStyle(resolvedOptions.style, {localIdeographFontFamily: resolvedOptions.localIdeographFontFamily});\n\n        if (resolvedOptions.attributionControl)\n            this.addControl(new AttributionControl(typeof resolvedOptions.attributionControl === 'boolean' ? undefined : resolvedOptions.attributionControl));\n\n        if (resolvedOptions.maplibreLogo)\n            this.addControl(new LogoControl(), resolvedOptions.logoPosition);\n\n        this.on('style.load', () => {\n            if (this.transform.unmodified) {\n                this.jumpTo(this.style.stylesheet as any);\n            }\n        });\n        this.on('data', (event: MapDataEvent) => {\n            this._update(event.dataType === 'style');\n            this.fire(new Event(`${event.dataType}data`, event));\n        });\n        this.on('dataloading', (event: MapDataEvent) => {\n            this.fire(new Event(`${event.dataType}dataloading`, event));\n        });\n        this.on('dataabort', (event: MapDataEvent) => {\n            this.fire(new Event('sourcedataabort', event));\n        });\n    }\n\n    /**\n     * @internal\n     * Returns a unique number for this map instance which is used for the MapLoadEvent\n     * to make sure we only fire one event per instantiated map object.\n     * @returns the uniq map ID\n     */\n    _getMapId() {\n        return this._mapId;\n    }\n\n    /**\n     * Adds an {@link IControl} to the map, calling `control.onAdd(this)`.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invald.\n     *\n     * @param control - The {@link IControl} to add.\n     * @param position - position on the map to which the control will be added.\n     * Valid values are `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`. Defaults to `'top-right'`.\n     * @example\n     * Add zoom and rotation controls to the map.\n     * ```ts\n     * map.addControl(new NavigationControl());\n     * ```\n     * @see [Display map navigation controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigation/)\n     */\n    addControl(control: IControl, position?: ControlPosition): Map {\n        if (position === undefined) {\n            if (control.getDefaultPosition) {\n                position = control.getDefaultPosition();\n            } else {\n                position = 'top-right';\n            }\n        }\n        if (!control || !control.onAdd) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.')));\n        }\n        const controlElement = control.onAdd(this);\n        this._controls.push(control);\n\n        const positionContainer = this._controlPositions[position];\n        if (position.indexOf('bottom') !== -1) {\n            positionContainer.insertBefore(controlElement, positionContainer.firstChild);\n        } else {\n            positionContainer.appendChild(controlElement);\n        }\n        return this;\n    }\n\n    /**\n     * Removes the control from the map.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invald.\n     *\n     * @param control - The {@link IControl} to remove.\n     * @example\n     * ```ts\n     * // Define a new navigation control.\n     * let navigation = new NavigationControl();\n     * // Add zoom and rotation controls to the map.\n     * map.addControl(navigation);\n     * // Remove zoom and rotation controls from the map.\n     * map.removeControl(navigation);\n     * ```\n     */\n    removeControl(control: IControl): Map {\n        if (!control || !control.onRemove) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.')));\n        }\n        const ci = this._controls.indexOf(control);\n        if (ci > -1) this._controls.splice(ci, 1);\n        control.onRemove(this);\n        return this;\n    }\n\n    /**\n     * Checks if a control exists on the map.\n     *\n     * @param control - The {@link IControl} to check.\n     * @returns true if map contains control.\n     * @example\n     * ```ts\n     * // Define a new navigation control.\n     * let navigation = new NavigationControl();\n     * // Add zoom and rotation controls to the map.\n     * map.addControl(navigation);\n     * // Check that the navigation control exists on the map.\n     * map.hasControl(navigation);\n     * ```\n     */\n    hasControl(control: IControl): boolean {\n        return this._controls.indexOf(control) > -1;\n    }\n\n    calculateCameraOptionsFromTo(from: LngLat, altitudeFrom: number, to: LngLat, altitudeTo?: number): CameraOptions {\n        if (altitudeTo == null && this.terrain) {\n            altitudeTo = this.terrain.getElevationForLngLatZoom(to, this.transform.tileZoom);\n        }\n        return super.calculateCameraOptionsFromTo(from, altitudeFrom, to, altitudeTo);\n    }\n\n    /**\n     * Resizes the map according to the dimensions of its\n     * `container` element.\n     *\n     * Checks if the map container size changed and updates the map if it has changed.\n     * This method must be called after the map's `container` is resized programmatically\n     * or when the map is shown after being initially hidden with CSS.\n     *\n     * Triggers the following events: `movestart`, `move`, `moveend`, and `resize`.\n     *\n     * @param eventData - Additional properties to be passed to `movestart`, `move`, `resize`, and `moveend`\n     * events that get triggered as a result of resize. This can be useful for differentiating the\n     * source of an event (for example, user-initiated or programmatically-triggered events).\n     * @example\n     * Resize the map when the map container is shown after being initially hidden with CSS.\n     * ```ts\n     * let mapDiv = document.getElementById('map');\n     * if (mapDiv.style.visibility === true) map.resize();\n     * ```\n     */\n    resize(eventData?: any): Map {\n        const dimensions = this._containerDimensions();\n        const width = dimensions[0];\n        const height = dimensions[1];\n\n        const clampedPixelRatio = this._getClampedPixelRatio(width, height);\n        this._resizeCanvas(width, height, clampedPixelRatio);\n        this.painter.resize(width, height, clampedPixelRatio);\n\n        // check if we've reached GL limits, in that case further clamps pixelRatio\n        if (this.painter.overLimit()) {\n            const gl = this.painter.context.gl;\n            // store updated _maxCanvasSize value\n            this._maxCanvasSize = [gl.drawingBufferWidth, gl.drawingBufferHeight];\n            const clampedPixelRatio = this._getClampedPixelRatio(width, height);\n            this._resizeCanvas(width, height, clampedPixelRatio);\n            this.painter.resize(width, height, clampedPixelRatio);\n        }\n\n        this.transform.resize(width, height);\n        this._requestedCameraState?.resize(width, height);\n\n        const fireMoving = !this._moving;\n        if (fireMoving) {\n            this.stop();\n            this.fire(new Event('movestart', eventData))\n                .fire(new Event('move', eventData));\n        }\n\n        this.fire(new Event('resize', eventData));\n\n        if (fireMoving) this.fire(new Event('moveend', eventData));\n\n        return this;\n    }\n\n    /**\n     * @internal\n     * Return the map's pixel ratio eventually scaled down to respect maxCanvasSize.\n     * Internally you should use this and not getPixelRatio().\n     */\n    _getClampedPixelRatio(width: number, height: number): number {\n        const {0: maxCanvasWidth, 1: maxCanvasHeight} = this._maxCanvasSize;\n        const pixelRatio = this.getPixelRatio();\n\n        const canvasWidth = width * pixelRatio;\n        const canvasHeight = height * pixelRatio;\n\n        const widthScaleFactor = canvasWidth > maxCanvasWidth ? (maxCanvasWidth / canvasWidth) : 1;\n        const heightScaleFactor = canvasHeight > maxCanvasHeight ? (maxCanvasHeight / canvasHeight) : 1;\n\n        return Math.min(widthScaleFactor, heightScaleFactor) * pixelRatio;\n    }\n\n    /**\n     * Returns the map's pixel ratio.\n     * Note that the pixel ratio actually applied may be lower to respect maxCanvasSize.\n     * @returns The pixel ratio.\n     */\n    getPixelRatio(): number {\n        return this._overridePixelRatio ?? devicePixelRatio;\n    }\n\n    /**\n     * Sets the map's pixel ratio. This allows to override `devicePixelRatio`.\n     * After this call, the canvas' `width` attribute will be `container.clientWidth * pixelRatio`\n     * and its height attribute will be `container.clientHeight * pixelRatio`.\n     * Set this to null to disable `devicePixelRatio` override.\n     * Note that the pixel ratio actually applied may be lower to respect maxCanvasSize.\n     * @param pixelRatio - The pixel ratio.\n     */\n    setPixelRatio(pixelRatio: number) {\n        this._overridePixelRatio = pixelRatio;\n        this.resize();\n    }\n\n    /**\n     * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not\n     * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.\n     * @returns The geographical bounds of the map as {@link LngLatBounds}.\n     * @example\n     * ```ts\n     * let bounds = map.getBounds();\n     * ```\n     */\n    getBounds(): LngLatBounds {\n        return this.transform.getBounds();\n    }\n\n    /**\n     * Returns the maximum geographical bounds the map is constrained to, or `null` if none set.\n     * @returns The map object.\n     * @example\n     * ```ts\n     * let maxBounds = map.getMaxBounds();\n     * ```\n     */\n    getMaxBounds(): LngLatBounds | null {\n        return this.transform.getMaxBounds();\n    }\n\n    /**\n     * Sets or clears the map's geographical bounds.\n     *\n     * Pan and zoom operations are constrained within these bounds.\n     * If a pan or zoom is performed that would\n     * display regions outside these bounds, the map will\n     * instead display a position and zoom level\n     * as close as possible to the operation's request while still\n     * remaining within the bounds.\n     *\n     * @param bounds - The maximum bounds to set. If `null` or `undefined` is provided, the function removes the map's maximum bounds.\n     * @example\n     * Define bounds that conform to the `LngLatBoundsLike` object as set the max bounds.\n     * ```ts\n     * let bounds = [\n     *   [-74.04728, 40.68392], // [west, south]\n     *   [-73.91058, 40.87764]  // [east, north]\n     * ];\n     * map.setMaxBounds(bounds);\n     * ```\n     */\n    setMaxBounds(bounds?: LngLatBoundsLike | null): Map {\n        this.transform.setMaxBounds(LngLatBounds.convert(bounds));\n        return this._update();\n    }\n\n    /**\n     * Sets or clears the map's minimum zoom level.\n     * If the map's current zoom level is lower than the new minimum,\n     * the map will zoom to the new minimum.\n     *\n     * It is not always possible to zoom out and reach the set `minZoom`.\n     * Other factors such as map height may restrict zooming. For example,\n     * if the map is 512px tall it will not be possible to zoom below zoom 0\n     * no matter what the `minZoom` is set to.\n     *\n     * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.\n     *\n     * @param minZoom - The minimum zoom level to set (-2 - 24).\n     * If `null` or `undefined` is provided, the function removes the current minimum zoom (i.e. sets it to -2).\n     * @example\n     * ```ts\n     * map.setMinZoom(12.25);\n     * ```\n     */\n    setMinZoom(minZoom?: number | null): Map {\n\n        minZoom = minZoom === null || minZoom === undefined ? defaultMinZoom : minZoom;\n\n        if (minZoom >= defaultMinZoom && minZoom <= this.transform.maxZoom) {\n            this.transform.minZoom = minZoom;\n            this._update();\n\n            if (this.getZoom() < minZoom) this.setZoom(minZoom);\n\n            return this;\n\n        } else throw new Error(`minZoom must be between ${defaultMinZoom} and the current maxZoom, inclusive`);\n    }\n\n    /**\n     * Returns the map's minimum allowable zoom level.\n     *\n     * @returns minZoom\n     * @example\n     * ```ts\n     * let minZoom = map.getMinZoom();\n     * ```\n     */\n    getMinZoom(): number { return this.transform.minZoom; }\n\n    /**\n     * Sets or clears the map's maximum zoom level.\n     * If the map's current zoom level is higher than the new maximum,\n     * the map will zoom to the new maximum.\n     *\n     * A {@link ErrorEvent} event will be fired if minZoom is out of bounds.\n     *\n     * @param maxZoom - The maximum zoom level to set.\n     * If `null` or `undefined` is provided, the function removes the current maximum zoom (sets it to 22).\n     * @example\n     * ```ts\n     * map.setMaxZoom(18.75);\n     * ```\n     */\n    setMaxZoom(maxZoom?: number | null): Map {\n\n        maxZoom = maxZoom === null || maxZoom === undefined ? defaultMaxZoom : maxZoom;\n\n        if (maxZoom >= this.transform.minZoom) {\n            this.transform.maxZoom = maxZoom;\n            this._update();\n\n            if (this.getZoom() > maxZoom) this.setZoom(maxZoom);\n\n            return this;\n\n        } else throw new Error('maxZoom must be greater than the current minZoom');\n    }\n\n    /**\n     * Returns the map's maximum allowable zoom level.\n     *\n     * @returns The maxZoom\n     * @example\n     * ```ts\n     * let maxZoom = map.getMaxZoom();\n     * ```\n     */\n    getMaxZoom(): number { return this.transform.maxZoom; }\n\n    /**\n     * Sets or clears the map's minimum pitch.\n     * If the map's current pitch is lower than the new minimum,\n     * the map will pitch to the new minimum.\n     *\n     * A {@link ErrorEvent} event will be fired if minPitch is out of bounds.\n     *\n     * @param minPitch - The minimum pitch to set (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * If `null` or `undefined` is provided, the function removes the current minimum pitch (i.e. sets it to 0).\n     */\n    setMinPitch(minPitch?: number | null): Map {\n\n        minPitch = minPitch === null || minPitch === undefined ? defaultMinPitch : minPitch;\n\n        if (minPitch < defaultMinPitch) {\n            throw new Error(`minPitch must be greater than or equal to ${defaultMinPitch}`);\n        }\n\n        if (minPitch >= defaultMinPitch && minPitch <= this.transform.maxPitch) {\n            this.transform.minPitch = minPitch;\n            this._update();\n\n            if (this.getPitch() < minPitch) this.setPitch(minPitch);\n\n            return this;\n\n        } else throw new Error(`minPitch must be between ${defaultMinPitch} and the current maxPitch, inclusive`);\n    }\n\n    /**\n     * Returns the map's minimum allowable pitch.\n     *\n     * @returns The minPitch\n     */\n    getMinPitch(): number { return this.transform.minPitch; }\n\n    /**\n     * Sets or clears the map's maximum pitch.\n     * If the map's current pitch is higher than the new maximum,\n     * the map will pitch to the new maximum.\n     *\n     * A {@link ErrorEvent} event will be fired if maxPitch is out of bounds.\n     *\n     * @param maxPitch - The maximum pitch to set (0-85). Values greater than 60 degrees are experimental and may result in rendering issues. If you encounter any, please raise an issue with details in the MapLibre project.\n     * If `null` or `undefined` is provided, the function removes the current maximum pitch (sets it to 60).\n     */\n    setMaxPitch(maxPitch?: number | null): Map {\n\n        maxPitch = maxPitch === null || maxPitch === undefined ? defaultMaxPitch : maxPitch;\n\n        if (maxPitch > maxPitchThreshold) {\n            throw new Error(`maxPitch must be less than or equal to ${maxPitchThreshold}`);\n        }\n\n        if (maxPitch >= this.transform.minPitch) {\n            this.transform.maxPitch = maxPitch;\n            this._update();\n\n            if (this.getPitch() > maxPitch) this.setPitch(maxPitch);\n\n            return this;\n\n        } else throw new Error('maxPitch must be greater than the current minPitch');\n    }\n\n    /**\n     * Returns the map's maximum allowable pitch.\n     *\n     * @returns The maxPitch\n     */\n    getMaxPitch(): number { return this.transform.maxPitch; }\n\n    /**\n     * Returns the state of `renderWorldCopies`. If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:\n     *\n     * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire\n     * container, there will be blank space beyond 180 and -180 degrees longitude.\n     * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the\n     * map and the other on the left edge of the map) at every zoom level.\n     * @returns The renderWorldCopies\n     * @example\n     * ```ts\n     * let worldCopiesRendered = map.getRenderWorldCopies();\n     * ```\n     * @see [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)\n     */\n    getRenderWorldCopies(): boolean { return this.transform.renderWorldCopies; }\n\n    /**\n     * Sets the state of `renderWorldCopies`.\n     *\n     * @param renderWorldCopies - If `true`, multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude. If set to `false`:\n     *\n     * - When the map is zoomed out far enough that a single representation of the world does not fill the map's entire\n     * container, there will be blank space beyond 180 and -180 degrees longitude.\n     * - Features that cross 180 and -180 degrees longitude will be cut in two (with one portion on the right edge of the\n     * map and the other on the left edge of the map) at every zoom level.\n     *\n     * `undefined` is treated as `true`, `null` is treated as `false`.\n     * @example\n     * ```ts\n     * map.setRenderWorldCopies(true);\n     * ```\n     * @see [Render world copies](https://maplibre.org/maplibre-gl-js/docs/examples/render-world-copies/)\n     */\n    setRenderWorldCopies(renderWorldCopies?: boolean | null): Map {\n        this.transform.renderWorldCopies = renderWorldCopies;\n        return this._update();\n    }\n\n    /**\n     * Returns a [Point](https://github.com/mapbox/point-geometry) representing pixel coordinates, relative to the map's `container`,\n     * that correspond to the specified geographical location.\n     *\n     * @param lnglat - The geographical location to project.\n     * @returns The [Point](https://github.com/mapbox/point-geometry) corresponding to `lnglat`, relative to the map's `container`.\n     * @example\n     * ```ts\n     * let coordinate = [-122.420679, 37.772537];\n     * let point = map.project(coordinate);\n     * ```\n     */\n    project(lnglat: LngLatLike): Point {\n        return this.transform.locationPoint(LngLat.convert(lnglat), this.style && this.terrain);\n    }\n\n    /**\n     * Returns a {@link LngLat} representing geographical coordinates that correspond\n     * to the specified pixel coordinates.\n     *\n     * @param point - The pixel coordinates to unproject.\n     * @returns The {@link LngLat} corresponding to `point`.\n     * @example\n     * ```ts\n     * map.on('click', (e) => {\n     *   // When the map is clicked, get the geographic coordinate.\n     *   let coordinate = map.unproject(e.point);\n     * });\n     * ```\n     */\n    unproject(point: PointLike): LngLat {\n        return this.transform.pointLocation(Point.convert(point), this.terrain);\n    }\n\n    /**\n     * Returns true if the map is panning, zooming, rotating, or pitching due to a camera animation or user gesture.\n     * @returns true if the map is moving.\n     * @example\n     * ```ts\n     * let isMoving = map.isMoving();\n     * ```\n     */\n    isMoving(): boolean {\n        return this._moving || this.handlers?.isMoving();\n    }\n\n    /**\n     * Returns true if the map is zooming due to a camera animation or user gesture.\n     * @returns true if the map is zooming.\n     * @example\n     * ```ts\n     * let isZooming = map.isZooming();\n     * ```\n     */\n    isZooming(): boolean {\n        return this._zooming || this.handlers?.isZooming();\n    }\n\n    /**\n     * Returns true if the map is rotating due to a camera animation or user gesture.\n     * @returns true if the map is rotating.\n     * @example\n     * ```ts\n     * map.isRotating();\n     * ```\n     */\n    isRotating(): boolean {\n        return this._rotating || this.handlers?.isRotating();\n    }\n\n    _createDelegatedListener(type: keyof MapEventType | string, layerIds: string[], listener: Listener): DelegatedListener {\n        if (type === 'mouseenter' || type === 'mouseover') {\n            let mousein = false;\n            const mousemove = (e) => {\n                const existingLayers = layerIds.filter((layerId) => this.getLayer(layerId));\n                const features = existingLayers.length !== 0 ? this.queryRenderedFeatures(e.point, {layers: existingLayers}) : [];\n                if (!features.length) {\n                    mousein = false;\n                } else if (!mousein) {\n                    mousein = true;\n                    listener.call(this, new MapMouseEvent(type, this, e.originalEvent, {features}));\n                }\n            };\n            const mouseout = () => {\n                mousein = false;\n            };\n            return {layers: layerIds, listener, delegates: {mousemove, mouseout}};\n        } else if (type === 'mouseleave' || type === 'mouseout') {\n            let mousein = false;\n            const mousemove = (e) => {\n                const existingLayers = layerIds.filter((layerId) => this.getLayer(layerId));\n                const features = existingLayers.length !== 0 ? this.queryRenderedFeatures(e.point, {layers: existingLayers}) : [];\n                if (features.length) {\n                    mousein = true;\n                } else if (mousein) {\n                    mousein = false;\n                    listener.call(this, new MapMouseEvent(type, this, e.originalEvent));\n                }\n            };\n            const mouseout = (e) => {\n                if (mousein) {\n                    mousein = false;\n                    listener.call(this, new MapMouseEvent(type, this, e.originalEvent));\n                }\n            };\n            return {layers: layerIds, listener, delegates: {mousemove, mouseout}};\n        } else {\n            const delegate = (e) => {\n                const existingLayers = layerIds.filter((layerId) => this.getLayer(layerId));\n                const features = existingLayers.length !== 0 ? this.queryRenderedFeatures(e.point, {layers: existingLayers}) : [];\n                if (features.length) {\n                    // Here we need to mutate the original event, so that preventDefault works as expected.\n                    e.features = features;\n                    listener.call(this, e);\n                    delete e.features;\n                }\n            };\n            return {layers: layerIds, listener, delegates: {[type]: delegate}};\n        }\n    }\n\n    _saveDelegatedListener(type: keyof MapEventType | string, delegatedListener: DelegatedListener): void {\n        this._delegatedListeners = this._delegatedListeners || {};\n        this._delegatedListeners[type] = this._delegatedListeners[type] || [];\n        this._delegatedListeners[type].push(delegatedListener);\n    }\n\n    _removeDelegatedListener(type: string, layerIds: string[], listener: Listener) {\n        if (!this._delegatedListeners || !this._delegatedListeners[type]) {\n            return;\n        }\n\n        const listeners = this._delegatedListeners[type];\n        for (let i = 0; i < listeners.length; i++) {\n            const delegatedListener = listeners[i];\n            if (\n                delegatedListener.listener === listener &&\n                delegatedListener.layers.length === layerIds.length &&\n                delegatedListener.layers.every((layerId: string) => layerIds.includes(layerId))\n            ) {\n                for (const event in delegatedListener.delegates) {\n                    this.off(event, delegatedListener.delegates[event]);\n                }\n                listeners.splice(i, 1);\n                return;\n            }\n        }\n    }\n\n    /**\n     * @event\n     * Adds a listener for events of a specified type, optionally limited to features in a specified style layer(s).\n     * See {@link MapEventType} and {@link MapLayerEventType} for a full list of events and their description.\n     *\n     * | Event                  | Compatible with `layerId` |\n     * |------------------------|---------------------------|\n     * | `mousedown`            | yes                       |\n     * | `mouseup`              | yes                       |\n     * | `mouseover`            | yes                       |\n     * | `mouseout`             | yes                       |\n     * | `mousemove`            | yes                       |\n     * | `mouseenter`           | yes (required)            |\n     * | `mouseleave`           | yes (required)            |\n     * | `click`                | yes                       |\n     * | `dblclick`             | yes                       |\n     * | `contextmenu`          | yes                       |\n     * | `touchstart`           | yes                       |\n     * | `touchend`             | yes                       |\n     * | `touchcancel`          | yes                       |\n     * | `wheel`                |                           |\n     * | `resize`               |                           |\n     * | `remove`               |                           |\n     * | `touchmove`            |                           |\n     * | `movestart`            |                           |\n     * | `move`                 |                           |\n     * | `moveend`              |                           |\n     * | `dragstart`            |                           |\n     * | `drag`                 |                           |\n     * | `dragend`              |                           |\n     * | `zoomstart`            |                           |\n     * | `zoom`                 |                           |\n     * | `zoomend`              |                           |\n     * | `rotatestart`          |                           |\n     * | `rotate`               |                           |\n     * | `rotateend`            |                           |\n     * | `pitchstart`           |                           |\n     * | `pitch`                |                           |\n     * | `pitchend`             |                           |\n     * | `boxzoomstart`         |                           |\n     * | `boxzoomend`           |                           |\n     * | `boxzoomcancel`        |                           |\n     * | `webglcontextlost`     |                           |\n     * | `webglcontextrestored` |                           |\n     * | `load`                 |                           |\n     * | `render`               |                           |\n     * | `idle`                 |                           |\n     * | `error`                |                           |\n     * | `data`                 |                           |\n     * | `styledata`            |                           |\n     * | `sourcedata`           |                           |\n     * | `dataloading`          |                           |\n     * | `styledataloading`     |                           |\n     * | `sourcedataloading`    |                           |\n     * | `styleimagemissing`    |                           |\n     * | `dataabort`            |                           |\n     * | `sourcedataabort`      |                           |\n     *\n     * @param type - The event type to listen for. Events compatible with the optional `layerId` parameter are triggered\n     * when the cursor enters a visible portion of the specified layer from outside that layer or outside the map canvas.\n     * @param layer - The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location\n     * is within a visible feature in this layer. The event will have a `features` property containing\n     * an array of the matching features. If `layer` is not supplied, the event will not have a `features` property.\n     * Please note that many event types are not compatible with the optional `layer` parameter.\n     * @param listener - The function to be called when the event is fired.\n     * @example\n     * ```ts\n     * // Set an event listener that will fire\n     * // when the map has finished loading\n     * map.on('load', () => {\n     *   // Once the map has finished loading,\n     *   // add a new layer\n     *   map.addLayer({\n     *     id: 'points-of-interest',\n     *     source: {\n     *       type: 'vector',\n     *       url: 'https://maplibre.org/maplibre-style-spec/'\n     *     },\n     *     'source-layer': 'poi_label',\n     *     type: 'circle',\n     *     paint: {\n     *       // MapLibre Style Specification paint properties\n     *     },\n     *     layout: {\n     *       // MapLibre Style Specification layout properties\n     *     }\n     *   });\n     * });\n     * ```\n     * @example\n     * ```ts\n     * // Set an event listener that will fire\n     * // when a feature on the countries layer of the map is clicked\n     * map.on('click', 'countries', (e) => {\n     *   new Popup()\n     *     .setLngLat(e.lngLat)\n     *     .setHTML(`Country name: ${e.features[0].properties.name}`)\n     *     .addTo(map);\n     * });\n     * ```\n     * @see [Display popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-on-symbol/)\n     * @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    on<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): Map;\n    /**\n     * Overload of the `on` method that allows to listen to events specifying multiple layers.\n     * @event\n     * @param type - The type of the event.\n     * @param layerIds - The array of style layer IDs.\n     * @param listener - The listener callback.\n     */\n    on<T extends keyof MapLayerEventType>(\n        type: T,\n        layerIds: string[],\n        listener: (ev: MapLayerEventType[T] & Object) => void\n    ): this;\n    /**\n     * Overload of the `on` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;\n    /**\n     * Overload of the `on` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    on(type: keyof MapEventType | string, listener: Listener): this;\n    on(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): this {\n        if (listener === undefined) {\n            return super.on(type, layerIdsOrListener as Listener);\n        }\n\n        const layerIds = typeof layerIdsOrListener === 'string' ? [layerIdsOrListener] : layerIdsOrListener as string[];\n\n        const delegatedListener = this._createDelegatedListener(type, layerIds, listener);\n\n        this._saveDelegatedListener(type, delegatedListener);\n\n        for (const event in delegatedListener.delegates) {\n            this.on(event, delegatedListener.delegates[event]);\n        }\n\n        return this;\n    }\n\n    /**\n     * Adds a listener that will be called only once to a specified event type, optionally limited to features in a specified style layer.\n     *\n     * @event\n     * @param type - The event type to listen for; one of `'mousedown'`, `'mouseup'`, `'click'`, `'dblclick'`,\n     * `'mousemove'`, `'mouseenter'`, `'mouseleave'`, `'mouseover'`, `'mouseout'`, `'contextmenu'`, `'touchstart'`,\n     * `'touchend'`, or `'touchcancel'`. `mouseenter` and `mouseover` events are triggered when the cursor enters\n     * a visible portion of the specified layer from outside that layer or outside the map canvas. `mouseleave`\n     * and `mouseout` events are triggered when the cursor leaves a visible portion of the specified layer, or leaves\n     * the map canvas.\n     * @param layer - The ID of a style layer or a listener if no ID is provided. Only events whose location is within a visible\n     * feature in this layer will trigger the listener. The event will have a `features` property containing\n     * an array of the matching features.\n     * @param listener - The function to be called when the event is fired.\n     * @returns `this` if listener is provided, promise otherwise to allow easier usage of async/await\n     */\n    once<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener?: (ev: MapLayerEventType[T] & Object) => void,\n    ): this | Promise<MapLayerEventType[T] & Object>;\n    /**\n     * Overload of the `once` method that allows to listen to events specifying multiple layers.\n     * @event\n     * @param type - The type of the event.\n     * @param layerIds - The array of style layer IDs.\n     * @param listener - The listener callback.\n     */\n    once<T extends keyof MapLayerEventType>(\n        type: T,\n        layerIds: string[],\n        listener?: (ev: MapLayerEventType[T] & Object) => void\n    ): this | Promise<any>;\n    /**\n     * Overload of the `once` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    once<T extends keyof MapEventType>(type: T, listener?: (ev: MapEventType[T] & Object) => void): this | Promise<any>;\n    /**\n     * Overload of the `once` method that allows to listen to events without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The listener callback.\n     */\n    once(type: keyof MapEventType | string, listener?: Listener): this | Promise<any>;\n    once(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): this | Promise<any> {\n        if (listener === undefined) {\n            return super.once(type, layerIdsOrListener as Listener);\n        }\n\n        const layerIds = typeof layerIdsOrListener === 'string' ? [layerIdsOrListener] : layerIdsOrListener as string[];\n\n        const delegatedListener = this._createDelegatedListener(type, layerIds, listener);\n\n        for (const key in delegatedListener.delegates) {\n            const delegate: Delegate = delegatedListener.delegates[key];\n            delegatedListener.delegates[key] = (...args: Parameters<Delegate>) => {\n                this._removeDelegatedListener(type, layerIds, listener);\n                delegate(...args);\n            };\n        }\n\n        this._saveDelegatedListener(type, delegatedListener);\n\n        for (const event in delegatedListener.delegates) {\n            this.once(event, delegatedListener.delegates[event]);\n        }\n\n        return this;\n    }\n\n    /**\n     * Removes an event listener for events previously added with `Map#on`.\n     *\n     * @event\n     * @param type - The event type previously used to install the listener.\n     * @param layer - The layer ID or listener previously used to install the listener.\n     * @param listener - The function previously installed as a listener.\n     */\n    off<T extends keyof MapLayerEventType>(\n        type: T,\n        layer: string,\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): this;\n    /**\n     * Overload of the `off` method that allows to remove an event created with multiple layers.\n     * Provide the same layer IDs as to `on` or `once`, when the listener was registered.\n     * @event\n     * @param type - The type of the event.\n     * @param layers - The layer IDs previously used to install the listener.\n     * @param listener - The function previously installed as a listener.\n     */\n    off<T extends keyof MapLayerEventType>(\n        type: T,\n        layers: string[],\n        listener: (ev: MapLayerEventType[T] & Object) => void,\n    ): this;\n    /**\n     * Overload of the `off` method that allows to remove an event created without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The function previously installed as a listener.\n     */\n    off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & Object) => void): this;\n    /**\n     * Overload of the `off` method that allows to remove an event created without specifying a layer.\n     * @event\n     * @param type - The type of the event.\n     * @param listener - The function previously installed as a listener.\n     */\n    off(type: keyof MapEventType | string, listener: Listener): this;\n    off(type: keyof MapEventType | string, layerIdsOrListener: string | string[] | Listener, listener?: Listener): this {\n        if (listener === undefined) {\n            return super.off(type, layerIdsOrListener as Listener);\n        }\n\n        const layerIds = typeof layerIdsOrListener === 'string' ? [layerIdsOrListener] : layerIdsOrListener as string[];\n        this._removeDelegatedListener(type, layerIds, listener);\n\n        return this;\n    }\n\n    /**\n     * Returns an array of MapGeoJSONFeature objects\n     * representing visible features that satisfy the query parameters.\n     *\n     * @param geometryOrOptions - (optional) The geometry of the query region:\n     * either a single point or southwest and northeast points describing a bounding box.\n     * Omitting this parameter (i.e. calling {@link Map#queryRenderedFeatures} with zero arguments,\n     * or with only a `options` argument) is equivalent to passing a bounding box encompassing the entire\n     * map viewport.\n     * The geometryOrOptions can receive a {@link QueryRenderedFeaturesOptions} only to support a situation where the function receives only one parameter which is the options parameter.\n     * @param options - (optional) Options object.\n     *\n     * @returns An array of MapGeoJSONFeature objects.\n     *\n     * The `properties` value of each returned feature object contains the properties of its source feature. For GeoJSON sources, only\n     * string and numeric property values are supported (i.e. `null`, `Array`, and `Object` values are not supported).\n     *\n     * Each feature includes top-level `layer`, `source`, and `sourceLayer` properties. The `layer` property is an object\n     * representing the style layer to  which the feature belongs. Layout and paint properties in this object contain values\n     * which are fully evaluated for the given zoom level and feature.\n     *\n     * Only features that are currently rendered are included. Some features will **not** be included, like:\n     *\n     * - Features from layers whose `visibility` property is `\"none\"`.\n     * - Features from layers whose zoom range excludes the current zoom level.\n     * - Symbol features that have been hidden due to text or icon collision.\n     *\n     * Features from all other layers are included, including features that may have no visible\n     * contribution to the rendered result; for example, because the layer's opacity or color alpha component is set to\n     * 0.\n     *\n     * The topmost rendered feature appears first in the returned array, and subsequent features are sorted by\n     * descending z-order. Features that are rendered multiple times (due to wrapping across the antemeridian at low\n     * zoom levels) are returned only once (though subject to the following caveat).\n     *\n     * Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature\n     * geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple\n     * times in query results. For example, suppose there is a highway running through the bounding rectangle of a query.\n     * The results of the query will be those parts of the highway that lie within the map tiles covering the bounding\n     * rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile\n     * will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple\n     * tiles due to tile buffering.\n     *\n     * @example\n     * Find all features at a point\n     * ```ts\n     * let features = map.queryRenderedFeatures(\n     *   [20, 35],\n     *   { layers: ['my-layer-name'] }\n     * );\n     * ```\n     *\n     * @example\n     * Find all features within a static bounding box\n     * ```ts\n     * let features = map.queryRenderedFeatures(\n     *   [[10, 20], [30, 50]],\n     *   { layers: ['my-layer-name'] }\n     * );\n     * ```\n     *\n     * @example\n     * Find all features within a bounding box around a point\n     * ```ts\n     * let width = 10;\n     * let height = 20;\n     * let features = map.queryRenderedFeatures([\n     *   [point.x - width / 2, point.y - height / 2],\n     *   [point.x + width / 2, point.y + height / 2]\n     * ], { layers: ['my-layer-name'] });\n     * ```\n     *\n     * @example\n     * Query all rendered features from a single layer\n     * ```ts\n     * let features = map.queryRenderedFeatures({ layers: ['my-layer-name'] });\n     * ```\n     * @see [Get features under the mouse pointer](https://maplibre.org/maplibre-gl-js/docs/examples/queryrenderedfeatures/)\n     */\n    queryRenderedFeatures(geometryOrOptions?: PointLike | [PointLike, PointLike] | QueryRenderedFeaturesOptions, options?: QueryRenderedFeaturesOptions): MapGeoJSONFeature[] {\n        if (!this.style) {\n            return [];\n        }\n        let queryGeometry;\n        const isGeometry = geometryOrOptions instanceof Point || Array.isArray(geometryOrOptions);\n        const geometry = isGeometry ? geometryOrOptions : [[0, 0], [this.transform.width, this.transform.height]];\n        options = options || (isGeometry ? {} : geometryOrOptions) || {};\n\n        if (geometry instanceof Point || typeof geometry[0] === 'number') {\n            queryGeometry = [Point.convert(geometry as PointLike)];\n        } else {\n            const tl = Point.convert(geometry[0] as PointLike);\n            const br = Point.convert(geometry[1] as PointLike);\n            queryGeometry = [tl, new Point(br.x, tl.y), br, new Point(tl.x, br.y), tl];\n        }\n\n        return this.style.queryRenderedFeatures(queryGeometry, options, this.transform);\n    }\n\n    /**\n     * Returns an array of MapGeoJSONFeature objects\n     * representing features within the specified vector tile or GeoJSON source that satisfy the query parameters.\n     *\n     * @param sourceId - The ID of the vector tile or GeoJSON source to query.\n     * @param parameters - The options object.\n     * @returns An array of MapGeoJSONFeature objects.\n     *\n     * In contrast to {@link Map#queryRenderedFeatures}, this function returns all features matching the query parameters,\n     * whether or not they are rendered by the current style (i.e. visible). The domain of the query includes all currently-loaded\n     * vector tiles and GeoJSON source tiles: this function does not check tiles outside the currently\n     * visible viewport.\n     *\n     * Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature\n     * geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple\n     * times in query results. For example, suppose there is a highway running through the bounding rectangle of a query.\n     * The results of the query will be those parts of the highway that lie within the map tiles covering the bounding\n     * rectangle, even if the highway extends into other tiles, and the portion of the highway within each map tile\n     * will be returned as a separate feature. Similarly, a point feature near a tile boundary may appear in multiple\n     * tiles due to tile buffering.\n     *\n     * @example\n     * Find all features in one source layer in a vector source\n     * ```ts\n     * let features = map.querySourceFeatures('your-source-id', {\n     *   sourceLayer: 'your-source-layer'\n     * });\n     * ```\n     *\n     */\n    querySourceFeatures(sourceId: string, parameters?: QuerySourceFeatureOptions | null): MapGeoJSONFeature[] {\n        return this.style.querySourceFeatures(sourceId, parameters);\n    }\n\n    /**\n     * Updates the map's MapLibre style object with a new value.\n     *\n     * If a style is already set when this is used and options.diff is set to true, the map renderer will attempt to compare the given style\n     * against the map's current state and perform only the changes necessary to make the map style match the desired state. Changes in sprites\n     * (images used for icons and patterns) and glyphs (fonts for label text) **cannot** be diffed. If the sprites or fonts used in the current\n     * style and the given style are different in any way, the map renderer will force a full update, removing the current style and building\n     * the given one from scratch.\n     *\n     *\n     * @param style - A JSON object conforming to the schema described in the\n     * [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/), or a URL to such JSON.\n     * @param options - The options object.\n     *\n     * @example\n     * ```ts\n     * map.setStyle(\"https://demotiles.maplibre.org/style.json\");\n     *\n     * map.setStyle('https://demotiles.maplibre.org/style.json', {\n     *   transformStyle: (previousStyle, nextStyle) => ({\n     *       ...nextStyle,\n     *       sources: {\n     *           ...nextStyle.sources,\n     *           // copy a source from previous style\n     *           'osm': previousStyle.sources.osm\n     *       },\n     *       layers: [\n     *           // background layer\n     *           nextStyle.layers[0],\n     *           // copy a layer from previous style\n     *           previousStyle.layers[0],\n     *           // other layers from the next style\n     *           ...nextStyle.layers.slice(1).map(layer => {\n     *               // hide the layers we don't need from demotiles style\n     *               if (layer.id.startsWith('geolines')) {\n     *                   layer.layout = {...layer.layout || {}, visibility: 'none'};\n     *               // filter out US polygons\n     *               } else if (layer.id.startsWith('coastline') || layer.id.startsWith('countries')) {\n     *                   layer.filter = ['!=', ['get', 'ADM0_A3'], 'USA'];\n     *               }\n     *               return layer;\n     *           })\n     *       ]\n     *   })\n     * });\n     * ```\n     */\n    setStyle(style: StyleSpecification | string | null, options?: StyleSwapOptions & StyleOptions): this {\n        options = extend({},\n            {\n                localIdeographFontFamily: this._localIdeographFontFamily,\n                validate: this._validateStyle\n            }, options);\n\n        if ((options.diff !== false && options.localIdeographFontFamily === this._localIdeographFontFamily) && this.style && style) {\n            this._diffStyle(style, options);\n            return this;\n        } else {\n            this._localIdeographFontFamily = options.localIdeographFontFamily;\n            return this._updateStyle(style, options);\n        }\n    }\n\n    /**\n     *  Updates the requestManager's transform request with a new function\n     *\n     * @param transformRequest - A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.\n     * Expected to return an object with a `url` property and optionally `headers` and `credentials` properties\n     *\n     * @example\n     * ```ts\n     * map.setTransformRequest((url: string, resourceType: string) => {});\n     * ```\n     */\n    setTransformRequest(transformRequest: RequestTransformFunction): this {\n        this._requestManager.setTransformRequest(transformRequest);\n        return this;\n    }\n\n    _getUIString(key: keyof typeof defaultLocale) {\n        const str = this._locale[key];\n        if (str == null) {\n            throw new Error(`Missing UI string '${key}'`);\n        }\n\n        return str;\n    }\n\n    _updateStyle(style: StyleSpecification | string | null, options?: StyleSwapOptions & StyleOptions) {\n        // transformStyle relies on having previous style serialized, if it is not loaded yet, delay _updateStyle until previous style is loaded\n        if (options.transformStyle && this.style && !this.style._loaded) {\n            this.style.once('style.load', () => this._updateStyle(style, options));\n            return;\n        }\n\n        const previousStyle = this.style && options.transformStyle ? this.style.serialize() : undefined;\n        if (this.style) {\n            this.style.setEventedParent(null);\n\n            // Only release workers when map is getting disposed\n            this.style._remove(!style);\n        }\n\n        if (!style) {\n            delete this.style;\n            return this;\n        } else {\n            this.style = new Style(this, options || {});\n        }\n\n        this.style.setEventedParent(this, {style: this.style});\n\n        if (typeof style === 'string') {\n            this.style.loadURL(style, options, previousStyle);\n        } else {\n            this.style.loadJSON(style, options, previousStyle);\n        }\n\n        return this;\n    }\n\n    _lazyInitEmptyStyle() {\n        if (!this.style) {\n            this.style = new Style(this, {});\n            this.style.setEventedParent(this, {style: this.style});\n            this.style.loadEmpty();\n        }\n    }\n\n    _diffStyle(style: StyleSpecification | string, options?: StyleSwapOptions & StyleOptions) {\n        if (typeof style === 'string') {\n            const url = style;\n            const request = this._requestManager.transformRequest(url, ResourceType.Style);\n            getJSON<StyleSpecification>(request, new AbortController()).then((response) => {\n                this._updateDiff(response.data, options);\n            }).catch((error) => {\n                if (error) {\n                    this.fire(new ErrorEvent(error));\n                }\n            });\n        } else if (typeof style === 'object') {\n            this._updateDiff(style, options);\n        }\n    }\n\n    _updateDiff(style: StyleSpecification, options?: StyleSwapOptions & StyleOptions) {\n        try {\n            if (this.style.setState(style, options)) {\n                this._update(true);\n            }\n        } catch (e) {\n            warnOnce(\n                `Unable to perform style diff: ${e.message || e.error || e}.  Rebuilding the style from scratch.`\n            );\n            this._updateStyle(style, options);\n        }\n    }\n\n    /**\n     * Returns the map's MapLibre style object, a JSON object which can be used to recreate the map's style.\n     *\n     * @returns The map's style JSON object.\n     *\n     * @example\n     * ```ts\n     * let styleJson = map.getStyle();\n     * ```\n     *\n     */\n    getStyle(): StyleSpecification {\n        if (this.style) {\n            return this.style.serialize();\n        }\n    }\n\n    /**\n     * Returns a Boolean indicating whether the map's style is fully loaded.\n     *\n     * @returns A Boolean indicating whether the style is fully loaded.\n     *\n     * @example\n     * ```ts\n     * let styleLoadStatus = map.isStyleLoaded();\n     * ```\n     */\n    isStyleLoaded(): boolean | void {\n        if (!this.style) return warnOnce('There is no style added to the map.');\n        return this.style.loaded();\n    }\n\n    /**\n     * Adds a source to the map's style.\n     *\n     * Events triggered:\n     *\n     * Triggers the `source.add` event.\n     *\n     * @param id - The ID of the source to add. Must not conflict with existing sources.\n     * @param source - The source object, conforming to the\n     * MapLibre Style Specification's [source definition](https://maplibre.org/maplibre-style-spec/sources) or\n     * {@link CanvasSourceSpecification}.\n     * @example\n     * ```ts\n     * map.addSource('my-data', {\n     *   type: 'vector',\n     *   url: 'https://demotiles.maplibre.org/tiles/tiles.json'\n     * });\n     * ```\n     * @example\n     * ```ts\n     * map.addSource('my-data', {\n     *   \"type\": \"geojson\",\n     *   \"data\": {\n     *     \"type\": \"Feature\",\n     *     \"geometry\": {\n     *       \"type\": \"Point\",\n     *       \"coordinates\": [-77.0323, 38.9131]\n     *     },\n     *     \"properties\": {\n     *       \"title\": \"Mapbox DC\",\n     *       \"marker-symbol\": \"monument\"\n     *     }\n     *   }\n     * });\n     * ```\n     * @see GeoJSON source: [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/live-geojson/)\n     */\n    addSource(id: string, source: SourceSpecification | CanvasSourceSpecification): this {\n        this._lazyInitEmptyStyle();\n        this.style.addSource(id, source);\n        return this._update(true);\n    }\n\n    /**\n     * Returns a Boolean indicating whether the source is loaded. Returns `true` if the source with\n     * the given ID in the map's style has no outstanding network requests, otherwise `false`.\n     *\n     * A {@link ErrorEvent} event will be fired if there is no source wit the specified ID.\n     *\n     * @param id - The ID of the source to be checked.\n     * @returns A Boolean indicating whether the source is loaded.\n     * @example\n     * ```ts\n     * let sourceLoaded = map.isSourceLoaded('bathymetry-data');\n     * ```\n     */\n    isSourceLoaded(id: string): boolean {\n        const source = this.style && this.style.sourceCaches[id];\n        if (source === undefined) {\n            this.fire(new ErrorEvent(new Error(`There is no source with ID '${id}'`)));\n            return;\n        }\n        return source.loaded();\n    }\n\n    /**\n     * Loads a 3D terrain mesh, based on a \"raster-dem\" source.\n     *\n     * Triggers the `terrain` event.\n     *\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setTerrain({ source: 'terrain' });\n     * ```\n     */\n    setTerrain(options: TerrainSpecification | null): this {\n        this.style._checkLoaded();\n\n        // clear event handlers\n        if (this._terrainDataCallback) this.style.off('data', this._terrainDataCallback);\n\n        if (!options) {\n            // remove terrain\n            if (this.terrain) this.terrain.sourceCache.destruct();\n            this.terrain = null;\n            if (this.painter.renderToTexture) this.painter.renderToTexture.destruct();\n            this.painter.renderToTexture = null;\n            this.transform.minElevationForCurrentTile = 0;\n            this.transform.elevation = 0;\n        } else {\n            // add terrain\n            const sourceCache = this.style.sourceCaches[options.source];\n            if (!sourceCache) throw new Error(`cannot load terrain, because there exists no source with ID: ${options.source}`);\n            // Update terrain tiles when adding new terrain\n            if (this.terrain === null) sourceCache.reload();\n            // Warn once if user is using the same source for hillshade and terrain\n            for (const index in this.style._layers) {\n                const thisLayer = this.style._layers[index];\n                if (thisLayer.type === 'hillshade' && thisLayer.source === options.source) {\n                    warnOnce('You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.');\n                }\n            }\n            this.terrain = new Terrain(this.painter, sourceCache, options);\n            this.painter.renderToTexture = new RenderToTexture(this.painter, this.terrain);\n            this.transform.minElevationForCurrentTile = this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom);\n            this.transform.elevation = this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom);\n            this._terrainDataCallback = e => {\n                if (e.dataType === 'style') {\n                    this.terrain.sourceCache.freeRtt();\n                } else if (e.dataType === 'source' && e.tile) {\n                    if (e.sourceId === options.source && !this._elevationFreeze) {\n                        this.transform.minElevationForCurrentTile = this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom);\n                        this.transform.elevation = this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom);\n                    }\n                    this.terrain.sourceCache.freeRtt(e.tile.tileID);\n                }\n            };\n            this.style.on('data', this._terrainDataCallback);\n        }\n\n        this.fire(new Event('terrain', {terrain: options}));\n        return this;\n    }\n\n    /**\n     * Get the terrain-options if terrain is loaded\n     * @returns the TerrainSpecification passed to setTerrain\n     * @example\n     * ```ts\n     * map.getTerrain(); // { source: 'terrain' };\n     * ```\n     */\n    getTerrain(): TerrainSpecification | null {\n        return this.terrain?.options ?? null;\n    }\n\n    /**\n     * Returns a Boolean indicating whether all tiles in the viewport from all sources on\n     * the style are loaded.\n     *\n     * @returns A Boolean indicating whether all tiles are loaded.\n     * @example\n     * ```ts\n     * let tilesLoaded = map.areTilesLoaded();\n     * ```\n     */\n    areTilesLoaded(): boolean {\n        const sources = this.style && this.style.sourceCaches;\n        for (const id in sources) {\n            const source = sources[id];\n            const tiles = source._tiles;\n            for (const t in tiles) {\n                const tile = tiles[t];\n                if (!(tile.state === 'loaded' || tile.state === 'errored')) return false;\n            }\n        }\n        return true;\n    }\n\n    /**\n     * Removes a source from the map's style.\n     *\n     * @param id - The ID of the source to remove.\n     * @example\n     * ```ts\n     * map.removeSource('bathymetry-data');\n     * ```\n     */\n    removeSource(id: string): Map {\n        this.style.removeSource(id);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the source with the specified ID in the map's style.\n     *\n     * This method is often used to update a source using the instance members for the relevant\n     * source type as defined in classes that derive from {@link Source}.\n     * For example, setting the `data` for a GeoJSON source or updating the `url` and `coordinates`\n     * of an image source.\n     *\n     * @param id - The ID of the source to get.\n     * @returns The style source with the specified ID or `undefined` if the ID\n     * corresponds to no existing sources.\n     * The shape of the object varies by source type.\n     * A list of options for each source type is available on the MapLibre Style Specification's\n     * [Sources](https://maplibre.org/maplibre-style-spec/sources/) page.\n     * @example\n     * ```ts\n     * let sourceObject = map.getSource('points');\n     * ```\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     * @see [Animate a point](https://maplibre.org/maplibre-gl-js/docs/examples/animate-point-along-line/)\n     * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js/docs/examples/live-geojson/)\n     */\n    getSource<TSource extends Source>(id: string): TSource | undefined {\n        return this.style.getSource(id) as TSource;\n    }\n\n    /**\n     * Add an image to the style. This image can be displayed on the map like any other icon in the style's\n     * sprite using the image's ID with\n     * [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),\n     * [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),\n     * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),\n     * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).\n     *\n     * A {@link ErrorEvent} event will be fired if the image parameter is invalid or there is not enough space in the sprite to add this image.\n     *\n     * @param id - The ID of the image.\n     * @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`\n     * properties with the same format as `ImageData`.\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * // If the style's sprite does not already contain an image with ID 'cat',\n     * // add the image 'cat-icon.png' to the style's sprite with the ID 'cat'.\n     * const image = await map.loadImage('https://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Cat_silhouette.svg/400px-Cat_silhouette.svg.png');\n     * if (!map.hasImage('cat')) map.addImage('cat', image.data);\n     *\n     * // Add a stretchable image that can be used with `icon-text-fit`\n     * // In this example, the image is 600px wide by 400px high.\n     * const image = await map.loadImage('https://upload.wikimedia.org/wikipedia/commons/8/89/Black_and_White_Boxed_%28bordered%29.png');\n     * if (map.hasImage('border-image')) return;\n     * map.addImage('border-image', image.data, {\n     *     content: [16, 16, 300, 384], // place text over left half of image, avoiding the 16px border\n     *     stretchX: [[16, 584]], // stretch everything horizontally except the 16px border\n     *     stretchY: [[16, 384]], // stretch everything vertically except the 16px border\n     * });\n     * ```\n     * @see Use `HTMLImageElement`: [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image/)\n     * @see Use `ImageData`: [Add a generated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-generated/)\n     */\n    addImage(id: string,\n        image: HTMLImageElement | ImageBitmap | ImageData | {\n            width: number;\n            height: number;\n            data: Uint8Array | Uint8ClampedArray;\n        } | StyleImageInterface,\n        options: Partial<StyleImageMetadata> = {}): this {\n        const {\n            pixelRatio = 1,\n            sdf = false,\n            stretchX,\n            stretchY,\n            content,\n            textFitWidth,\n            textFitHeight\n        } = options;\n        this._lazyInitEmptyStyle();\n        const version = 0;\n\n        if (image instanceof HTMLImageElement || isImageBitmap(image)) {\n            const {width, height, data} = browser.getImageData(image);\n            this.style.addImage(id, {data: new RGBAImage({width, height}, data), pixelRatio, stretchX, stretchY, content, textFitWidth, textFitHeight, sdf, version});\n        } else if (image.width === undefined || image.height === undefined) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, ' +\n                'or object with `width`, `height`, and `data` properties with the same format as `ImageData`')));\n        } else {\n            const {width, height, data} = image as ImageData;\n            const userImage = (image as any as StyleImageInterface);\n\n            this.style.addImage(id, {\n                data: new RGBAImage({width, height}, new Uint8Array(data)),\n                pixelRatio,\n                stretchX,\n                stretchY,\n                content,\n                textFitWidth,\n                textFitHeight,\n                sdf,\n                version,\n                userImage\n            });\n\n            if (userImage.onAdd) {\n                userImage.onAdd(this, id);\n            }\n            return this;\n        }\n    }\n\n    /**\n     * Update an existing image in a style. This image can be displayed on the map like any other icon in the style's\n     * sprite using the image's ID with\n     * [`icon-image`](https://maplibre.org/maplibre-style-spec/layers/#layout-symbol-icon-image),\n     * [`background-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-background-background-pattern),\n     * [`fill-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-fill-fill-pattern),\n     * or [`line-pattern`](https://maplibre.org/maplibre-style-spec/layers/#paint-line-line-pattern).\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invald.\n     *\n     * @param id - The ID of the image.\n     * @param image - The image as an `HTMLImageElement`, `ImageData`, `ImageBitmap` or object with `width`, `height`, and `data`\n     * properties with the same format as `ImageData`.\n     * @example\n     * ```ts\n     * // If an image with the ID 'cat' already exists in the style's sprite,\n     * // replace that image with a new image, 'other-cat-icon.png'.\n     * if (map.hasImage('cat')) map.updateImage('cat', './other-cat-icon.png');\n     * ```\n     */\n    updateImage(id: string,\n        image: HTMLImageElement | ImageBitmap | ImageData | {\n            width: number;\n            height: number;\n            data: Uint8Array | Uint8ClampedArray;\n        } | StyleImageInterface): this {\n\n        const existingImage = this.style.getImage(id);\n        if (!existingImage) {\n            return this.fire(new ErrorEvent(new Error(\n                'The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.')));\n        }\n        const imageData = (image instanceof HTMLImageElement || isImageBitmap(image)) ?\n            browser.getImageData(image) :\n            image;\n        const {width, height, data} = imageData;\n\n        if (width === undefined || height === undefined) {\n            return this.fire(new ErrorEvent(new Error(\n                'Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, ' +\n                'or object with `width`, `height`, and `data` properties with the same format as `ImageData`')));\n        }\n\n        if (width !== existingImage.data.width || height !== existingImage.data.height) {\n            return this.fire(new ErrorEvent(new Error(\n                'The width and height of the updated image must be that same as the previous version of the image')));\n        }\n\n        const copy = !(image instanceof HTMLImageElement || isImageBitmap(image));\n        existingImage.data.replace(data, copy);\n\n        this.style.updateImage(id, existingImage);\n        return this;\n    }\n\n    /**\n     * Returns an image, specified by ID, currently available in the map.\n     * This includes both images from the style's original sprite\n     * and any images that have been added at runtime using {@link Map#addImage}.\n     *\n     * @param id - The ID of the image.\n     * @returns An image in the map with the specified ID.\n     *\n     * @example\n     * ```ts\n     * let coffeeShopIcon = map.getImage(\"coffee_cup\");\n     * ```\n     */\n    getImage(id: string): StyleImage {\n        return this.style.getImage(id);\n    }\n\n    /**\n     * Check whether or not an image with a specific ID exists in the style. This checks both images\n     * in the style's original sprite and any images\n     * that have been added at runtime using {@link Map#addImage}.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invald.\n     *\n     * @param id - The ID of the image.\n     *\n     * @returns A Boolean indicating whether the image exists.\n     * @example\n     * Check if an image with the ID 'cat' exists in the style's sprite.\n     * ```ts\n     * let catIconExists = map.hasImage('cat');\n     * ```\n     */\n    hasImage(id: string): boolean {\n        if (!id) {\n            this.fire(new ErrorEvent(new Error('Missing required image id')));\n            return false;\n        }\n\n        return !!this.style.getImage(id);\n    }\n\n    /**\n     * Remove an image from a style. This can be an image from the style's original\n     * sprite or any images\n     * that have been added at runtime using {@link Map#addImage}.\n     *\n     * @param id - The ID of the image.\n     *\n     * @example\n     * ```ts\n     * // If an image with the ID 'cat' exists in\n     * // the style's sprite, remove it.\n     * if (map.hasImage('cat')) map.removeImage('cat');\n     * ```\n     */\n    removeImage(id: string) {\n        this.style.removeImage(id);\n    }\n\n    /**\n     * Load an image from an external URL to be used with {@link Map#addImage}. External\n     * domains must support [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS).\n     *\n     * @param url - The URL of the image file. Image file must be in png, webp, or jpg format.\n     * @returns a promise that is resolved when the image is loaded\n     *\n     * @example\n     * Load an image from an external URL.\n     * ```ts\n     * const response = await map.loadImage('https://picsum.photos/50/50');\n     * // Add the loaded image to the style's sprite with the ID 'photo'.\n     * map.addImage('photo', response.data);\n     * ```\n     * @see [Add an icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image/)\n     */\n    loadImage(url: string): Promise<GetResourceResponse<HTMLImageElement | ImageBitmap>> {\n        return ImageRequest.getImage(this._requestManager.transformRequest(url, ResourceType.Image), new AbortController());\n    }\n\n    /**\n     * Returns an Array of strings containing the IDs of all images currently available in the map.\n     * This includes both images from the style's original sprite\n     * and any images that have been added at runtime using {@link Map#addImage}.\n     *\n     * @returns An Array of strings containing the names of all sprites/images currently available in the map.\n     *\n     * @example\n     * ```ts\n     * let allImages = map.listImages();\n     * ```\n     */\n    listImages(): Array<string> {\n        return this.style.listImages();\n    }\n\n    /**\n     * Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)\n     * to the map's style.\n     *\n     * A layer defines how data from a specified source will be styled. Read more about layer types\n     * and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).\n     *\n     * @param layer - The layer to add,\n     * conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,\n     * less commonly, the {@link CustomLayerInterface} specification. Can also be a layer definition with an embedded source definition.\n     * The MapLibre Style Specification's layer definition is appropriate for most layers.\n     *\n     * @param beforeId - The ID of an existing layer to insert the new layer before,\n     * resulting in the new layer appearing visually beneath the existing layer.\n     * If this argument is not specified, the layer will be appended to the end of the layers array\n     * and appear visually above all other layers.\n     *\n     * @example\n     * Add a circle layer with a vector source\n     * ```ts\n     * map.addLayer({\n     *   id: 'points-of-interest',\n     *   source: {\n     *     type: 'vector',\n     *     url: 'https://demotiles.maplibre.org/tiles/tiles.json'\n     *   },\n     *   'source-layer': 'poi_label',\n     *   type: 'circle',\n     *   paint: {\n     *     // MapLibre Style Specification paint properties\n     *   },\n     *   layout: {\n     *     // MapLibre Style Specification layout properties\n     *   }\n     * });\n     * ```\n     *\n     * @example\n     * Define a source before using it to create a new layer\n     * ```ts\n     * map.addSource('state-data', {\n     *   type: 'geojson',\n     *   data: 'path/to/data.geojson'\n     * });\n     *\n     * map.addLayer({\n     *   id: 'states',\n     *   // References the GeoJSON source defined above\n     *   // and does not require a `source-layer`\n     *   source: 'state-data',\n     *   type: 'symbol',\n     *   layout: {\n     *     // Set the label content to the\n     *     // feature's `name` property\n     *     text-field: ['get', 'name']\n     *   }\n     * });\n     * ```\n     *\n     * @example\n     * Add a new symbol layer before an existing layer\n     * ```ts\n     * map.addLayer({\n     *   id: 'states',\n     *   // References a source that's already been defined\n     *   source: 'state-data',\n     *   type: 'symbol',\n     *   layout: {\n     *     // Set the label content to the\n     *     // feature's `name` property\n     *     text-field: ['get', 'name']\n     *   }\n     * // Add the layer before the existing `cities` layer\n     * }, 'cities');\n     * ```\n     * @see [Create and style clusters](https://maplibre.org/maplibre-gl-js/docs/examples/cluster/)\n     * @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js/docs/examples/vector-source/)\n     * @see [Add a WMS source](https://maplibre.org/maplibre-gl-js/docs/examples/wms/)\n     */\n    addLayer(layer: AddLayerObject, beforeId?: string) {\n        this._lazyInitEmptyStyle();\n        this.style.addLayer(layer, beforeId);\n        return this._update(true);\n    }\n\n    /**\n     * Moves a layer to a different z-position.\n     *\n     * @param id - The ID of the layer to move.\n     * @param beforeId - The ID of an existing layer to insert the new layer before. When viewing the map, the `id` layer will appear beneath the `beforeId` layer. If `beforeId` is omitted, the layer will be appended to the end of the layers array and appear above all other layers on the map.\n     *\n     * @example\n     * Move a layer with ID 'polygon' before the layer with ID 'country-label'. The `polygon` layer will appear beneath the `country-label` layer on the map.\n     * ```ts\n     * map.moveLayer('polygon', 'country-label');\n     * ```\n     */\n    moveLayer(id: string, beforeId?: string): this {\n        this.style.moveLayer(id, beforeId);\n        return this._update(true);\n    }\n\n    /**\n     * Removes the layer with the given ID from the map's style.\n     *\n     * An {@link ErrorEvent} will be fired if the image parameter is invald.\n     *\n     * @param id - The ID of the layer to remove\n     *\n     * @example\n     * If a layer with ID 'state-data' exists, remove it.\n     * ```ts\n     * if (map.getLayer('state-data')) map.removeLayer('state-data');\n     * ```\n     */\n    removeLayer(id: string): this {\n        this.style.removeLayer(id);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the layer with the specified ID in the map's style.\n     *\n     * @param id - The ID of the layer to get.\n     * @returns The layer with the specified ID, or `undefined`\n     * if the ID corresponds to no existing layers.\n     *\n     * @example\n     * ```ts\n     * let stateDataLayer = map.getLayer('state-data');\n     * ```\n     * @see [Filter symbols by toggling a list](https://maplibre.org/maplibre-gl-js/docs/examples/filter-markers/)\n     * @see [Filter symbols by text input](https://maplibre.org/maplibre-gl-js/docs/examples/filter-markers-by-input/)\n     */\n    getLayer(id: string): StyleLayer | undefined {\n        return this.style.getLayer(id);\n    }\n\n    /**\n     * Return the ids of all layers currently in the style, including custom layers, in order.\n     *\n     * @returns ids of layers, in order\n     *\n     * @example\n     * ```ts\n     * const orderedLayerIds = map.getLayersOrder();\n     * ```\n     */\n    getLayersOrder(): string[] {\n        return this.style.getLayersOrder();\n    }\n\n    /**\n     * Sets the zoom extent for the specified style layer. The zoom extent includes the\n     * [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)\n     * and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))\n     * at which the layer will be rendered.\n     *\n     * Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the\n     * minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum\n     * zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style\n     * layer will not be rendered at all zoom levels in the zoom range.\n     *\n     * @param layerId - The ID of the layer to which the zoom extent will be applied.\n     * @param minzoom - The minimum zoom to set (0-24).\n     * @param maxzoom - The maximum zoom to set (0-24).\n     *\n     * @example\n     * ```ts\n     * map.setLayerZoomRange('my-layer', 2, 5);\n     * ```\n     */\n    setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this {\n        this.style.setLayerZoomRange(layerId, minzoom, maxzoom);\n        return this._update(true);\n    }\n\n    /**\n     * Sets the filter for the specified style layer.\n     *\n     * Filters control which features a style layer renders from its source.\n     * Any feature for which the filter expression evaluates to `true` will be\n     * rendered on the map. Those that are false will be hidden.\n     *\n     * Use `setFilter` to show a subset of your source data.\n     *\n     * To clear the filter, pass `null` or `undefined` as the second parameter.\n     *\n     * @param layerId - The ID of the layer to which the filter will be applied.\n     * @param filter - The filter, conforming to the MapLibre Style Specification's\n     * [filter definition](https://maplibre.org/maplibre-style-spec/layers/#filter).  If `null` or `undefined` is provided, the function removes any existing filter from the layer.\n     * @param options - Options object.\n     *\n     * @example\n     * Display only features with the 'name' property 'USA'\n     * ```ts\n     * map.setFilter('my-layer', ['==', ['get', 'name'], 'USA']);\n     * ```\n     * @example\n     * Display only features with five or more 'available-spots'\n     * ```ts\n     * map.setFilter('bike-docks', ['>=', ['get', 'available-spots'], 5]);\n     * ```\n     * @example\n     * Remove the filter for the 'bike-docks' style layer\n     * ```ts\n     * map.setFilter('bike-docks', null);\n     * ```\n     * @see [Create a timeline animation](https://maplibre.org/maplibre-gl-js/docs/examples/timeline-animation/)\n     */\n    setFilter(layerId: string, filter?: FilterSpecification | null, options: StyleSetterOptions = {}) {\n        this.style.setFilter(layerId, filter, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the filter applied to the specified style layer.\n     *\n     * @param layerId - The ID of the style layer whose filter to get.\n     * @returns The layer's filter.\n     */\n    getFilter(layerId: string): FilterSpecification | void {\n        return this.style.getFilter(layerId);\n    }\n\n    /**\n     * Sets the value of a paint property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to set the paint property in.\n     * @param name - The name of the paint property to set.\n     * @param value - The value of the paint property to set.\n     * Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).\n     * Pass `null` to unset the existing value.\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setPaintProperty('my-layer', 'fill-color', '#faafee');\n     * ```\n     * @see [Change a layer's color with buttons](https://maplibre.org/maplibre-gl-js/docs/examples/color-switcher/)\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    setPaintProperty(layerId: string, name: string, value: any, options: StyleSetterOptions = {}): this {\n        this.style.setPaintProperty(layerId, name, value, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of a paint property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to get the paint property from.\n     * @param name - The name of a paint property to get.\n     * @returns The value of the specified paint property.\n     */\n    getPaintProperty(layerId: string, name: string) {\n        return this.style.getPaintProperty(layerId, name);\n    }\n\n    /**\n     * Sets the value of a layout property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to set the layout property in.\n     * @param name - The name of the layout property to set.\n     * @param value - The value of the layout property. Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).\n     * @param options - The options object.\n     * @example\n     * ```ts\n     * map.setLayoutProperty('my-layer', 'visibility', 'none');\n     * ```\n     */\n    setLayoutProperty(layerId: string, name: string, value: any, options: StyleSetterOptions = {}): this {\n        this.style.setLayoutProperty(layerId, name, value, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of a layout property in the specified style layer.\n     *\n     * @param layerId - The ID of the layer to get the layout property from.\n     * @param name - The name of the layout property to get.\n     * @returns The value of the specified layout property.\n     */\n    getLayoutProperty(layerId: string, name: string) {\n        return this.style.getLayoutProperty(layerId, name);\n    }\n\n    /**\n     * Sets the value of the style's glyphs property.\n     *\n     * @param glyphsUrl - Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');\n     * ```\n     */\n    setGlyphs(glyphsUrl: string | null, options: StyleSetterOptions = {}): this {\n        this._lazyInitEmptyStyle();\n        this.style.setGlyphs(glyphsUrl, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the style's glyphs URL\n     *\n     * @returns glyphs Style's glyphs url\n     */\n    getGlyphs(): string | null {\n        return this.style.getGlyphsUrl();\n    }\n\n    /**\n     * Adds a sprite to the map's style. Fires the `style` event.\n     *\n     * @param id - The ID of the sprite to add. Must not conflict with existing sprites.\n     * @param url - The URL to load the sprite from\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.addSprite('sprite-two', 'http://example.com/sprite-two');\n     * ```\n     */\n    addSprite(id: string, url: string, options: StyleSetterOptions = {}): this {\n        this._lazyInitEmptyStyle();\n        this.style.addSprite(id, url, options, (err) => {\n            if (!err) {\n                this._update(true);\n            }\n        });\n        return this;\n    }\n\n    /**\n     * Removes the sprite from the map's style. Fires the `style` event.\n     *\n     * @param id - The ID of the sprite to remove. If the sprite is declared as a single URL, the ID must be \"default\".\n     * @example\n     * ```ts\n     * map.removeSprite('sprite-two');\n     * map.removeSprite('default');\n     * ```\n     */\n    removeSprite(id: string) {\n        this._lazyInitEmptyStyle();\n        this.style.removeSprite(id);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the as-is value of the style's sprite.\n     *\n     * @returns style's sprite list of id-url pairs\n     */\n    getSprite(): {id: string; url: string}[] {\n        return this.style.getSprite();\n    }\n\n    /**\n     * Sets the value of the style's sprite property.\n     *\n     * @param spriteUrl - Sprite URL to set.\n     * @param options - Options object.\n     * @example\n     * ```ts\n     * map.setSprite('YOUR_SPRITE_URL');\n     * ```\n     */\n    setSprite(spriteUrl: string | null, options: StyleSetterOptions = {}) {\n        this._lazyInitEmptyStyle();\n        this.style.setSprite(spriteUrl, options, (err) => {\n            if (!err) {\n                this._update(true);\n            }\n        });\n        return this;\n    }\n\n    /**\n     * Sets the any combination of light values.\n     *\n     * @param light - Light properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/light).\n     * @param options - Options object.\n     *\n     * @example\n     * ```ts\n     * let layerVisibility = map.getLayoutProperty('my-layer', 'visibility');\n     * ```\n     */\n    setLight(light: LightSpecification, options: StyleSetterOptions = {}) {\n        this._lazyInitEmptyStyle();\n        this.style.setLight(light, options);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the light object.\n     *\n     * @returns light Light properties of the style.\n     */\n    getLight(): LightSpecification {\n        return this.style.getLight();\n    }\n\n    /**\n     * Loads sky and fog defined by {@link SkySpecification} onto the map.\n     * Note: The fog only shows when using the terrain 3D feature.\n     * @param sky - Sky properties to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/sky/).\n     * @returns `this`\n     * @example\n     * ```ts\n     * map.setSky({ 'sky-color': '#00f' });\n     * ```\n     */\n    setSky(sky: SkySpecification) {\n        this._lazyInitEmptyStyle();\n        this.style.setSky(sky);\n        return this._update(true);\n    }\n\n    /**\n     * Returns the value of the sky object.\n     *\n     * @returns the sky properties of the style.\n     * @example\n     * ```ts\n     * map.getSky();\n     * ```\n     */\n    getSky() {\n        return this.style.getSky();\n    }\n\n    /**\n     * Sets the `state` of a feature.\n     * A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime.\n     * When using this method, the `state` object is merged with any existing key-value pairs in the feature's state.\n     * Features are identified by their `feature.id` attribute, which can be any number or string.\n     *\n     * This method can only be used with sources that have a `feature.id` attribute. The `feature.id` attribute can be defined in three ways:\n     *\n     * - For vector or GeoJSON sources, including an `id` attribute in the original data file.\n     * - For vector or GeoJSON sources, using the [`promoteId`](https://maplibre.org/maplibre-style-spec/sources/#vector-promoteId) option at the time the source is defined.\n     * - For GeoJSON sources, using the [`generateId`](https://maplibre.org/maplibre-style-spec/sources/#geojson-generateId) option to auto-assign an `id` based on the feature's index in the source data. If you change feature data using `map.getSource('some id').setData(..)`, you may need to re-apply state taking into account updated `id` values.\n     *\n     * _Note: You can use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state) to access the values in a feature's state object for the purposes of styling._\n     *\n     * @param feature - Feature identifier. Feature objects returned from\n     * {@link Map#queryRenderedFeatures} or event handlers can be used as feature identifiers.\n     * @param state - A set of key-value pairs. The values should be valid JSON types.\n     *\n     * @example\n     * ```ts\n     * // When the mouse moves over the `my-layer` layer, update\n     * // the feature state for the feature under the mouse\n     * map.on('mousemove', 'my-layer', (e) => {\n     *   if (e.features.length > 0) {\n     *     map.setFeatureState({\n     *       source: 'my-source',\n     *       sourceLayer: 'my-source-layer',\n     *       id: e.features[0].id,\n     *     }, {\n     *       hover: true\n     *     });\n     *   }\n     * });\n     * ```\n     * @see [Create a hover effect](https://maplibre.org/maplibre-gl-js/docs/examples/hover-styles/)\n     */\n    setFeatureState(feature: FeatureIdentifier, state: any): this {\n        this.style.setFeatureState(feature, state);\n        return this._update();\n    }\n\n    /**\n     * Removes the `state` of a feature, setting it back to the default behavior.\n     * If only a `target.source` is specified, it will remove the state for all features from that source.\n     * If `target.id` is also specified, it will remove all keys for that feature's state.\n     * If `key` is also specified, it removes only that key from that feature's state.\n     * Features are identified by their `feature.id` attribute, which can be any number or string.\n     *\n     * @param target - Identifier of where to remove state. It can be a source, a feature, or a specific key of feature.\n     * Feature objects returned from {@link Map#queryRenderedFeatures} or event handlers can be used as feature identifiers.\n     * @param key - (optional) The key in the feature state to reset.\n     * @example\n     * Reset the entire state object for all features in the `my-source` source\n     * ```ts\n     * map.removeFeatureState({\n     *   source: 'my-source'\n     * });\n     * ```\n     *\n     * @example\n     * When the mouse leaves the `my-layer` layer,\n     * reset the entire state object for the\n     * feature under the mouse\n     * ```ts\n     * map.on('mouseleave', 'my-layer', (e) => {\n     *   map.removeFeatureState({\n     *     source: 'my-source',\n     *     sourceLayer: 'my-source-layer',\n     *     id: e.features[0].id\n     *   });\n     * });\n     * ```\n     *\n     * @example\n     * When the mouse leaves the `my-layer` layer,\n     * reset only the `hover` key-value pair in the\n     * state for the feature under the mouse\n     * ```ts\n     * map.on('mouseleave', 'my-layer', (e) => {\n     *   map.removeFeatureState({\n     *     source: 'my-source',\n     *     sourceLayer: 'my-source-layer',\n     *     id: e.features[0].id\n     *   }, 'hover');\n     * });\n     * ```\n     */\n    removeFeatureState(target: FeatureIdentifier, key?: string): this {\n        this.style.removeFeatureState(target, key);\n        return this._update();\n    }\n\n    /**\n     * Gets the `state` of a feature.\n     * A feature's `state` is a set of user-defined key-value pairs that are assigned to a feature at runtime.\n     * Features are identified by their `feature.id` attribute, which can be any number or string.\n     *\n     * _Note: To access the values in a feature's state object for the purposes of styling the feature, use the [`feature-state` expression](https://maplibre.org/maplibre-style-spec/expressions/#feature-state)._\n     *\n     * @param feature - Feature identifier. Feature objects returned from\n     * {@link Map#queryRenderedFeatures} or event handlers can be used as feature identifiers.\n     * @returns The state of the feature: a set of key-value pairs that was assigned to the feature at runtime.\n     *\n     * @example\n     * When the mouse moves over the `my-layer` layer,\n     * get the feature state for the feature under the mouse\n     * ```ts\n     * map.on('mousemove', 'my-layer', (e) => {\n     *   if (e.features.length > 0) {\n     *     map.getFeatureState({\n     *       source: 'my-source',\n     *       sourceLayer: 'my-source-layer',\n     *       id: e.features[0].id\n     *     });\n     *   }\n     * });\n     * ```\n     */\n    getFeatureState(feature: FeatureIdentifier): any {\n        return this.style.getFeatureState(feature);\n    }\n\n    /**\n     * Returns the map's containing HTML element.\n     *\n     * @returns The map's container.\n     */\n    getContainer(): HTMLElement {\n        return this._container;\n    }\n\n    /**\n     * Returns the HTML element containing the map's `<canvas>` element.\n     *\n     * If you want to add non-GL overlays to the map, you should append them to this element.\n     *\n     * This is the element to which event bindings for map interactivity (such as panning and zooming) are\n     * attached. It will receive bubbled events from child elements such as the `<canvas>`, but not from\n     * map controls.\n     *\n     * @returns The container of the map's `<canvas>`.\n     * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-point/)\n     */\n    getCanvasContainer(): HTMLElement {\n        return this._canvasContainer;\n    }\n\n    /**\n     * Returns the map's `<canvas>` element.\n     *\n     * @returns The map's `<canvas>` element.\n     * @see [Measure distances](https://maplibre.org/maplibre-gl-js/docs/examples/measure/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js/docs/examples/center-on-symbol/)\n     */\n    getCanvas(): HTMLCanvasElement {\n        return this._canvas;\n    }\n\n    _containerDimensions() {\n        let width = 0;\n        let height = 0;\n\n        if (this._container) {\n            width = this._container.clientWidth || 400;\n            height = this._container.clientHeight || 300;\n        }\n\n        return [width, height];\n    }\n\n    _setupContainer() {\n        const container = this._container;\n        container.classList.add('maplibregl-map');\n\n        const canvasContainer = this._canvasContainer = DOM.create('div', 'maplibregl-canvas-container', container);\n        if (this._interactive) {\n            canvasContainer.classList.add('maplibregl-interactive');\n        }\n\n        this._canvas = DOM.create('canvas', 'maplibregl-canvas', canvasContainer);\n        this._canvas.addEventListener('webglcontextlost', this._contextLost, false);\n        this._canvas.addEventListener('webglcontextrestored', this._contextRestored, false);\n        this._canvas.setAttribute('tabindex', this._interactive ? '0' : '-1');\n        this._canvas.setAttribute('aria-label', this._getUIString('Map.Title'));\n        this._canvas.setAttribute('role', 'region');\n\n        const dimensions = this._containerDimensions();\n        const clampedPixelRatio = this._getClampedPixelRatio(dimensions[0], dimensions[1]);\n        this._resizeCanvas(dimensions[0], dimensions[1], clampedPixelRatio);\n\n        const controlContainer = this._controlContainer = DOM.create('div', 'maplibregl-control-container', container);\n        const positions = this._controlPositions = {};\n        ['top-left', 'top-right', 'bottom-left', 'bottom-right'].forEach((positionName) => {\n            positions[positionName] = DOM.create('div', `maplibregl-ctrl-${positionName} `, controlContainer);\n        });\n\n        this._container.addEventListener('scroll', this._onMapScroll, false);\n    }\n\n    _resizeCanvas(width: number, height: number, pixelRatio: number) {\n        // Request the required canvas size taking the pixelratio into account.\n        this._canvas.width = Math.floor(pixelRatio * width);\n        this._canvas.height = Math.floor(pixelRatio * height);\n\n        // Maintain the same canvas size, potentially downscaling it for HiDPI displays\n        this._canvas.style.width = `${width}px`;\n        this._canvas.style.height = `${height}px`;\n    }\n\n    _setupPainter() {\n\n        const attributes = {\n            alpha: true,\n            stencil: true,\n            depth: true,\n            failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat,\n            preserveDrawingBuffer: this._preserveDrawingBuffer,\n            antialias: this._antialias || false\n        };\n\n        let webglcontextcreationerrorDetailObject: any = null;\n        this._canvas.addEventListener('webglcontextcreationerror', (args: WebGLContextEvent) => {\n            webglcontextcreationerrorDetailObject = {requestedAttributes: attributes};\n            if (args) {\n                webglcontextcreationerrorDetailObject.statusMessage = args.statusMessage;\n                webglcontextcreationerrorDetailObject.type = args.type;\n            }\n        }, {once: true});\n\n        const gl =\n            this._canvas.getContext('webgl2', attributes) as WebGL2RenderingContext ||\n            this._canvas.getContext('webgl', attributes) as WebGLRenderingContext;\n\n        if (!gl) {\n            const msg = 'Failed to initialize WebGL';\n            if (webglcontextcreationerrorDetailObject) {\n                webglcontextcreationerrorDetailObject.message = msg;\n                throw new Error(JSON.stringify(webglcontextcreationerrorDetailObject));\n            } else {\n                throw new Error(msg);\n            }\n        }\n\n        this.painter = new Painter(gl, this.transform);\n\n        webpSupported.testSupport(gl);\n    }\n\n    _contextLost = (event: any) => {\n        event.preventDefault();\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        this.fire(new Event('webglcontextlost', {originalEvent: event}));\n    };\n\n    _contextRestored = (event: any) => {\n        this._setupPainter();\n        this.resize();\n        this._update();\n        this.fire(new Event('webglcontextrestored', {originalEvent: event}));\n    };\n\n    _onMapScroll = (event: any) => {\n        if (event.target !== this._container) return;\n\n        // Revert any scroll which would move the canvas outside of the view\n        this._container.scrollTop = 0;\n        this._container.scrollLeft = 0;\n        return false;\n    };\n\n    /**\n     * Returns a Boolean indicating whether the map is fully loaded.\n     *\n     * Returns `false` if the style is not yet fully loaded,\n     * or if there has been a change to the sources or style that\n     * has not yet fully loaded.\n     *\n     * @returns A Boolean indicating whether the map is fully loaded.\n     */\n    loaded(): boolean {\n        return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded();\n    }\n\n    /**\n     * @internal\n     * Update this map's style and sources, and re-render the map.\n     *\n     * @param updateStyle - mark the map's style for reprocessing as\n     * well as its sources\n     */\n    _update(updateStyle?: boolean) {\n        if (!this.style || !this.style._loaded) return this;\n\n        this._styleDirty = this._styleDirty || updateStyle;\n        this._sourcesDirty = true;\n        this.triggerRepaint();\n\n        return this;\n    }\n\n    /**\n     * @internal\n     * Request that the given callback be executed during the next render\n     * frame.  Schedule a render frame if one is not already scheduled.\n     *\n     * @returns An id that can be used to cancel the callback\n     */\n    _requestRenderFrame(callback: () => void): TaskID {\n        this._update();\n        return this._renderTaskQueue.add(callback);\n    }\n\n    _cancelRenderFrame(id: TaskID) {\n        this._renderTaskQueue.remove(id);\n    }\n\n    /**\n     * @internal\n     * Call when a (re-)render of the map is required:\n     *\n     * - The style has changed (`setPaintProperty()`, etc.)\n     * - Source data has changed (e.g. tiles have finished loading)\n     * - The map has is moving (or just finished moving)\n     * - A transition is in progress\n     *\n     * @param paintStartTimeStamp - The time when the animation frame began executing.\n     */\n    _render(paintStartTimeStamp: number) {\n        const fadeDuration = this._idleTriggered ? this._fadeDuration : 0;\n\n        // A custom layer may have used the context asynchronously. Mark the state as dirty.\n        this.painter.context.setDirty();\n        this.painter.setBaseState();\n\n        this._renderTaskQueue.run(paintStartTimeStamp);\n        // A task queue callback may have fired a user event which may have removed the map\n        if (this._removed) return;\n\n        let crossFading = false;\n\n        // If the style has changed, the map is being zoomed, or a transition or fade is in progress:\n        //  - Apply style changes (in a batch)\n        //  - Recalculate paint properties.\n        if (this.style && this._styleDirty) {\n            this._styleDirty = false;\n\n            const zoom = this.transform.zoom;\n            const now = browser.now();\n            this.style.zoomHistory.update(zoom, now);\n\n            const parameters = new EvaluationParameters(zoom, {\n                now,\n                fadeDuration,\n                zoomHistory: this.style.zoomHistory,\n                transition: this.style.getTransition()\n            });\n\n            const factor = parameters.crossFadingFactor();\n            if (factor !== 1 || factor !== this._crossFadingFactor) {\n                crossFading = true;\n                this._crossFadingFactor = factor;\n            }\n\n            this.style.update(parameters);\n        }\n\n        // If we are in _render for any reason other than an in-progress paint\n        // transition, update source caches to check for and load any tiles we\n        // need for the current transform\n        if (this.style && this._sourcesDirty) {\n            this._sourcesDirty = false;\n            this.style._updateSources(this.transform);\n        }\n\n        // update terrain stuff\n        if (this.terrain) {\n            this.terrain.sourceCache.update(this.transform, this.terrain);\n            this.transform.minElevationForCurrentTile = this.terrain.getMinTileElevationForLngLatZoom(this.transform.center, this.transform.tileZoom);\n            if (!this._elevationFreeze) {\n                this.transform.elevation = this.terrain.getElevationForLngLatZoom(this.transform.center, this.transform.tileZoom);\n            }\n        } else {\n            this.transform.minElevationForCurrentTile = 0;\n            this.transform.elevation = 0;\n        }\n\n        this._placementDirty = this.style && this.style._updatePlacement(this.painter.transform, this.showCollisionBoxes, fadeDuration, this._crossSourceCollisions);\n\n        // Actually draw\n        this.painter.render(this.style, {\n            showTileBoundaries: this.showTileBoundaries,\n            showOverdrawInspector: this._showOverdrawInspector,\n            rotating: this.isRotating(),\n            zooming: this.isZooming(),\n            moving: this.isMoving(),\n            fadeDuration,\n            showPadding: this.showPadding,\n        });\n\n        this.fire(new Event('render'));\n\n        if (this.loaded() && !this._loaded) {\n            this._loaded = true;\n            PerformanceUtils.mark(PerformanceMarkers.load);\n            this.fire(new Event('load'));\n        }\n\n        if (this.style && (this.style.hasTransitions() || crossFading)) {\n            this._styleDirty = true;\n        }\n\n        if (this.style && !this._placementDirty) {\n            // Since no fade operations are in progress, we can release\n            // all tiles held for fading. If we didn't do this, the tiles\n            // would just sit in the SourceCaches until the next render\n            this.style._releaseSymbolFadeTiles();\n        }\n\n        // Schedule another render frame if it's needed.\n        //\n        // Even though `_styleDirty` and `_sourcesDirty` are reset in this\n        // method, synchronous events fired during Style#update or\n        // Style#_updateSources could have caused them to be set again.\n        const somethingDirty = this._sourcesDirty || this._styleDirty || this._placementDirty;\n        if (somethingDirty || this._repaint) {\n            this.triggerRepaint();\n        } else if (!this.isMoving() && this.loaded()) {\n            this.fire(new Event('idle'));\n        }\n\n        if (this._loaded && !this._fullyLoaded && !somethingDirty) {\n            this._fullyLoaded = true;\n            PerformanceUtils.mark(PerformanceMarkers.fullLoad);\n        }\n\n        return this;\n    }\n\n    /**\n     * Force a synchronous redraw of the map.\n     * @example\n     * ```ts\n     * map.redraw();\n     * ```\n     */\n    redraw(): this {\n        if (this.style) {\n            // cancel the scheduled update\n            if (this._frameRequest) {\n                this._frameRequest.abort();\n                this._frameRequest = null;\n            }\n            this._render(0);\n        }\n        return this;\n    }\n\n    /**\n     * Clean up and release all internal resources associated with this map.\n     *\n     * This includes DOM elements, event bindings, web workers, and WebGL resources.\n     *\n     * Use this method when you are done using the map and wish to ensure that it no\n     * longer consumes browser resources. Afterwards, you must not call any other\n     * methods on the map.\n     */\n    remove() {\n        if (this._hash) this._hash.remove();\n\n        for (const control of this._controls) control.onRemove(this);\n        this._controls = [];\n\n        if (this._frameRequest) {\n            this._frameRequest.abort();\n            this._frameRequest = null;\n        }\n        this._renderTaskQueue.clear();\n        this.painter.destroy();\n        this.handlers.destroy();\n        delete this.handlers;\n        this.setStyle(null);\n        if (typeof window !== 'undefined') {\n            removeEventListener('online', this._onWindowOnline, false);\n        }\n\n        ImageRequest.removeThrottleControl(this._imageQueueHandle);\n\n        this._resizeObserver?.disconnect();\n        const extension = this.painter.context.gl.getExtension('WEBGL_lose_context');\n        if (extension?.loseContext) extension.loseContext();\n        this._canvas.removeEventListener('webglcontextrestored', this._contextRestored, false);\n        this._canvas.removeEventListener('webglcontextlost', this._contextLost, false);\n        DOM.remove(this._canvasContainer);\n        DOM.remove(this._controlContainer);\n        this._container.classList.remove('maplibregl-map');\n\n        PerformanceUtils.clearMetrics();\n\n        this._removed = true;\n        this.fire(new Event('remove'));\n    }\n\n    /**\n     * Trigger the rendering of a single frame. Use this method with custom layers to\n     * repaint the map when the layer changes. Calling this multiple times before the\n     * next frame is rendered will still result in only a single frame being rendered.\n     * @example\n     * ```ts\n     * map.triggerRepaint();\n     * ```\n     * @see [Add a 3D model](https://maplibre.org/maplibre-gl-js/docs/examples/add-3d-model/)\n     * @see [Add an animated icon to the map](https://maplibre.org/maplibre-gl-js/docs/examples/add-image-animated/)\n     */\n    triggerRepaint() {\n        if (this.style && !this._frameRequest) {\n            this._frameRequest = new AbortController();\n            browser.frameAsync(this._frameRequest).then((paintStartTimeStamp: number) => {\n                PerformanceUtils.frame(paintStartTimeStamp);\n                this._frameRequest = null;\n                this._render(paintStartTimeStamp);\n            }).catch(() => {}); // ignore abort error\n        }\n    }\n\n    _onWindowOnline = () => {\n        this._update();\n    };\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will render an outline\n     * around each tile and the tile ID. These tile boundaries are useful for\n     * debugging.\n     *\n     * The uncompressed file size of the first vector source is drawn in the top left\n     * corner of each tile, next to the tile ID.\n     *\n     * @example\n     * ```ts\n     * map.showTileBoundaries = true;\n     * ```\n     */\n    get showTileBoundaries(): boolean { return !!this._showTileBoundaries; }\n    set showTileBoundaries(value: boolean) {\n        if (this._showTileBoundaries === value) return;\n        this._showTileBoundaries = value;\n        this._update();\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will visualize\n     * the padding offsets.\n     */\n    get showPadding(): boolean { return !!this._showPadding; }\n    set showPadding(value: boolean) {\n        if (this._showPadding === value) return;\n        this._showPadding = value;\n        this._update();\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will render boxes\n     * around all symbols in the data source, revealing which symbols\n     * were rendered or which were hidden due to collisions.\n     * This information is useful for debugging.\n     */\n    get showCollisionBoxes(): boolean { return !!this._showCollisionBoxes; }\n    set showCollisionBoxes(value: boolean) {\n        if (this._showCollisionBoxes === value) return;\n        this._showCollisionBoxes = value;\n        if (value) {\n            // When we turn collision boxes on we have to generate them for existing tiles\n            // When we turn them off, there's no cost to leaving existing boxes in place\n            this.style._generateCollisionBoxes();\n        } else {\n            // Otherwise, call an update to remove collision boxes\n            this._update();\n        }\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map should color-code\n     * each fragment to show how many times it has been shaded.\n     * White fragments have been shaded 8 or more times.\n     * Black fragments have been shaded 0 times.\n     * This information is useful for debugging.\n     */\n    get showOverdrawInspector(): boolean { return !!this._showOverdrawInspector; }\n    set showOverdrawInspector(value: boolean) {\n        if (this._showOverdrawInspector === value) return;\n        this._showOverdrawInspector = value;\n        this._update();\n    }\n\n    /**\n     * Gets and sets a Boolean indicating whether the map will\n     * continuously repaint. This information is useful for analyzing performance.\n     */\n    get repaint(): boolean { return !!this._repaint; }\n    set repaint(value: boolean) {\n        if (this._repaint !== value) {\n            this._repaint = value;\n            this.triggerRepaint();\n        }\n    }\n    // show vertices\n    get vertices(): boolean { return !!this._vertices; }\n    set vertices(value: boolean) { this._vertices = value; this._update(); }\n\n    /**\n     * Returns the package version of the library\n     * @returns Package version of the library\n     */\n    get version(): string {\n        return version;\n    }\n\n    /**\n     * Returns the elevation for the point where the camera is looking.\n     * This value corresponds to:\n     * \"meters above sea level\" * \"exaggeration\"\n     * @returns The elevation.\n     */\n    getCameraTargetElevation(): number {\n        return this.transform.elevation;\n    }\n}\n", "import type Point from '@mapbox/point-geometry';\n\nimport {DragMoveHandler, DragRotateResult, DragPitchResult, DragHandler} from './drag_handler';\nimport {OneFingerTouchMoveStateManager} from './drag_move_state_manager';\n\nexport interface OneFingerTouchRotateHandler extends DragMoveHandler<DragRotateResult, TouchEvent> {}\nexport interface OneFingerTouchPitchHandler extends DragMoveHandler<DragPitchResult, TouchEvent> {}\n\nconst assignEvents = (handler: DragHandler<DragRotateResult, TouchEvent>) => {\n    handler.touchstart = handler.dragStart;\n    handler.touchmoveWindow = handler.dragMove;\n    handler.touchend = handler.dragEnd;\n};\n\nexport const generateOneFingerTouchRotationHandler = ({enable, clickTolerance, bearingDegreesPerPixelMoved = 0.8}: {\n    clickTolerance: number;\n    bearingDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}): OneFingerTouchRotateHandler => {\n    const touchMoveStateManager = new OneFingerTouchMoveStateManager();\n    return new DragHandler<DragRotateResult, TouchEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) =>\n            ({bearingDelta: (point.x - lastPoint.x) * bearingDegreesPerPixelMoved}),\n        moveStateManager: touchMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n\nexport const generateOneFingerTouchPitchHandler = ({enable, clickTolerance, pitchDegreesPerPixelMoved = -0.5}: {\n    clickTolerance: number;\n    pitchDegreesPerPixelMoved?: number;\n    enable?: boolean;\n}): OneFingerTouchPitchHandler => {\n    const touchMoveStateManager = new OneFingerTouchMoveStateManager();\n    return new DragHandler<DragPitchResult, TouchEvent>({\n        clickTolerance,\n        move: (lastPoint: Point, point: Point) =>\n            ({pitchDelta: (point.y - lastPoint.y) * pitchDegreesPerPixelMoved}),\n        moveStateManager: touchMoveStateManager,\n        enable,\n        assignEvents,\n    });\n};\n", "import Point from '@mapbox/point-geometry';\n\nimport {DOM} from '../../util/dom';\nimport {extend} from '../../util/util';\nimport {generateMousePitchHandler, generateMouseRotationHandler, MousePitchHandler, MouseRotateHandler} from '../handler/mouse';\nimport {generateOneFingerTouchPitchHandler, generateOneFingerTouchRotationHandler, OneFingerTouchPitchHandler, OneFingerTouchRotateHandler} from '../handler/one_finger_touch_drag';\n\nimport type {Map} from '../map';\nimport type {IControl} from './control';\n\n/**\n * The {@link NavigationControl} options object\n */\ntype NavigationControlOptions = {\n    /**\n     * If `true` the compass button is included.\n     */\n    showCompass?: boolean;\n    /**\n     * If `true` the zoom-in and zoom-out buttons are included.\n     */\n    showZoom?: boolean;\n    /**\n     * If `true` the pitch is visualized by rotating X-axis of compass.\n     */\n    visualizePitch?: boolean;\n};\n\nconst defaultOptions: NavigationControlOptions = {\n    showCompass: true,\n    showZoom: true,\n    visualizePitch: false\n};\n\n/**\n * A `NavigationControl` control contains zoom buttons and a compass.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let nav = new NavigationControl();\n * map.addControl(nav, 'top-left');\n * ```\n * @see [Display map navigation controls](https://maplibre.org/maplibre-gl-js/docs/examples/navigation/)\n */\nexport class NavigationControl implements IControl {\n    _map: Map;\n    options: NavigationControlOptions;\n    _container: HTMLElement;\n    _zoomInButton: HTMLButtonElement;\n    _zoomOutButton: HTMLButtonElement;\n    _compass: HTMLButtonElement;\n    _compassIcon: HTMLElement;\n    _handler: MouseRotateWrapper;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options?: NavigationControlOptions) {\n        this.options = extend({}, defaultOptions, options);\n\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._container.addEventListener('contextmenu', (e) => e.preventDefault());\n\n        if (this.options.showZoom) {\n            this._zoomInButton = this._createButton('maplibregl-ctrl-zoom-in', (e) => this._map.zoomIn({}, {originalEvent: e}));\n            DOM.create('span', 'maplibregl-ctrl-icon', this._zoomInButton).setAttribute('aria-hidden', 'true');\n            this._zoomOutButton = this._createButton('maplibregl-ctrl-zoom-out', (e) => this._map.zoomOut({}, {originalEvent: e}));\n            DOM.create('span', 'maplibregl-ctrl-icon', this._zoomOutButton).setAttribute('aria-hidden', 'true');\n        }\n        if (this.options.showCompass) {\n            this._compass = this._createButton('maplibregl-ctrl-compass', (e) => {\n                if (this.options.visualizePitch) {\n                    this._map.resetNorthPitch({}, {originalEvent: e});\n                } else {\n                    this._map.resetNorth({}, {originalEvent: e});\n                }\n            });\n            this._compassIcon = DOM.create('span', 'maplibregl-ctrl-icon', this._compass);\n            this._compassIcon.setAttribute('aria-hidden', 'true');\n        }\n    }\n\n    _updateZoomButtons = () => {\n        const zoom = this._map.getZoom();\n        const isMax = zoom === this._map.getMaxZoom();\n        const isMin = zoom === this._map.getMinZoom();\n        this._zoomInButton.disabled = isMax;\n        this._zoomOutButton.disabled = isMin;\n        this._zoomInButton.setAttribute('aria-disabled', isMax.toString());\n        this._zoomOutButton.setAttribute('aria-disabled', isMin.toString());\n    };\n\n    _rotateCompassArrow = () => {\n        const rotate = this.options.visualizePitch ?\n            `scale(${1 / Math.pow(Math.cos(this._map.transform.pitch * (Math.PI / 180)), 0.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle * (180 / Math.PI)}deg)` :\n            `rotate(${this._map.transform.angle * (180 / Math.PI)}deg)`;\n\n        this._compassIcon.style.transform = rotate;\n    };\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        if (this.options.showZoom) {\n            this._setButtonTitle(this._zoomInButton, 'ZoomIn');\n            this._setButtonTitle(this._zoomOutButton, 'ZoomOut');\n            this._map.on('zoom', this._updateZoomButtons);\n            this._updateZoomButtons();\n        }\n        if (this.options.showCompass) {\n            this._setButtonTitle(this._compass, 'ResetBearing');\n            if (this.options.visualizePitch) {\n                this._map.on('pitch', this._rotateCompassArrow);\n            }\n            this._map.on('rotate', this._rotateCompassArrow);\n            this._rotateCompassArrow();\n            this._handler = new MouseRotateWrapper(this._map, this._compass, this.options.visualizePitch);\n        }\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        if (this.options.showZoom) {\n            this._map.off('zoom', this._updateZoomButtons);\n        }\n        if (this.options.showCompass) {\n            if (this.options.visualizePitch) {\n                this._map.off('pitch', this._rotateCompassArrow);\n            }\n            this._map.off('rotate', this._rotateCompassArrow);\n            this._handler.off();\n            delete this._handler;\n        }\n\n        delete this._map;\n    }\n\n    _createButton(className: string, fn: (e?: any) => unknown) {\n        const a = DOM.create('button', className, this._container) as HTMLButtonElement;\n        a.type = 'button';\n        a.addEventListener('click', fn);\n        return a;\n    }\n\n    _setButtonTitle = (button: HTMLButtonElement, title: 'ZoomIn' | 'ZoomOut' | 'ResetBearing') => {\n        const str = this._map._getUIString(`NavigationControl.${title}`);\n        button.title = str;\n        button.setAttribute('aria-label', str);\n    };\n}\n\nclass MouseRotateWrapper {\n\n    map: Map;\n    _clickTolerance: number;\n    element: HTMLElement;\n    // Rotation and pitch handlers are separated due to different _clickTolerance values\n    mouseRotate: MouseRotateHandler;\n    touchRotate: OneFingerTouchRotateHandler;\n    mousePitch: MousePitchHandler;\n    touchPitch: OneFingerTouchPitchHandler;\n    _startPos: Point;\n    _lastPos: Point;\n\n    constructor(map: Map, element: HTMLElement, pitch: boolean = false) {\n        this._clickTolerance = 10;\n        const mapRotateTolerance = map.dragRotate._mouseRotate.getClickTolerance();\n        const mapPitchTolerance = map.dragRotate._mousePitch.getClickTolerance();\n        this.element = element;\n        this.mouseRotate = generateMouseRotationHandler({clickTolerance: mapRotateTolerance, enable: true});\n        this.touchRotate = generateOneFingerTouchRotationHandler({clickTolerance: mapRotateTolerance, enable: true});\n        this.map = map;\n        if (pitch) {\n            this.mousePitch = generateMousePitchHandler({clickTolerance: mapPitchTolerance, enable: true});\n            this.touchPitch = generateOneFingerTouchPitchHandler({clickTolerance: mapPitchTolerance, enable: true});\n        }\n\n        DOM.addEventListener(element, 'mousedown', this.mousedown);\n        DOM.addEventListener(element, 'touchstart', this.touchstart, {passive: false});\n        DOM.addEventListener(element, 'touchcancel', this.reset);\n    }\n\n    startMouse(e: MouseEvent, point: Point) {\n        this.mouseRotate.dragStart(e, point);\n        if (this.mousePitch) this.mousePitch.dragStart(e, point);\n        DOM.disableDrag();\n    }\n\n    startTouch(e: TouchEvent, point: Point) {\n        this.touchRotate.dragStart(e, point);\n        if (this.touchPitch) this.touchPitch.dragStart(e, point);\n        DOM.disableDrag();\n    }\n\n    moveMouse(e: MouseEvent, point: Point) {\n        const map = this.map;\n        const {bearingDelta} = this.mouseRotate.dragMove(e, point) || {};\n        if (bearingDelta) map.setBearing(map.getBearing() + bearingDelta);\n        if (this.mousePitch) {\n            const {pitchDelta} = this.mousePitch.dragMove(e, point) || {};\n            if (pitchDelta) map.setPitch(map.getPitch() + pitchDelta);\n        }\n    }\n\n    moveTouch(e: TouchEvent, point: Point) {\n        const map = this.map;\n        const {bearingDelta} = this.touchRotate.dragMove(e, point) || {};\n        if (bearingDelta) map.setBearing(map.getBearing() + bearingDelta);\n        if (this.touchPitch) {\n            const {pitchDelta} = this.touchPitch.dragMove(e, point) || {};\n            if (pitchDelta) map.setPitch(map.getPitch() + pitchDelta);\n        }\n    }\n\n    off() {\n        const element = this.element;\n        DOM.removeEventListener(element, 'mousedown', this.mousedown);\n        DOM.removeEventListener(element, 'touchstart', this.touchstart, {passive: false});\n        DOM.removeEventListener(window, 'touchmove', this.touchmove, {passive: false});\n        DOM.removeEventListener(window, 'touchend', this.touchend);\n        DOM.removeEventListener(element, 'touchcancel', this.reset);\n        this.offTemp();\n    }\n\n    offTemp() {\n        DOM.enableDrag();\n        DOM.removeEventListener(window, 'mousemove', this.mousemove);\n        DOM.removeEventListener(window, 'mouseup', this.mouseup);\n        DOM.removeEventListener(window, 'touchmove', this.touchmove, {passive: false});\n        DOM.removeEventListener(window, 'touchend', this.touchend);\n    }\n\n    mousedown = (e: MouseEvent) => {\n        this.startMouse(extend({}, e, {ctrlKey: true, preventDefault: () => e.preventDefault()}), DOM.mousePos(this.element, e));\n        DOM.addEventListener(window, 'mousemove', this.mousemove);\n        DOM.addEventListener(window, 'mouseup', this.mouseup);\n    };\n\n    mousemove = (e: MouseEvent) => {\n        this.moveMouse(e, DOM.mousePos(this.element, e));\n    };\n\n    mouseup = (e: MouseEvent) => {\n        this.mouseRotate.dragEnd(e);\n        if (this.mousePitch) this.mousePitch.dragEnd(e);\n        this.offTemp();\n    };\n\n    touchstart = (e: TouchEvent) => {\n        if (e.targetTouches.length !== 1) {\n            this.reset();\n        } else {\n            this._startPos = this._lastPos = DOM.touchPos(this.element, e.targetTouches)[0];\n            this.startTouch(e, this._startPos);\n            DOM.addEventListener(window, 'touchmove', this.touchmove, {passive: false});\n            DOM.addEventListener(window, 'touchend', this.touchend);\n        }\n    };\n\n    touchmove = (e: TouchEvent) => {\n        if (e.targetTouches.length !== 1) {\n            this.reset();\n        } else {\n            this._lastPos = DOM.touchPos(this.element, e.targetTouches)[0];\n            this.moveTouch(e, this._lastPos);\n        }\n    };\n\n    touchend = (e: TouchEvent) => {\n        if (e.targetTouches.length === 0 &&\n            this._startPos &&\n            this._lastPos &&\n            this._startPos.dist(this._lastPos) < this._clickTolerance) {\n            this.element.click();\n        }\n        delete this._startPos;\n        delete this._lastPos;\n        this.offTemp();\n    };\n\n    reset = () => {\n        this.mouseRotate.reset();\n        if (this.mousePitch) this.mousePitch.reset();\n        this.touchRotate.reset();\n        if (this.touchPitch) this.touchPitch.reset();\n        delete this._startPos;\n        delete this._lastPos;\n        this.offTemp();\n    };\n}\n", "let supportsGeolocation;\n\nexport async function checkGeolocationSupport(forceRecalculation = false): Promise<boolean> {\n    if (supportsGeolocation !== undefined && !forceRecalculation) {\n        return supportsGeolocation;\n    }\n    if (window.navigator.permissions === undefined) {\n        supportsGeolocation = !!window.navigator.geolocation;\n        return supportsGeolocation;\n    }\n    // navigator.permissions has incomplete browser support\n    // https://caniuse.com/#feat=permissions-api\n    // Test for the case where a browser disables Geolocation because of an\n    // insecure origin\n    try {\n        const permissions = await window.navigator.permissions.query({name: 'geolocation'});\n        supportsGeolocation = permissions.state !== 'denied'; // eslint-disable-line require-atomic-updates\n    } catch {\n        // Fix for iOS16 which rejects query but still supports geolocation\n        supportsGeolocation = !!window.navigator.geolocation; // eslint-disable-line require-atomic-updates\n    }\n    return supportsGeolocation;\n}\n", "import {LngLat} from '../geo/lng_lat';\n\nimport type Point from '@mapbox/point-geometry';\nimport type {Transform} from '../geo/transform';\n\n/**\n * Given a LngLat, prior projected position, and a transform, return a new LngLat shifted\n * n Ã 360Â° east or west for some n â¥ 0 such that:\n *\n * * the projected location of the result is on screen, if possible, and secondarily:\n * * the difference between the projected location of the result and the prior position\n *   is minimized.\n *\n * The object is to preserve perceived object constancy for Popups and Markers as much as\n * possible; they should avoid shifting large distances across the screen, even when the\n * map center changes by Â±360Â° due to automatic wrapping, and when about to go off screen,\n * should wrap just enough to avoid doing so.\n */\nexport function smartWrap(lngLat: LngLat, priorPos: Point, transform: Transform): LngLat {\n    const originalLngLat = new LngLat(lngLat.lng, lngLat.lat);\n    lngLat = new LngLat(lngLat.lng, lngLat.lat);\n\n    // First, try shifting one world in either direction, and see if either is closer to the\n    // prior position. This preserves object constancy when the map center is auto-wrapped\n    // during animations.\n    if (priorPos) {\n        const left  = new LngLat(lngLat.lng - 360, lngLat.lat);\n        const right = new LngLat(lngLat.lng + 360, lngLat.lat);\n        const delta = transform.locationPoint(lngLat).distSqr(priorPos);\n        if (transform.locationPoint(left).distSqr(priorPos) < delta) {\n            lngLat = left;\n        } else if (transform.locationPoint(right).distSqr(priorPos) < delta) {\n            lngLat = right;\n        }\n    }\n\n    // Second, wrap toward the center until the new position is on screen, or we can't get\n    // any closer.\n    while (Math.abs(lngLat.lng - transform.center.lng) > 180) {\n        const pos = transform.locationPoint(lngLat);\n        if (pos.x >= 0 && pos.y >= 0 && pos.x <= transform.width && pos.y <= transform.height) {\n            break;\n        }\n        if (lngLat.lng > transform.center.lng) {\n            lngLat.lng -= 360;\n        } else {\n            lngLat.lng += 360;\n        }\n    }\n\n    // Apply the change only if new coord is below horizon\n    if (lngLat.lng !== originalLngLat.lng &&\n        transform.locationPoint(lngLat).y > (transform.height / 2 - transform.getHorizon())) {\n        return lngLat;\n    }\n\n    return originalLngLat;\n}\n", "/**\n * Where to position the anchor.\n * Used by a popup and a marker.\n */\nexport type PositionAnchor = 'center' | 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';\n\nexport const anchorTranslate: {\n    [_ in PositionAnchor]: string;\n} = {\n    'center': 'translate(-50%,-50%)',\n    'top': 'translate(-50%,0)',\n    'top-left': 'translate(0,0)',\n    'top-right': 'translate(-100%,0)',\n    'bottom': 'translate(-50%,-100%)',\n    'bottom-left': 'translate(0,-100%)',\n    'bottom-right': 'translate(-100%,-100%)',\n    'left': 'translate(0,-50%)',\n    'right': 'translate(-100%,-50%)'\n};\n\nexport function applyAnchorClass(element: HTMLElement, anchor: PositionAnchor, prefix: string) {\n    const classList = element.classList;\n    for (const key in anchorTranslate) {\n        classList.remove(`maplibregl-${prefix}-anchor-${key}`);\n    }\n    classList.add(`maplibregl-${prefix}-anchor-${anchor}`);\n}\n", "import {DOM} from '../util/dom';\nimport {browser} from '../util/browser';\nimport {LngLat} from '../geo/lng_lat';\nimport Point from '@mapbox/point-geometry';\nimport {smartWrap} from '../util/smart_wrap';\nimport {anchorTranslate, applyAnchorClass} from './anchor';\nimport type {PositionAnchor} from './anchor';\nimport {Event, Evented} from '../util/evented';\nimport type {Map} from './map';\nimport {Popup, Offset} from './popup';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {MapMouseEvent, MapTouchEvent} from './events';\nimport type {PointLike} from './camera';\n\n/**\n * Alignment options of rotation and pitch\n */\ntype Alignment = 'map' | 'viewport' | 'auto';\n\n/**\n * The {@link Marker} options object\n */\ntype MarkerOptions = {\n    /**\n     * DOM element to use as a marker. The default is a light blue, droplet-shaped SVG marker.\n     */\n    element?: HTMLElement;\n    /**\n     * Space-separated CSS class names to add to marker element.\n     */\n    className?: string;\n    /**\n     * The offset in pixels as a {@link PointLike} object to apply relative to the element's center. Negatives indicate left and up.\n     */\n    offset?: PointLike;\n    /**\n     * A string indicating the part of the Marker that should be positioned closest to the coordinate set via {@link Marker#setLngLat}.\n     * Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`.\n     * @defaultValue 'center'\n     * */\n    anchor?: PositionAnchor;\n    /**\n     * The color to use for the default marker if options.element is not provided. The default is light blue.\n     * @defaultValue '#3FB1CE'\n     */\n    color?: string;\n    /**\n     * The scale to use for the default marker if options.element is not provided. The default scale corresponds to a height of `41px` and a width of `27px`.\n     * @defaultValue 1\n     */\n    scale?: number;\n    /**\n     * A boolean indicating whether or not a marker is able to be dragged to a new position on the map.\n     * @defaultValue false\n     */\n    draggable?: boolean;\n    /**\n     * The max number of pixels a user can shift the mouse pointer during a click on the marker for it to be considered a valid click (as opposed to a marker drag). The default is to inherit map's clickTolerance.\n     * @defaultValue 0\n     */\n    clickTolerance?: number;\n    /**\n     * The rotation angle of the marker in degrees, relative to its respective `rotationAlignment` setting. A positive value will rotate the marker clockwise.\n     * @defaultValue 0\n     */\n    rotation?: number;\n    /**\n     * `map` aligns the `Marker`'s rotation relative to the map, maintaining a bearing as the map rotates. `viewport` aligns the `Marker`'s rotation relative to the viewport, agnostic to map rotations. `auto` is equivalent to `viewport`.\n     * @defaultValue 'auto'\n     */\n    rotationAlignment?: Alignment;\n    /**\n     * `map` aligns the `Marker` to the plane of the map. `viewport` aligns the `Marker` to the plane of the viewport. `auto` automatically matches the value of `rotationAlignment`.\n     * @defaultValue 'auto'\n     */\n    pitchAlignment?: Alignment;\n    /**\n     * Marker's opacity when it's in clear view (not behind 3d terrain)\n     * @defaultValue 1\n     */\n    opacity?: string;\n    /**\n     * Marker's opacity when it's behind 3d terrain\n     * @defaultValue 0.2\n     */\n    opacityWhenCovered?: string;\n    /**\n      * If `true`, rounding is disabled for placement of the marker, allowing for\n      * subpixel positioning and smoother movement when the marker is translated.\n      * @defaultValue false\n      */\n    subpixelPositioning?: boolean;\n};\n\n/**\n * Creates a marker component\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let marker = new Marker()\n *   .setLngLat([30.5, 50.5])\n *   .addTo(map);\n * ```\n *\n * @example\n * Set options\n * ```ts\n * let marker = new Marker({\n *     color: \"#FFFFFF\",\n *     draggable: true\n *   }).setLngLat([30.5, 50.5])\n *   .addTo(map);\n * ```\n * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js/docs/examples/custom-marker-icons/)\n * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-marker/)\n *\n * ## Events\n *\n * **Event** `dragstart` of type {@link Event} will be fired when dragging starts.\n *\n * **Event** `drag` of type {@link Event} will be fired while dragging.\n *\n * **Event** `dragend` of type {@link Event} will be fired when the marker is finished being dragged.\n */\nexport class Marker extends Evented {\n    _map: Map;\n    _anchor: PositionAnchor;\n    _offset: Point;\n    _element: HTMLElement;\n    _popup: Popup;\n    _lngLat: LngLat;\n    _pos: Point;\n    _flatPos: Point;\n    _color: string;\n    _scale: number;\n    _defaultMarker: boolean;\n    _draggable: boolean;\n    _clickTolerance: number;\n    _isDragging: boolean;\n    _state: 'inactive' | 'pending' | 'active'; // used for handling drag events\n    _positionDelta: Point;\n    _pointerdownPos: Point;\n    _rotation: number;\n    _pitchAlignment: Alignment;\n    _rotationAlignment: Alignment;\n    _originalTabIndex: string; // original tabindex of _element\n    _opacity: string;\n    _opacityWhenCovered: string;\n    _opacityTimeout: ReturnType<typeof setTimeout>;\n    _subpixelPositioning: boolean;\n\n    /**\n     * @param options - the options\n     */\n    constructor(options?: MarkerOptions) {\n        super();\n\n        this._anchor = options && options.anchor || 'center';\n        this._color = options && options.color || '#3FB1CE';\n        this._scale = options && options.scale || 1;\n        this._draggable = options && options.draggable || false;\n        this._clickTolerance = options && options.clickTolerance || 0;\n        this._subpixelPositioning = options && options.subpixelPositioning || false;\n        this._isDragging = false;\n        this._state = 'inactive';\n        this._rotation = options && options.rotation || 0;\n        this._rotationAlignment = options && options.rotationAlignment || 'auto';\n        this._pitchAlignment = options && options.pitchAlignment && options.pitchAlignment !== 'auto' ?  options.pitchAlignment : this._rotationAlignment;\n        this.setOpacity(); // set default opacity\n        this.setOpacity(options?.opacity, options?.opacityWhenCovered);\n\n        if (!options || !options.element) {\n            this._defaultMarker = true;\n            this._element = DOM.create('div');\n\n            // create default map marker SVG\n            const svg = DOM.createNS('http://www.w3.org/2000/svg', 'svg');\n            const defaultHeight = 41;\n            const defaultWidth = 27;\n            svg.setAttributeNS(null, 'display', 'block');\n            svg.setAttributeNS(null, 'height', `${defaultHeight}px`);\n            svg.setAttributeNS(null, 'width', `${defaultWidth}px`);\n            svg.setAttributeNS(null, 'viewBox', `0 0 ${defaultWidth} ${defaultHeight}`);\n\n            const markerLarge = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            markerLarge.setAttributeNS(null, 'stroke', 'none');\n            markerLarge.setAttributeNS(null, 'stroke-width', '1');\n            markerLarge.setAttributeNS(null, 'fill', 'none');\n            markerLarge.setAttributeNS(null, 'fill-rule', 'evenodd');\n\n            const page1 = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            page1.setAttributeNS(null, 'fill-rule', 'nonzero');\n\n            const shadow = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            shadow.setAttributeNS(null, 'transform', 'translate(3.0, 29.0)');\n            shadow.setAttributeNS(null, 'fill', '#000000');\n\n            const ellipses = [\n                {'rx': '10.5', 'ry': '5.25002273'},\n                {'rx': '10.5', 'ry': '5.25002273'},\n                {'rx': '9.5', 'ry': '4.77275007'},\n                {'rx': '8.5', 'ry': '4.29549936'},\n                {'rx': '7.5', 'ry': '3.81822308'},\n                {'rx': '6.5', 'ry': '3.34094679'},\n                {'rx': '5.5', 'ry': '2.86367051'},\n                {'rx': '4.5', 'ry': '2.38636864'}\n            ];\n\n            for (const data of ellipses) {\n                const ellipse = DOM.createNS('http://www.w3.org/2000/svg', 'ellipse');\n                ellipse.setAttributeNS(null, 'opacity', '0.04');\n                ellipse.setAttributeNS(null, 'cx', '10.5');\n                ellipse.setAttributeNS(null, 'cy', '5.80029008');\n                ellipse.setAttributeNS(null, 'rx', data['rx']);\n                ellipse.setAttributeNS(null, 'ry', data['ry']);\n                shadow.appendChild(ellipse);\n            }\n\n            const background = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            background.setAttributeNS(null, 'fill', this._color);\n\n            const bgPath = DOM.createNS('http://www.w3.org/2000/svg', 'path');\n            bgPath.setAttributeNS(null, 'd', 'M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z');\n\n            background.appendChild(bgPath);\n\n            const border = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            border.setAttributeNS(null, 'opacity', '0.25');\n            border.setAttributeNS(null, 'fill', '#000000');\n\n            const borderPath = DOM.createNS('http://www.w3.org/2000/svg', 'path');\n            borderPath.setAttributeNS(null, 'd', 'M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z');\n\n            border.appendChild(borderPath);\n\n            const maki = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            maki.setAttributeNS(null, 'transform', 'translate(6.0, 7.0)');\n            maki.setAttributeNS(null, 'fill', '#FFFFFF');\n\n            const circleContainer = DOM.createNS('http://www.w3.org/2000/svg', 'g');\n            circleContainer.setAttributeNS(null, 'transform', 'translate(8.0, 8.0)');\n\n            const circle1 = DOM.createNS('http://www.w3.org/2000/svg', 'circle');\n            circle1.setAttributeNS(null, 'fill', '#000000');\n            circle1.setAttributeNS(null, 'opacity', '0.25');\n            circle1.setAttributeNS(null, 'cx', '5.5');\n            circle1.setAttributeNS(null, 'cy', '5.5');\n            circle1.setAttributeNS(null, 'r', '5.4999962');\n\n            const circle2 = DOM.createNS('http://www.w3.org/2000/svg', 'circle');\n            circle2.setAttributeNS(null, 'fill', '#FFFFFF');\n            circle2.setAttributeNS(null, 'cx', '5.5');\n            circle2.setAttributeNS(null, 'cy', '5.5');\n            circle2.setAttributeNS(null, 'r', '5.4999962');\n\n            circleContainer.appendChild(circle1);\n            circleContainer.appendChild(circle2);\n\n            page1.appendChild(shadow);\n            page1.appendChild(background);\n            page1.appendChild(border);\n            page1.appendChild(maki);\n            page1.appendChild(circleContainer);\n\n            svg.appendChild(page1);\n\n            svg.setAttributeNS(null, 'height', `${defaultHeight * this._scale}px`);\n            svg.setAttributeNS(null, 'width', `${defaultWidth * this._scale}px`);\n\n            this._element.appendChild(svg);\n\n            // if no element and no offset option given apply an offset for the default marker\n            // the -14 as the y value of the default marker offset was determined as follows\n            //\n            // the marker tip is at the center of the shadow ellipse from the default svg\n            // the y value of the center of the shadow ellipse relative to the svg top left is \"shadow transform translate-y (29.0) + ellipse cy (5.80029008)\"\n            // offset to the svg center \"height (41 / 2)\" gives (29.0 + 5.80029008) - (41 / 2) and rounded for an integer pixel offset gives 14\n            // negative is used to move the marker up from the center so the tip is at the Marker lngLat\n            this._offset = Point.convert(options && options.offset || [0, -14]);\n        } else {\n            this._element = options.element;\n            this._offset = Point.convert(options && options.offset || [0, 0]);\n        }\n\n        this._element.classList.add('maplibregl-marker');\n        this._element.addEventListener('dragstart', (e: DragEvent) => {\n            e.preventDefault();\n        });\n        this._element.addEventListener('mousedown', (e: MouseEvent) => {\n            // prevent focusing on click\n            e.preventDefault();\n        });\n        applyAnchorClass(this._element, this._anchor, 'marker');\n\n        if (options && options.className) {\n            for (const name of options.className.split(' ')) {\n                this._element.classList.add(name);\n            }\n        }\n\n        this._popup = null;\n    }\n\n    /**\n     * Attaches the `Marker` to a `Map` object.\n     * @param map - The MapLibre GL JS map to add the marker to.\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *   .setLngLat([30.5, 50.5])\n     *   .addTo(map); // add the marker to the map\n     * ```\n     */\n    addTo(map: Map): this {\n        this.remove();\n        this._map = map;\n        this._element.setAttribute('aria-label', map._getUIString('Marker.Title'));\n\n        map.getCanvasContainer().appendChild(this._element);\n        map.on('move', this._update);\n        map.on('moveend', this._update);\n        map.on('terrain', this._update);\n\n        this.setDraggable(this._draggable);\n        this._update();\n\n        // If we attached the `click` listener to the marker element, the popup\n        // would close once the event propagated to `map` due to the\n        // `Popup#_onClickClose` listener.\n        this._map.on('click', this._onMapClick);\n\n        return this;\n    }\n\n    /**\n     * Removes the marker from a map\n     * @example\n     * ```ts\n     * let marker = new Marker().addTo(map);\n     * marker.remove();\n     * ```\n     */\n    remove(): this {\n        if (this._opacityTimeout) {\n            clearTimeout(this._opacityTimeout);\n            delete this._opacityTimeout;\n        }\n        if (this._map) {\n            this._map.off('click', this._onMapClick);\n            this._map.off('move', this._update);\n            this._map.off('moveend', this._update);\n            this._map.off('terrain', this._update);\n            this._map.off('mousedown', this._addDragHandler);\n            this._map.off('touchstart', this._addDragHandler);\n            this._map.off('mouseup', this._onUp);\n            this._map.off('touchend', this._onUp);\n            this._map.off('mousemove', this._onMove);\n            this._map.off('touchmove', this._onMove);\n            delete this._map;\n        }\n        DOM.remove(this._element);\n        if (this._popup) this._popup.remove();\n        return this;\n    }\n\n    /**\n     * Get the marker's geographical location.\n     *\n     * The longitude of the result may differ by a multiple of 360 degrees from the longitude previously\n     * set by `setLngLat` because `Marker` wraps the anchor longitude across copies of the world to keep\n     * the marker on screen.\n     *\n     * @returns A {@link LngLat} describing the marker's location.\n     * @example\n     * ```ts\n     * // Store the marker's longitude and latitude coordinates in a variable\n     * let lngLat = marker.getLngLat();\n     * // Print the marker's longitude and latitude values in the console\n     * console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )\n     * ```\n     * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-marker/)\n     */\n    getLngLat(): LngLat {\n        return this._lngLat;\n    }\n\n    /**\n     * Set the marker's geographical position and move it.\n     * @param lnglat - A {@link LngLat} describing where the marker should be located.\n     * @example\n     * Create a new marker, set the longitude and latitude, and add it to the map\n     * ```ts\n     * new Marker()\n     *   .setLngLat([-65.017, -16.457])\n     *   .addTo(map);\n     * ```\n     * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js/docs/examples/custom-marker-icons/)\n     * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js/docs/examples/drag-a-marker/)\n     */\n    setLngLat(lnglat: LngLatLike): this {\n        this._lngLat = LngLat.convert(lnglat);\n        this._pos = null;\n        if (this._popup) this._popup.setLngLat(this._lngLat);\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the `Marker`'s HTML element.\n     * @returns element\n     */\n    getElement(): HTMLElement {\n        return this._element;\n    }\n\n    /**\n     * Binds a {@link Popup} to the {@link Marker}.\n     * @param popup - An instance of the {@link Popup} class. If undefined or null, any popup\n     * set on this {@link Marker} instance is unset.\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *  .setLngLat([0, 0])\n     *  .setPopup(new Popup().setHTML(\"<h1>Hello World!</h1>\")) // add popup\n     *  .addTo(map);\n     * ```\n     * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/set-popup/)\n     */\n    setPopup(popup?: Popup | null): this {\n        if (this._popup) {\n            this._popup.remove();\n            this._popup = null;\n            this._element.removeEventListener('keypress', this._onKeyPress);\n\n            if (!this._originalTabIndex) {\n                this._element.removeAttribute('tabindex');\n            }\n        }\n\n        if (popup) {\n            if (!('offset' in popup.options)) {\n                const markerHeight = 41 - (5.8 / 2);\n                const markerRadius = 13.5;\n                const linearOffset = Math.abs(markerRadius) / Math.SQRT2;\n                popup.options.offset = this._defaultMarker ? {\n                    'top': [0, 0],\n                    'top-left': [0, 0],\n                    'top-right': [0, 0],\n                    'bottom': [0, -markerHeight],\n                    'bottom-left': [linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n                    'bottom-right': [-linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n                    'left': [markerRadius, (markerHeight - markerRadius) * -1],\n                    'right': [-markerRadius, (markerHeight - markerRadius) * -1]\n                } as Offset : this._offset;\n            }\n            this._popup = popup;\n\n            this._originalTabIndex = this._element.getAttribute('tabindex');\n            if (!this._originalTabIndex) {\n                this._element.setAttribute('tabindex', '0');\n            }\n            this._element.addEventListener('keypress', this._onKeyPress);\n        }\n\n        return this;\n    }\n\n    /**\n      * Set the option to allow subpixel positioning of the marker by passing a boolean\n      *\n      * @param value - when set to `true`, subpixel positioning is enabled for the marker.\n      *\n      * @example\n      * ```ts\n      * let marker = new Marker()\n      * marker.setSubpixelPositioning(true);\n      * ```\n      */\n    setSubpixelPositioning(value: boolean) {\n        this._subpixelPositioning = value;\n        return this;\n    }\n\n    _onKeyPress = (e: KeyboardEvent) => {\n        const code = e.code;\n        const legacyCode = e.charCode || e.keyCode;\n\n        if (\n            (code === 'Space') || (code === 'Enter') ||\n            (legacyCode === 32) || (legacyCode === 13) // space or enter\n        ) {\n            this.togglePopup();\n        }\n    };\n\n    _onMapClick = (e: MapMouseEvent) => {\n        const targetElement = e.originalEvent.target;\n        const element = this._element;\n\n        if (this._popup && (targetElement === element || element.contains(targetElement as any))) {\n            this.togglePopup();\n        }\n    };\n\n    /**\n     * Returns the {@link Popup} instance that is bound to the {@link Marker}.\n     * @returns popup\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *  .setLngLat([0, 0])\n     *  .setPopup(new Popup().setHTML(\"<h1>Hello World!</h1>\"))\n     *  .addTo(map);\n     *\n     * console.log(marker.getPopup()); // return the popup instance\n     * ```\n     */\n    getPopup(): Popup {\n        return this._popup;\n    }\n\n    /**\n     * Opens or closes the {@link Popup} instance that is bound to the {@link Marker}, depending on the current state of the {@link Popup}.\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     *  .setLngLat([0, 0])\n     *  .setPopup(new Popup().setHTML(\"<h1>Hello World!</h1>\"))\n     *  .addTo(map);\n     *\n     * marker.togglePopup(); // toggle popup open or closed\n     * ```\n     */\n    togglePopup(): this {\n        const popup = this._popup;\n\n        if (this._element.style.opacity === this._opacityWhenCovered) return this;\n\n        if (!popup) return this;\n        else if (popup.isOpen()) popup.remove();\n        else {\n            popup.setLngLat(this._lngLat);\n            popup.addTo(this._map);\n        }\n        return this;\n    }\n\n    _updateOpacity(force: boolean = false) {\n        const terrain = this._map?.terrain;\n        if (!terrain) {\n            if (this._element.style.opacity !== this._opacity) { this._element.style.opacity = this._opacity; }\n            return;\n        }\n        if (force) {\n            this._opacityTimeout = null;\n        } else {\n            if (this._opacityTimeout) { return; }\n            this._opacityTimeout = setTimeout(() => {\n                this._opacityTimeout = null;\n            }, 100);\n        }\n\n        const map = this._map;\n\n        // Read depth framebuffer, getting position of terrain in line of sight to marker\n        const terrainDistance = map.terrain.depthAtPoint(this._pos);\n        // Transform marker position to clip space\n        const elevation = map.terrain.getElevationForLngLatZoom(this._lngLat, map.transform.tileZoom);\n        const markerDistance = map.transform.lngLatToCameraDepth(this._lngLat, elevation);\n\n        const forgiveness = .006;\n        if (markerDistance - terrainDistance < forgiveness) {\n            this._element.style.opacity = this._opacity;\n            return;\n        }\n        // If the base is obscured, use the offset to check if the marker's center is obscured.\n        const metersToCenter = -this._offset.y / map.transform._pixelPerMeter;\n        const elevationToCenter = Math.sin(map.getPitch() * Math.PI / 180) * metersToCenter;\n        const terrainDistanceCenter = map.terrain.depthAtPoint(new Point(this._pos.x, this._pos.y - this._offset.y));\n        const markerDistanceCenter = map.transform.lngLatToCameraDepth(this._lngLat, elevation + elevationToCenter);\n        // Display at full opacity if center is visible.\n        const centerIsInvisible = markerDistanceCenter - terrainDistanceCenter > forgiveness;\n\n        if (this._popup?.isOpen() && centerIsInvisible) this._popup.remove();\n        this._element.style.opacity = centerIsInvisible ? this._opacityWhenCovered : this._opacity;\n    }\n\n    _update = (e?: { type: 'move' | 'moveend' | 'terrain' | 'render' }) => {\n        if (!this._map) return;\n\n        const isFullyLoaded = this._map.loaded() && !this._map.isMoving();\n        if (e?.type === 'terrain' || (e?.type === 'render' && !isFullyLoaded)) {\n            this._map.once('render', this._update);\n        }\n\n        if (this._map.transform.renderWorldCopies) {\n            this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform);\n        } else {\n            this._lngLat = this._lngLat?.wrap();\n        }\n\n        this._flatPos = this._pos = this._map.project(this._lngLat)._add(this._offset);\n        if (this._map.terrain) {\n            // flat position is saved because smartWrap needs non-elevated points\n            this._flatPos = this._map.transform.locationPoint(this._lngLat)._add(this._offset);\n        }\n\n        let rotation = '';\n        if (this._rotationAlignment === 'viewport' || this._rotationAlignment === 'auto') {\n            rotation = `rotateZ(${this._rotation}deg)`;\n        } else if (this._rotationAlignment === 'map') {\n            rotation = `rotateZ(${this._rotation - this._map.getBearing()}deg)`;\n        }\n\n        let pitch = '';\n        if (this._pitchAlignment === 'viewport' || this._pitchAlignment === 'auto') {\n            pitch = 'rotateX(0deg)';\n        } else if (this._pitchAlignment === 'map') {\n            pitch = `rotateX(${this._map.getPitch()}deg)`;\n        }\n\n        // because rounding the coordinates at every `move` event causes stuttered zooming\n        // we only round them when _update is called with `moveend` or when its called with\n        // no arguments (when the Marker is initialized or Marker#setLngLat is invoked).\n        if (!this._subpixelPositioning && (!e || e.type === 'moveend')) {\n            this._pos = this._pos.round();\n        }\n\n        DOM.setTransform(this._element, `${anchorTranslate[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${pitch} ${rotation}`);\n\n        browser.frameAsync(new AbortController()).then(() => { // Run _updateOpacity only after painter.render and drawDepth\n            this._updateOpacity(e && e.type === 'moveend');\n        }).catch(() => {});\n    };\n\n    /**\n     * Get the marker's offset.\n     * @returns The marker's screen coordinates in pixels.\n     */\n    getOffset(): Point {\n        return this._offset;\n    }\n\n    /**\n     * Sets the offset of the marker\n     * @param offset - The offset in pixels as a {@link PointLike} object to apply relative to the element's center. Negatives indicate left and up.\n     */\n    setOffset(offset: PointLike): this {\n        this._offset = Point.convert(offset);\n        this._update();\n        return this;\n    }\n\n    /**\n     * Adds a CSS class to the marker element.\n     *\n     * @param className - on-empty string with CSS class name to add to marker element\n     *\n     * @example\n     * ```\n     * let marker = new Marker()\n     * marker.addClassName('some-class')\n     * ```\n     */\n    addClassName(className: string) {\n        this._element.classList.add(className);\n    }\n\n    /**\n     * Removes a CSS class from the marker element.\n     *\n     * @param className - Non-empty string with CSS class name to remove from marker element\n     *\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     * marker.removeClassName('some-class')\n     * ```\n     */\n    removeClassName(className: string) {\n        this._element.classList.remove(className);\n    }\n\n    /**\n     * Add or remove the given CSS class on the marker element, depending on whether the element currently has that class.\n     *\n     * @param className - Non-empty string with CSS class name to add/remove\n     *\n     * @returns if the class was removed return false, if class was added, then return true\n     *\n     * @example\n     * ```ts\n     * let marker = new Marker()\n     * marker.toggleClassName('toggleClass')\n     * ```\n     */\n    toggleClassName(className: string): boolean {\n        return this._element.classList.toggle(className);\n    }\n\n    _onMove = (e: MapMouseEvent | MapTouchEvent) => {\n        if (!this._isDragging) {\n            const clickTolerance = this._clickTolerance || this._map._clickTolerance;\n            this._isDragging = e.point.dist(this._pointerdownPos) >= clickTolerance;\n        }\n        if (!this._isDragging) return;\n\n        this._pos = e.point.sub(this._positionDelta);\n        this._lngLat = this._map.unproject(this._pos);\n        this.setLngLat(this._lngLat);\n        // suppress click event so that popups don't toggle on drag\n        this._element.style.pointerEvents = 'none';\n\n        // make sure dragstart only fires on the first move event after mousedown.\n        // this can't be on mousedown because that event doesn't necessarily\n        // imply that a drag is about to happen.\n        if (this._state === 'pending') {\n            this._state = 'active';\n            this.fire(new Event('dragstart'));\n        }\n        this.fire(new Event('drag'));\n    };\n\n    _onUp = () => {\n        // revert to normal pointer event handling\n        this._element.style.pointerEvents = 'auto';\n        this._positionDelta = null;\n        this._pointerdownPos = null;\n        this._isDragging = false;\n        this._map.off('mousemove', this._onMove);\n        this._map.off('touchmove', this._onMove);\n\n        // only fire dragend if it was preceded by at least one drag event\n        if (this._state === 'active') {\n            this.fire(new Event('dragend'));\n        }\n\n        this._state = 'inactive';\n    };\n\n    _addDragHandler = (e: MapMouseEvent | MapTouchEvent) => {\n        if (this._element.contains(e.originalEvent.target as any)) {\n            e.preventDefault();\n\n            // We need to calculate the pixel distance between the click point\n            // and the marker position, with the offset accounted for. Then we\n            // can subtract this distance from the mousemove event's position\n            // to calculate the new marker position.\n            // If we don't do this, the marker 'jumps' to the click position\n            // creating a jarring UX effect.\n            this._positionDelta = e.point.sub(this._pos).add(this._offset);\n\n            this._pointerdownPos = e.point;\n\n            this._state = 'pending';\n            this._map.on('mousemove', this._onMove);\n            this._map.on('touchmove', this._onMove);\n            this._map.once('mouseup', this._onUp);\n            this._map.once('touchend', this._onUp);\n        }\n    };\n\n    /**\n     * Sets the `draggable` property and functionality of the marker\n     * @param shouldBeDraggable - Turns drag functionality on/off\n     */\n    setDraggable(shouldBeDraggable?: boolean): this {\n        this._draggable = !!shouldBeDraggable; // convert possible undefined value to false\n\n        // handle case where map may not exist yet\n        // e.g. when setDraggable is called before addTo\n        if (this._map) {\n            if (shouldBeDraggable) {\n                this._map.on('mousedown', this._addDragHandler);\n                this._map.on('touchstart', this._addDragHandler);\n            } else {\n                this._map.off('mousedown', this._addDragHandler);\n                this._map.off('touchstart', this._addDragHandler);\n            }\n        }\n\n        return this;\n    }\n\n    /**\n     * Returns true if the marker can be dragged\n     * @returns True if the marker is draggable.\n     */\n    isDraggable(): boolean {\n        return this._draggable;\n    }\n\n    /**\n     * Sets the `rotation` property of the marker.\n     * @param rotation - The rotation angle of the marker (clockwise, in degrees), relative to its respective {@link Marker#setRotationAlignment} setting.\n     */\n    setRotation(rotation?: number): this {\n        this._rotation = rotation || 0;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the current rotation angle of the marker (in degrees).\n     * @returns The current rotation angle of the marker.\n     */\n    getRotation(): number {\n        return this._rotation;\n    }\n\n    /**\n     * Sets the `rotationAlignment` property of the marker.\n     * @param alignment - Sets the `rotationAlignment` property of the marker. defaults to 'auto'\n     */\n    setRotationAlignment(alignment?: Alignment): this {\n        this._rotationAlignment = alignment || 'auto';\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the current `rotationAlignment` property of the marker.\n     * @returns The current rotational alignment of the marker.\n     */\n    getRotationAlignment(): Alignment {\n        return this._rotationAlignment;\n    }\n\n    /**\n     * Sets the `pitchAlignment` property of the marker.\n     * @param alignment - Sets the `pitchAlignment` property of the marker. If alignment is 'auto', it will automatically match `rotationAlignment`.\n     */\n    setPitchAlignment(alignment?: Alignment): this {\n        this._pitchAlignment = alignment && alignment !== 'auto' ? alignment : this._rotationAlignment;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Returns the current `pitchAlignment` property of the marker.\n     * @returns The current pitch alignment of the marker in degrees.\n     */\n    getPitchAlignment(): Alignment {\n        return this._pitchAlignment;\n    }\n\n    /**\n     * Sets the `opacity` and `opacityWhenCovered` properties of the marker.\n     * When called without arguments, resets opacity and opacityWhenCovered to defaults\n     * @param opacity - Sets the `opacity` property of the marker.\n     * @param opacityWhenCovered - Sets the `opacityWhenCovered` property of the marker.\n     */\n    setOpacity(opacity?: string, opacityWhenCovered?: string): this {\n        if (opacity === undefined && opacityWhenCovered === undefined) {\n            this._opacity = '1';\n            this._opacityWhenCovered = '0.2';\n        }\n        if (opacity !== undefined) {\n            this._opacity = opacity;\n        }\n        if (opacityWhenCovered !== undefined) {\n            this._opacityWhenCovered = opacityWhenCovered;\n        }\n        if (this._map) {\n            this._updateOpacity(true);\n        }\n        return this;\n    }\n}\n", "import {Event, Evented} from '../../util/evented';\nimport {DOM} from '../../util/dom';\nimport {extend, warnOnce} from '../../util/util';\nimport {checkGeolocationSupport} from '../../util/geolocation_support';\nimport {LngLat} from '../../geo/lng_lat';\nimport {Marker} from '../marker';\n\nimport type {Map} from '../map';\nimport type {FitBoundsOptions} from '../camera';\nimport type {IControl} from './control';\nimport {LngLatBounds} from '../../geo/lng_lat_bounds';\n\n/**\n * The {@link GeolocateControl} options object\n */\ntype GeolocateControlOptions = {\n    /**\n     * A Geolocation API [PositionOptions](https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions) object.\n     * @defaultValue `{enableHighAccuracy: false, timeout: 6000}`\n     */\n    positionOptions?: PositionOptions;\n    /**\n     * A options object to use when the map is panned and zoomed to the user's location. The default is to use a `maxZoom` of 15 to limit how far the map will zoom in for very accurate locations.\n     */\n    fitBoundsOptions?: FitBoundsOptions;\n    /**\n     * If `true` the `GeolocateControl` becomes a toggle button and when active the map will receive updates to the user's location as it changes.\n     * @defaultValue false\n     */\n    trackUserLocation?: boolean;\n    /**\n     * By default, if `showUserLocation` is `true`, a transparent circle will be drawn around the user location indicating the accuracy (95% confidence level) of the user's location. Set to `false` to disable. Always disabled when `showUserLocation` is `false`.\n     * @defaultValue true\n     */\n    showAccuracyCircle?: boolean;\n    /**\n     * By default a dot will be shown on the map at the user's location. Set to `false` to disable.\n     * @defaultValue true\n     */\n    showUserLocation?: boolean;\n};\n\nconst defaultOptions: GeolocateControlOptions = {\n    positionOptions: {\n        enableHighAccuracy: false,\n        maximumAge: 0,\n        timeout: 6000 /* 6 sec */\n    },\n    fitBoundsOptions: {\n        maxZoom: 15\n    },\n    trackUserLocation: false,\n    showAccuracyCircle: true,\n    showUserLocation: true\n};\n\nlet numberOfWatches = 0;\nlet noTimeout = false;\n\n/**\n * A `GeolocateControl` control provides a button that uses the browser's geolocation\n * API to locate the user on the map.\n *\n * Not all browsers support geolocation,\n * and some users may disable the feature. Geolocation support for modern\n * browsers including Chrome requires sites to be served over HTTPS. If\n * geolocation support is not available, the `GeolocateControl` will show\n * as disabled.\n *\n * The zoom level applied will depend on the accuracy of the geolocation provided by the device.\n *\n * The `GeolocateControl` has two modes. If `trackUserLocation` is `false` (default) the control acts as a button, which when pressed will set the map's camera to target the user location. If the user moves, the map won't update. This is most suited for the desktop. If `trackUserLocation` is `true` the control acts as a toggle button that when active the user's location is actively monitored for changes. In this mode the `GeolocateControl` has three interaction states:\n * * active - the map's camera automatically updates as the user's location changes, keeping the location dot in the center. Initial state and upon clicking the `GeolocateControl` button.\n * * passive - the user's location dot automatically updates, but the map's camera does not. Occurs upon the user initiating a map movement.\n * * disabled - occurs if Geolocation is not available, disabled or denied.\n *\n * These interaction states can't be controlled programmatically, rather they are set based on user interactions.\n *\n * ## State Diagram\n * ![GeolocateControl state diagram](https://github.com/maplibre/maplibre-gl-js/assets/3269297/78e720e5-d781-4da8-9803-a7a0e6aaaa9f)\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * map.addControl(new GeolocateControl({\n *     positionOptions: {\n *         enableHighAccuracy: true\n *     },\n *     trackUserLocation: true\n * }));\n * ```\n * @see [Locate the user](https://maplibre.org/maplibre-gl-js/docs/examples/locate-user/)\n *\n * ## Events\n *\n * **Event** `trackuserlocationend` of type {@link Event} will be fired when the `GeolocateControl` changes to the background state, which happens when a user changes the camera during an active position lock. This only applies when `trackUserLocation` is `true`. In the background state, the dot on the map will update with location updates but the camera will not.\n *\n * **Event** `trackuserlocationstart` of type {@link Event} will be fired when the `GeolocateControl` changes to the active lock state, which happens either upon first obtaining a successful Geolocation API position for the user (a `geolocate` event will follow), or the user clicks the geolocate button when in the background state which uses the last known position to recenter the map and enter active lock state (no `geolocate` event will follow unless the users's location changes).\n *\n * **Event** `userlocationlostfocus` of type {@link Event} will be fired when the `GeolocateControl` changes to the background state, which happens when a user changes the camera during an active position lock. This only applies when `trackUserLocation` is `true`. In the background state, the dot on the map will update with location updates but the camera will not.\n *\n * **Event** `userlocationfocus` of type {@link Event} will be fired when the `GeolocateControl` changes to the active lock state, which happens upon the user clicks the geolocate button when in the background state which uses the last known position to recenter the map and enter active lock state.\n *\n * **Event** `geolocate` of type {@link Event} will be fired on each Geolocation API position update which returned as success.\n * `data` - The returned [Position](https://developer.mozilla.org/en-US/docs/Web/API/Position) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).\n *\n * **Event** `error` of type {@link Event} will be fired on each Geolocation API position update which returned as an error.\n * `data` - The returned [PositionError](https://developer.mozilla.org/en-US/docs/Web/API/PositionError) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).\n *\n * **Event** `outofmaxbounds` of type {@link Event} will be fired on each Geolocation API position update which returned as success but user position is out of map `maxBounds`.\n * `data` - The returned [Position](https://developer.mozilla.org/en-US/docs/Web/API/Position) object from the callback in [Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) or [Geolocation.watchPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition).\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when a trackuserlocationend event occurs.\n * geolocate.on('trackuserlocationend', () => {\n *   console.log('A trackuserlocationend event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when a trackuserlocationstart event occurs.\n * geolocate.on('trackuserlocationstart', () => {\n *   console.log('A trackuserlocationstart event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an userlocationlostfocus event occurs.\n * geolocate.on('userlocationlostfocus', function() {\n *   console.log('An userlocationlostfocus event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an userlocationfocus event occurs.\n * geolocate.on('userlocationfocus', function() {\n *   console.log('An userlocationfocus event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when a geolocate event occurs.\n * geolocate.on('geolocate', () => {\n *   console.log('A geolocate event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an error event occurs.\n * geolocate.on('error', () => {\n *   console.log('An error event has occurred.')\n * });\n * ```\n *\n * @example\n * ```ts\n * // Initialize the geolocate control.\n * let geolocate = new GeolocateControl({\n *   positionOptions: {\n *       enableHighAccuracy: true\n *   },\n *   trackUserLocation: true\n * });\n * // Add the control to the map.\n * map.addControl(geolocate);\n * // Set an event listener that fires\n * // when an outofmaxbounds event occurs.\n * geolocate.on('outofmaxbounds', () => {\n *   console.log('An outofmaxbounds event has occurred.')\n * });\n * ```\n */\nexport class GeolocateControl extends Evented implements IControl {\n    _map: Map;\n    options: GeolocateControlOptions;\n    _container: HTMLElement;\n    _dotElement: HTMLElement;\n    _circleElement: HTMLElement;\n    _geolocateButton: HTMLButtonElement;\n    _geolocationWatchID: number;\n    _timeoutId: ReturnType<typeof setTimeout>;\n    /* Geolocate Control Watch States\n     * This is the private state of the control.\n     *\n     * OFF\n     *    off/inactive\n     * WAITING_ACTIVE\n     *    Geolocate Control was clicked but still waiting for Geolocation API response with user location\n     * ACTIVE_LOCK\n     *    Showing the user location as a dot AND tracking the camera to be fixed to their location. If their location changes the map moves to follow.\n     * ACTIVE_ERROR\n     *    There was en error from the Geolocation API while trying to show and track the user location.\n     * BACKGROUND\n     *    Showing the user location as a dot but the camera doesn't follow their location as it changes.\n     * BACKGROUND_ERROR\n     *    There was an error from the Geolocation API while trying to show (but not track) the user location.\n     */\n    _watchState: 'OFF' | 'ACTIVE_LOCK' | 'WAITING_ACTIVE' | 'ACTIVE_ERROR' | 'BACKGROUND' | 'BACKGROUND_ERROR';\n    _lastKnownPosition: any;\n    _userLocationDotMarker: Marker;\n    _accuracyCircleMarker: Marker;\n    _accuracy: number;\n    _setup: boolean; // set to true once the control has been setup\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: GeolocateControlOptions) {\n        super();\n        this.options = extend({}, defaultOptions, options);\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._setupUI();\n        checkGeolocationSupport().then((supported) => this._finishSetupUI(supported));\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        // clear the geolocation watch if exists\n        if (this._geolocationWatchID !== undefined) {\n            window.navigator.geolocation.clearWatch(this._geolocationWatchID);\n            this._geolocationWatchID = undefined;\n        }\n\n        // clear the markers from the map\n        if (this.options.showUserLocation && this._userLocationDotMarker) {\n            this._userLocationDotMarker.remove();\n        }\n        if (this.options.showAccuracyCircle && this._accuracyCircleMarker) {\n            this._accuracyCircleMarker.remove();\n        }\n\n        DOM.remove(this._container);\n        this._map.off('zoom', this._onZoom);\n        this._map = undefined;\n        numberOfWatches = 0;\n        noTimeout = false;\n    }\n\n    /**\n     * Check if the Geolocation API Position is outside the map's `maxBounds`.\n     *\n     * @param position - the Geolocation API Position\n     * @returns `true` if position is outside the map's `maxBounds`, otherwise returns `false`.\n     */\n    _isOutOfMapMaxBounds(position: GeolocationPosition) {\n        const bounds = this._map.getMaxBounds();\n        const coordinates = position.coords;\n\n        return bounds && (\n            coordinates.longitude < bounds.getWest() ||\n            coordinates.longitude > bounds.getEast() ||\n            coordinates.latitude < bounds.getSouth() ||\n            coordinates.latitude > bounds.getNorth()\n        );\n    }\n\n    _setErrorState() {\n        switch (this._watchState) {\n            case 'WAITING_ACTIVE':\n                this._watchState = 'ACTIVE_ERROR';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active-error');\n                break;\n            case 'ACTIVE_LOCK':\n                this._watchState = 'ACTIVE_ERROR';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active-error');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                // turn marker grey\n                break;\n            case 'BACKGROUND':\n                this._watchState = 'BACKGROUND_ERROR';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-background-error');\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                // turn marker grey\n                break;\n            case 'ACTIVE_ERROR':\n                break;\n            default:\n                throw new Error(`Unexpected watchState ${this._watchState}`);\n        }\n    }\n\n    /**\n     * When the Geolocation API returns a new location, update the `GeolocateControl`.\n     *\n     * @param position - the Geolocation API Position\n     */\n    _onSuccess = (position: GeolocationPosition) => {\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\n        if (this._isOutOfMapMaxBounds(position)) {\n            this._setErrorState();\n\n            this.fire(new Event('outofmaxbounds', position));\n            this._updateMarker();\n            this._finish();\n\n            return;\n        }\n\n        if (this.options.trackUserLocation) {\n            // keep a record of the position so that if the state is BACKGROUND and the user\n            // clicks the button, we can move to ACTIVE_LOCK immediately without waiting for\n            // watchPosition to trigger _onSuccess\n            this._lastKnownPosition = position;\n\n            switch (this._watchState) {\n                case 'WAITING_ACTIVE':\n                case 'ACTIVE_LOCK':\n                case 'ACTIVE_ERROR':\n                    this._watchState = 'ACTIVE_LOCK';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active-error');\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active');\n                    break;\n                case 'BACKGROUND':\n                case 'BACKGROUND_ERROR':\n                    this._watchState = 'BACKGROUND';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background-error');\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-background');\n                    break;\n                default:\n                    throw new Error(`Unexpected watchState ${this._watchState}`);\n            }\n        }\n\n        // if showUserLocation and the watch state isn't off then update the marker location\n        if (this.options.showUserLocation && this._watchState !== 'OFF') {\n            this._updateMarker(position);\n        }\n\n        // if in normal mode (not watch mode), or if in watch mode and the state is active watch\n        // then update the camera\n        if (!this.options.trackUserLocation || this._watchState === 'ACTIVE_LOCK') {\n            this._updateCamera(position);\n        }\n\n        if (this.options.showUserLocation) {\n            this._dotElement.classList.remove('maplibregl-user-location-dot-stale');\n        }\n\n        this.fire(new Event('geolocate', position));\n        this._finish();\n    };\n\n    /**\n     * Update the camera location to center on the current position\n     *\n     * @param position - the Geolocation API Position\n     */\n    _updateCamera = (position: GeolocationPosition) => {\n        const center = new LngLat(position.coords.longitude, position.coords.latitude);\n        const radius = position.coords.accuracy;\n        const bearing = this._map.getBearing();\n        const options = extend({bearing}, this.options.fitBoundsOptions);\n        const newBounds = LngLatBounds.fromLngLat(center, radius);\n\n        this._map.fitBounds(newBounds, options, {\n            geolocateSource: true // tag this camera change so it won't cause the control to change to background state\n        });\n    };\n\n    /**\n     * Update the user location dot Marker to the current position\n     *\n     * @param position - the Geolocation API Position\n     */\n    _updateMarker = (position?: GeolocationPosition | null) => {\n        if (position) {\n            const center = new LngLat(position.coords.longitude, position.coords.latitude);\n            this._accuracyCircleMarker.setLngLat(center).addTo(this._map);\n            this._userLocationDotMarker.setLngLat(center).addTo(this._map);\n            this._accuracy = position.coords.accuracy;\n            if (this.options.showUserLocation && this.options.showAccuracyCircle) {\n                this._updateCircleRadius();\n            }\n        } else {\n            this._userLocationDotMarker.remove();\n            this._accuracyCircleMarker.remove();\n        }\n    };\n\n    _updateCircleRadius() {\n        const bounds = this._map.getBounds();\n        const southEastPoint = bounds.getSouthEast();\n        const northEastPoint = bounds.getNorthEast();\n        const mapHeightInMeters = southEastPoint.distanceTo(northEastPoint);\n        const mapHeightInPixels = this._map._container.clientHeight;\n        const circleDiameter = Math.ceil(2 * (this._accuracy / (mapHeightInMeters / mapHeightInPixels)));\n        this._circleElement.style.width = `${circleDiameter}px`;\n        this._circleElement.style.height = `${circleDiameter}px`;\n    }\n\n    _onZoom = () => {\n        if (this.options.showUserLocation && this.options.showAccuracyCircle) {\n            this._updateCircleRadius();\n        }\n    };\n\n    _onError = (error: GeolocationPositionError) => {\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\n        if (this.options.trackUserLocation) {\n            if (error.code === 1) {\n                // PERMISSION_DENIED\n                this._watchState = 'OFF';\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active-error');\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background-error');\n                this._geolocateButton.disabled = true;\n                const title = this._map._getUIString('GeolocateControl.LocationNotAvailable');\n                this._geolocateButton.title = title;\n                this._geolocateButton.setAttribute('aria-label', title);\n\n                if (this._geolocationWatchID !== undefined) {\n                    this._clearWatch();\n                }\n            } else if (error.code === 3 && noTimeout) {\n                // this represents a forced error state\n                // this was triggered to force immediate geolocation when a watch is already present\n                // see https://github.com/mapbox/mapbox-gl-js/issues/8214\n                // and https://w3c.github.io/geolocation-api/#example-5-forcing-the-user-agent-to-return-a-fresh-cached-position\n                return;\n            } else {\n                this._setErrorState();\n            }\n        }\n\n        if (this._watchState !== 'OFF' && this.options.showUserLocation) {\n            this._dotElement.classList.add('maplibregl-user-location-dot-stale');\n        }\n\n        this.fire(new Event('error', error));\n\n        this._finish();\n    };\n\n    _finish = () => {\n        if (this._timeoutId) { clearTimeout(this._timeoutId); }\n        this._timeoutId = undefined;\n    };\n\n    _setupUI = () => {\n        // the control could have been removed before reaching here\n        if (!this._map) {\n            return;\n        }\n\n        this._container.addEventListener('contextmenu', (e: MouseEvent) => e.preventDefault());\n        this._geolocateButton = DOM.create('button', 'maplibregl-ctrl-geolocate', this._container);\n        DOM.create('span', 'maplibregl-ctrl-icon', this._geolocateButton).setAttribute('aria-hidden', 'true');\n        this._geolocateButton.type = 'button';\n        this._geolocateButton.disabled = true;\n    };\n\n    _finishSetupUI = (supported: boolean) => {\n        // this method is called asynchronously during onAdd\n        if (!this._map) {\n            // control has since been removed\n            return;\n        }\n\n        if (supported === false) {\n            warnOnce('Geolocation support is not available so the GeolocateControl will be disabled.');\n            const title = this._map._getUIString('GeolocateControl.LocationNotAvailable');\n            this._geolocateButton.disabled = true;\n            this._geolocateButton.title = title;\n            this._geolocateButton.setAttribute('aria-label', title);\n        } else {\n            const title = this._map._getUIString('GeolocateControl.FindMyLocation');\n            this._geolocateButton.disabled = false;\n            this._geolocateButton.title = title;\n            this._geolocateButton.setAttribute('aria-label', title);\n        }\n\n        if (this.options.trackUserLocation) {\n            this._geolocateButton.setAttribute('aria-pressed', 'false');\n            this._watchState = 'OFF';\n        }\n\n        // when showUserLocation is enabled, keep the Geolocate button disabled until the device location marker is setup on the map\n        if (this.options.showUserLocation) {\n            this._dotElement = DOM.create('div', 'maplibregl-user-location-dot');\n\n            this._userLocationDotMarker = new Marker({element: this._dotElement});\n\n            this._circleElement = DOM.create('div', 'maplibregl-user-location-accuracy-circle');\n            this._accuracyCircleMarker = new Marker({element: this._circleElement, pitchAlignment: 'map'});\n\n            if (this.options.trackUserLocation) this._watchState = 'OFF';\n\n            this._map.on('zoom', this._onZoom);\n        }\n\n        this._geolocateButton.addEventListener('click', () => this.trigger());\n\n        this._setup = true;\n\n        // when the camera is changed (and it's not as a result of the Geolocation Control) change\n        // the watch mode to background watch, so that the marker is updated but not the camera.\n        if (this.options.trackUserLocation) {\n            this._map.on('movestart', (event: any) => {\n                const fromResize = event.originalEvent && event.originalEvent.type === 'resize';\n                if (!event.geolocateSource && this._watchState === 'ACTIVE_LOCK' && !fromResize) {\n                    this._watchState = 'BACKGROUND';\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-background');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n\n                    this.fire(new Event('trackuserlocationend'));\n                    this.fire(new Event('userlocationlostfocus'));\n                }\n            });\n        }\n    };\n\n    /**\n     * Programmatically request and move the map to the user's location.\n     *\n     * @returns `false` if called before control was added to a map, otherwise returns `true`.\n     * @example\n     * ```ts\n     * // Initialize the geolocate control.\n     * let geolocate = new GeolocateControl({\n     *  positionOptions: {\n     *    enableHighAccuracy: true\n     *  },\n     *  trackUserLocation: true\n     * });\n     * // Add the control to the map.\n     * map.addControl(geolocate);\n     * map.on('load', () => {\n     *   geolocate.trigger();\n     * });\n     * ```\n     */\n    trigger(): boolean {\n        if (!this._setup) {\n            warnOnce('Geolocate control triggered before added to a map');\n            return false;\n        }\n        if (this.options.trackUserLocation) {\n            // update watchState and do any outgoing state cleanup\n            switch (this._watchState) {\n                case 'OFF':\n                // turn on the Geolocate Control\n                    this._watchState = 'WAITING_ACTIVE';\n\n                    this.fire(new Event('trackuserlocationstart'));\n                    break;\n                case 'WAITING_ACTIVE':\n                case 'ACTIVE_LOCK':\n                case 'ACTIVE_ERROR':\n                case 'BACKGROUND_ERROR':\n                // turn off the Geolocate Control\n                    numberOfWatches--;\n                    noTimeout = false;\n                    this._watchState = 'OFF';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-active-error');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background-error');\n\n                    this.fire(new Event('trackuserlocationend'));\n                    break;\n                case 'BACKGROUND':\n                    this._watchState = 'ACTIVE_LOCK';\n                    this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-background');\n                    // set camera to last known location\n                    if (this._lastKnownPosition) this._updateCamera(this._lastKnownPosition);\n\n                    this.fire(new Event('trackuserlocationstart'));\n                    this.fire(new Event('userlocationfocus'));\n                    break;\n                default:\n                    throw new Error(`Unexpected watchState ${this._watchState}`);\n            }\n\n            // incoming state setup\n            switch (this._watchState) {\n                case 'WAITING_ACTIVE':\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active');\n                    break;\n                case 'ACTIVE_LOCK':\n                    this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-active');\n                    break;\n                case 'OFF':\n                    break;\n                default:\n                    throw new Error(`Unexpected watchState ${this._watchState}`);\n            }\n\n            // manage geolocation.watchPosition / geolocation.clearWatch\n            if (this._watchState === 'OFF' && this._geolocationWatchID !== undefined) {\n                // clear watchPosition as we've changed to an OFF state\n                this._clearWatch();\n            } else if (this._geolocationWatchID === undefined) {\n                // enable watchPosition since watchState is not OFF and there is no watchPosition already running\n\n                this._geolocateButton.classList.add('maplibregl-ctrl-geolocate-waiting');\n                this._geolocateButton.setAttribute('aria-pressed', 'true');\n\n                numberOfWatches++;\n                let positionOptions;\n                if (numberOfWatches > 1) {\n                    positionOptions = {maximumAge: 600000, timeout: 0};\n                    noTimeout = true;\n                } else {\n                    positionOptions = this.options.positionOptions;\n                    noTimeout = false;\n                }\n\n                this._geolocationWatchID = window.navigator.geolocation.watchPosition(\n                    this._onSuccess, this._onError, positionOptions);\n            }\n        } else {\n            window.navigator.geolocation.getCurrentPosition(\n                this._onSuccess, this._onError, this.options.positionOptions);\n\n            // This timeout ensures that we still call finish() even if\n            // the user declines to share their location in Firefox\n            this._timeoutId = setTimeout(this._finish, 10000 /* 10sec */);\n        }\n\n        return true;\n    }\n\n    _clearWatch() {\n        window.navigator.geolocation.clearWatch(this._geolocationWatchID);\n\n        this._geolocationWatchID = undefined;\n        this._geolocateButton.classList.remove('maplibregl-ctrl-geolocate-waiting');\n        this._geolocateButton.setAttribute('aria-pressed', 'false');\n\n        if (this.options.showUserLocation) {\n            this._updateMarker(null);\n        }\n    }\n}\n\n", "import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {ControlPosition, IControl} from './control';\n\n/**\n * The unit type for length to use for the {@link ScaleControl}\n */\nexport type Unit = 'imperial' | 'metric' | 'nautical';\n\n/**\n * The {@link ScaleControl} options object\n */\ntype ScaleControlOptions = {\n    /**\n     * The maximum length of the scale control in pixels.\n     * @defaultValue 100\n     */\n    maxWidth?: number;\n    /**\n     * Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).\n     * @defaultValue 'metric'\n     */\n    unit?: Unit;\n};\n\nconst defaultOptions: ScaleControlOptions = {\n    maxWidth: 100,\n    unit: 'metric'\n};\n\n/**\n * A `ScaleControl` control displays the ratio of a distance on the map to the corresponding distance on the ground.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let scale = new ScaleControl({\n *     maxWidth: 80,\n *     unit: 'imperial'\n * });\n * map.addControl(scale);\n *\n * scale.setUnit('metric');\n * ```\n */\nexport class ScaleControl implements IControl {\n    _map: Map;\n    _container: HTMLElement;\n    options: ScaleControlOptions;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options?: ScaleControlOptions) {\n        this.options = {...defaultOptions, ...options};\n    }\n\n    getDefaultPosition(): ControlPosition {\n        return 'bottom-left';\n    }\n\n    _onMove = () => {\n        updateScale(this._map, this._container, this.options);\n    };\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-scale', map.getContainer());\n\n        this._map.on('move', this._onMove);\n        this._onMove();\n\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('move', this._onMove);\n        this._map = undefined;\n    }\n\n    /**\n     * Set the scale's unit of the distance\n     *\n     * @param unit - Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).\n     */\n    setUnit = (unit: Unit) => {\n        this.options.unit = unit;\n        updateScale(this._map, this._container, this.options);\n    };\n}\n\nfunction updateScale(map, container, options) {\n    // A horizontal scale is imagined to be present at center of the map\n    // container with maximum length (Default) as 100px.\n    // Using spherical law of cosines approximation, the real distance is\n    // found between the two coordinates.\n    const maxWidth = options && options.maxWidth || 100;\n\n    const y = map._container.clientHeight / 2;\n    const left = map.unproject([0, y]);\n    const right = map.unproject([maxWidth, y]);\n    const maxMeters = left.distanceTo(right);\n    // The real distance corresponding to 100px scale length is rounded off to\n    // near pretty number and the scale length for the same is found out.\n    // Default unit of the scale is based on User's locale.\n    if (options && options.unit === 'imperial') {\n        const maxFeet = 3.2808 * maxMeters;\n        if (maxFeet > 5280) {\n            const maxMiles = maxFeet / 5280;\n            setScale(container, maxWidth, maxMiles, map._getUIString('ScaleControl.Miles'));\n        } else {\n            setScale(container, maxWidth, maxFeet, map._getUIString('ScaleControl.Feet'));\n        }\n    } else if (options && options.unit === 'nautical') {\n        const maxNauticals = maxMeters / 1852;\n        setScale(container, maxWidth, maxNauticals, map._getUIString('ScaleControl.NauticalMiles'));\n    } else if (maxMeters >= 1000) {\n        setScale(container, maxWidth, maxMeters / 1000, map._getUIString('ScaleControl.Kilometers'));\n    } else {\n        setScale(container, maxWidth, maxMeters, map._getUIString('ScaleControl.Meters'));\n    }\n}\n\nfunction setScale(container, maxWidth, maxDistance, unit) {\n    const distance = getRoundNum(maxDistance);\n    const ratio = distance / maxDistance;\n    container.style.width = `${maxWidth * ratio}px`;\n    container.innerHTML = `${distance}&nbsp;${unit}`;\n}\n\nfunction getDecimalRoundNum(d) {\n    const multiplier = Math.pow(10, Math.ceil(-Math.log(d) / Math.LN10));\n    return Math.round(d * multiplier) / multiplier;\n}\n\nfunction getRoundNum(num) {\n    const pow10 = Math.pow(10, (`${Math.floor(num)}`).length - 1);\n    let d = num / pow10;\n\n    d = d >= 10 ? 10 :\n        d >= 5 ? 5 :\n            d >= 3 ? 3 :\n                d >= 2 ? 2 :\n                    d >= 1 ? 1 : getDecimalRoundNum(d);\n\n    return pow10 * d;\n}\n", "import {extend} from '../util/util';\nimport {Event, Evented} from '../util/evented';\nimport {MapMouseEvent} from '../ui/events';\nimport {DOM} from '../util/dom';\nimport {LngLat} from '../geo/lng_lat';\nimport Point from '@mapbox/point-geometry';\nimport {smartWrap} from '../util/smart_wrap';\nimport {anchorTranslate, applyAnchorClass} from './anchor';\n\nimport type {PositionAnchor} from './anchor';\nimport type {Map} from './map';\nimport type {LngLatLike} from '../geo/lng_lat';\nimport type {PointLike} from './camera';\n\nconst defaultOptions = {\n    closeButton: true,\n    closeOnClick: true,\n    focusAfterOpen: true,\n    className: '',\n    maxWidth: '240px',\n    subpixelPositioning: false\n};\n\n/**\n * A pixel offset specified as:\n *\n * - a single number specifying a distance from the location\n * - a {@link PointLike} specifying a constant offset\n * - an object of {@link Point}s specifying an offset for each anchor position\n *\n * Negative offsets indicate left and up.\n */\nexport type Offset = number | PointLike | {\n    [_ in PositionAnchor]: PointLike;\n};\n\n/**\n * The {@link Popup} options object\n */\nexport type PopupOptions = {\n    /**\n     * If `true`, a close button will appear in the top right corner of the popup.\n     * @defaultValue true\n     */\n    closeButton?: boolean;\n    /**\n     * If `true`, the popup will closed when the map is clicked.\n     * @defaultValue true\n     */\n    closeOnClick?: boolean;\n    /**\n     * If `true`, the popup will closed when the map moves.\n     * @defaultValue false\n     */\n    closeOnMove?: boolean;\n    /**\n     * If `true`, the popup will try to focus the first focusable element inside the popup.\n     * @defaultValue true\n     */\n    focusAfterOpen?: boolean;\n    /**\n     * A string indicating the part of the Popup that should\n     * be positioned closest to the coordinate set via {@link Popup#setLngLat}.\n     * Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`,\n     * `'top-right'`, `'bottom-left'`, and `'bottom-right'`. If unset the anchor will be\n     * dynamically set to ensure the popup falls within the map container with a preference\n     * for `'bottom'`.\n     */\n    anchor?: PositionAnchor;\n    /**\n     * A pixel offset applied to the popup's location\n     */\n    offset?: Offset;\n    /**\n     * Space-separated CSS class names to add to popup container\n     */\n    className?: string;\n    /**\n     * A string that sets the CSS property of the popup's maximum width, eg `'300px'`.\n     * To ensure the popup resizes to fit its content, set this property to `'none'`.\n     * Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n     * @defaultValue '240px'\n     */\n    maxWidth?: string;\n    /**\n     * If `true`, rounding is disabled for placement of the popup, allowing for\n     * subpixel positioning and smoother movement when the popup is translated.\n     * @defaultValue false\n     */\n    subpixelPositioning?: boolean;\n};\n\nconst focusQuerySelector = [\n    'a[href]',\n    '[tabindex]:not([tabindex=\\'-1\\'])',\n    '[contenteditable]:not([contenteditable=\\'false\\'])',\n    'button:not([disabled])',\n    'input:not([disabled])',\n    'select:not([disabled])',\n    'textarea:not([disabled])',\n].join(', ');\n\n/**\n * A popup component.\n *\n * @group Markers and Controls\n *\n *\n * @example\n * Create a popup\n * ```ts\n * let popup = new Popup();\n * // Set an event listener that will fire\n * // any time the popup is opened\n * popup.on('open', () => {\n *   console.log('popup was opened');\n * });\n * ```\n *\n * @example\n * Create a popup\n * ```ts\n * let popup = new Popup();\n * // Set an event listener that will fire\n * // any time the popup is closed\n * popup.on('close', () => {\n *   console.log('popup was closed');\n * });\n * ```\n *\n * @example\n * ```ts\n * let markerHeight = 50, markerRadius = 10, linearOffset = 25;\n * let popupOffsets = {\n *  'top': [0, 0],\n *  'top-left': [0,0],\n *  'top-right': [0,0],\n *  'bottom': [0, -markerHeight],\n *  'bottom-left': [linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n *  'bottom-right': [-linearOffset, (markerHeight - markerRadius + linearOffset) * -1],\n *  'left': [markerRadius, (markerHeight - markerRadius) * -1],\n *  'right': [-markerRadius, (markerHeight - markerRadius) * -1]\n *  };\n * let popup = new Popup({offset: popupOffsets, className: 'my-class'})\n *   .setLngLat(e.lngLat)\n *   .setHTML(\"<h1>Hello World!</h1>\")\n *   .setMaxWidth(\"300px\")\n *   .addTo(map);\n * ```\n * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)\n * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)\n * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/set-popup/)\n *\n * ## Events\n *\n * **Event** `open` of type {@link Event} will be fired when the popup is opened manually or programmatically.\n *\n * **Event** `close` of type {@link Event} will be fired when the popup is closed manually or programmatically.\n */\nexport class Popup extends Evented {\n    _map: Map;\n    options: PopupOptions;\n    _content: HTMLElement;\n    _container: HTMLElement;\n    _closeButton: HTMLButtonElement;\n    _tip: HTMLElement;\n    _lngLat: LngLat;\n    _trackPointer: boolean;\n    _pos: Point;\n    _flatPos: Point;\n\n    /**\n     * @param options - the options\n     */\n    constructor(options?: PopupOptions) {\n        super();\n        this.options = extend(Object.create(defaultOptions), options);\n    }\n\n    /**\n     * Adds the popup to a map.\n     *\n     * @param map - The MapLibre GL JS map to add the popup to.\n     * @example\n     * ```ts\n     * new Popup()\n     *   .setLngLat([0, 0])\n     *   .setHTML(\"<h1>Null Island</h1>\")\n     *   .addTo(map);\n     * ```\n     * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)\n     * @see [Show polygon information on click](https://maplibre.org/maplibre-gl-js/docs/examples/polygon-popup-on-click/)\n     */\n    addTo(map: Map): this {\n        if (this._map) this.remove();\n\n        this._map = map;\n        if (this.options.closeOnClick) {\n            this._map.on('click', this._onClose);\n        }\n\n        if (this.options.closeOnMove) {\n            this._map.on('move', this._onClose);\n        }\n\n        this._map.on('remove', this.remove);\n        this._update();\n        this._focusFirstElement();\n\n        if (this._trackPointer) {\n            this._map.on('mousemove', this._onMouseMove);\n            this._map.on('mouseup', this._onMouseUp);\n            if (this._container) {\n                this._container.classList.add('maplibregl-popup-track-pointer');\n            }\n            this._map._canvasContainer.classList.add('maplibregl-track-pointer');\n        } else {\n            this._map.on('move', this._update);\n        }\n\n        this.fire(new Event('open'));\n\n        return this;\n    }\n\n    /**\n     * @returns `true` if the popup is open, `false` if it is closed.\n     */\n    isOpen() {\n        return !!this._map;\n    }\n\n    /**\n     * Removes the popup from the map it has been added to.\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup().addTo(map);\n     * popup.remove();\n     * ```\n     */\n    remove = (): this => {\n        if (this._content) {\n            DOM.remove(this._content);\n        }\n\n        if (this._container) {\n            DOM.remove(this._container);\n            delete this._container;\n        }\n\n        if (this._map) {\n            this._map.off('move', this._update);\n            this._map.off('move', this._onClose);\n            this._map.off('click', this._onClose);\n            this._map.off('remove', this.remove);\n            this._map.off('mousemove', this._onMouseMove);\n            this._map.off('mouseup', this._onMouseUp);\n            this._map.off('drag', this._onDrag);\n            this._map._canvasContainer.classList.remove('maplibregl-track-pointer');\n            delete this._map;\n            this.fire(new Event('close'));\n        }\n\n        return this;\n    };\n\n    /**\n     * Returns the geographical location of the popup's anchor.\n     *\n     * The longitude of the result may differ by a multiple of 360 degrees from the longitude previously\n     * set by `setLngLat` because `Popup` wraps the anchor longitude across copies of the world to keep\n     * the popup on screen.\n     *\n     * @returns The geographical location of the popup's anchor.\n     */\n    getLngLat(): LngLat {\n        return this._lngLat;\n    }\n\n    /**\n     * Sets the geographical location of the popup's anchor, and moves the popup to it. Replaces trackPointer() behavior.\n     *\n     * @param lnglat - The geographical location to set as the popup's anchor.\n     */\n    setLngLat(lnglat: LngLatLike): this {\n        this._lngLat = LngLat.convert(lnglat);\n        this._pos = null;\n        this._flatPos = null;\n\n        this._trackPointer = false;\n\n        this._update();\n\n        if (this._map) {\n            this._map.on('move', this._update);\n            this._map.off('mousemove', this._onMouseMove);\n            if (this._container) {\n                this._container.classList.remove('maplibregl-popup-track-pointer');\n            }\n            this._map._canvasContainer.classList.remove('maplibregl-track-pointer');\n        }\n\n        return this;\n    }\n\n    /**\n     * Tracks the popup anchor to the cursor position on screens with a pointer device (it will be hidden on touchscreens). Replaces the `setLngLat` behavior.\n     * For most use cases, set `closeOnClick` and `closeButton` to `false`.\n     * @example\n     * ```ts\n     * let popup = new Popup({ closeOnClick: false, closeButton: false })\n     *   .setHTML(\"<h1>Hello World!</h1>\")\n     *   .trackPointer()\n     *   .addTo(map);\n     * ```\n     */\n    trackPointer(): this {\n        this._trackPointer = true;\n        this._pos = null;\n        this._flatPos = null;\n        this._update();\n        if (this._map) {\n            this._map.off('move', this._update);\n            this._map.on('mousemove', this._onMouseMove);\n            this._map.on('drag', this._onDrag);\n            if (this._container) {\n                this._container.classList.add('maplibregl-popup-track-pointer');\n            }\n            this._map._canvasContainer.classList.add('maplibregl-track-pointer');\n        }\n\n        return this;\n\n    }\n\n    /**\n     * Returns the `Popup`'s HTML element.\n     * @example\n     * Change the `Popup` element's font size\n     * ```ts\n     * let popup = new Popup()\n     *   .setLngLat([-96, 37.8])\n     *   .setHTML(\"<p>Hello World!</p>\")\n     *   .addTo(map);\n     * let popupElem = popup.getElement();\n     * popupElem.style.fontSize = \"25px\";\n     * ```\n     * @returns element\n     */\n    getElement(): HTMLElement {\n        return this._container;\n    }\n\n    /**\n     * Sets the popup's content to a string of text.\n     *\n     * This function creates a [Text](https://developer.mozilla.org/en-US/docs/Web/API/Text) node in the DOM,\n     * so it cannot insert raw HTML. Use this method for security against XSS\n     * if the popup content is user-provided.\n     *\n     * @param text - Textual content for the popup.\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     *   .setLngLat(e.lngLat)\n     *   .setText('Hello, world!')\n     *   .addTo(map);\n     * ```\n     */\n    setText(text: string): this {\n        return this.setDOMContent(document.createTextNode(text));\n    }\n\n    /**\n     * Sets the popup's content to the HTML provided as a string.\n     *\n     * This method does not perform HTML filtering or sanitization, and must be\n     * used only with trusted content. Consider {@link Popup#setText} if\n     * the content is an untrusted text string.\n     *\n     * @param html - A string representing HTML content for the popup.\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     *   .setLngLat(e.lngLat)\n     *   .setHTML(\"<h1>Hello World!</h1>\")\n     *   .addTo(map);\n     * ```\n     * @see [Display a popup](https://maplibre.org/maplibre-gl-js/docs/examples/popup/)\n     * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-hover/)\n     * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js/docs/examples/popup-on-click/)\n     * @see [Attach a popup to a marker instance](https://maplibre.org/maplibre-gl-js/docs/examples/set-popup/)\n     */\n    setHTML(html: string): this {\n        const frag = document.createDocumentFragment();\n        const temp = document.createElement('body');\n        let child;\n        temp.innerHTML = html;\n        while (true) {\n            child = temp.firstChild;\n            if (!child) break;\n            frag.appendChild(child);\n        }\n\n        return this.setDOMContent(frag);\n    }\n\n    /**\n     * Returns the popup's maximum width.\n     *\n     * @returns The maximum width of the popup.\n     */\n    getMaxWidth(): string {\n        return this._container?.style.maxWidth;\n    }\n\n    /**\n     * Sets the popup's maximum width. This is setting the CSS property `max-width`.\n     * Available values can be found here: https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\n     *\n     * @param maxWidth - A string representing the value for the maximum width.\n     */\n    setMaxWidth(maxWidth: string): this {\n        this.options.maxWidth = maxWidth;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Sets the popup's content to the element provided as a DOM node.\n     *\n     * @param htmlNode - A DOM node to be used as content for the popup.\n     * @example\n     * Create an element with the popup content\n     * ```ts\n     * let div = document.createElement('div');\n     * div.innerHTML = 'Hello, world!';\n     * let popup = new Popup()\n     *   .setLngLat(e.lngLat)\n     *   .setDOMContent(div)\n     *   .addTo(map);\n     * ```\n     */\n    setDOMContent(htmlNode: Node): this {\n        if (this._content) {\n            // Clear out children first.\n            while (this._content.hasChildNodes()) {\n                if (this._content.firstChild) {\n                    this._content.removeChild(this._content.firstChild);\n                }\n            }\n        } else {\n            this._content = DOM.create('div', 'maplibregl-popup-content', this._container);\n        }\n\n        // The close button should be the last tabbable element inside the popup for a good keyboard UX.\n        this._content.appendChild(htmlNode);\n        this._createCloseButton();\n        this._update();\n        this._focusFirstElement();\n        return this;\n    }\n\n    /**\n     * Adds a CSS class to the popup container element.\n     *\n     * @param className - Non-empty string with CSS class name to add to popup container\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.addClassName('some-class')\n     * ```\n     */\n    addClassName(className: string) {\n        if (this._container) {\n            this._container.classList.add(className);\n        }\n        return this;\n    }\n\n    /**\n     * Removes a CSS class from the popup container element.\n     *\n     * @param className - Non-empty string with CSS class name to remove from popup container\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.removeClassName('some-class')\n     * ```\n     */\n    removeClassName(className: string) {\n        if (this._container) {\n            this._container.classList.remove(className);\n        }\n        return this;\n    }\n\n    /**\n     * Sets the popup's offset.\n     *\n     * @param offset - Sets the popup's offset.\n     */\n    setOffset (offset?: Offset): this {\n        this.options.offset = offset;\n        this._update();\n        return this;\n    }\n\n    /**\n     * Add or remove the given CSS class on the popup container, depending on whether the container currently has that class.\n     *\n     * @param className - Non-empty string with CSS class name to add/remove\n     *\n     * @returns if the class was removed return false, if class was added, then return true, undefined if there is no container\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.toggleClassName('toggleClass')\n     * ```\n     */\n    toggleClassName(className: string): boolean | undefined {\n        if (this._container) {\n            return this._container.classList.toggle(className);\n        }\n    }\n\n    /**\n     * Set the option to allow subpixel positioning of the popup by passing a boolean\n     *\n     * @param value - When boolean is true, subpixel positioning is enabled for the popup.\n     *\n     * @example\n     * ```ts\n     * let popup = new Popup()\n     * popup.setSubpixelPositioning(true);\n     * ```\n     */\n    setSubpixelPositioning(value: boolean) {\n        this.options.subpixelPositioning = value;\n    }\n\n    _createCloseButton() {\n        if (this.options.closeButton) {\n            this._closeButton = DOM.create('button', 'maplibregl-popup-close-button', this._content);\n            this._closeButton.type = 'button';\n            this._closeButton.innerHTML = '&#215;';\n            this._closeButton.addEventListener('click', this._onClose);\n        }\n    }\n\n    _onMouseUp = (event: MapMouseEvent) => {\n        this._update(event.point);\n    };\n\n    _onMouseMove = (event: MapMouseEvent) => {\n        this._update(event.point);\n    };\n\n    _onDrag = (event: MapMouseEvent) => {\n        this._update(event.point);\n    };\n\n    _update = (cursor?: Point) => {\n        const hasPosition = this._lngLat || this._trackPointer;\n\n        if (!this._map || !hasPosition || !this._content) { return; }\n\n        if (!this._container) {\n            this._container = DOM.create('div', 'maplibregl-popup', this._map.getContainer());\n            this._tip       = DOM.create('div', 'maplibregl-popup-tip', this._container);\n            this._container.appendChild(this._content);\n            if (this.options.className) {\n                for (const name of this.options.className.split(' ')) {\n                    this._container.classList.add(name);\n                }\n            }\n\n            if (this._closeButton) {\n                this._closeButton.setAttribute('aria-label', this._map._getUIString('Popup.Close'));\n            }\n\n            if (this._trackPointer) {\n                this._container.classList.add('maplibregl-popup-track-pointer');\n            }\n        }\n\n        if (this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth) {\n            this._container.style.maxWidth = this.options.maxWidth;\n        }\n\n        if (this._map.transform.renderWorldCopies && !this._trackPointer) {\n            this._lngLat = smartWrap(this._lngLat, this._flatPos, this._map.transform);\n        } else {\n            this._lngLat = this._lngLat?.wrap();\n        }\n\n        if (this._trackPointer && !cursor) return;\n\n        const pos = this._flatPos = this._pos = this._trackPointer && cursor ? cursor : this._map.project(this._lngLat);\n        if (this._map.terrain) {\n            // flat position is saved because smartWrap needs non-elevated points\n            this._flatPos = this._trackPointer && cursor ? cursor : this._map.transform.locationPoint(this._lngLat);\n        }\n\n        let anchor = this.options.anchor;\n        const offset = normalizeOffset(this.options.offset);\n\n        if (!anchor) {\n            const width = this._container.offsetWidth;\n            const height = this._container.offsetHeight;\n            let anchorComponents;\n\n            if (pos.y + offset.bottom.y < height) {\n                anchorComponents = ['top'];\n            } else if (pos.y > this._map.transform.height - height) {\n                anchorComponents = ['bottom'];\n            } else {\n                anchorComponents = [];\n            }\n\n            if (pos.x < width / 2) {\n                anchorComponents.push('left');\n            } else if (pos.x > this._map.transform.width - width / 2) {\n                anchorComponents.push('right');\n            }\n\n            if (anchorComponents.length === 0) {\n                anchor = 'bottom';\n            } else {\n                anchor = (anchorComponents.join('-') as any);\n            }\n        }\n\n        let offsetedPos = pos.add(offset[anchor]);\n\n        if (!this.options.subpixelPositioning) {\n            offsetedPos = offsetedPos.round();\n        }\n\n        DOM.setTransform(this._container, `${anchorTranslate[anchor]} translate(${offsetedPos.x}px,${offsetedPos.y}px)`);\n        applyAnchorClass(this._container, anchor, 'popup');\n    };\n\n    _focusFirstElement() {\n        if (!this.options.focusAfterOpen || !this._container) return;\n\n        const firstFocusable = this._container.querySelector(focusQuerySelector) as HTMLElement;\n\n        if (firstFocusable) firstFocusable.focus();\n    }\n\n    _onClose = () => {\n        this.remove();\n    };\n}\n\nfunction normalizeOffset(offset?: Offset | null) {\n    if (!offset) {\n        return normalizeOffset(new Point(0, 0));\n\n    } else if (typeof offset === 'number') {\n        // input specifies a radius from which to calculate offsets at all positions\n        const cornerOffset = Math.round(Math.abs(offset) / Math.SQRT2);\n        return {\n            'center': new Point(0, 0),\n            'top': new Point(0, offset),\n            'top-left': new Point(cornerOffset, cornerOffset),\n            'top-right': new Point(-cornerOffset, cornerOffset),\n            'bottom': new Point(0, -offset),\n            'bottom-left': new Point(cornerOffset, -cornerOffset),\n            'bottom-right': new Point(-cornerOffset, -cornerOffset),\n            'left': new Point(offset, 0),\n            'right': new Point(-offset, 0)\n        };\n\n    } else if (offset instanceof Point || Array.isArray(offset)) {\n        // input specifies a single offset to be applied to all positions\n        const convertedOffset = Point.convert(offset);\n        return {\n            'center': convertedOffset,\n            'top': convertedOffset,\n            'top-left': convertedOffset,\n            'top-right': convertedOffset,\n            'bottom': convertedOffset,\n            'bottom-left': convertedOffset,\n            'bottom-right': convertedOffset,\n            'left': convertedOffset,\n            'right': convertedOffset\n        };\n\n    } else {\n        // input specifies an offset per position\n        return {\n            'center': Point.convert(offset['center'] || [0, 0]),\n            'top': Point.convert(offset['top'] || [0, 0]),\n            'top-left': Point.convert(offset['top-left'] || [0, 0]),\n            'top-right': Point.convert(offset['top-right'] || [0, 0]),\n            'bottom': Point.convert(offset['bottom'] || [0, 0]),\n            'bottom-left': Point.convert(offset['bottom-left'] || [0, 0]),\n            'bottom-right': Point.convert(offset['bottom-right'] || [0, 0]),\n            'left': Point.convert(offset['left'] || [0, 0]),\n            'right': Point.convert(offset['right'] || [0, 0])\n        };\n    }\n}\n", "import packageJSON from '../package.json' with {type: 'json'};\nimport {Map} from './ui/map';\nimport {NavigationControl} from './ui/control/navigation_control';\nimport {GeolocateControl} from './ui/control/geolocate_control';\nimport {AttributionControl} from './ui/control/attribution_control';\nimport {LogoControl} from './ui/control/logo_control';\nimport {ScaleControl} from './ui/control/scale_control';\nimport {FullscreenControl} from './ui/control/fullscreen_control';\nimport {TerrainControl} from './ui/control/terrain_control';\nimport {Popup} from './ui/popup';\nimport {Marker} from './ui/marker';\nimport {Style} from './style/style';\nimport {LngLat, LngLatLike} from './geo/lng_lat';\nimport {LngLatBounds, LngLatBoundsLike} from './geo/lng_lat_bounds';\nimport Point from '@mapbox/point-geometry';\nimport {MercatorCoordinate} from './geo/mercator_coordinate';\nimport {Evented} from './util/evented';\nimport {config} from './util/config';\nimport {rtlMainThreadPluginFactory} from './source/rtl_text_plugin_main_thread';\nimport {WorkerPool} from './util/worker_pool';\nimport {prewarm, clearPrewarmedResources} from './util/global_worker_pool';\nimport {AJAXError} from './util/ajax';\nimport {GeoJSONSource} from './source/geojson_source';\nimport {CanvasSource, CanvasSourceSpecification} from './source/canvas_source';\nimport {ImageSource} from './source/image_source';\nimport {RasterDEMTileSource} from './source/raster_dem_tile_source';\nimport {RasterTileSource} from './source/raster_tile_source';\nimport {VectorTileSource} from './source/vector_tile_source';\nimport {VideoSource} from './source/video_source';\nimport {Source, addSourceType} from './source/source';\nimport {addProtocol, removeProtocol} from './source/protocol_crud';\nimport {getGlobalDispatcher} from './util/dispatcher';\nimport {IControl} from './ui/control/control';\nimport {EdgeInsets, PaddingOptions} from './geo/edge_insets';\nimport {MapTerrainEvent, MapStyleImageMissingEvent, MapStyleDataEvent, MapSourceDataEvent, MapLibreZoomEvent, MapLibreEvent, MapLayerTouchEvent, MapLayerMouseEvent, MapLayerEventType, MapEventType, MapDataEvent, MapContextEvent, MapWheelEvent, MapTouchEvent, MapMouseEvent} from './ui/events';\nimport {BoxZoomHandler} from './ui/handler/box_zoom';\nimport {DragRotateHandler} from './ui/handler/shim/drag_rotate';\nimport {DragPanHandler} from './ui/handler/shim/drag_pan';\nimport {ScrollZoomHandler} from './ui/handler/scroll_zoom';\nimport {TwoFingersTouchZoomRotateHandler} from './ui/handler/shim/two_fingers_touch';\nimport {CustomLayerInterface} from './style/style_layer/custom_style_layer';\nimport {PointLike} from './ui/camera';\nimport {Hash} from './ui/hash';\nimport {CooperativeGesturesHandler} from './ui/handler/cooperative_gestures';\nimport {DoubleClickZoomHandler} from './ui/handler/shim/dblclick_zoom';\nimport {KeyboardHandler} from './ui/handler/keyboard';\nimport {TwoFingersTouchPitchHandler, TwoFingersTouchRotateHandler, TwoFingersTouchZoomHandler} from './ui/handler/two_fingers_touch';\nimport {MessageType} from './util/actor_messages';\nconst version = packageJSON.version;\n\nexport type * from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text).\n * Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.\n *\n * @param pluginURL - URL pointing to the Mapbox RTL text plugin source.\n * @param lazy - If set to `true`, maplibre will defer loading the plugin until rtl text is encountered,\n * rtl text will then be rendered only after the plugin finishes loading.\n * @example\n * ```ts\n * setRTLTextPlugin('https://unpkg.com/@mapbox/mapbox-gl-rtl-text@0.2.3/mapbox-gl-rtl-text.js', false);\n * ```\n * @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js/docs/examples/mapbox-gl-rtl-text/)\n */\nfunction setRTLTextPlugin(pluginURL: string, lazy: boolean): Promise<void> {\n    return rtlMainThreadPluginFactory().setRTLTextPlugin(pluginURL, lazy);\n}\n/**\n * Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.\n * The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.\n * If the status is `loaded` and the plugin is requested again, an error will be thrown.\n *\n * @example\n * ```ts\n * const pluginStatus = getRTLTextPluginStatus();\n * ```\n */\nfunction getRTLTextPluginStatus(): string {\n    return rtlMainThreadPluginFactory().getRTLTextPluginStatus();\n}\n/**\n * Returns the package version of the library\n * @returns Package version of the library\n */\nfunction getVersion() { return version; }\n/**\n * Gets the number of web workers instantiated on a page with GL JS maps.\n * By default, workerCount is 1 except for Safari browser where it is set to half the number of CPU cores (capped at 3).\n * Make sure to set this property before creating any map instances for it to have effect.\n *\n * @returns Number of workers currently configured.\n * @example\n * ```ts\n * const workerCount = getWorkerCount()\n * ```\n */\nfunction getWorkerCount() { return WorkerPool.workerCount; }\n/**\n * Sets the number of web workers instantiated on a page with GL JS maps.\n * By default, workerCount is 1 except for Safari browser where it is set to half the number of CPU cores (capped at 3).\n * Make sure to set this property before creating any map instances for it to have effect.\n *\n * @example\n * ```ts\n * setWorkerCount(2);\n * ```\n */\nfunction setWorkerCount(count: number) { WorkerPool.workerCount = count; }\n/**\n * Gets and sets the maximum number of images (raster tiles, sprites, icons) to load in parallel,\n * which affects performance in raster-heavy maps. 16 by default.\n *\n * @returns Number of parallel requests currently configured.\n * @example\n * ```ts\n * getMaxParallelImageRequests();\n * ```\n */\nfunction getMaxParallelImageRequests() { return config.MAX_PARALLEL_IMAGE_REQUESTS; }\n/**\n * Sets the maximum number of images (raster tiles, sprites, icons) to load in parallel,\n * which affects performance in raster-heavy maps. 16 by default.\n *\n * @example\n * ```ts\n * setMaxParallelImageRequests(10);\n * ```\n */\nfunction setMaxParallelImageRequests(numRequests: number) { config.MAX_PARALLEL_IMAGE_REQUESTS = numRequests; }\n/**\n * Gets the worker url\n * @returns The worker url\n */\nfunction getWorkerUrl() { return config.WORKER_URL; }\n/**\n * Sets the worker url\n */\nfunction setWorkerUrl(value: string) { config.WORKER_URL = value; }\n/**\n * Allows loading javascript code in the worker thread.\n * *Note* that since this is using some very internal classes and flows it is considered experimental and can break at any point.\n *\n * It can be useful for the following examples:\n * 1. Using `self.addProtocol` in the worker thread - note that you might need to also register the protocol on the main thread.\n * 2. Using `self.registerWorkerSource(workerSource: WorkerSource)` to register a worker source, which should come with `addSourceType` usually.\n * 3. using `self.actor.registerMessageHandler` to override some internal worker operations\n * @param workerUrl - the worker url e.g. a url of a javascript file to load in the worker\n * @returns\n *\n * @example\n * ```ts\n * // below is an example of sending a js file to the worker to load the method there\n * // Note that you'll need to call the global function `addProtocol` in the worker to register the protocol there.\n * // add-protocol-worker.js\n * async function loadFn(params, abortController) {\n *     const t = await fetch(`https://${params.url.split(\"://\")[1]}`);\n *     if (t.status == 200) {\n *         const buffer = await t.arrayBuffer();\n *         return {data: buffer}\n *     } else {\n *         throw new Error(`Tile fetch error: ${t.statusText}`);\n *     }\n * }\n * self.addProtocol('custom', loadFn);\n *\n * // main.js\n * importScriptInWorkers('add-protocol-worker.js');\n * ```\n */\nfunction importScriptInWorkers(workerUrl: string) { return getGlobalDispatcher().broadcast(MessageType.importScript, workerUrl); }\n\nexport {\n    Map,\n    NavigationControl,\n    GeolocateControl,\n    AttributionControl,\n    LogoControl,\n    ScaleControl,\n    FullscreenControl,\n    TerrainControl,\n    Hash,\n    Popup,\n    Marker,\n    Style,\n    LngLat,\n    LngLatBounds,\n    Point,\n    MercatorCoordinate,\n    Evented,\n    AJAXError,\n    config,\n    CanvasSource,\n    GeoJSONSource,\n    ImageSource,\n    RasterDEMTileSource,\n    RasterTileSource,\n    VectorTileSource,\n    VideoSource,\n    EdgeInsets,\n    BoxZoomHandler,\n    DragRotateHandler,\n    DragPanHandler,\n    ScrollZoomHandler,\n    TwoFingersTouchZoomRotateHandler,\n    CooperativeGesturesHandler,\n    DoubleClickZoomHandler,\n    KeyboardHandler,\n    TwoFingersTouchZoomHandler,\n    TwoFingersTouchRotateHandler,\n    TwoFingersTouchPitchHandler,\n    MapWheelEvent,\n    MapTouchEvent,\n    MapMouseEvent,\n    type IControl,\n    type CustomLayerInterface,\n    type CanvasSourceSpecification,\n    type PaddingOptions,\n    type LngLatLike,\n    type PointLike,\n    type LngLatBoundsLike,\n    type Source,\n    type MapTerrainEvent,\n    type MapStyleImageMissingEvent,\n    type MapStyleDataEvent,\n    type MapSourceDataEvent,\n    type MapLibreZoomEvent,\n    type MapLibreEvent,\n    type MapLayerTouchEvent,\n    type MapLayerMouseEvent,\n    type MapLayerEventType,\n    type MapEventType,\n    type MapDataEvent,\n    type MapContextEvent,\n    setRTLTextPlugin,\n    getRTLTextPluginStatus,\n    prewarm,\n    clearPrewarmedResources,\n    getVersion,\n    getWorkerCount,\n    setWorkerCount,\n    getMaxParallelImageRequests,\n    setMaxParallelImageRequests,\n    getWorkerUrl,\n    setWorkerUrl,\n    addProtocol,\n    removeProtocol,\n    addSourceType,\n    importScriptInWorkers\n};\n", "import {DOM} from '../../util/dom';\n\nimport {warnOnce} from '../../util/util';\n\nimport {Event, Evented} from '../../util/evented';\nimport type {Map} from '../map';\nimport type {IControl} from './control';\n\n/**\n * The {@link FullscreenControl} options object\n */\ntype FullscreenControlOptions = {\n    /**\n     * `container` is the [compatible DOM element](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen#Compatible_elements) which should be made full screen. By default, the map container element will be made full screen.\n     */\n    container?: HTMLElement;\n};\n\n/**\n * A `FullscreenControl` control contains a button for toggling the map in and out of fullscreen mode.\n * When [requestFullscreen](https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullscreen) is not supported, fullscreen is handled via CSS properties.\n * The map's `cooperativeGestures` option is temporarily disabled while the map\n * is in fullscreen mode, and is restored when the map exist fullscreen mode.\n *\n * @group Markers and Controls\n * @param options - the full screen control options\n *\n * @example\n * ```ts\n * map.addControl(new FullscreenControl({container: document.querySelector('body')}));\n * ```\n * @see [View a fullscreen map](https://maplibre.org/maplibre-gl-js/docs/examples/fullscreen/)\n *\n * ## Events\n *\n * **Event** `fullscreenstart` of type {@link Event} will be fired when fullscreen mode has started.\n *\n * **Event** `fullscreenend` of type {@link Event} will be fired when fullscreen mode has ended.\n */\nexport class FullscreenControl extends Evented implements IControl {\n    _map: Map;\n    _controlContainer: HTMLElement;\n    _fullscreen: boolean;\n    _fullscreenchange: string;\n    _fullscreenButton: HTMLButtonElement;\n    _container: HTMLElement;\n    _prevCooperativeGesturesEnabled: boolean;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: FullscreenControlOptions = {}) {\n        super();\n        this._fullscreen = false;\n\n        if (options && options.container) {\n            if (options.container instanceof HTMLElement) {\n                this._container = options.container;\n            } else {\n                warnOnce('Full screen control \\'container\\' must be a DOM element.');\n            }\n        }\n\n        if ('onfullscreenchange' in document) {\n            this._fullscreenchange = 'fullscreenchange';\n        } else if ('onmozfullscreenchange' in document) {\n            this._fullscreenchange = 'mozfullscreenchange';\n        } else if ('onwebkitfullscreenchange' in document) {\n            this._fullscreenchange = 'webkitfullscreenchange';\n        } else if ('onmsfullscreenchange' in document) {\n            this._fullscreenchange = 'MSFullscreenChange';\n        }\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map): HTMLElement {\n        this._map = map;\n        if (!this._container) this._container = this._map.getContainer();\n        this._controlContainer = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._setupUI();\n        return this._controlContainer;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._controlContainer);\n        this._map = null;\n        window.document.removeEventListener(this._fullscreenchange, this._onFullscreenChange);\n    }\n\n    _setupUI() {\n        const button = this._fullscreenButton = DOM.create('button', (('maplibregl-ctrl-fullscreen')), this._controlContainer);\n        DOM.create('span', 'maplibregl-ctrl-icon', button).setAttribute('aria-hidden', 'true');\n        button.type = 'button';\n        this._updateTitle();\n        this._fullscreenButton.addEventListener('click', this._onClickFullscreen);\n        window.document.addEventListener(this._fullscreenchange, this._onFullscreenChange);\n    }\n\n    _updateTitle() {\n        const title = this._getTitle();\n        this._fullscreenButton.setAttribute('aria-label', title);\n        this._fullscreenButton.title = title;\n    }\n\n    _getTitle() {\n        return this._map._getUIString(this._isFullscreen() ? 'FullscreenControl.Exit' : 'FullscreenControl.Enter');\n    }\n\n    _isFullscreen() {\n        return this._fullscreen;\n    }\n\n    _onFullscreenChange = () => {\n        let fullscreenElement =\n            window.document.fullscreenElement ||\n            (window.document as any).mozFullScreenElement ||\n            (window.document as any).webkitFullscreenElement ||\n            (window.document as any).msFullscreenElement;\n\n        while (fullscreenElement?.shadowRoot?.fullscreenElement) {\n            fullscreenElement = fullscreenElement.shadowRoot.fullscreenElement;\n        }\n\n        if ((fullscreenElement === this._container) !== this._fullscreen) {\n            this._handleFullscreenChange();\n        }\n    };\n\n    _handleFullscreenChange() {\n        this._fullscreen = !this._fullscreen;\n        this._fullscreenButton.classList.toggle('maplibregl-ctrl-shrink');\n        this._fullscreenButton.classList.toggle('maplibregl-ctrl-fullscreen');\n        this._updateTitle();\n\n        if (this._fullscreen) {\n            this.fire(new Event('fullscreenstart'));\n            this._prevCooperativeGesturesEnabled = this._map.cooperativeGestures.isEnabled();\n            this._map.cooperativeGestures.disable();\n        } else {\n            this.fire(new Event('fullscreenend'));\n            if (this._prevCooperativeGesturesEnabled) {\n                this._map.cooperativeGestures.enable();\n            }\n        }\n    }\n\n    _onClickFullscreen = () => {\n        if (this._isFullscreen()) {\n            this._exitFullscreen();\n        } else {\n            this._requestFullscreen();\n        }\n    };\n\n    _exitFullscreen() {\n        if (window.document.exitFullscreen) {\n            (window.document as any).exitFullscreen();\n        } else if ((window.document as any).mozCancelFullScreen) {\n            (window.document as any).mozCancelFullScreen();\n        } else if ((window.document as any).msExitFullscreen) {\n            (window.document as any).msExitFullscreen();\n        } else if ((window.document as any).webkitCancelFullScreen) {\n            (window.document as any).webkitCancelFullScreen();\n        } else {\n            this._togglePseudoFullScreen();\n        }\n    }\n\n    _requestFullscreen() {\n        if (this._container.requestFullscreen) {\n            this._container.requestFullscreen();\n        } else if ((this._container as any).mozRequestFullScreen) {\n            (this._container as any).mozRequestFullScreen();\n        } else if ((this._container as any).msRequestFullscreen) {\n            (this._container as any).msRequestFullscreen();\n        } else if ((this._container as any).webkitRequestFullscreen) {\n            (this._container as any).webkitRequestFullscreen();\n        } else {\n            this._togglePseudoFullScreen();\n        }\n    }\n\n    _togglePseudoFullScreen() {\n        this._container.classList.toggle('maplibregl-pseudo-fullscreen');\n        this._handleFullscreenChange();\n        this._map.resize();\n    }\n}\n", "import {DOM} from '../../util/dom';\n\nimport type {Map} from '../map';\nimport type {IControl} from './control';\nimport type {TerrainSpecification} from '@maplibre/maplibre-gl-style-spec';\n\n/**\n * A `TerrainControl` control contains a button for turning the terrain on and off.\n *\n * @group Markers and Controls\n *\n * @example\n * ```ts\n * let map = new Map({TerrainControl: false})\n *     .addControl(new TerrainControl({\n *         source: \"terrain\"\n *     }));\n * ```\n */\nexport class TerrainControl implements IControl {\n    options: TerrainSpecification;\n    _map: Map;\n    _container: HTMLElement;\n    _terrainButton: HTMLButtonElement;\n\n    /**\n     * @param options - the control's options\n     */\n    constructor(options: TerrainSpecification) {\n        this.options = options;\n    }\n\n    /** {@inheritDoc IControl.onAdd} */\n    onAdd(map: Map) {\n        this._map = map;\n        this._container = DOM.create('div', 'maplibregl-ctrl maplibregl-ctrl-group');\n        this._terrainButton = DOM.create('button', 'maplibregl-ctrl-terrain', this._container);\n        DOM.create('span', 'maplibregl-ctrl-icon', this._terrainButton).setAttribute('aria-hidden', 'true');\n        this._terrainButton.type = 'button';\n        this._terrainButton.addEventListener('click', this._toggleTerrain);\n\n        this._updateTerrainIcon();\n        this._map.on('terrain', this._updateTerrainIcon);\n        return this._container;\n    }\n\n    /** {@inheritDoc IControl.onRemove} */\n    onRemove() {\n        DOM.remove(this._container);\n        this._map.off('terrain', this._updateTerrainIcon);\n        this._map = undefined;\n    }\n\n    _toggleTerrain = () => {\n        if (this._map.getTerrain()) {\n            this._map.setTerrain(null);\n        } else {\n            this._map.setTerrain(this.options);\n        }\n        this._updateTerrainIcon();\n    };\n\n    _updateTerrainIcon = () => {\n        this._terrainButton.classList.remove('maplibregl-ctrl-terrain');\n        this._terrainButton.classList.remove('maplibregl-ctrl-terrain-enabled');\n        if (this._map.terrain) {\n            this._terrainButton.classList.add('maplibregl-ctrl-terrain-enabled');\n            this._terrainButton.title = this._map._getUIString('TerrainControl.Disable');\n        } else {\n            this._terrainButton.classList.add('maplibregl-ctrl-terrain');\n            this._terrainButton.title = this._map._getUIString('TerrainControl.Enable');\n        }\n    };\n}\n", "//\n// Our custom intro provides a specialized \"define()\" function, called by the\n// AMD modules below, that sets up the worker blob URL and then executes the\n// main module, storing its exported value as 'maplibregl'\n\n// The three \"chunks\" imported here are produced by a first Rollup pass,\n// which outputs them as AMD modules.\n\n// Shared dependencies\nimport '../../staging/maplibregl/shared';\n\n// Worker and its unique dependencies\n// When this wrapper function is passed to our custom define() in build/rollup/bundle_prelude.js,\n// it gets stringified, together with the shared wrapper (using\n// Function.toString()), and the resulting string of code is made into a\n// Blob URL that gets used by the main module to create the web workers.\nimport '../../staging/maplibregl/worker';\n\n// Main module and its dependencies\nimport '../../staging/maplibregl/index';\n\nexport default maplibregl;\n", "(function (root, factory) {\n    if (typeof define === 'function' && define.amd) {\n        // AMD\n        define(['leaflet', 'maplibre-gl'], factory);\n    } else if (typeof exports === 'object') {\n        // Node, CommonJS-like\n        module.exports = factory(require('leaflet'), require('maplibre-gl'));\n    } else {\n        // Browser globals (root is window)\n        root.returnExports = factory(root.L, root.maplibregl);\n    }\n}(typeof globalThis !== 'undefined' ? globalThis : this || self, function (L, maplibregl) {\n    L.MaplibreGL = L.Layer.extend({\n            options: {\n            updateInterval: 32,\n            // How much to extend the overlay view (relative to map size)\n            // e.g. 0.1 would be 10% of map view in each direction\n            padding: 0.1,\n            // whether or not to register the mouse and keyboard\n            // events on the maplibre overlay\n            interactive: false,\n            // set the tilepane as the default pane to draw gl tiles\n            pane: 'tilePane'\n        },\n\n        initialize: function (options) {\n            L.setOptions(this, options);\n\n            // setup throttling the update event when panning\n            this._throttledUpdate = L.Util.throttle(this._update, this.options.updateInterval, this);\n        },\n\n        onAdd: function (map) {\n            if (!this._container) {\n                this._initContainer();\n            }\n\n            var paneName = this.getPaneName();\n            map.getPane(paneName).appendChild(this._container);\n\n            this._initGL();\n\n            this._offset = this._map.containerPointToLayerPoint([0, 0]);\n\n            // work around https://github.com/mapbox/mapbox-gl-leaflet/issues/47\n            if (map.options.zoomAnimation) {\n                L.DomEvent.on(map._proxy, L.DomUtil.TRANSITION_END, this._transitionEnd, this);\n            }\n        },\n\n        onRemove: function (map) {\n            if (this._map._proxy && this._map.options.zoomAnimation) {\n                L.DomEvent.off(this._map._proxy, L.DomUtil.TRANSITION_END, this._transitionEnd, this);\n            }\n            var paneName = this.getPaneName();\n            map.getPane(paneName).removeChild(this._container);\n\n            this._glMap.remove();\n            this._glMap = null;\n        },\n\n        getEvents: function () {\n            return {\n                move: this._throttledUpdate, // sensibly throttle updating while panning\n                zoomanim: this._animateZoom, // applys the zoom animation to the <canvas>\n                zoom: this._pinchZoom, // animate every zoom event for smoother pinch-zooming\n                zoomstart: this._zoomStart, // flag starting a zoom to disable panning\n                zoomend: this._zoomEnd,\n                resize: this._resize\n            };\n        },\n\n        getMaplibreMap: function () {\n            return this._glMap;\n        },\n\n        getCanvas: function () {\n            return this._glMap.getCanvas();\n        },\n\n        getSize: function () {\n            return this._map.getSize().multiplyBy(1 + this.options.padding * 2);\n        },\n\n        getBounds: function () {\n            var halfSize = this.getSize().multiplyBy(0.5);\n            var center = this._map.latLngToContainerPoint(this._map.getCenter());\n            return L.latLngBounds(\n                this._map.containerPointToLatLng(center.subtract(halfSize)),\n                this._map.containerPointToLatLng(center.add(halfSize))\n            );\n        },\n\n        getContainer: function () {\n            return this._container;\n        },\n\n        // returns the pane name set in options if it is a valid pane, defaults to tilePane\n        getPaneName: function () {\n            return this._map.getPane(this.options.pane) ? this.options.pane : 'tilePane';\n        },\n\n        _roundPoint: function(p) {\n            return {x: Math.round(p.x), y: Math.round(p.y)};\n        },\n\n        _initContainer: function () {\n            var container = this._container = L.DomUtil.create('div', 'leaflet-gl-layer');\n\n            var size = this.getSize();\n            var offset = this._map.getSize().multiplyBy(this.options.padding);\n            container.style.width  = size.x + 'px';\n            container.style.height = size.y + 'px';\n\n            var topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset);\n\n            L.DomUtil.setPosition(container, this._roundPoint(topLeft));\n        },\n\n        _initGL: function () {\n            var center = this._map.getCenter();\n\n            var options = L.extend({}, this.options, {\n                container: this._container,\n                center: [center.lng, center.lat],\n                zoom: this._map.getZoom() - 1,\n                attributionControl: false\n            });\n\n            this._glMap = new maplibregl.Map(options);\n\n            // allow GL base map to pan beyond min/max latitudes\n            this._glMap.transform.latRange = null;\n            this._glMap.transform.maxValidLatitude = Infinity;\n\n            this._transformGL(this._glMap);\n\n            if (this._glMap._canvas.canvas) {\n                // older versions of mapbox-gl surfaced the canvas differently\n                this._glMap._actualCanvas = this._glMap._canvas.canvas;\n            } else {\n                this._glMap._actualCanvas = this._glMap._canvas;\n            }\n\n            // treat child <canvas> element like L.ImageOverlay\n            var canvas = this._glMap._actualCanvas;\n            L.DomUtil.addClass(canvas, 'leaflet-image-layer');\n            L.DomUtil.addClass(canvas, 'leaflet-zoom-animated');\n            if (this.options.interactive) {\n                L.DomUtil.addClass(canvas, 'leaflet-interactive');\n            }\n            if (this.options.className) {\n                L.DomUtil.addClass(canvas, this.options.className);\n            }\n        },\n\n        _update: function (e) {\n            if (!this._map) {\n                return;\n            }\n            // update the offset so we can correct for it later when we zoom\n            this._offset = this._map.containerPointToLayerPoint([0, 0]);\n\n            if (this._zooming) {\n                return;\n            }\n\n            var size = this.getSize(),\n                container = this._container,\n                gl = this._glMap,\n                offset = this._map.getSize().multiplyBy(this.options.padding),\n                topLeft = this._map.containerPointToLayerPoint([0, 0]).subtract(offset);\n\n            L.DomUtil.setPosition(container, this._roundPoint(topLeft));\n\n            this._transformGL(gl);\n\n            if (gl.transform.width !== size.x || gl.transform.height !== size.y) {\n                container.style.width  = size.x + 'px';\n                container.style.height = size.y + 'px';\n                if (gl._resize !== null && gl._resize !== undefined){\n                    gl._resize();\n                } else {\n                    gl.resize();\n                }\n            } else {\n                // older versions of mapbox-gl surfaced update publicly\n                if (gl._update !== null && gl._update !== undefined){\n                    gl._update();\n                } else {\n                    gl.update();\n                }\n            }\n        },\n\n        _transformGL: function (gl) {\n            var center = this._map.getCenter();\n\n            // gl.setView([center.lat, center.lng], this._map.getZoom() - 1, 0);\n            // calling setView directly causes sync issues because it uses requestAnimFrame\n\n            var tr = gl.transform;\n            tr.center = maplibregl.LngLat.convert([center.lng, center.lat]);\n            tr.zoom = this._map.getZoom() - 1;\n        },\n\n        // update the map constantly during a pinch zoom\n        _pinchZoom: function (e) {\n            this._glMap.jumpTo({\n                zoom: this._map.getZoom() - 1,\n                center: this._map.getCenter()\n            });\n        },\n\n        // borrowed from L.ImageOverlay\n        // https://github.com/Leaflet/Leaflet/blob/master/src/layer/ImageOverlay.js#L139-L144\n        _animateZoom: function (e) {\n            var scale = this._map.getZoomScale(e.zoom);\n            var padding = this._map.getSize().multiplyBy(this.options.padding * scale);\n            var viewHalf = this.getSize()._divideBy(2);\n            // corrections for padding (scaled), adapted from\n            // https://github.com/Leaflet/Leaflet/blob/master/src/map/Map.js#L1490-L1508\n            var topLeft = this._map.project(e.center, e.zoom)\n                ._subtract(viewHalf)\n                ._add(this._map._getMapPanePos()\n                .add(padding))._round();\n            var offset = this._map.project(this._map.getBounds().getNorthWest(), e.zoom)\n                ._subtract(topLeft);\n\n            L.DomUtil.setTransform(\n                this._glMap._actualCanvas,\n                offset.subtract(this._offset),\n                scale\n            );\n        },\n\n        _zoomStart: function (e) {\n            this._zooming = true;\n        },\n\n        _zoomEnd: function () {\n            var scale = this._map.getZoomScale(this._map.getZoom());\n\n            L.DomUtil.setTransform(\n                this._glMap._actualCanvas,\n                // https://github.com/mapbox/mapbox-gl-leaflet/pull/130\n                null,\n                scale\n            );\n\n            this._zooming = false;\n\n            this._update();\n        },\n\n        _transitionEnd: function (e) {\n            L.Util.requestAnimFrame(function () {\n                var zoom = this._map.getZoom();\n                var center = this._map.getCenter();\n                var offset = this._map.latLngToContainerPoint(\n                    this._map.getBounds().getNorthWest()\n                );\n\n                // reset the scale and offset\n                L.DomUtil.setTransform(this._glMap._actualCanvas, offset, 1);\n\n                // enable panning once the gl map is ready again\n                this._glMap.once('moveend', L.Util.bind(function () {\n                    this._zoomEnd();\n                }, this));\n\n                // update the map position\n                this._glMap.jumpTo({\n                    center: center,\n                    zoom: zoom - 1\n                });\n            }, this);\n        },\n\n        _resize: function (e) {\n            this._transitionEnd(e);\n        }\n    });\n\n    L.maplibreGL = function (options) {\n        return new L.MaplibreGL(options);\n    };\n\n}));", "/*\n * L.MarkerClusterGroup extends L.FeatureGroup by clustering the markers contained within\n */\n\nexport var MarkerClusterGroup = L.MarkerClusterGroup = L.FeatureGroup.extend({\n\n\toptions: {\n\t\tmaxClusterRadius: 80, //A cluster will cover at most this many pixels from its center\n\t\ticonCreateFunction: null,\n\t\tclusterPane: L.Marker.prototype.options.pane,\n\n\t\tspiderfyOnEveryZoom: false,\n\t\tspiderfyOnMaxZoom: true,\n\t\tshowCoverageOnHover: true,\n\t\tzoomToBoundsOnClick: true,\n\t\tsingleMarkerMode: false,\n\n\t\tdisableClusteringAtZoom: null,\n\n\t\t// Setting this to false prevents the removal of any clusters outside of the viewpoint, which\n\t\t// is the default behaviour for performance reasons.\n\t\tremoveOutsideVisibleBounds: true,\n\n\t\t// Set to false to disable all animations (zoom and spiderfy).\n\t\t// If false, option animateAddingMarkers below has no effect.\n\t\t// If L.DomUtil.TRANSITION is falsy, this option has no effect.\n\t\tanimate: true,\n\n\t\t//Whether to animate adding markers after adding the MarkerClusterGroup to the map\n\t\t// If you are adding individual markers set to true, if adding bulk markers leave false for massive performance gains.\n\t\tanimateAddingMarkers: false,\n\n\t\t// Make it possible to provide custom function to calculate spiderfy shape positions\n\t\tspiderfyShapePositions: null,\n\n\t\t//Increase to increase the distance away that spiderfied markers appear from the center\n\t\tspiderfyDistanceMultiplier: 1,\n\n\t\t// Make it possible to specify a polyline options on a spider leg\n\t\tspiderLegPolylineOptions: { weight: 1.5, color: '#222', opacity: 0.5 },\n\n\t\t// When bulk adding layers, adds markers in chunks. Means addLayers may not add all the layers in the call, others will be loaded during setTimeouts\n\t\tchunkedLoading: false,\n\t\tchunkInterval: 200, // process markers for a maximum of ~ n milliseconds (then trigger the chunkProgress callback)\n\t\tchunkDelay: 50, // at the end of each interval, give n milliseconds back to system/browser\n\t\tchunkProgress: null, // progress callback: function(processed, total, elapsed) (e.g. for a progress indicator)\n\n\t\t//Options to pass to the L.Polygon constructor\n\t\tpolygonOptions: {}\n\t},\n\n\tinitialize: function (options) {\n\t\tL.Util.setOptions(this, options);\n\t\tif (!this.options.iconCreateFunction) {\n\t\t\tthis.options.iconCreateFunction = this._defaultIconCreateFunction;\n\t\t}\n\n\t\tthis._featureGroup = L.featureGroup();\n\t\tthis._featureGroup.addEventParent(this);\n\n\t\tthis._nonPointGroup = L.featureGroup();\n\t\tthis._nonPointGroup.addEventParent(this);\n\n\t\tthis._inZoomAnimation = 0;\n\t\tthis._needsClustering = [];\n\t\tthis._needsRemoving = []; //Markers removed while we aren't on the map need to be kept track of\n\t\t//The bounds of the currently shown area (from _getExpandedVisibleBounds) Updated on zoom/move\n\t\tthis._currentShownBounds = null;\n\n\t\tthis._queue = [];\n\n\t\tthis._childMarkerEventHandlers = {\n\t\t\t'dragstart': this._childMarkerDragStart,\n\t\t\t'move': this._childMarkerMoved,\n\t\t\t'dragend': this._childMarkerDragEnd,\n\t\t};\n\n\t\t// Hook the appropriate animation methods.\n\t\tvar animate = L.DomUtil.TRANSITION && this.options.animate;\n\t\tL.extend(this, animate ? this._withAnimation : this._noAnimation);\n\t\t// Remember which MarkerCluster class to instantiate (animated or not).\n\t\tthis._markerCluster = animate ? L.MarkerCluster : L.MarkerClusterNonAnimated;\n\t},\n\n\taddLayer: function (layer) {\n\n\t\tif (layer instanceof L.LayerGroup) {\n\t\t\treturn this.addLayers([layer]);\n\t\t}\n\n\t\t//Don't cluster non point data\n\t\tif (!layer.getLatLng) {\n\t\t\tthis._nonPointGroup.addLayer(layer);\n\t\t\tthis.fire('layeradd', { layer: layer });\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this._map) {\n\t\t\tthis._needsClustering.push(layer);\n\t\t\tthis.fire('layeradd', { layer: layer });\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this.hasLayer(layer)) {\n\t\t\treturn this;\n\t\t}\n\n\n\t\t//If we have already clustered we'll need to add this one to a cluster\n\n\t\tif (this._unspiderfy) {\n\t\t\tthis._unspiderfy();\n\t\t}\n\n\t\tthis._addLayer(layer, this._maxZoom);\n\t\tthis.fire('layeradd', { layer: layer });\n\n\t\t// Refresh bounds and weighted positions.\n\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\tthis._refreshClustersIcons();\n\n\t\t//Work out what is visible\n\t\tvar visibleLayer = layer,\n\t\t    currentZoom = this._zoom;\n\t\tif (layer.__parent) {\n\t\t\twhile (visibleLayer.__parent._zoom >= currentZoom) {\n\t\t\t\tvisibleLayer = visibleLayer.__parent;\n\t\t\t}\n\t\t}\n\n\t\tif (this._currentShownBounds.contains(visibleLayer.getLatLng())) {\n\t\t\tif (this.options.animateAddingMarkers) {\n\t\t\t\tthis._animationAddLayer(layer, visibleLayer);\n\t\t\t} else {\n\t\t\t\tthis._animationAddLayerNonAnimated(layer, visibleLayer);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\n\tremoveLayer: function (layer) {\n\n\t\tif (layer instanceof L.LayerGroup) {\n\t\t\treturn this.removeLayers([layer]);\n\t\t}\n\n\t\t//Non point layers\n\t\tif (!layer.getLatLng) {\n\t\t\tthis._nonPointGroup.removeLayer(layer);\n\t\t\tthis.fire('layerremove', { layer: layer });\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this._map) {\n\t\t\tif (!this._arraySplice(this._needsClustering, layer) && this.hasLayer(layer)) {\n\t\t\t\tthis._needsRemoving.push({ layer: layer, latlng: layer._latlng });\n\t\t\t}\n\t\t\tthis.fire('layerremove', { layer: layer });\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!layer.__parent) {\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this._unspiderfy) {\n\t\t\tthis._unspiderfy();\n\t\t\tthis._unspiderfyLayer(layer);\n\t\t}\n\n\t\t//Remove the marker from clusters\n\t\tthis._removeLayer(layer, true);\n\t\tthis.fire('layerremove', { layer: layer });\n\n\t\t// Refresh bounds and weighted positions.\n\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\tthis._refreshClustersIcons();\n\n\t\tlayer.off(this._childMarkerEventHandlers, this);\n\n\t\tif (this._featureGroup.hasLayer(layer)) {\n\t\t\tthis._featureGroup.removeLayer(layer);\n\t\t\tif (layer.clusterShow) {\n\t\t\t\tlayer.clusterShow();\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t//Takes an array of markers and adds them in bulk\n\taddLayers: function (layersArray, skipLayerAddEvent) {\n\t\tif (!L.Util.isArray(layersArray)) {\n\t\t\treturn this.addLayer(layersArray);\n\t\t}\n\n\t\tvar fg = this._featureGroup,\n\t\t    npg = this._nonPointGroup,\n\t\t    chunked = this.options.chunkedLoading,\n\t\t    chunkInterval = this.options.chunkInterval,\n\t\t    chunkProgress = this.options.chunkProgress,\n\t\t    l = layersArray.length,\n\t\t    offset = 0,\n\t\t    originalArray = true,\n\t\t    m;\n\n\t\tif (this._map) {\n\t\t\tvar started = (new Date()).getTime();\n\t\t\tvar process = L.bind(function () {\n\t\t\t\tvar start = (new Date()).getTime();\n\n\t\t\t\t// Make sure to unspiderfy before starting to add some layers\n\t\t\t\tif (this._map && this._unspiderfy) {\n\t\t\t\t\tthis._unspiderfy();\n\t\t\t\t}\n\n\t\t\t\tfor (; offset < l; offset++) {\n\t\t\t\t\tif (chunked && offset % 200 === 0) {\n\t\t\t\t\t\t// every couple hundred markers, instrument the time elapsed since processing started:\n\t\t\t\t\t\tvar elapsed = (new Date()).getTime() - start;\n\t\t\t\t\t\tif (elapsed > chunkInterval) {\n\t\t\t\t\t\t\tbreak; // been working too hard, time to take a break :-)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tm = layersArray[offset];\n\n\t\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\t\t// Side effects:\n\t\t\t\t\t// - Total increases, so chunkProgress ratio jumps backward.\n\t\t\t\t\t// - Groups are not included in this group, only their non-group child layers (hasLayer).\n\t\t\t\t\t// Changing array length while looping does not affect performance in current browsers:\n\t\t\t\t\t// http://jsperf.com/for-loop-changing-length/6\n\t\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t//Not point data, can't be clustered\n\t\t\t\t\tif (!m.getLatLng) {\n\t\t\t\t\t\tnpg.addLayer(m);\n\t\t\t\t\t\tif (!skipLayerAddEvent) {\n\t\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.hasLayer(m)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis._addLayer(m, this._maxZoom);\n\t\t\t\t\tif (!skipLayerAddEvent) {\n\t\t\t\t\t\tthis.fire('layeradd', { layer: m });\n\t\t\t\t\t}\n\n\t\t\t\t\t//If we just made a cluster of size 2 then we need to remove the other marker from the map (if it is) or we never will\n\t\t\t\t\tif (m.__parent) {\n\t\t\t\t\t\tif (m.__parent.getChildCount() === 2) {\n\t\t\t\t\t\t\tvar markers = m.__parent.getAllChildMarkers(),\n\t\t\t\t\t\t\t    otherMarker = markers[0] === m ? markers[1] : markers[0];\n\t\t\t\t\t\t\tfg.removeLayer(otherMarker);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (chunkProgress) {\n\t\t\t\t\t// report progress and time elapsed:\n\t\t\t\t\tchunkProgress(offset, l, (new Date()).getTime() - started);\n\t\t\t\t}\n\n\t\t\t\t// Completed processing all markers.\n\t\t\t\tif (offset === l) {\n\n\t\t\t\t\t// Refresh bounds and weighted positions.\n\t\t\t\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\t\t\t\tthis._refreshClustersIcons();\n\n\t\t\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\n\t\t\t\t} else {\n\t\t\t\t\tsetTimeout(process, this.options.chunkDelay);\n\t\t\t\t}\n\t\t\t}, this);\n\n\t\t\tprocess();\n\t\t} else {\n\t\t\tvar needsClustering = this._needsClustering;\n\n\t\t\tfor (; offset < l; offset++) {\n\t\t\t\tm = layersArray[offset];\n\n\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//Not point data, can't be clustered\n\t\t\t\tif (!m.getLatLng) {\n\t\t\t\t\tnpg.addLayer(m);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (this.hasLayer(m)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tneedsClustering.push(m);\n\t\t\t}\n\t\t}\n\t\treturn this;\n\t},\n\n\t//Takes an array of markers and removes them in bulk\n\tremoveLayers: function (layersArray) {\n\t\tvar i, m,\n\t\t    l = layersArray.length,\n\t\t    fg = this._featureGroup,\n\t\t    npg = this._nonPointGroup,\n\t\t    originalArray = true;\n\n\t\tif (!this._map) {\n\t\t\tfor (i = 0; i < l; i++) {\n\t\t\t\tm = layersArray[i];\n\n\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\tif (originalArray) {\n\t\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\t\toriginalArray = false;\n\t\t\t\t\t}\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\t\tl = layersArray.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis._arraySplice(this._needsClustering, m);\n\t\t\t\tnpg.removeLayer(m);\n\t\t\t\tif (this.hasLayer(m)) {\n\t\t\t\t\tthis._needsRemoving.push({ layer: m, latlng: m._latlng });\n\t\t\t\t}\n\t\t\t\tthis.fire('layerremove', { layer: m });\n\t\t\t}\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this._unspiderfy) {\n\t\t\tthis._unspiderfy();\n\n\t\t\t// Work on a copy of the array, so that next loop is not affected.\n\t\t\tvar layersArray2 = layersArray.slice(),\n\t\t\t    l2 = l;\n\t\t\tfor (i = 0; i < l2; i++) {\n\t\t\t\tm = layersArray2[i];\n\n\t\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\t\tthis._extractNonGroupLayers(m, layersArray2);\n\t\t\t\t\tl2 = layersArray2.length;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tthis._unspiderfyLayer(m);\n\t\t\t}\n\t\t}\n\n\t\tfor (i = 0; i < l; i++) {\n\t\t\tm = layersArray[i];\n\n\t\t\t// Group of layers, append children to layersArray and skip.\n\t\t\tif (m instanceof L.LayerGroup) {\n\t\t\t\tif (originalArray) {\n\t\t\t\t\tlayersArray = layersArray.slice();\n\t\t\t\t\toriginalArray = false;\n\t\t\t\t}\n\t\t\t\tthis._extractNonGroupLayers(m, layersArray);\n\t\t\t\tl = layersArray.length;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!m.__parent) {\n\t\t\t\tnpg.removeLayer(m);\n\t\t\t\tthis.fire('layerremove', { layer: m });\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis._removeLayer(m, true, true);\n\t\t\tthis.fire('layerremove', { layer: m });\n\n\t\t\tif (fg.hasLayer(m)) {\n\t\t\t\tfg.removeLayer(m);\n\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\tm.clusterShow();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Refresh bounds and weighted positions.\n\t\tthis._topClusterLevel._recalculateBounds();\n\n\t\tthis._refreshClustersIcons();\n\n\t\t//Fix up the clusters and markers on the map\n\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, this._zoom, this._currentShownBounds);\n\n\t\treturn this;\n\t},\n\n\t//Removes all layers from the MarkerClusterGroup\n\tclearLayers: function () {\n\t\t//Need our own special implementation as the LayerGroup one doesn't work for us\n\n\t\t//If we aren't on the map (yet), blow away the markers we know of\n\t\tif (!this._map) {\n\t\t\tthis._needsClustering = [];\n\t\t\tthis._needsRemoving = [];\n\t\t\tdelete this._gridClusters;\n\t\t\tdelete this._gridUnclustered;\n\t\t}\n\n\t\tif (this._noanimationUnspiderfy) {\n\t\t\tthis._noanimationUnspiderfy();\n\t\t}\n\n\t\t//Remove all the visible layers\n\t\tthis._featureGroup.clearLayers();\n\t\tthis._nonPointGroup.clearLayers();\n\n\t\tthis.eachLayer(function (marker) {\n\t\t\tmarker.off(this._childMarkerEventHandlers, this);\n\t\t\tdelete marker.__parent;\n\t\t}, this);\n\n\t\tif (this._map) {\n\t\t\t//Reset _topClusterLevel and the DistanceGrids\n\t\t\tthis._generateInitialClusters();\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t//Override FeatureGroup.getBounds as it doesn't work\n\tgetBounds: function () {\n\t\tvar bounds = new L.LatLngBounds();\n\n\t\tif (this._topClusterLevel) {\n\t\t\tbounds.extend(this._topClusterLevel._bounds);\n\t\t}\n\n\t\tfor (var i = this._needsClustering.length - 1; i >= 0; i--) {\n\t\t\tbounds.extend(this._needsClustering[i].getLatLng());\n\t\t}\n\n\t\tbounds.extend(this._nonPointGroup.getBounds());\n\n\t\treturn bounds;\n\t},\n\n\t//Overrides LayerGroup.eachLayer\n\teachLayer: function (method, context) {\n\t\tvar markers = this._needsClustering.slice(),\n\t\t\tneedsRemoving = this._needsRemoving,\n\t\t\tthisNeedsRemoving, i, j;\n\n\t\tif (this._topClusterLevel) {\n\t\t\tthis._topClusterLevel.getAllChildMarkers(markers);\n\t\t}\n\n\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\tthisNeedsRemoving = true;\n\n\t\t\tfor (j = needsRemoving.length - 1; j >= 0; j--) {\n\t\t\t\tif (needsRemoving[j].layer === markers[i]) {\n\t\t\t\t\tthisNeedsRemoving = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (thisNeedsRemoving) {\n\t\t\t\tmethod.call(context, markers[i]);\n\t\t\t}\n\t\t}\n\n\t\tthis._nonPointGroup.eachLayer(method, context);\n\t},\n\n\t//Overrides LayerGroup.getLayers\n\tgetLayers: function () {\n\t\tvar layers = [];\n\t\tthis.eachLayer(function (l) {\n\t\t\tlayers.push(l);\n\t\t});\n\t\treturn layers;\n\t},\n\n\t//Overrides LayerGroup.getLayer, WARNING: Really bad performance\n\tgetLayer: function (id) {\n\t\tvar result = null;\n\n\t\tid = parseInt(id, 10);\n\n\t\tthis.eachLayer(function (l) {\n\t\t\tif (L.stamp(l) === id) {\n\t\t\t\tresult = l;\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t},\n\n\t//Returns true if the given layer is in this MarkerClusterGroup\n\thasLayer: function (layer) {\n\t\tif (!layer) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar i, anArray = this._needsClustering;\n\n\t\tfor (i = anArray.length - 1; i >= 0; i--) {\n\t\t\tif (anArray[i] === layer) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tanArray = this._needsRemoving;\n\t\tfor (i = anArray.length - 1; i >= 0; i--) {\n\t\t\tif (anArray[i].layer === layer) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn !!(layer.__parent && layer.__parent._group === this) || this._nonPointGroup.hasLayer(layer);\n\t},\n\n\t//Zoom down to show the given layer (spiderfying if necessary) then calls the callback\n\tzoomToShowLayer: function (layer, callback) {\n\n\t\tvar map = this._map;\n\n\t\tif (typeof callback !== 'function') {\n\t\t\tcallback = function () {};\n\t\t}\n\n\t\tvar showMarker = function () {\n\t\t\t// Assumes that map.hasLayer checks for direct appearance on map, not recursively calling\n\t\t\t// hasLayer on Layer Groups that are on map (typically not calling this MarkerClusterGroup.hasLayer, which would always return true)\n\t\t\tif ((map.hasLayer(layer) || map.hasLayer(layer.__parent)) && !this._inZoomAnimation) {\n\t\t\t\tthis._map.off('moveend', showMarker, this);\n\t\t\t\tthis.off('animationend', showMarker, this);\n\n\t\t\t\tif (map.hasLayer(layer)) {\n\t\t\t\t\tcallback();\n\t\t\t\t} else if (layer.__parent._icon) {\n\t\t\t\t\tthis.once('spiderfied', callback, this);\n\t\t\t\t\tlayer.__parent.spiderfy();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tif (layer._icon && this._map.getBounds().contains(layer.getLatLng())) {\n\t\t\t//Layer is visible ond on screen, immediate return\n\t\t\tcallback();\n\t\t} else if (layer.__parent._zoom < Math.round(this._map._zoom)) {\n\t\t\t//Layer should be visible at this zoom level. It must not be on screen so just pan over to it\n\t\t\tthis._map.on('moveend', showMarker, this);\n\t\t\tthis._map.panTo(layer.getLatLng());\n\t\t} else {\n\t\t\tthis._map.on('moveend', showMarker, this);\n\t\t\tthis.on('animationend', showMarker, this);\n\t\t\tlayer.__parent.zoomToBounds();\n\t\t}\n\t},\n\n\t//Overrides FeatureGroup.onAdd\n\tonAdd: function (map) {\n\t\tthis._map = map;\n\t\tvar i, l, layer;\n\n\t\tif (!isFinite(this._map.getMaxZoom())) {\n\t\t\tthrow \"Map has no maxZoom specified\";\n\t\t}\n\n\t\tthis._featureGroup.addTo(map);\n\t\tthis._nonPointGroup.addTo(map);\n\n\t\tif (!this._gridClusters) {\n\t\t\tthis._generateInitialClusters();\n\t\t}\n\n\t\tthis._maxLat = map.options.crs.projection.MAX_LATITUDE;\n\n\t\t//Restore all the positions as they are in the MCG before removing them\n\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\n\t\t\tlayer = this._needsRemoving[i];\n\t\t\tlayer.newlatlng = layer.layer._latlng;\n\t\t\tlayer.layer._latlng = layer.latlng;\n\t\t}\n\t\t//Remove them, then restore their new positions\n\t\tfor (i = 0, l = this._needsRemoving.length; i < l; i++) {\n\t\t\tlayer = this._needsRemoving[i];\n\t\t\tthis._removeLayer(layer.layer, true);\n\t\t\tlayer.layer._latlng = layer.newlatlng;\n\t\t}\n\t\tthis._needsRemoving = [];\n\n\t\t//Remember the current zoom level and bounds\n\t\tthis._zoom = Math.round(this._map._zoom);\n\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\n\n\t\tthis._map.on('zoomend', this._zoomEnd, this);\n\t\tthis._map.on('moveend', this._moveEnd, this);\n\n\t\tif (this._spiderfierOnAdd) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\n\t\t\tthis._spiderfierOnAdd();\n\t\t}\n\n\t\tthis._bindEvents();\n\n\t\t//Actually add our markers to the map:\n\t\tl = this._needsClustering;\n\t\tthis._needsClustering = [];\n\t\tthis.addLayers(l, true);\n\t},\n\n\t//Overrides FeatureGroup.onRemove\n\tonRemove: function (map) {\n\t\tmap.off('zoomend', this._zoomEnd, this);\n\t\tmap.off('moveend', this._moveEnd, this);\n\n\t\tthis._unbindEvents();\n\n\t\t//In case we are in a cluster animation\n\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\n\n\t\tif (this._spiderfierOnRemove) { //TODO FIXME: Not sure how to have spiderfier add something on here nicely\n\t\t\tthis._spiderfierOnRemove();\n\t\t}\n\n\t\tdelete this._maxLat;\n\n\t\t//Clean up all the layers we added to the map\n\t\tthis._hideCoverage();\n\t\tthis._featureGroup.remove();\n\t\tthis._nonPointGroup.remove();\n\n\t\tthis._featureGroup.clearLayers();\n\n\t\tthis._map = null;\n\t},\n\n\tgetVisibleParent: function (marker) {\n\t\tvar vMarker = marker;\n\t\twhile (vMarker && !vMarker._icon) {\n\t\t\tvMarker = vMarker.__parent;\n\t\t}\n\t\treturn vMarker || null;\n\t},\n\n\t//Remove the given object from the given array\n\t_arraySplice: function (anArray, obj) {\n\t\tfor (var i = anArray.length - 1; i >= 0; i--) {\n\t\t\tif (anArray[i] === obj) {\n\t\t\t\tanArray.splice(i, 1);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Removes a marker from all _gridUnclustered zoom levels, starting at the supplied zoom.\n\t * @param marker to be removed from _gridUnclustered.\n\t * @param z integer bottom start zoom level (included)\n\t * @private\n\t */\n\t_removeFromGridUnclustered: function (marker, z) {\n\t\tvar map = this._map,\n\t\t    gridUnclustered = this._gridUnclustered,\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\n\n\t\tfor (; z >= minZoom; z--) {\n\t\t\tif (!gridUnclustered[z].removeObject(marker, map.project(marker.getLatLng(), z))) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t},\n\n\t_childMarkerDragStart: function (e) {\n\t\te.target.__dragStart = e.target._latlng;\n\t},\n\n\t_childMarkerMoved: function (e) {\n\t\tif (!this._ignoreMove && !e.target.__dragStart) {\n\t\t\tvar isPopupOpen = e.target._popup && e.target._popup.isOpen();\n\n\t\t\tthis._moveChild(e.target, e.oldLatLng, e.latlng);\n\n\t\t\tif (isPopupOpen) {\n\t\t\t\te.target.openPopup();\n\t\t\t}\n\t\t}\n\t},\n\n\t_moveChild: function (layer, from, to) {\n\t\tlayer._latlng = from;\n\t\tthis.removeLayer(layer);\n\n\t\tlayer._latlng = to;\n\t\tthis.addLayer(layer);\n\t},\n\n\t_childMarkerDragEnd: function (e) {\n\t\tvar dragStart = e.target.__dragStart;\n\t\tdelete e.target.__dragStart;\n\t\tif (dragStart) {\n\t\t\tthis._moveChild(e.target, dragStart, e.target._latlng);\n\t\t}\t\t\n\t},\n\n\n\t//Internal function for removing a marker from everything.\n\t//dontUpdateMap: set to true if you will handle updating the map manually (for bulk functions)\n\t_removeLayer: function (marker, removeFromDistanceGrid, dontUpdateMap) {\n\t\tvar gridClusters = this._gridClusters,\n\t\t\tgridUnclustered = this._gridUnclustered,\n\t\t\tfg = this._featureGroup,\n\t\t\tmap = this._map,\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\n\n\t\t//Remove the marker from distance clusters it might be in\n\t\tif (removeFromDistanceGrid) {\n\t\t\tthis._removeFromGridUnclustered(marker, this._maxZoom);\n\t\t}\n\n\t\t//Work our way up the clusters removing them as we go if required\n\t\tvar cluster = marker.__parent,\n\t\t\tmarkers = cluster._markers,\n\t\t\totherMarker;\n\n\t\t//Remove the marker from the immediate parents marker list\n\t\tthis._arraySplice(markers, marker);\n\n\t\twhile (cluster) {\n\t\t\tcluster._childCount--;\n\t\t\tcluster._boundsNeedUpdate = true;\n\n\t\t\tif (cluster._zoom < minZoom) {\n\t\t\t\t//Top level, do nothing\n\t\t\t\tbreak;\n\t\t\t} else if (removeFromDistanceGrid && cluster._childCount <= 1) { //Cluster no longer required\n\t\t\t\t//We need to push the other marker up to the parent\n\t\t\t\totherMarker = cluster._markers[0] === marker ? cluster._markers[1] : cluster._markers[0];\n\n\t\t\t\t//Update distance grid\n\t\t\t\tgridClusters[cluster._zoom].removeObject(cluster, map.project(cluster._cLatLng, cluster._zoom));\n\t\t\t\tgridUnclustered[cluster._zoom].addObject(otherMarker, map.project(otherMarker.getLatLng(), cluster._zoom));\n\n\t\t\t\t//Move otherMarker up to parent\n\t\t\t\tthis._arraySplice(cluster.__parent._childClusters, cluster);\n\t\t\t\tcluster.__parent._markers.push(otherMarker);\n\t\t\t\totherMarker.__parent = cluster.__parent;\n\n\t\t\t\tif (cluster._icon) {\n\t\t\t\t\t//Cluster is currently on the map, need to put the marker on the map instead\n\t\t\t\t\tfg.removeLayer(cluster);\n\t\t\t\t\tif (!dontUpdateMap) {\n\t\t\t\t\t\tfg.addLayer(otherMarker);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcluster._iconNeedsUpdate = true;\n\t\t\t}\n\n\t\t\tcluster = cluster.__parent;\n\t\t}\n\n\t\tdelete marker.__parent;\n\t},\n\n\t_isOrIsParent: function (el, oel) {\n\t\twhile (oel) {\n\t\t\tif (el === oel) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\toel = oel.parentNode;\n\t\t}\n\t\treturn false;\n\t},\n\n\t//Override L.Evented.fire\n\tfire: function (type, data, propagate) {\n\t\tif (data && data.layer instanceof L.MarkerCluster) {\n\t\t\t//Prevent multiple clustermouseover/off events if the icon is made up of stacked divs (Doesn't work in ie <= 8, no relatedTarget)\n\t\t\tif (data.originalEvent && this._isOrIsParent(data.layer._icon, data.originalEvent.relatedTarget)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttype = 'cluster' + type;\n\t\t}\n\n\t\tL.FeatureGroup.prototype.fire.call(this, type, data, propagate);\n\t},\n\n\t//Override L.Evented.listens\n\tlistens: function (type, propagate) {\n\t\treturn L.FeatureGroup.prototype.listens.call(this, type, propagate) || L.FeatureGroup.prototype.listens.call(this, 'cluster' + type, propagate);\n\t},\n\n\t//Default functionality\n\t_defaultIconCreateFunction: function (cluster) {\n\t\tvar childCount = cluster.getChildCount();\n\n\t\tvar c = ' marker-cluster-';\n\t\tif (childCount < 10) {\n\t\t\tc += 'small';\n\t\t} else if (childCount < 100) {\n\t\t\tc += 'medium';\n\t\t} else {\n\t\t\tc += 'large';\n\t\t}\n\n\t\treturn new L.DivIcon({ html: '<div><span>' + childCount + '</span></div>', className: 'marker-cluster' + c, iconSize: new L.Point(40, 40) });\n\t},\n\n\t_bindEvents: function () {\n\t\tvar map = this._map,\n\t\t    spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\n\t\t    showCoverageOnHover = this.options.showCoverageOnHover,\n\t\t    zoomToBoundsOnClick = this.options.zoomToBoundsOnClick,\n\t\t    spiderfyOnEveryZoom = this.options.spiderfyOnEveryZoom;\n\n\t\t//Zoom on cluster click or spiderfy if we are at the lowest level\n\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick || spiderfyOnEveryZoom) {\n\t\t\tthis.on('clusterclick clusterkeypress', this._zoomOrSpiderfy, this);\n\t\t}\n\n\t\t//Show convex hull (boundary) polygon on mouse over\n\t\tif (showCoverageOnHover) {\n\t\t\tthis.on('clustermouseover', this._showCoverage, this);\n\t\t\tthis.on('clustermouseout', this._hideCoverage, this);\n\t\t\tmap.on('zoomend', this._hideCoverage, this);\n\t\t}\n\t},\n\n\t_zoomOrSpiderfy: function (e) {\n\t\tvar cluster = e.layer,\n\t\t    bottomCluster = cluster;\n\n\t\tif (e.type === 'clusterkeypress' && e.originalEvent && e.originalEvent.keyCode !== 13) {\n\t\t\treturn;\n\t\t}\n\n\t\twhile (bottomCluster._childClusters.length === 1) {\n\t\t\tbottomCluster = bottomCluster._childClusters[0];\n\t\t}\n\n\t\tif (bottomCluster._zoom === this._maxZoom &&\n\t\t\tbottomCluster._childCount === cluster._childCount &&\n\t\t\tthis.options.spiderfyOnMaxZoom) {\n\n\t\t\t// All child markers are contained in a single cluster from this._maxZoom to this cluster.\n\t\t\tcluster.spiderfy();\n\t\t} else if (this.options.zoomToBoundsOnClick) {\n\t\t\tcluster.zoomToBounds();\n\t\t}\n\n\t\tif (this.options.spiderfyOnEveryZoom) {\n\t\t\tcluster.spiderfy();\n\t\t}\n\n\t\t// Focus the map again for keyboard users.\n\t\tif (e.originalEvent && e.originalEvent.keyCode === 13) {\n\t\t\tthis._map._container.focus();\n\t\t}\n\t},\n\n\t_showCoverage: function (e) {\n\t\tvar map = this._map;\n\t\tif (this._inZoomAnimation) {\n\t\t\treturn;\n\t\t}\n\t\tif (this._shownPolygon) {\n\t\t\tmap.removeLayer(this._shownPolygon);\n\t\t}\n\t\tif (e.layer.getChildCount() > 2 && e.layer !== this._spiderfied) {\n\t\t\tthis._shownPolygon = new L.Polygon(e.layer.getConvexHull(), this.options.polygonOptions);\n\t\t\tmap.addLayer(this._shownPolygon);\n\t\t}\n\t},\n\n\t_hideCoverage: function () {\n\t\tif (this._shownPolygon) {\n\t\t\tthis._map.removeLayer(this._shownPolygon);\n\t\t\tthis._shownPolygon = null;\n\t\t}\n\t},\n\n\t_unbindEvents: function () {\n\t\tvar spiderfyOnMaxZoom = this.options.spiderfyOnMaxZoom,\n\t\t\tshowCoverageOnHover = this.options.showCoverageOnHover,\n\t\t\tzoomToBoundsOnClick = this.options.zoomToBoundsOnClick,\n\t\t\tspiderfyOnEveryZoom = this.options.spiderfyOnEveryZoom,\n\t\t\tmap = this._map;\n\n\t\tif (spiderfyOnMaxZoom || zoomToBoundsOnClick || spiderfyOnEveryZoom) {\n\t\t\tthis.off('clusterclick clusterkeypress', this._zoomOrSpiderfy, this);\n\t\t}\n\t\tif (showCoverageOnHover) {\n\t\t\tthis.off('clustermouseover', this._showCoverage, this);\n\t\t\tthis.off('clustermouseout', this._hideCoverage, this);\n\t\t\tmap.off('zoomend', this._hideCoverage, this);\n\t\t}\n\t},\n\n\t_zoomEnd: function () {\n\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\n\t\t\treturn;\n\t\t}\n\t\tthis._mergeSplitClusters();\n\n\t\tthis._zoom = Math.round(this._map._zoom);\n\t\tthis._currentShownBounds = this._getExpandedVisibleBounds();\n\t},\n\n\t_moveEnd: function () {\n\t\tif (this._inZoomAnimation) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newBounds = this._getExpandedVisibleBounds();\n\n\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, newBounds);\n\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, Math.round(this._map._zoom), newBounds);\n\n\t\tthis._currentShownBounds = newBounds;\n\t\treturn;\n\t},\n\n\t_generateInitialClusters: function () {\n\t\tvar maxZoom = Math.ceil(this._map.getMaxZoom()),\n\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\n\t\t\tradius = this.options.maxClusterRadius,\n\t\t\tradiusFn = radius;\n\n\t\t//If we just set maxClusterRadius to a single number, we need to create\n\t\t//a simple function to return that number. Otherwise, we just have to\n\t\t//use the function we've passed in.\n\t\tif (typeof radius !== \"function\") {\n\t\t\tradiusFn = function () { return radius; };\n\t\t}\n\n\t\tif (this.options.disableClusteringAtZoom !== null) {\n\t\t\tmaxZoom = this.options.disableClusteringAtZoom - 1;\n\t\t}\n\t\tthis._maxZoom = maxZoom;\n\t\tthis._gridClusters = {};\n\t\tthis._gridUnclustered = {};\n\n\t\t//Set up DistanceGrids for each zoom\n\t\tfor (var zoom = maxZoom; zoom >= minZoom; zoom--) {\n\t\t\tthis._gridClusters[zoom] = new L.DistanceGrid(radiusFn(zoom));\n\t\t\tthis._gridUnclustered[zoom] = new L.DistanceGrid(radiusFn(zoom));\n\t\t}\n\n\t\t// Instantiate the appropriate L.MarkerCluster class (animated or not).\n\t\tthis._topClusterLevel = new this._markerCluster(this, minZoom - 1);\n\t},\n\n\t//Zoom: Zoom to start adding at (Pass this._maxZoom to start at the bottom)\n\t_addLayer: function (layer, zoom) {\n\t\tvar gridClusters = this._gridClusters,\n\t\t    gridUnclustered = this._gridUnclustered,\n\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\n\t\t    markerPoint, z;\n\n\t\tif (this.options.singleMarkerMode) {\n\t\t\tthis._overrideMarkerIcon(layer);\n\t\t}\n\n\t\tlayer.on(this._childMarkerEventHandlers, this);\n\n\t\t//Find the lowest zoom level to slot this one in\n\t\tfor (; zoom >= minZoom; zoom--) {\n\t\t\tmarkerPoint = this._map.project(layer.getLatLng(), zoom); // calculate pixel position\n\n\t\t\t//Try find a cluster close by\n\t\t\tvar closest = gridClusters[zoom].getNearObject(markerPoint);\n\t\t\tif (closest) {\n\t\t\t\tclosest._addChild(layer);\n\t\t\t\tlayer.__parent = closest;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Try find a marker close by to form a new cluster with\n\t\t\tclosest = gridUnclustered[zoom].getNearObject(markerPoint);\n\t\t\tif (closest) {\n\t\t\t\tvar parent = closest.__parent;\n\t\t\t\tif (parent) {\n\t\t\t\t\tthis._removeLayer(closest, false);\n\t\t\t\t}\n\n\t\t\t\t//Create new cluster with these 2 in it\n\n\t\t\t\tvar newCluster = new this._markerCluster(this, zoom, closest, layer);\n\t\t\t\tgridClusters[zoom].addObject(newCluster, this._map.project(newCluster._cLatLng, zoom));\n\t\t\t\tclosest.__parent = newCluster;\n\t\t\t\tlayer.__parent = newCluster;\n\n\t\t\t\t//First create any new intermediate parent clusters that don't exist\n\t\t\t\tvar lastParent = newCluster;\n\t\t\t\tfor (z = zoom - 1; z > parent._zoom; z--) {\n\t\t\t\t\tlastParent = new this._markerCluster(this, z, lastParent);\n\t\t\t\t\tgridClusters[z].addObject(lastParent, this._map.project(closest.getLatLng(), z));\n\t\t\t\t}\n\t\t\t\tparent._addChild(lastParent);\n\n\t\t\t\t//Remove closest from this zoom level and any above that it is in, replace with newCluster\n\t\t\t\tthis._removeFromGridUnclustered(closest, zoom);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//Didn't manage to cluster in at this zoom, record us as a marker here and continue upwards\n\t\t\tgridUnclustered[zoom].addObject(layer, markerPoint);\n\t\t}\n\n\t\t//Didn't get in anything, add us to the top\n\t\tthis._topClusterLevel._addChild(layer);\n\t\tlayer.__parent = this._topClusterLevel;\n\t\treturn;\n\t},\n\n\t/**\n\t * Refreshes the icon of all \"dirty\" visible clusters.\n\t * Non-visible \"dirty\" clusters will be updated when they are added to the map.\n\t * @private\n\t */\n\t_refreshClustersIcons: function () {\n\t\tthis._featureGroup.eachLayer(function (c) {\n\t\t\tif (c instanceof L.MarkerCluster && c._iconNeedsUpdate) {\n\t\t\t\tc._updateIcon();\n\t\t\t}\n\t\t});\n\t},\n\n\t//Enqueue code to fire after the marker expand/contract has happened\n\t_enqueue: function (fn) {\n\t\tthis._queue.push(fn);\n\t\tif (!this._queueTimeout) {\n\t\t\tthis._queueTimeout = setTimeout(L.bind(this._processQueue, this), 300);\n\t\t}\n\t},\n\t_processQueue: function () {\n\t\tfor (var i = 0; i < this._queue.length; i++) {\n\t\t\tthis._queue[i].call(this);\n\t\t}\n\t\tthis._queue.length = 0;\n\t\tclearTimeout(this._queueTimeout);\n\t\tthis._queueTimeout = null;\n\t},\n\n\t//Merge and split any existing clusters that are too big or small\n\t_mergeSplitClusters: function () {\n\t\tvar mapZoom = Math.round(this._map._zoom);\n\n\t\t//In case we are starting to split before the animation finished\n\t\tthis._processQueue();\n\n\t\tif (this._zoom < mapZoom && this._currentShownBounds.intersects(this._getExpandedVisibleBounds())) { //Zoom in, split\n\t\t\tthis._animationStart();\n\t\t\t//Remove clusters now off screen\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), this._zoom, this._getExpandedVisibleBounds());\n\n\t\t\tthis._animationZoomIn(this._zoom, mapZoom);\n\n\t\t} else if (this._zoom > mapZoom) { //Zoom out, merge\n\t\t\tthis._animationStart();\n\n\t\t\tthis._animationZoomOut(this._zoom, mapZoom);\n\t\t} else {\n\t\t\tthis._moveEnd();\n\t\t}\n\t},\n\n\t//Gets the maps visible bounds expanded in each direction by the size of the screen (so the user cannot see an area we do not cover in one pan)\n\t_getExpandedVisibleBounds: function () {\n\t\tif (!this.options.removeOutsideVisibleBounds) {\n\t\t\treturn this._mapBoundsInfinite;\n\t\t} else if (L.Browser.mobile) {\n\t\t\treturn this._checkBoundsMaxLat(this._map.getBounds());\n\t\t}\n\n\t\treturn this._checkBoundsMaxLat(this._map.getBounds().pad(1)); // Padding expands the bounds by its own dimensions but scaled with the given factor.\n\t},\n\n\t/**\n\t * Expands the latitude to Infinity (or -Infinity) if the input bounds reach the map projection maximum defined latitude\n\t * (in the case of Web/Spherical Mercator, it is 85.0511287798 / see https://en.wikipedia.org/wiki/Web_Mercator#Formulas).\n\t * Otherwise, the removeOutsideVisibleBounds option will remove markers beyond that limit, whereas the same markers without\n\t * this option (or outside MCG) will have their position floored (ceiled) by the projection and rendered at that limit,\n\t * making the user think that MCG \"eats\" them and never displays them again.\n\t * @param bounds L.LatLngBounds\n\t * @returns {L.LatLngBounds}\n\t * @private\n\t */\n\t_checkBoundsMaxLat: function (bounds) {\n\t\tvar maxLat = this._maxLat;\n\n\t\tif (maxLat !== undefined) {\n\t\t\tif (bounds.getNorth() >= maxLat) {\n\t\t\t\tbounds._northEast.lat = Infinity;\n\t\t\t}\n\t\t\tif (bounds.getSouth() <= -maxLat) {\n\t\t\t\tbounds._southWest.lat = -Infinity;\n\t\t\t}\n\t\t}\n\n\t\treturn bounds;\n\t},\n\n\t//Shared animation code\n\t_animationAddLayerNonAnimated: function (layer, newCluster) {\n\t\tif (newCluster === layer) {\n\t\t\tthis._featureGroup.addLayer(layer);\n\t\t} else if (newCluster._childCount === 2) {\n\t\t\tnewCluster._addToMap();\n\n\t\t\tvar markers = newCluster.getAllChildMarkers();\n\t\t\tthis._featureGroup.removeLayer(markers[0]);\n\t\t\tthis._featureGroup.removeLayer(markers[1]);\n\t\t} else {\n\t\t\tnewCluster._updateIcon();\n\t\t}\n\t},\n\n\t/**\n\t * Extracts individual (i.e. non-group) layers from a Layer Group.\n\t * @param group to extract layers from.\n\t * @param output {Array} in which to store the extracted layers.\n\t * @returns {*|Array}\n\t * @private\n\t */\n\t_extractNonGroupLayers: function (group, output) {\n\t\tvar layers = group.getLayers(),\n\t\t    i = 0,\n\t\t    layer;\n\n\t\toutput = output || [];\n\n\t\tfor (; i < layers.length; i++) {\n\t\t\tlayer = layers[i];\n\n\t\t\tif (layer instanceof L.LayerGroup) {\n\t\t\t\tthis._extractNonGroupLayers(layer, output);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\toutput.push(layer);\n\t\t}\n\n\t\treturn output;\n\t},\n\n\t/**\n\t * Implements the singleMarkerMode option.\n\t * @param layer Marker to re-style using the Clusters iconCreateFunction.\n\t * @returns {L.Icon} The newly created icon.\n\t * @private\n\t */\n\t_overrideMarkerIcon: function (layer) {\n\t\tvar icon = layer.options.icon = this.options.iconCreateFunction({\n\t\t\tgetChildCount: function () {\n\t\t\t\treturn 1;\n\t\t\t},\n\t\t\tgetAllChildMarkers: function () {\n\t\t\t\treturn [layer];\n\t\t\t}\n\t\t});\n\n\t\treturn icon;\n\t}\n});\n\n// Constant bounds used in case option \"removeOutsideVisibleBounds\" is set to false.\nL.MarkerClusterGroup.include({\n\t_mapBoundsInfinite: new L.LatLngBounds(new L.LatLng(-Infinity, -Infinity), new L.LatLng(Infinity, Infinity))\n});\n\nL.MarkerClusterGroup.include({\n\t_noAnimation: {\n\t\t//Non Animated versions of everything\n\t\t_animationStart: function () {\n\t\t\t//Do nothing...\n\t\t},\n\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\n\n\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\n\t\t\tthis.fire('animationend');\n\t\t},\n\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel);\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\n\n\t\t\t//We didn't actually animate, but we use this event to mean \"clustering animations have finished\"\n\t\t\tthis.fire('animationend');\n\t\t},\n\t\t_animationAddLayer: function (layer, newCluster) {\n\t\t\tthis._animationAddLayerNonAnimated(layer, newCluster);\n\t\t}\n\t},\n\n\t_withAnimation: {\n\t\t//Animated versions here\n\t\t_animationStart: function () {\n\t\t\tthis._map._mapPane.className += ' leaflet-cluster-anim';\n\t\t\tthis._inZoomAnimation++;\n\t\t},\n\n\t\t_animationZoomIn: function (previousZoomLevel, newZoomLevel) {\n\t\t\tvar bounds = this._getExpandedVisibleBounds(),\n\t\t\t    fg = this._featureGroup,\n\t\t\t\tminZoom = Math.floor(this._map.getMinZoom()),\n\t\t\t    i;\n\n\t\t\tthis._ignoreMove = true;\n\n\t\t\t//Add all children of current clusters to map and remove those clusters from map\n\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\n\t\t\t\tvar startPos = c._latlng,\n\t\t\t\t    markers  = c._markers,\n\t\t\t\t    m;\n\n\t\t\t\tif (!bounds.contains(startPos)) {\n\t\t\t\t\tstartPos = null;\n\t\t\t\t}\n\n\t\t\t\tif (c._isSingleParent() && previousZoomLevel + 1 === newZoomLevel) { //Immediately add the new child and remove us\n\t\t\t\t\tfg.removeLayer(c);\n\t\t\t\t\tc._recursivelyAddChildrenToMap(null, newZoomLevel, bounds);\n\t\t\t\t} else {\n\t\t\t\t\t//Fade out old cluster\n\t\t\t\t\tc.clusterHide();\n\t\t\t\t\tc._recursivelyAddChildrenToMap(startPos, newZoomLevel, bounds);\n\t\t\t\t}\n\n\t\t\t\t//Remove all markers that aren't visible any more\n\t\t\t\t//TODO: Do we actually need to do this on the higher levels too?\n\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\t\t\tm = markers[i];\n\t\t\t\t\tif (!bounds.contains(m._latlng)) {\n\t\t\t\t\t\tfg.removeLayer(m);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tthis._forceLayout();\n\n\t\t\t//Update opacities\n\t\t\tthis._topClusterLevel._recursivelyBecomeVisible(bounds, newZoomLevel);\n\t\t\t//TODO Maybe? Update markers in _recursivelyBecomeVisible\n\t\t\tfg.eachLayer(function (n) {\n\t\t\t\tif (!(n instanceof L.MarkerCluster) && n._icon) {\n\t\t\t\t\tn.clusterShow();\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t//update the positions of the just added clusters/markers\n\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, newZoomLevel, function (c) {\n\t\t\t\tc._recursivelyRestoreChildPositions(newZoomLevel);\n\t\t\t});\n\n\t\t\tthis._ignoreMove = false;\n\n\t\t\t//Remove the old clusters and close the zoom animation\n\t\t\tthis._enqueue(function () {\n\t\t\t\t//update the positions of the just added clusters/markers\n\t\t\t\tthis._topClusterLevel._recursively(bounds, previousZoomLevel, minZoom, function (c) {\n\t\t\t\t\tfg.removeLayer(c);\n\t\t\t\t\tc.clusterShow();\n\t\t\t\t});\n\n\t\t\t\tthis._animationEnd();\n\t\t\t});\n\t\t},\n\n\t\t_animationZoomOut: function (previousZoomLevel, newZoomLevel) {\n\t\t\tthis._animationZoomOutSingle(this._topClusterLevel, previousZoomLevel - 1, newZoomLevel);\n\n\t\t\t//Need to add markers for those that weren't on the map before but are now\n\t\t\tthis._topClusterLevel._recursivelyAddChildrenToMap(null, newZoomLevel, this._getExpandedVisibleBounds());\n\t\t\t//Remove markers that were on the map before but won't be now\n\t\t\tthis._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds, Math.floor(this._map.getMinZoom()), previousZoomLevel, this._getExpandedVisibleBounds());\n\t\t},\n\n\t\t_animationAddLayer: function (layer, newCluster) {\n\t\t\tvar me = this,\n\t\t\t    fg = this._featureGroup;\n\n\t\t\tfg.addLayer(layer);\n\t\t\tif (newCluster !== layer) {\n\t\t\t\tif (newCluster._childCount > 2) { //Was already a cluster\n\n\t\t\t\t\tnewCluster._updateIcon();\n\t\t\t\t\tthis._forceLayout();\n\t\t\t\t\tthis._animationStart();\n\n\t\t\t\t\tlayer._setPos(this._map.latLngToLayerPoint(newCluster.getLatLng()));\n\t\t\t\t\tlayer.clusterHide();\n\n\t\t\t\t\tthis._enqueue(function () {\n\t\t\t\t\t\tfg.removeLayer(layer);\n\t\t\t\t\t\tlayer.clusterShow();\n\n\t\t\t\t\t\tme._animationEnd();\n\t\t\t\t\t});\n\n\t\t\t\t} else { //Just became a cluster\n\t\t\t\t\tthis._forceLayout();\n\n\t\t\t\t\tme._animationStart();\n\t\t\t\t\tme._animationZoomOutSingle(newCluster, this._map.getMaxZoom(), this._zoom);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t// Private methods for animated versions.\n\t_animationZoomOutSingle: function (cluster, previousZoomLevel, newZoomLevel) {\n\t\tvar bounds = this._getExpandedVisibleBounds(),\n\t\t\tminZoom = Math.floor(this._map.getMinZoom());\n\n\t\t//Animate all of the markers in the clusters to move to their cluster center point\n\t\tcluster._recursivelyAnimateChildrenInAndAddSelfToMap(bounds, minZoom, previousZoomLevel + 1, newZoomLevel);\n\n\t\tvar me = this;\n\n\t\t//Update the opacity (If we immediately set it they won't animate)\n\t\tthis._forceLayout();\n\t\tcluster._recursivelyBecomeVisible(bounds, newZoomLevel);\n\n\t\t//TODO: Maybe use the transition timing stuff to make this more reliable\n\t\t//When the animations are done, tidy up\n\t\tthis._enqueue(function () {\n\n\t\t\t//This cluster stopped being a cluster before the timeout fired\n\t\t\tif (cluster._childCount === 1) {\n\t\t\t\tvar m = cluster._markers[0];\n\t\t\t\t//If we were in a cluster animation at the time then the opacity and position of our child could be wrong now, so fix it\n\t\t\t\tthis._ignoreMove = true;\n\t\t\t\tm.setLatLng(m.getLatLng());\n\t\t\t\tthis._ignoreMove = false;\n\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\tm.clusterShow();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcluster._recursively(bounds, newZoomLevel, minZoom, function (c) {\n\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, minZoom, previousZoomLevel + 1);\n\t\t\t\t});\n\t\t\t}\n\t\t\tme._animationEnd();\n\t\t});\n\t},\n\n\t_animationEnd: function () {\n\t\tif (this._map) {\n\t\t\tthis._map._mapPane.className = this._map._mapPane.className.replace(' leaflet-cluster-anim', '');\n\t\t}\n\t\tthis._inZoomAnimation--;\n\t\tthis.fire('animationend');\n\t},\n\n\t//Force a browser layout of stuff in the map\n\t// Should apply the current opacity and location to all elements so we can update them again for an animation\n\t_forceLayout: function () {\n\t\t//In my testing this works, infact offsetWidth of any element seems to work.\n\t\t//Could loop all this._layers and do this for each _icon if it stops working\n\n\t\tL.Util.falseFn(document.body.offsetWidth);\n\t}\n});\n\nL.markerClusterGroup = function (options) {\n\treturn new L.MarkerClusterGroup(options);\n};\n", "export var MarkerCluster = L.MarkerCluster = L.Marker.extend({\n\toptions: L.Icon.prototype.options,\n\n\tinitialize: function (group, zoom, a, b) {\n\n\t\tL.Marker.prototype.initialize.call(this, a ? (a._cLatLng || a.getLatLng()) : new L.LatLng(0, 0),\n            { icon: this, pane: group.options.clusterPane });\n\n\t\tthis._group = group;\n\t\tthis._zoom = zoom;\n\n\t\tthis._markers = [];\n\t\tthis._childClusters = [];\n\t\tthis._childCount = 0;\n\t\tthis._iconNeedsUpdate = true;\n\t\tthis._boundsNeedUpdate = true;\n\n\t\tthis._bounds = new L.LatLngBounds();\n\n\t\tif (a) {\n\t\t\tthis._addChild(a);\n\t\t}\n\t\tif (b) {\n\t\t\tthis._addChild(b);\n\t\t}\n\t},\n\n\t//Recursively retrieve all child markers of this cluster\n\tgetAllChildMarkers: function (storageArray, ignoreDraggedMarker) {\n\t\tstorageArray = storageArray || [];\n\n\t\tfor (var i = this._childClusters.length - 1; i >= 0; i--) {\n\t\t\tthis._childClusters[i].getAllChildMarkers(storageArray, ignoreDraggedMarker);\n\t\t}\n\n\t\tfor (var j = this._markers.length - 1; j >= 0; j--) {\n\t\t\tif (ignoreDraggedMarker && this._markers[j].__dragStart) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tstorageArray.push(this._markers[j]);\n\t\t}\n\n\t\treturn storageArray;\n\t},\n\n\t//Returns the count of how many child markers we have\n\tgetChildCount: function () {\n\t\treturn this._childCount;\n\t},\n\n\t//Zoom to the minimum of showing all of the child markers, or the extents of this cluster\n\tzoomToBounds: function (fitBoundsOptions) {\n\t\tvar childClusters = this._childClusters.slice(),\n\t\t\tmap = this._group._map,\n\t\t\tboundsZoom = map.getBoundsZoom(this._bounds),\n\t\t\tzoom = this._zoom + 1,\n\t\t\tmapZoom = map.getZoom(),\n\t\t\ti;\n\n\t\t//calculate how far we need to zoom down to see all of the markers\n\t\twhile (childClusters.length > 0 && boundsZoom > zoom) {\n\t\t\tzoom++;\n\t\t\tvar newClusters = [];\n\t\t\tfor (i = 0; i < childClusters.length; i++) {\n\t\t\t\tnewClusters = newClusters.concat(childClusters[i]._childClusters);\n\t\t\t}\n\t\t\tchildClusters = newClusters;\n\t\t}\n\n\t\tif (boundsZoom > zoom) {\n\t\t\tthis._group._map.setView(this._latlng, zoom);\n\t\t} else if (boundsZoom <= mapZoom) { //If fitBounds wouldn't zoom us down, zoom us down instead\n\t\t\tthis._group._map.setView(this._latlng, mapZoom + 1);\n\t\t} else {\n\t\t\tthis._group._map.fitBounds(this._bounds, fitBoundsOptions);\n\t\t}\n\t},\n\n\tgetBounds: function () {\n\t\tvar bounds = new L.LatLngBounds();\n\t\tbounds.extend(this._bounds);\n\t\treturn bounds;\n\t},\n\n\t_updateIcon: function () {\n\t\tthis._iconNeedsUpdate = true;\n\t\tif (this._icon) {\n\t\t\tthis.setIcon(this);\n\t\t}\n\t},\n\n\t//Cludge for Icon, we pretend to be an icon for performance\n\tcreateIcon: function () {\n\t\tif (this._iconNeedsUpdate) {\n\t\t\tthis._iconObj = this._group.options.iconCreateFunction(this);\n\t\t\tthis._iconNeedsUpdate = false;\n\t\t}\n\t\treturn this._iconObj.createIcon();\n\t},\n\tcreateShadow: function () {\n\t\treturn this._iconObj.createShadow();\n\t},\n\n\n\t_addChild: function (new1, isNotificationFromChild) {\n\n\t\tthis._iconNeedsUpdate = true;\n\n\t\tthis._boundsNeedUpdate = true;\n\t\tthis._setClusterCenter(new1);\n\n\t\tif (new1 instanceof L.MarkerCluster) {\n\t\t\tif (!isNotificationFromChild) {\n\t\t\t\tthis._childClusters.push(new1);\n\t\t\t\tnew1.__parent = this;\n\t\t\t}\n\t\t\tthis._childCount += new1._childCount;\n\t\t} else {\n\t\t\tif (!isNotificationFromChild) {\n\t\t\t\tthis._markers.push(new1);\n\t\t\t}\n\t\t\tthis._childCount++;\n\t\t}\n\n\t\tif (this.__parent) {\n\t\t\tthis.__parent._addChild(new1, true);\n\t\t}\n\t},\n\n\t/**\n\t * Makes sure the cluster center is set. If not, uses the child center if it is a cluster, or the marker position.\n\t * @param child L.MarkerCluster|L.Marker that will be used as cluster center if not defined yet.\n\t * @private\n\t */\n\t_setClusterCenter: function (child) {\n\t\tif (!this._cLatLng) {\n\t\t\t// when clustering, take position of the first point as the cluster center\n\t\t\tthis._cLatLng = child._cLatLng || child._latlng;\n\t\t}\n\t},\n\n\t/**\n\t * Assigns impossible bounding values so that the next extend entirely determines the new bounds.\n\t * This method avoids having to trash the previous L.LatLngBounds object and to create a new one, which is much slower for this class.\n\t * As long as the bounds are not extended, most other methods would probably fail, as they would with bounds initialized but not extended.\n\t * @private\n\t */\n\t_resetBounds: function () {\n\t\tvar bounds = this._bounds;\n\n\t\tif (bounds._southWest) {\n\t\t\tbounds._southWest.lat = Infinity;\n\t\t\tbounds._southWest.lng = Infinity;\n\t\t}\n\t\tif (bounds._northEast) {\n\t\t\tbounds._northEast.lat = -Infinity;\n\t\t\tbounds._northEast.lng = -Infinity;\n\t\t}\n\t},\n\n\t_recalculateBounds: function () {\n\t\tvar markers = this._markers,\n\t\t    childClusters = this._childClusters,\n\t\t    latSum = 0,\n\t\t    lngSum = 0,\n\t\t    totalCount = this._childCount,\n\t\t    i, child, childLatLng, childCount;\n\n\t\t// Case where all markers are removed from the map and we are left with just an empty _topClusterLevel.\n\t\tif (totalCount === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Reset rather than creating a new object, for performance.\n\t\tthis._resetBounds();\n\n\t\t// Child markers.\n\t\tfor (i = 0; i < markers.length; i++) {\n\t\t\tchildLatLng = markers[i]._latlng;\n\n\t\t\tthis._bounds.extend(childLatLng);\n\n\t\t\tlatSum += childLatLng.lat;\n\t\t\tlngSum += childLatLng.lng;\n\t\t}\n\n\t\t// Child clusters.\n\t\tfor (i = 0; i < childClusters.length; i++) {\n\t\t\tchild = childClusters[i];\n\n\t\t\t// Re-compute child bounds and weighted position first if necessary.\n\t\t\tif (child._boundsNeedUpdate) {\n\t\t\t\tchild._recalculateBounds();\n\t\t\t}\n\n\t\t\tthis._bounds.extend(child._bounds);\n\n\t\t\tchildLatLng = child._wLatLng;\n\t\t\tchildCount = child._childCount;\n\n\t\t\tlatSum += childLatLng.lat * childCount;\n\t\t\tlngSum += childLatLng.lng * childCount;\n\t\t}\n\n\t\tthis._latlng = this._wLatLng = new L.LatLng(latSum / totalCount, lngSum / totalCount);\n\n\t\t// Reset dirty flag.\n\t\tthis._boundsNeedUpdate = false;\n\t},\n\n\t//Set our markers position as given and add it to the map\n\t_addToMap: function (startPos) {\n\t\tif (startPos) {\n\t\t\tthis._backupLatlng = this._latlng;\n\t\t\tthis.setLatLng(startPos);\n\t\t}\n\t\tthis._group._featureGroup.addLayer(this);\n\t},\n\n\t_recursivelyAnimateChildrenIn: function (bounds, center, maxZoom) {\n\t\tthis._recursively(bounds, this._group._map.getMinZoom(), maxZoom - 1,\n\t\t\tfunction (c) {\n\t\t\t\tvar markers = c._markers,\n\t\t\t\t\ti, m;\n\t\t\t\tfor (i = markers.length - 1; i >= 0; i--) {\n\t\t\t\t\tm = markers[i];\n\n\t\t\t\t\t//Only do it if the icon is still on the map\n\t\t\t\t\tif (m._icon) {\n\t\t\t\t\t\tm._setPos(center);\n\t\t\t\t\t\tm.clusterHide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction (c) {\n\t\t\t\tvar childClusters = c._childClusters,\n\t\t\t\t\tj, cm;\n\t\t\t\tfor (j = childClusters.length - 1; j >= 0; j--) {\n\t\t\t\t\tcm = childClusters[j];\n\t\t\t\t\tif (cm._icon) {\n\t\t\t\t\t\tcm._setPos(center);\n\t\t\t\t\t\tcm.clusterHide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n\n\t_recursivelyAnimateChildrenInAndAddSelfToMap: function (bounds, mapMinZoom, previousZoomLevel, newZoomLevel) {\n\t\tthis._recursively(bounds, newZoomLevel, mapMinZoom,\n\t\t\tfunction (c) {\n\t\t\t\tc._recursivelyAnimateChildrenIn(bounds, c._group._map.latLngToLayerPoint(c.getLatLng()).round(), previousZoomLevel);\n\n\t\t\t\t//TODO: depthToAnimateIn affects _isSingleParent, if there is a multizoom we may/may not be.\n\t\t\t\t//As a hack we only do a animation free zoom on a single level zoom, if someone does multiple levels then we always animate\n\t\t\t\tif (c._isSingleParent() && previousZoomLevel - 1 === newZoomLevel) {\n\t\t\t\t\tc.clusterShow();\n\t\t\t\t\tc._recursivelyRemoveChildrenFromMap(bounds, mapMinZoom, previousZoomLevel); //Immediately remove our children as we are replacing them. TODO previousBounds not bounds\n\t\t\t\t} else {\n\t\t\t\t\tc.clusterHide();\n\t\t\t\t}\n\n\t\t\t\tc._addToMap();\n\t\t\t}\n\t\t);\n\t},\n\n\t_recursivelyBecomeVisible: function (bounds, zoomLevel) {\n\t\tthis._recursively(bounds, this._group._map.getMinZoom(), zoomLevel, null, function (c) {\n\t\t\tc.clusterShow();\n\t\t});\n\t},\n\n\t_recursivelyAddChildrenToMap: function (startPos, zoomLevel, bounds) {\n\t\tthis._recursively(bounds, this._group._map.getMinZoom() - 1, zoomLevel,\n\t\t\tfunction (c) {\n\t\t\t\tif (zoomLevel === c._zoom) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Add our child markers at startPos (so they can be animated out)\n\t\t\t\tfor (var i = c._markers.length - 1; i >= 0; i--) {\n\t\t\t\t\tvar nm = c._markers[i];\n\n\t\t\t\t\tif (!bounds.contains(nm._latlng)) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (startPos) {\n\t\t\t\t\t\tnm._backupLatlng = nm.getLatLng();\n\n\t\t\t\t\t\tnm.setLatLng(startPos);\n\t\t\t\t\t\tif (nm.clusterHide) {\n\t\t\t\t\t\t\tnm.clusterHide();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tc._group._featureGroup.addLayer(nm);\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction (c) {\n\t\t\t\tc._addToMap(startPos);\n\t\t\t}\n\t\t);\n\t},\n\n\t_recursivelyRestoreChildPositions: function (zoomLevel) {\n\t\t//Fix positions of child markers\n\t\tfor (var i = this._markers.length - 1; i >= 0; i--) {\n\t\t\tvar nm = this._markers[i];\n\t\t\tif (nm._backupLatlng) {\n\t\t\t\tnm.setLatLng(nm._backupLatlng);\n\t\t\t\tdelete nm._backupLatlng;\n\t\t\t}\n\t\t}\n\n\t\tif (zoomLevel - 1 === this._zoom) {\n\t\t\t//Reposition child clusters\n\t\t\tfor (var j = this._childClusters.length - 1; j >= 0; j--) {\n\t\t\t\tthis._childClusters[j]._restorePosition();\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var k = this._childClusters.length - 1; k >= 0; k--) {\n\t\t\t\tthis._childClusters[k]._recursivelyRestoreChildPositions(zoomLevel);\n\t\t\t}\n\t\t}\n\t},\n\n\t_restorePosition: function () {\n\t\tif (this._backupLatlng) {\n\t\t\tthis.setLatLng(this._backupLatlng);\n\t\t\tdelete this._backupLatlng;\n\t\t}\n\t},\n\n\t//exceptBounds: If set, don't remove any markers/clusters in it\n\t_recursivelyRemoveChildrenFromMap: function (previousBounds, mapMinZoom, zoomLevel, exceptBounds) {\n\t\tvar m, i;\n\t\tthis._recursively(previousBounds, mapMinZoom - 1, zoomLevel - 1,\n\t\t\tfunction (c) {\n\t\t\t\t//Remove markers at every level\n\t\t\t\tfor (i = c._markers.length - 1; i >= 0; i--) {\n\t\t\t\t\tm = c._markers[i];\n\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\n\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\n\t\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction (c) {\n\t\t\t\t//Remove child clusters at just the bottom level\n\t\t\t\tfor (i = c._childClusters.length - 1; i >= 0; i--) {\n\t\t\t\t\tm = c._childClusters[i];\n\t\t\t\t\tif (!exceptBounds || !exceptBounds.contains(m._latlng)) {\n\t\t\t\t\t\tc._group._featureGroup.removeLayer(m);\n\t\t\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\t\t\tm.clusterShow();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t},\n\n\t//Run the given functions recursively to this and child clusters\n\t// boundsToApplyTo: a L.LatLngBounds representing the bounds of what clusters to recurse in to\n\t// zoomLevelToStart: zoom level to start running functions (inclusive)\n\t// zoomLevelToStop: zoom level to stop running functions (inclusive)\n\t// runAtEveryLevel: function that takes an L.MarkerCluster as an argument that should be applied on every level\n\t// runAtBottomLevel: function that takes an L.MarkerCluster as an argument that should be applied at only the bottom level\n\t_recursively: function (boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel) {\n\t\tvar childClusters = this._childClusters,\n\t\t    zoom = this._zoom,\n\t\t    i, c;\n\n\t\tif (zoomLevelToStart <= zoom) {\n\t\t\tif (runAtEveryLevel) {\n\t\t\t\trunAtEveryLevel(this);\n\t\t\t}\n\t\t\tif (runAtBottomLevel && zoom === zoomLevelToStop) {\n\t\t\t\trunAtBottomLevel(this);\n\t\t\t}\n\t\t}\n\n\t\tif (zoom < zoomLevelToStart || zoom < zoomLevelToStop) {\n\t\t\tfor (i = childClusters.length - 1; i >= 0; i--) {\n\t\t\t\tc = childClusters[i];\n\t\t\t\tif (c._boundsNeedUpdate) {\n\t\t\t\t\tc._recalculateBounds();\n\t\t\t\t}\n\t\t\t\tif (boundsToApplyTo.intersects(c._bounds)) {\n\t\t\t\t\tc._recursively(boundsToApplyTo, zoomLevelToStart, zoomLevelToStop, runAtEveryLevel, runAtBottomLevel);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\t//Returns true if we are the parent of only one cluster and that cluster is the same as us\n\t_isSingleParent: function () {\n\t\t//Don't need to check this._markers as the rest won't work if there are any\n\t\treturn this._childClusters.length > 0 && this._childClusters[0]._childCount === this._childCount;\n\t}\n});\n\n", "/*\n* Extends L.Marker to include two extra methods: clusterHide and clusterShow.\n* \n* They work as setOpacity(0) and setOpacity(1) respectively, but\n* don't overwrite the options.opacity\n* \n*/\n\nL.Marker.include({\n\tclusterHide: function () {\n\t\tvar backup = this.options.opacity;\n\t\tthis.setOpacity(0);\n\t\tthis.options.opacity = backup;\n\t\treturn this;\n\t},\n\t\n\tclusterShow: function () {\n\t\treturn this.setOpacity(this.options.opacity);\n\t}\n});\n\n\n", "\nL.DistanceGrid = function (cellSize) {\n\tthis._cellSize = cellSize;\n\tthis._sqCellSize = cellSize * cellSize;\n\tthis._grid = {};\n\tthis._objectPoint = { };\n};\n\nL.DistanceGrid.prototype = {\n\n\taddObject: function (obj, point) {\n\t\tvar x = this._getCoord(point.x),\n\t\t    y = this._getCoord(point.y),\n\t\t    grid = this._grid,\n\t\t    row = grid[y] = grid[y] || {},\n\t\t    cell = row[x] = row[x] || [],\n\t\t    stamp = L.Util.stamp(obj);\n\n\t\tthis._objectPoint[stamp] = point;\n\n\t\tcell.push(obj);\n\t},\n\n\tupdateObject: function (obj, point) {\n\t\tthis.removeObject(obj);\n\t\tthis.addObject(obj, point);\n\t},\n\n\t//Returns true if the object was found\n\tremoveObject: function (obj, point) {\n\t\tvar x = this._getCoord(point.x),\n\t\t    y = this._getCoord(point.y),\n\t\t    grid = this._grid,\n\t\t    row = grid[y] = grid[y] || {},\n\t\t    cell = row[x] = row[x] || [],\n\t\t    i, len;\n\n\t\tdelete this._objectPoint[L.Util.stamp(obj)];\n\n\t\tfor (i = 0, len = cell.length; i < len; i++) {\n\t\t\tif (cell[i] === obj) {\n\n\t\t\t\tcell.splice(i, 1);\n\n\t\t\t\tif (len === 1) {\n\t\t\t\t\tdelete row[x];\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t},\n\n\teachObject: function (fn, context) {\n\t\tvar i, j, k, len, row, cell, removed,\n\t\t    grid = this._grid;\n\n\t\tfor (i in grid) {\n\t\t\trow = grid[i];\n\n\t\t\tfor (j in row) {\n\t\t\t\tcell = row[j];\n\n\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\n\t\t\t\t\tremoved = fn.call(context, cell[k]);\n\t\t\t\t\tif (removed) {\n\t\t\t\t\t\tk--;\n\t\t\t\t\t\tlen--;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\n\tgetNearObject: function (point) {\n\t\tvar x = this._getCoord(point.x),\n\t\t    y = this._getCoord(point.y),\n\t\t    i, j, k, row, cell, len, obj, dist,\n\t\t    objectPoint = this._objectPoint,\n\t\t    closestDistSq = this._sqCellSize,\n\t\t    closest = null;\n\n\t\tfor (i = y - 1; i <= y + 1; i++) {\n\t\t\trow = this._grid[i];\n\t\t\tif (row) {\n\n\t\t\t\tfor (j = x - 1; j <= x + 1; j++) {\n\t\t\t\t\tcell = row[j];\n\t\t\t\t\tif (cell) {\n\n\t\t\t\t\t\tfor (k = 0, len = cell.length; k < len; k++) {\n\t\t\t\t\t\t\tobj = cell[k];\n\t\t\t\t\t\t\tdist = this._sqDist(objectPoint[L.Util.stamp(obj)], point);\n\t\t\t\t\t\t\tif (dist < closestDistSq ||\n\t\t\t\t\t\t\t\tdist <= closestDistSq && closest === null) {\n\t\t\t\t\t\t\t\tclosestDistSq = dist;\n\t\t\t\t\t\t\t\tclosest = obj;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn closest;\n\t},\n\n\t_getCoord: function (x) {\n\t\tvar coord = Math.floor(x / this._cellSize);\n\t\treturn isFinite(coord) ? coord : x;\n\t},\n\n\t_sqDist: function (p, p2) {\n\t\tvar dx = p2.x - p.x,\n\t\t    dy = p2.y - p.y;\n\t\treturn dx * dx + dy * dy;\n\t}\n};\n", "/* Copyright (c) 2012 the authors listed at the following URL, and/or\nthe authors of referenced articles or incorporated external code:\nhttp://en.literateprograms.org/Quickhull_(Javascript)?action=history&offset=20120410175256\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nRetrieved from: http://en.literateprograms.org/Quickhull_(Javascript)?oldid=18434\n*/\n\n(function () {\n\tL.QuickHull = {\n\n\t\t/*\n\t\t * @param {Object} cpt a point to be measured from the baseline\n\t\t * @param {Array} bl the baseline, as represented by a two-element\n\t\t *   array of latlng objects.\n\t\t * @returns {Number} an approximate distance measure\n\t\t */\n\t\tgetDistant: function (cpt, bl) {\n\t\t\tvar vY = bl[1].lat - bl[0].lat,\n\t\t\t\tvX = bl[0].lng - bl[1].lng;\n\t\t\treturn (vX * (cpt.lat - bl[0].lat) + vY * (cpt.lng - bl[0].lng));\n\t\t},\n\n\t\t/*\n\t\t * @param {Array} baseLine a two-element array of latlng objects\n\t\t *   representing the baseline to project from\n\t\t * @param {Array} latLngs an array of latlng objects\n\t\t * @returns {Object} the maximum point and all new points to stay\n\t\t *   in consideration for the hull.\n\t\t */\n\t\tfindMostDistantPointFromBaseLine: function (baseLine, latLngs) {\n\t\t\tvar maxD = 0,\n\t\t\t\tmaxPt = null,\n\t\t\t\tnewPoints = [],\n\t\t\t\ti, pt, d;\n\n\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\n\t\t\t\tpt = latLngs[i];\n\t\t\t\td = this.getDistant(pt, baseLine);\n\n\t\t\t\tif (d > 0) {\n\t\t\t\t\tnewPoints.push(pt);\n\t\t\t\t} else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (d > maxD) {\n\t\t\t\t\tmaxD = d;\n\t\t\t\t\tmaxPt = pt;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn { maxPoint: maxPt, newPoints: newPoints };\n\t\t},\n\n\n\t\t/*\n\t\t * Given a baseline, compute the convex hull of latLngs as an array\n\t\t * of latLngs.\n\t\t *\n\t\t * @param {Array} latLngs\n\t\t * @returns {Array}\n\t\t */\n\t\tbuildConvexHull: function (baseLine, latLngs) {\n\t\t\tvar convexHullBaseLines = [],\n\t\t\t\tt = this.findMostDistantPointFromBaseLine(baseLine, latLngs);\n\n\t\t\tif (t.maxPoint) { // if there is still a point \"outside\" the base line\n\t\t\t\tconvexHullBaseLines =\n\t\t\t\t\tconvexHullBaseLines.concat(\n\t\t\t\t\t\tthis.buildConvexHull([baseLine[0], t.maxPoint], t.newPoints)\n\t\t\t\t\t);\n\t\t\t\tconvexHullBaseLines =\n\t\t\t\t\tconvexHullBaseLines.concat(\n\t\t\t\t\t\tthis.buildConvexHull([t.maxPoint, baseLine[1]], t.newPoints)\n\t\t\t\t\t);\n\t\t\t\treturn convexHullBaseLines;\n\t\t\t} else {  // if there is no more point \"outside\" the base line, the current base line is part of the convex hull\n\t\t\t\treturn [baseLine[0]];\n\t\t\t}\n\t\t},\n\n\t\t/*\n\t\t * Given an array of latlngs, compute a convex hull as an array\n\t\t * of latlngs\n\t\t *\n\t\t * @param {Array} latLngs\n\t\t * @returns {Array}\n\t\t */\n\t\tgetConvexHull: function (latLngs) {\n\t\t\t// find first baseline\n\t\t\tvar maxLat = false, minLat = false,\n\t\t\t\tmaxLng = false, minLng = false,\n\t\t\t\tmaxLatPt = null, minLatPt = null,\n\t\t\t\tmaxLngPt = null, minLngPt = null,\n\t\t\t\tmaxPt = null, minPt = null,\n\t\t\t\ti;\n\n\t\t\tfor (i = latLngs.length - 1; i >= 0; i--) {\n\t\t\t\tvar pt = latLngs[i];\n\t\t\t\tif (maxLat === false || pt.lat > maxLat) {\n\t\t\t\t\tmaxLatPt = pt;\n\t\t\t\t\tmaxLat = pt.lat;\n\t\t\t\t}\n\t\t\t\tif (minLat === false || pt.lat < minLat) {\n\t\t\t\t\tminLatPt = pt;\n\t\t\t\t\tminLat = pt.lat;\n\t\t\t\t}\n\t\t\t\tif (maxLng === false || pt.lng > maxLng) {\n\t\t\t\t\tmaxLngPt = pt;\n\t\t\t\t\tmaxLng = pt.lng;\n\t\t\t\t}\n\t\t\t\tif (minLng === false || pt.lng < minLng) {\n\t\t\t\t\tminLngPt = pt;\n\t\t\t\t\tminLng = pt.lng;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (minLat !== maxLat) {\n\t\t\t\tminPt = minLatPt;\n\t\t\t\tmaxPt = maxLatPt;\n\t\t\t} else {\n\t\t\t\tminPt = minLngPt;\n\t\t\t\tmaxPt = maxLngPt;\n\t\t\t}\n\n\t\t\tvar ch = [].concat(this.buildConvexHull([minPt, maxPt], latLngs),\n\t\t\t\t\t\t\t\tthis.buildConvexHull([maxPt, minPt], latLngs));\n\t\t\treturn ch;\n\t\t}\n\t};\n}());\n\nL.MarkerCluster.include({\n\tgetConvexHull: function () {\n\t\tvar childMarkers = this.getAllChildMarkers(),\n\t\t\tpoints = [],\n\t\t\tp, i;\n\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\tp = childMarkers[i].getLatLng();\n\t\t\tpoints.push(p);\n\t\t}\n\n\t\treturn L.QuickHull.getConvexHull(points);\n\t}\n});\n", "//This code is 100% based on https://github.com/jawj/OverlappingMarkerSpiderfier-Leaflet\n//Huge thanks to jawj for implementing it first to make my job easy :-)\n\nL.MarkerCluster.include({\n\n\t_2PI: Math.PI * 2,\n\t_circleFootSeparation: 25, //related to circumference of circle\n\t_circleStartAngle: 0,\n\n\t_spiralFootSeparation:  28, //related to size of spiral (experiment!)\n\t_spiralLengthStart: 11,\n\t_spiralLengthFactor: 5,\n\n\t_circleSpiralSwitchover: 9, //show spiral instead of circle from this marker count upwards.\n\t\t\t\t\t\t\t\t// 0 -> always spiral; Infinity -> always circle\n\n\tspiderfy: function () {\n\t\tif (this._group._spiderfied === this || this._group._inZoomAnimation) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar childMarkers = this.getAllChildMarkers(null, true),\n\t\t\tgroup = this._group,\n\t\t\tmap = group._map,\n\t\t\tcenter = map.latLngToLayerPoint(this._latlng),\n\t\t\tpositions;\n\n\t\tthis._group._unspiderfy();\n\t\tthis._group._spiderfied = this;\n\n\t\t//TODO Maybe: childMarkers order by distance to center\n\n\t\tif (this._group.options.spiderfyShapePositions) {\n\t\t\tpositions = this._group.options.spiderfyShapePositions(childMarkers.length, center);\n\t\t} else if (childMarkers.length >= this._circleSpiralSwitchover) {\n\t\t\tpositions = this._generatePointsSpiral(childMarkers.length, center);\n\t\t} else {\n\t\t\tcenter.y += 10; // Otherwise circles look wrong => hack for standard blue icon, renders differently for other icons.\n\t\t\tpositions = this._generatePointsCircle(childMarkers.length, center);\n\t\t}\n\n\t\tthis._animationSpiderfy(childMarkers, positions);\n\t},\n\n\tunspiderfy: function (zoomDetails) {\n\t\t/// <param Name=\"zoomDetails\">Argument from zoomanim if being called in a zoom animation or null otherwise</param>\n\t\tif (this._group._inZoomAnimation) {\n\t\t\treturn;\n\t\t}\n\t\tthis._animationUnspiderfy(zoomDetails);\n\n\t\tthis._group._spiderfied = null;\n\t},\n\n\t_generatePointsCircle: function (count, centerPt) {\n\t\tvar circumference = this._group.options.spiderfyDistanceMultiplier * this._circleFootSeparation * (2 + count),\n\t\t\tlegLength = circumference / this._2PI,  //radius from circumference\n\t\t\tangleStep = this._2PI / count,\n\t\t\tres = [],\n\t\t\ti, angle;\n\n\t\tlegLength = Math.max(legLength, 35); // Minimum distance to get outside the cluster icon.\n\n\t\tres.length = count;\n\n\t\tfor (i = 0; i < count; i++) { // Clockwise, like spiral.\n\t\t\tangle = this._circleStartAngle + i * angleStep;\n\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\n\t\t}\n\n\t\treturn res;\n\t},\n\n\t_generatePointsSpiral: function (count, centerPt) {\n\t\tvar spiderfyDistanceMultiplier = this._group.options.spiderfyDistanceMultiplier,\n\t\t\tlegLength = spiderfyDistanceMultiplier * this._spiralLengthStart,\n\t\t\tseparation = spiderfyDistanceMultiplier * this._spiralFootSeparation,\n\t\t\tlengthFactor = spiderfyDistanceMultiplier * this._spiralLengthFactor * this._2PI,\n\t\t\tangle = 0,\n\t\t\tres = [],\n\t\t\ti;\n\n\t\tres.length = count;\n\n\t\t// Higher index, closer position to cluster center.\n\t\tfor (i = count; i >= 0; i--) {\n\t\t\t// Skip the first position, so that we are already farther from center and we avoid\n\t\t\t// being under the default cluster icon (especially important for Circle Markers).\n\t\t\tif (i < count) {\n\t\t\t\tres[i] = new L.Point(centerPt.x + legLength * Math.cos(angle), centerPt.y + legLength * Math.sin(angle))._round();\n\t\t\t}\n\t\t\tangle += separation / legLength + i * 0.0005;\n\t\t\tlegLength += lengthFactor / angle;\n\t\t}\n\t\treturn res;\n\t},\n\n\t_noanimationUnspiderfy: function () {\n\t\tvar group = this._group,\n\t\t\tmap = group._map,\n\t\t\tfg = group._featureGroup,\n\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\n\t\t\tm, i;\n\n\t\tgroup._ignoreMove = true;\n\n\t\tthis.setOpacity(1);\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\tm = childMarkers[i];\n\n\t\t\tfg.removeLayer(m);\n\n\t\t\tif (m._preSpiderfyLatlng) {\n\t\t\t\tm.setLatLng(m._preSpiderfyLatlng);\n\t\t\t\tdelete m._preSpiderfyLatlng;\n\t\t\t}\n\t\t\tif (m.setZIndexOffset) {\n\t\t\t\tm.setZIndexOffset(0);\n\t\t\t}\n\n\t\t\tif (m._spiderLeg) {\n\t\t\t\tmap.removeLayer(m._spiderLeg);\n\t\t\t\tdelete m._spiderLeg;\n\t\t\t}\n\t\t}\n\n\t\tgroup.fire('unspiderfied', {\n\t\t\tcluster: this,\n\t\t\tmarkers: childMarkers\n\t\t});\n\t\tgroup._ignoreMove = false;\n\t\tgroup._spiderfied = null;\n\t}\n});\n\n//Non Animated versions of everything\nL.MarkerClusterNonAnimated = L.MarkerCluster.extend({\n\t_animationSpiderfy: function (childMarkers, positions) {\n\t\tvar group = this._group,\n\t\t\tmap = group._map,\n\t\t\tfg = group._featureGroup,\n\t\t\tlegOptions = this._group.options.spiderLegPolylineOptions,\n\t\t\ti, m, leg, newPos;\n\n\t\tgroup._ignoreMove = true;\n\n\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\n\t\t// The reverse order trick no longer improves performance on modern browsers.\n\t\tfor (i = 0; i < childMarkers.length; i++) {\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\n\t\t\tm = childMarkers[i];\n\n\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\n\t\t\tleg = new L.Polyline([this._latlng, newPos], legOptions);\n\t\t\tmap.addLayer(leg);\n\t\t\tm._spiderLeg = leg;\n\n\t\t\t// Now add the marker.\n\t\t\tm._preSpiderfyLatlng = m._latlng;\n\t\t\tm.setLatLng(newPos);\n\t\t\tif (m.setZIndexOffset) {\n\t\t\t\tm.setZIndexOffset(1000000); //Make these appear on top of EVERYTHING\n\t\t\t}\n\n\t\t\tfg.addLayer(m);\n\t\t}\n\t\tthis.setOpacity(0.3);\n\n\t\tgroup._ignoreMove = false;\n\t\tgroup.fire('spiderfied', {\n\t\t\tcluster: this,\n\t\t\tmarkers: childMarkers\n\t\t});\n\t},\n\n\t_animationUnspiderfy: function () {\n\t\tthis._noanimationUnspiderfy();\n\t}\n});\n\n//Animated versions here\nL.MarkerCluster.include({\n\n\t_animationSpiderfy: function (childMarkers, positions) {\n\t\tvar me = this,\n\t\t\tgroup = this._group,\n\t\t\tmap = group._map,\n\t\t\tfg = group._featureGroup,\n\t\t\tthisLayerLatLng = this._latlng,\n\t\t\tthisLayerPos = map.latLngToLayerPoint(thisLayerLatLng),\n\t\t\tsvg = L.Path.SVG,\n\t\t\tlegOptions = L.extend({}, this._group.options.spiderLegPolylineOptions), // Copy the options so that we can modify them for animation.\n\t\t\tfinalLegOpacity = legOptions.opacity,\n\t\t\ti, m, leg, legPath, legLength, newPos;\n\n\t\tif (finalLegOpacity === undefined) {\n\t\t\tfinalLegOpacity = L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity;\n\t\t}\n\n\t\tif (svg) {\n\t\t\t// If the initial opacity of the spider leg is not 0 then it appears before the animation starts.\n\t\t\tlegOptions.opacity = 0;\n\n\t\t\t// Add the class for CSS transitions.\n\t\t\tlegOptions.className = (legOptions.className || '') + ' leaflet-cluster-spider-leg';\n\t\t} else {\n\t\t\t// Make sure we have a defined opacity.\n\t\t\tlegOptions.opacity = finalLegOpacity;\n\t\t}\n\n\t\tgroup._ignoreMove = true;\n\n\t\t// Add markers and spider legs to map, hidden at our center point.\n\t\t// Traverse in ascending order to make sure that inner circleMarkers are on top of further legs. Normal markers are re-ordered by newPosition.\n\t\t// The reverse order trick no longer improves performance on modern browsers.\n\t\tfor (i = 0; i < childMarkers.length; i++) {\n\t\t\tm = childMarkers[i];\n\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\n\n\t\t\t// Add the leg before the marker, so that in case the latter is a circleMarker, the leg is behind it.\n\t\t\tleg = new L.Polyline([thisLayerLatLng, newPos], legOptions);\n\t\t\tmap.addLayer(leg);\n\t\t\tm._spiderLeg = leg;\n\n\t\t\t// Explanations: https://jakearchibald.com/2013/animated-line-drawing-svg/\n\t\t\t// In our case the transition property is declared in the CSS file.\n\t\t\tif (svg) {\n\t\t\t\tlegPath = leg._path;\n\t\t\t\tlegLength = legPath.getTotalLength() + 0.1; // Need a small extra length to avoid remaining dot in Firefox.\n\t\t\t\tlegPath.style.strokeDasharray = legLength; // Just 1 length is enough, it will be duplicated.\n\t\t\t\tlegPath.style.strokeDashoffset = legLength;\n\t\t\t}\n\n\t\t\t// If it is a marker, add it now and we'll animate it out\n\t\t\tif (m.setZIndexOffset) {\n\t\t\t\tm.setZIndexOffset(1000000); // Make normal markers appear on top of EVERYTHING\n\t\t\t}\n\t\t\tif (m.clusterHide) {\n\t\t\t\tm.clusterHide();\n\t\t\t}\n\t\t\t\n\t\t\t// Vectors just get immediately added\n\t\t\tfg.addLayer(m);\n\n\t\t\tif (m._setPos) {\n\t\t\t\tm._setPos(thisLayerPos);\n\t\t\t}\n\t\t}\n\n\t\tgroup._forceLayout();\n\t\tgroup._animationStart();\n\n\t\t// Reveal markers and spider legs.\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\tnewPos = map.layerPointToLatLng(positions[i]);\n\t\t\tm = childMarkers[i];\n\n\t\t\t//Move marker to new position\n\t\t\tm._preSpiderfyLatlng = m._latlng;\n\t\t\tm.setLatLng(newPos);\n\t\t\t\n\t\t\tif (m.clusterShow) {\n\t\t\t\tm.clusterShow();\n\t\t\t}\n\n\t\t\t// Animate leg (animation is actually delegated to CSS transition).\n\t\t\tif (svg) {\n\t\t\t\tleg = m._spiderLeg;\n\t\t\t\tlegPath = leg._path;\n\t\t\t\tlegPath.style.strokeDashoffset = 0;\n\t\t\t\t//legPath.style.strokeOpacity = finalLegOpacity;\n\t\t\t\tleg.setStyle({opacity: finalLegOpacity});\n\t\t\t}\n\t\t}\n\t\tthis.setOpacity(0.3);\n\n\t\tgroup._ignoreMove = false;\n\n\t\tsetTimeout(function () {\n\t\t\tgroup._animationEnd();\n\t\t\tgroup.fire('spiderfied', {\n\t\t\t\tcluster: me,\n\t\t\t\tmarkers: childMarkers\n\t\t\t});\n\t\t}, 200);\n\t},\n\n\t_animationUnspiderfy: function (zoomDetails) {\n\t\tvar me = this,\n\t\t\tgroup = this._group,\n\t\t\tmap = group._map,\n\t\t\tfg = group._featureGroup,\n\t\t\tthisLayerPos = zoomDetails ? map._latLngToNewLayerPoint(this._latlng, zoomDetails.zoom, zoomDetails.center) : map.latLngToLayerPoint(this._latlng),\n\t\t\tchildMarkers = this.getAllChildMarkers(null, true),\n\t\t\tsvg = L.Path.SVG,\n\t\t\tm, i, leg, legPath, legLength, nonAnimatable;\n\n\t\tgroup._ignoreMove = true;\n\t\tgroup._animationStart();\n\n\t\t//Make us visible and bring the child markers back in\n\t\tthis.setOpacity(1);\n\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\tm = childMarkers[i];\n\n\t\t\t//Marker was added to us after we were spiderfied\n\t\t\tif (!m._preSpiderfyLatlng) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//Close any popup on the marker first, otherwise setting the location of the marker will make the map scroll\n\t\t\tm.closePopup();\n\n\t\t\t//Fix up the location to the real one\n\t\t\tm.setLatLng(m._preSpiderfyLatlng);\n\t\t\tdelete m._preSpiderfyLatlng;\n\n\t\t\t//Hack override the location to be our center\n\t\t\tnonAnimatable = true;\n\t\t\tif (m._setPos) {\n\t\t\t\tm._setPos(thisLayerPos);\n\t\t\t\tnonAnimatable = false;\n\t\t\t}\n\t\t\tif (m.clusterHide) {\n\t\t\t\tm.clusterHide();\n\t\t\t\tnonAnimatable = false;\n\t\t\t}\n\t\t\tif (nonAnimatable) {\n\t\t\t\tfg.removeLayer(m);\n\t\t\t}\n\n\t\t\t// Animate the spider leg back in (animation is actually delegated to CSS transition).\n\t\t\tif (svg) {\n\t\t\t\tleg = m._spiderLeg;\n\t\t\t\tlegPath = leg._path;\n\t\t\t\tlegLength = legPath.getTotalLength() + 0.1;\n\t\t\t\tlegPath.style.strokeDashoffset = legLength;\n\t\t\t\tleg.setStyle({opacity: 0});\n\t\t\t}\n\t\t}\n\n\t\tgroup._ignoreMove = false;\n\n\t\tsetTimeout(function () {\n\t\t\t//If we have only <= one child left then that marker will be shown on the map so don't remove it!\n\t\t\tvar stillThereChildCount = 0;\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\tm = childMarkers[i];\n\t\t\t\tif (m._spiderLeg) {\n\t\t\t\t\tstillThereChildCount++;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tfor (i = childMarkers.length - 1; i >= 0; i--) {\n\t\t\t\tm = childMarkers[i];\n\n\t\t\t\tif (!m._spiderLeg) { //Has already been unspiderfied\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (m.clusterShow) {\n\t\t\t\t\tm.clusterShow();\n\t\t\t\t}\n\t\t\t\tif (m.setZIndexOffset) {\n\t\t\t\t\tm.setZIndexOffset(0);\n\t\t\t\t}\n\n\t\t\t\tif (stillThereChildCount > 1) {\n\t\t\t\t\tfg.removeLayer(m);\n\t\t\t\t}\n\n\t\t\t\tmap.removeLayer(m._spiderLeg);\n\t\t\t\tdelete m._spiderLeg;\n\t\t\t}\n\t\t\tgroup._animationEnd();\n\t\t\tgroup.fire('unspiderfied', {\n\t\t\t\tcluster: me,\n\t\t\t\tmarkers: childMarkers\n\t\t\t});\n\t\t}, 200);\n\t}\n});\n\n\nL.MarkerClusterGroup.include({\n\t//The MarkerCluster currently spiderfied (if any)\n\t_spiderfied: null,\n\n\tunspiderfy: function () {\n\t\tthis._unspiderfy.apply(this, arguments);\n\t},\n\n\t_spiderfierOnAdd: function () {\n\t\tthis._map.on('click', this._unspiderfyWrapper, this);\n\n\t\tif (this._map.options.zoomAnimation) {\n\t\t\tthis._map.on('zoomstart', this._unspiderfyZoomStart, this);\n\t\t}\n\t\t//Browsers without zoomAnimation or a big zoom don't fire zoomstart\n\t\tthis._map.on('zoomend', this._noanimationUnspiderfy, this);\n\n\t\tif (!L.Browser.touch) {\n\t\t\tthis._map.getRenderer(this);\n\t\t\t//Needs to happen in the pageload, not after, or animations don't work in webkit\n\t\t\t//  http://stackoverflow.com/questions/8455200/svg-animate-with-dynamically-added-elements\n\t\t\t//Disable on touch browsers as the animation messes up on a touch zoom and isn't very noticable\n\t\t}\n\t},\n\n\t_spiderfierOnRemove: function () {\n\t\tthis._map.off('click', this._unspiderfyWrapper, this);\n\t\tthis._map.off('zoomstart', this._unspiderfyZoomStart, this);\n\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\n\t\tthis._map.off('zoomend', this._noanimationUnspiderfy, this);\n\n\t\t//Ensure that markers are back where they should be\n\t\t// Use no animation to avoid a sticky leaflet-cluster-anim class on mapPane\n\t\tthis._noanimationUnspiderfy();\n\t},\n\n\t//On zoom start we add a zoomanim handler so that we are guaranteed to be last (after markers are animated)\n\t//This means we can define the animation they do rather than Markers doing an animation to their actual location\n\t_unspiderfyZoomStart: function () {\n\t\tif (!this._map) { //May have been removed from the map by a zoomEnd handler\n\t\t\treturn;\n\t\t}\n\n\t\tthis._map.on('zoomanim', this._unspiderfyZoomAnim, this);\n\t},\n\n\t_unspiderfyZoomAnim: function (zoomDetails) {\n\t\t//Wait until the first zoomanim after the user has finished touch-zooming before running the animation\n\t\tif (L.DomUtil.hasClass(this._map._mapPane, 'leaflet-touching')) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._map.off('zoomanim', this._unspiderfyZoomAnim, this);\n\t\tthis._unspiderfy(zoomDetails);\n\t},\n\n\t_unspiderfyWrapper: function () {\n\t\t/// <summary>_unspiderfy but passes no arguments</summary>\n\t\tthis._unspiderfy();\n\t},\n\n\t_unspiderfy: function (zoomDetails) {\n\t\tif (this._spiderfied) {\n\t\t\tthis._spiderfied.unspiderfy(zoomDetails);\n\t\t}\n\t},\n\n\t_noanimationUnspiderfy: function () {\n\t\tif (this._spiderfied) {\n\t\t\tthis._spiderfied._noanimationUnspiderfy();\n\t\t}\n\t},\n\n\t//If the given layer is currently being spiderfied then we unspiderfy it so it isn't on the map anymore etc\n\t_unspiderfyLayer: function (layer) {\n\t\tif (layer._spiderLeg) {\n\t\t\tthis._featureGroup.removeLayer(layer);\n\n\t\t\tif (layer.clusterShow) {\n\t\t\t\tlayer.clusterShow();\n\t\t\t}\n\t\t\t\t//Position will be fixed up immediately in _animationUnspiderfy\n\t\t\tif (layer.setZIndexOffset) {\n\t\t\t\tlayer.setZIndexOffset(0);\n\t\t\t}\n\n\t\t\tthis._map.removeLayer(layer._spiderLeg);\n\t\t\tdelete layer._spiderLeg;\n\t\t}\n\t}\n});\n", "/**\n * Adds 1 public method to MCG and 1 to L.Marker to facilitate changing\n * markers' icon options and refreshing their icon and their parent clusters\n * accordingly (case where their iconCreateFunction uses data of childMarkers\n * to make up the cluster icon).\n */\n\n\nL.MarkerClusterGroup.include({\n\t/**\n\t * Updates the icon of all clusters which are parents of the given marker(s).\n\t * In singleMarkerMode, also updates the given marker(s) icon.\n\t * @param layers L.MarkerClusterGroup|L.LayerGroup|Array(L.Marker)|Map(L.Marker)|\n\t * L.MarkerCluster|L.Marker (optional) list of markers (or single marker) whose parent\n\t * clusters need to be updated. If not provided, retrieves all child markers of this.\n\t * @returns {L.MarkerClusterGroup}\n\t */\n\trefreshClusters: function (layers) {\n\t\tif (!layers) {\n\t\t\tlayers = this._topClusterLevel.getAllChildMarkers();\n\t\t} else if (layers instanceof L.MarkerClusterGroup) {\n\t\t\tlayers = layers._topClusterLevel.getAllChildMarkers();\n\t\t} else if (layers instanceof L.LayerGroup) {\n\t\t\tlayers = layers._layers;\n\t\t} else if (layers instanceof L.MarkerCluster) {\n\t\t\tlayers = layers.getAllChildMarkers();\n\t\t} else if (layers instanceof L.Marker) {\n\t\t\tlayers = [layers];\n\t\t} // else: must be an Array(L.Marker)|Map(L.Marker)\n\t\tthis._flagParentsIconsNeedUpdate(layers);\n\t\tthis._refreshClustersIcons();\n\n\t\t// In case of singleMarkerMode, also re-draw the markers.\n\t\tif (this.options.singleMarkerMode) {\n\t\t\tthis._refreshSingleMarkerModeMarkers(layers);\n\t\t}\n\n\t\treturn this;\n\t},\n\n\t/**\n\t * Simply flags all parent clusters of the given markers as having a \"dirty\" icon.\n\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\n\t * @private\n\t */\n\t_flagParentsIconsNeedUpdate: function (layers) {\n\t\tvar id, parent;\n\n\t\t// Assumes layers is an Array or an Object whose prototype is non-enumerable.\n\t\tfor (id in layers) {\n\t\t\t// Flag parent clusters' icon as \"dirty\", all the way up.\n\t\t\t// Dumb process that flags multiple times upper parents, but still\n\t\t\t// much more efficient than trying to be smart and make short lists,\n\t\t\t// at least in the case of a hierarchy following a power law:\n\t\t\t// http://jsperf.com/flag-nodes-in-power-hierarchy/2\n\t\t\tparent = layers[id].__parent;\n\t\t\twhile (parent) {\n\t\t\t\tparent._iconNeedsUpdate = true;\n\t\t\t\tparent = parent.__parent;\n\t\t\t}\n\t\t}\n\t},\n\n\t/**\n\t * Re-draws the icon of the supplied markers.\n\t * To be used in singleMarkerMode only.\n\t * @param layers Array(L.Marker)|Map(L.Marker) list of markers.\n\t * @private\n\t */\n\t_refreshSingleMarkerModeMarkers: function (layers) {\n\t\tvar id, layer;\n\n\t\tfor (id in layers) {\n\t\t\tlayer = layers[id];\n\n\t\t\t// Make sure we do not override markers that do not belong to THIS group.\n\t\t\tif (this.hasLayer(layer)) {\n\t\t\t\t// Need to re-create the icon first, then re-draw the marker.\n\t\t\t\tlayer.setIcon(this._overrideMarkerIcon(layer));\n\t\t\t}\n\t\t}\n\t}\n});\n\nL.Marker.include({\n\t/**\n\t * Updates the given options in the marker's icon and refreshes the marker.\n\t * @param options map object of icon options.\n\t * @param directlyRefreshClusters boolean (optional) true to trigger\n\t * MCG.refreshClustersOf() right away with this single marker.\n\t * @returns {L.Marker}\n\t */\n\trefreshIconOptions: function (options, directlyRefreshClusters) {\n\t\tvar icon = this.options.icon;\n\n\t\tL.setOptions(icon, options);\n\n\t\tthis.setIcon(icon);\n\n\t\t// Shortcut to refresh the associated MCG clusters right away.\n\t\t// To be used when refreshing a single marker.\n\t\t// Otherwise, better use MCG.refreshClusters() once at the end with\n\t\t// the list of modified markers.\n\t\tif (directlyRefreshClusters && this.__parent) {\n\t\t\tthis.__parent._group.refreshClusters(this);\n\t\t}\n\n\t\treturn this;\n\t}\n});\n", "// geohash.js\n// Geohash library for Javascript\n// (c) 2008 David Troy\n// (c) 2010 Chris Williams\n// Distributed under the MIT License\n\n\nvar GeoHash = (function () {\n  BITS = [16, 8, 4, 2, 1];\n\n  BASE32 =                         \"0123456789bcdefghjkmnpqrstuvwxyz\";\n  NEIGHBORS = { right  : { even :  \"bc01fg45238967deuvhjyznpkmstqrwx\" },\n                left   : { even :  \"238967debc01fg45kmstqrwxuvhjyznp\" },\n                top    : { even :  \"p0r21436x8zb9dcf5h7kjnmqesgutwvy\" },\n                bottom : { even :  \"14365h7k9dcfesgujnmqp0r2twvyx8zb\" } };\n  BORDERS   = { right  : { even : \"bcfguvyz\" },\n                left   : { even : \"0145hjnp\" },\n                top    : { even : \"prxz\" },\n                bottom : { even : \"028b\" } };\n\n  NEIGHBORS.bottom.odd = NEIGHBORS.left.even;\n  NEIGHBORS.top.odd = NEIGHBORS.right.even;\n  NEIGHBORS.left.odd = NEIGHBORS.bottom.even;\n  NEIGHBORS.right.odd = NEIGHBORS.top.even;\n\n  BORDERS.bottom.odd = BORDERS.left.even;\n  BORDERS.top.odd = BORDERS.right.even;\n  BORDERS.left.odd = BORDERS.bottom.even;\n  BORDERS.right.odd = BORDERS.top.even;\n\n  var refine_interval = function (interval, cd, mask) {\n    if (cd&mask)\n      interval[0] = (interval[0] + interval[1])/2;\n    else\n      interval[1] = (interval[0] + interval[1])/2;\n  };\n\n  \n\n\n\n  return {\n    encodeGeoHash: function (latitude, longitude) {\n      var is_even=1;\n      var i=0;\n      var lat = []; var lon = [];\n      var bit=0;\n      var ch=0;\n      var precision = 12;\n      geohash = \"\";\n\n      lat[0] = -90.0;  lat[1] = 90.0;\n      lon[0] = -180.0; lon[1] = 180.0;\n\n      while (geohash.length < precision) {\n        if (is_even) {\n          mid = (lon[0] + lon[1]) / 2;\n          if (longitude > mid) {\n            ch |= BITS[bit];\n            lon[0] = mid;\n          } else\n            lon[1] = mid;\n        } else {\n          mid = (lat[0] + lat[1]) / 2;\n          if (latitude > mid) {\n            ch |= BITS[bit];\n            lat[0] = mid;\n          } else\n            lat[1] = mid;\n        }\n\n        is_even = !is_even;\n        if (bit < 4)\n          bit++;\n        else {\n          geohash += BASE32[ch];\n          bit = 0;\n          ch = 0;\n        }\n      }\n      return geohash;\n    },\n    decodeGeoHash: function (geohash) {\n      var is_even = 1;\n      var lat = []; var lon = [];\n      lat[0] = -90.0;  lat[1] = 90.0;\n      lon[0] = -180.0; lon[1] = 180.0;\n      lat_err = 90.0;  lon_err = 180.0;\n\n      for (i=0; i<geohash.length; i++) {\n        c = geohash[i];\n        cd = BASE32.indexOf(c);\n        for (j=0; j<5; j++) {\n          mask = BITS[j];\n          if (is_even) {\n            lon_err /= 2;\n            refine_interval(lon, cd, mask);\n          } else {\n            lat_err /= 2;\n            refine_interval(lat, cd, mask);\n          }\n          is_even = !is_even;\n        }\n      }\n      lat[2] = (lat[0] + lat[1])/2;\n      lon[2] = (lon[0] + lon[1])/2;\n\n      return { latitude: lat, longitude: lon};\n    },\n    calculateAdjacent: function (srcHash, dir) {\n      srcHash = srcHash.toLowerCase();\n      var lastChr = srcHash.charAt(srcHash.length-1);\n      var type = (srcHash.length % 2) ? 'odd' : 'even';\n      var base = srcHash.substring(0,srcHash.length-1);\n      if (BORDERS[dir][type].indexOf(lastChr)!=-1)\n        base = calculateAdjacent(base, dir);\n      return base + BASE32[NEIGHBORS[dir][type].indexOf(lastChr)];\n    }\n  };\n})();\n\nif (typeof exports == \"undefined\") { exports = {}; }\n\nexports.GeoHash = GeoHash;\n", "(function(e,t){if(typeof define===\"function\"&&define.amd){define([],t)}else if(typeof module===\"object\"&&module.exports){module.exports=t()}else{e.htmx=e.htmx||t()}})(typeof self!==\"undefined\"?self:this,function(){return function(){\"use strict\";var Q={onLoad:F,process:zt,on:de,off:ge,trigger:ce,ajax:Nr,find:C,findAll:f,closest:v,values:function(e,t){var r=dr(e,t||\"post\");return r.values},remove:_,addClass:z,removeClass:n,toggleClass:$,takeClass:W,defineExtension:Ur,removeExtension:Br,logAll:V,logNone:j,logger:null,config:{historyEnabled:true,historyCacheSize:10,refreshOnHistoryMiss:false,defaultSwapStyle:\"innerHTML\",defaultSwapDelay:0,defaultSettleDelay:20,includeIndicatorStyles:true,indicatorClass:\"htmx-indicator\",requestClass:\"htmx-request\",addedClass:\"htmx-added\",settlingClass:\"htmx-settling\",swappingClass:\"htmx-swapping\",allowEval:true,allowScriptTags:true,inlineScriptNonce:\"\",attributesToSettle:[\"class\",\"style\",\"width\",\"height\"],withCredentials:false,timeout:0,wsReconnectDelay:\"full-jitter\",wsBinaryType:\"blob\",disableSelector:\"[hx-disable], [data-hx-disable]\",useTemplateFragments:false,scrollBehavior:\"smooth\",defaultFocusScroll:false,getCacheBusterParam:false,globalViewTransitions:false,methodsThatUseUrlParams:[\"get\"],selfRequestsOnly:false,ignoreTitle:false,scrollIntoViewOnBoost:true,triggerSpecsCache:null},parseInterval:d,_:t,createEventSource:function(e){return new EventSource(e,{withCredentials:true})},createWebSocket:function(e){var t=new WebSocket(e,[]);t.binaryType=Q.config.wsBinaryType;return t},version:\"1.9.10\"};var r={addTriggerHandler:Lt,bodyContains:se,canAccessLocalStorage:U,findThisElement:xe,filterValues:yr,hasAttribute:o,getAttributeValue:te,getClosestAttributeValue:ne,getClosestMatch:c,getExpressionVars:Hr,getHeaders:xr,getInputValues:dr,getInternalData:ae,getSwapSpecification:wr,getTriggerSpecs:it,getTarget:ye,makeFragment:l,mergeObjects:le,makeSettleInfo:T,oobSwap:Ee,querySelectorExt:ue,selectAndSwap:je,settleImmediately:nr,shouldCancel:ut,triggerEvent:ce,triggerErrorEvent:fe,withExtensions:R};var w=[\"get\",\"post\",\"put\",\"delete\",\"patch\"];var i=w.map(function(e){return\"[hx-\"+e+\"], [data-hx-\"+e+\"]\"}).join(\", \");var S=e(\"head\"),q=e(\"title\"),H=e(\"svg\",true);function e(e,t=false){return new RegExp(`<${e}(\\\\s[^>]*>|>)([\\\\s\\\\S]*?)<\\\\/${e}>`,t?\"gim\":\"im\")}function d(e){if(e==undefined){return undefined}let t=NaN;if(e.slice(-2)==\"ms\"){t=parseFloat(e.slice(0,-2))}else if(e.slice(-1)==\"s\"){t=parseFloat(e.slice(0,-1))*1e3}else if(e.slice(-1)==\"m\"){t=parseFloat(e.slice(0,-1))*1e3*60}else{t=parseFloat(e)}return isNaN(t)?undefined:t}function ee(e,t){return e.getAttribute&&e.getAttribute(t)}function o(e,t){return e.hasAttribute&&(e.hasAttribute(t)||e.hasAttribute(\"data-\"+t))}function te(e,t){return ee(e,t)||ee(e,\"data-\"+t)}function u(e){return e.parentElement}function re(){return document}function c(e,t){while(e&&!t(e)){e=u(e)}return e?e:null}function L(e,t,r){var n=te(t,r);var i=te(t,\"hx-disinherit\");if(e!==t&&i&&(i===\"*\"||i.split(\" \").indexOf(r)>=0)){return\"unset\"}else{return n}}function ne(t,r){var n=null;c(t,function(e){return n=L(t,e,r)});if(n!==\"unset\"){return n}}function h(e,t){var r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return r&&r.call(e,t)}function A(e){var t=/<([a-z][^\\/\\0>\\x20\\t\\r\\n\\f]*)/i;var r=t.exec(e);if(r){return r[1].toLowerCase()}else{return\"\"}}function a(e,t){var r=new DOMParser;var n=r.parseFromString(e,\"text/html\");var i=n.body;while(t>0){t--;i=i.firstChild}if(i==null){i=re().createDocumentFragment()}return i}function N(e){return/<body/.test(e)}function l(e){var t=!N(e);var r=A(e);var n=e;if(r===\"head\"){n=n.replace(S,\"\")}if(Q.config.useTemplateFragments&&t){var i=a(\"<body><template>\"+n+\"</template></body>\",0);return i.querySelector(\"template\").content}switch(r){case\"thead\":case\"tbody\":case\"tfoot\":case\"colgroup\":case\"caption\":return a(\"<table>\"+n+\"</table>\",1);case\"col\":return a(\"<table><colgroup>\"+n+\"</colgroup></table>\",2);case\"tr\":return a(\"<table><tbody>\"+n+\"</tbody></table>\",2);case\"td\":case\"th\":return a(\"<table><tbody><tr>\"+n+\"</tr></tbody></table>\",3);case\"script\":case\"style\":return a(\"<div>\"+n+\"</div>\",1);default:return a(n,0)}}function ie(e){if(e){e()}}function I(e,t){return Object.prototype.toString.call(e)===\"[object \"+t+\"]\"}function k(e){return I(e,\"Function\")}function P(e){return I(e,\"Object\")}function ae(e){var t=\"htmx-internal-data\";var r=e[t];if(!r){r=e[t]={}}return r}function M(e){var t=[];if(e){for(var r=0;r<e.length;r++){t.push(e[r])}}return t}function oe(e,t){if(e){for(var r=0;r<e.length;r++){t(e[r])}}}function X(e){var t=e.getBoundingClientRect();var r=t.top;var n=t.bottom;return r<window.innerHeight&&n>=0}function se(e){if(e.getRootNode&&e.getRootNode()instanceof window.ShadowRoot){return re().body.contains(e.getRootNode().host)}else{return re().body.contains(e)}}function D(e){return e.trim().split(/\\s+/)}function le(e,t){for(var r in t){if(t.hasOwnProperty(r)){e[r]=t[r]}}return e}function E(e){try{return JSON.parse(e)}catch(e){b(e);return null}}function U(){var e=\"htmx:localStorageTest\";try{localStorage.setItem(e,e);localStorage.removeItem(e);return true}catch(e){return false}}function B(t){try{var e=new URL(t);if(e){t=e.pathname+e.search}if(!/^\\/$/.test(t)){t=t.replace(/\\/+$/,\"\")}return t}catch(e){return t}}function t(e){return Tr(re().body,function(){return eval(e)})}function F(t){var e=Q.on(\"htmx:load\",function(e){t(e.detail.elt)});return e}function V(){Q.logger=function(e,t,r){if(console){console.log(t,e,r)}}}function j(){Q.logger=null}function C(e,t){if(t){return e.querySelector(t)}else{return C(re(),e)}}function f(e,t){if(t){return e.querySelectorAll(t)}else{return f(re(),e)}}function _(e,t){e=g(e);if(t){setTimeout(function(){_(e);e=null},t)}else{e.parentElement.removeChild(e)}}function z(e,t,r){e=g(e);if(r){setTimeout(function(){z(e,t);e=null},r)}else{e.classList&&e.classList.add(t)}}function n(e,t,r){e=g(e);if(r){setTimeout(function(){n(e,t);e=null},r)}else{if(e.classList){e.classList.remove(t);if(e.classList.length===0){e.removeAttribute(\"class\")}}}}function $(e,t){e=g(e);e.classList.toggle(t)}function W(e,t){e=g(e);oe(e.parentElement.children,function(e){n(e,t)});z(e,t)}function v(e,t){e=g(e);if(e.closest){return e.closest(t)}else{do{if(e==null||h(e,t)){return e}}while(e=e&&u(e));return null}}function s(e,t){return e.substring(0,t.length)===t}function G(e,t){return e.substring(e.length-t.length)===t}function J(e){var t=e.trim();if(s(t,\"<\")&&G(t,\"/>\")){return t.substring(1,t.length-2)}else{return t}}function Z(e,t){if(t.indexOf(\"closest \")===0){return[v(e,J(t.substr(8)))]}else if(t.indexOf(\"find \")===0){return[C(e,J(t.substr(5)))]}else if(t===\"next\"){return[e.nextElementSibling]}else if(t.indexOf(\"next \")===0){return[K(e,J(t.substr(5)))]}else if(t===\"previous\"){return[e.previousElementSibling]}else if(t.indexOf(\"previous \")===0){return[Y(e,J(t.substr(9)))]}else if(t===\"document\"){return[document]}else if(t===\"window\"){return[window]}else if(t===\"body\"){return[document.body]}else{return re().querySelectorAll(J(t))}}var K=function(e,t){var r=re().querySelectorAll(t);for(var n=0;n<r.length;n++){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_PRECEDING){return i}}};var Y=function(e,t){var r=re().querySelectorAll(t);for(var n=r.length-1;n>=0;n--){var i=r[n];if(i.compareDocumentPosition(e)===Node.DOCUMENT_POSITION_FOLLOWING){return i}}};function ue(e,t){if(t){return Z(e,t)[0]}else{return Z(re().body,e)[0]}}function g(e){if(I(e,\"String\")){return C(e)}else{return e}}function ve(e,t,r){if(k(t)){return{target:re().body,event:e,listener:t}}else{return{target:g(e),event:t,listener:r}}}function de(t,r,n){jr(function(){var e=ve(t,r,n);e.target.addEventListener(e.event,e.listener)});var e=k(r);return e?r:n}function ge(t,r,n){jr(function(){var e=ve(t,r,n);e.target.removeEventListener(e.event,e.listener)});return k(r)?r:n}var me=re().createElement(\"output\");function pe(e,t){var r=ne(e,t);if(r){if(r===\"this\"){return[xe(e,t)]}else{var n=Z(e,r);if(n.length===0){b('The selector \"'+r+'\" on '+t+\" returned no matches!\");return[me]}else{return n}}}}function xe(e,t){return c(e,function(e){return te(e,t)!=null})}function ye(e){var t=ne(e,\"hx-target\");if(t){if(t===\"this\"){return xe(e,\"hx-target\")}else{return ue(e,t)}}else{var r=ae(e);if(r.boosted){return re().body}else{return e}}}function be(e){var t=Q.config.attributesToSettle;for(var r=0;r<t.length;r++){if(e===t[r]){return true}}return false}function we(t,r){oe(t.attributes,function(e){if(!r.hasAttribute(e.name)&&be(e.name)){t.removeAttribute(e.name)}});oe(r.attributes,function(e){if(be(e.name)){t.setAttribute(e.name,e.value)}})}function Se(e,t){var r=Fr(t);for(var n=0;n<r.length;n++){var i=r[n];try{if(i.isInlineSwap(e)){return true}}catch(e){b(e)}}return e===\"outerHTML\"}function Ee(e,i,a){var t=\"#\"+ee(i,\"id\");var o=\"outerHTML\";if(e===\"true\"){}else if(e.indexOf(\":\")>0){o=e.substr(0,e.indexOf(\":\"));t=e.substr(e.indexOf(\":\")+1,e.length)}else{o=e}var r=re().querySelectorAll(t);if(r){oe(r,function(e){var t;var r=i.cloneNode(true);t=re().createDocumentFragment();t.appendChild(r);if(!Se(o,e)){t=r}var n={shouldSwap:true,target:e,fragment:t};if(!ce(e,\"htmx:oobBeforeSwap\",n))return;e=n.target;if(n[\"shouldSwap\"]){Fe(o,e,e,t,a)}oe(a.elts,function(e){ce(e,\"htmx:oobAfterSwap\",n)})});i.parentNode.removeChild(i)}else{i.parentNode.removeChild(i);fe(re().body,\"htmx:oobErrorNoTarget\",{content:i})}return e}function Ce(e,t,r){var n=ne(e,\"hx-select-oob\");if(n){var i=n.split(\",\");for(var a=0;a<i.length;a++){var o=i[a].split(\":\",2);var s=o[0].trim();if(s.indexOf(\"#\")===0){s=s.substring(1)}var l=o[1]||\"true\";var u=t.querySelector(\"#\"+s);if(u){Ee(l,u,r)}}}oe(f(t,\"[hx-swap-oob], [data-hx-swap-oob]\"),function(e){var t=te(e,\"hx-swap-oob\");if(t!=null){Ee(t,e,r)}})}function Re(e){oe(f(e,\"[hx-preserve], [data-hx-preserve]\"),function(e){var t=te(e,\"id\");var r=re().getElementById(t);if(r!=null){e.parentNode.replaceChild(r,e)}})}function Te(o,e,s){oe(e.querySelectorAll(\"[id]\"),function(e){var t=ee(e,\"id\");if(t&&t.length>0){var r=t.replace(\"'\",\"\\\\'\");var n=e.tagName.replace(\":\",\"\\\\:\");var i=o.querySelector(n+\"[id='\"+r+\"']\");if(i&&i!==o){var a=e.cloneNode();we(e,i);s.tasks.push(function(){we(e,a)})}}})}function Oe(e){return function(){n(e,Q.config.addedClass);zt(e);Nt(e);qe(e);ce(e,\"htmx:load\")}}function qe(e){var t=\"[autofocus]\";var r=h(e,t)?e:e.querySelector(t);if(r!=null){r.focus()}}function m(e,t,r,n){Te(e,r,n);while(r.childNodes.length>0){var i=r.firstChild;z(i,Q.config.addedClass);e.insertBefore(i,t);if(i.nodeType!==Node.TEXT_NODE&&i.nodeType!==Node.COMMENT_NODE){n.tasks.push(Oe(i))}}}function He(e,t){var r=0;while(r<e.length){t=(t<<5)-t+e.charCodeAt(r++)|0}return t}function Le(e){var t=0;if(e.attributes){for(var r=0;r<e.attributes.length;r++){var n=e.attributes[r];if(n.value){t=He(n.name,t);t=He(n.value,t)}}}return t}function Ae(e){var t=ae(e);if(t.onHandlers){for(var r=0;r<t.onHandlers.length;r++){const n=t.onHandlers[r];e.removeEventListener(n.event,n.listener)}delete t.onHandlers}}function Ne(e){var t=ae(e);if(t.timeout){clearTimeout(t.timeout)}if(t.webSocket){t.webSocket.close()}if(t.sseEventSource){t.sseEventSource.close()}if(t.listenerInfos){oe(t.listenerInfos,function(e){if(e.on){e.on.removeEventListener(e.trigger,e.listener)}})}Ae(e);oe(Object.keys(t),function(e){delete t[e]})}function p(e){ce(e,\"htmx:beforeCleanupElement\");Ne(e);if(e.children){oe(e.children,function(e){p(e)})}}function Ie(t,e,r){if(t.tagName===\"BODY\"){return Ue(t,e,r)}else{var n;var i=t.previousSibling;m(u(t),t,e,r);if(i==null){n=u(t).firstChild}else{n=i.nextSibling}r.elts=r.elts.filter(function(e){return e!=t});while(n&&n!==t){if(n.nodeType===Node.ELEMENT_NODE){r.elts.push(n)}n=n.nextElementSibling}p(t);u(t).removeChild(t)}}function ke(e,t,r){return m(e,e.firstChild,t,r)}function Pe(e,t,r){return m(u(e),e,t,r)}function Me(e,t,r){return m(e,null,t,r)}function Xe(e,t,r){return m(u(e),e.nextSibling,t,r)}function De(e,t,r){p(e);return u(e).removeChild(e)}function Ue(e,t,r){var n=e.firstChild;m(e,n,t,r);if(n){while(n.nextSibling){p(n.nextSibling);e.removeChild(n.nextSibling)}p(n);e.removeChild(n)}}function Be(e,t,r){var n=r||ne(e,\"hx-select\");if(n){var i=re().createDocumentFragment();oe(t.querySelectorAll(n),function(e){i.appendChild(e)});t=i}return t}function Fe(e,t,r,n,i){switch(e){case\"none\":return;case\"outerHTML\":Ie(r,n,i);return;case\"afterbegin\":ke(r,n,i);return;case\"beforebegin\":Pe(r,n,i);return;case\"beforeend\":Me(r,n,i);return;case\"afterend\":Xe(r,n,i);return;case\"delete\":De(r,n,i);return;default:var a=Fr(t);for(var o=0;o<a.length;o++){var s=a[o];try{var l=s.handleSwap(e,r,n,i);if(l){if(typeof l.length!==\"undefined\"){for(var u=0;u<l.length;u++){var f=l[u];if(f.nodeType!==Node.TEXT_NODE&&f.nodeType!==Node.COMMENT_NODE){i.tasks.push(Oe(f))}}}return}}catch(e){b(e)}}if(e===\"innerHTML\"){Ue(r,n,i)}else{Fe(Q.config.defaultSwapStyle,t,r,n,i)}}}function Ve(e){if(e.indexOf(\"<title\")>-1){var t=e.replace(H,\"\");var r=t.match(q);if(r){return r[2]}}}function je(e,t,r,n,i,a){i.title=Ve(n);var o=l(n);if(o){Ce(r,o,i);o=Be(r,o,a);Re(o);return Fe(e,r,t,o,i)}}function _e(e,t,r){var n=e.getResponseHeader(t);if(n.indexOf(\"{\")===0){var i=E(n);for(var a in i){if(i.hasOwnProperty(a)){var o=i[a];if(!P(o)){o={value:o}}ce(r,a,o)}}}else{var s=n.split(\",\");for(var l=0;l<s.length;l++){ce(r,s[l].trim(),[])}}}var ze=/\\s/;var x=/[\\s,]/;var $e=/[_$a-zA-Z]/;var We=/[_$a-zA-Z0-9]/;var Ge=['\"',\"'\",\"/\"];var Je=/[^\\s]/;var Ze=/[{(]/;var Ke=/[})]/;function Ye(e){var t=[];var r=0;while(r<e.length){if($e.exec(e.charAt(r))){var n=r;while(We.exec(e.charAt(r+1))){r++}t.push(e.substr(n,r-n+1))}else if(Ge.indexOf(e.charAt(r))!==-1){var i=e.charAt(r);var n=r;r++;while(r<e.length&&e.charAt(r)!==i){if(e.charAt(r)===\"\\\\\"){r++}r++}t.push(e.substr(n,r-n+1))}else{var a=e.charAt(r);t.push(a)}r++}return t}function Qe(e,t,r){return $e.exec(e.charAt(0))&&e!==\"true\"&&e!==\"false\"&&e!==\"this\"&&e!==r&&t!==\".\"}function et(e,t,r){if(t[0]===\"[\"){t.shift();var n=1;var i=\" return (function(\"+r+\"){ return (\";var a=null;while(t.length>0){var o=t[0];if(o===\"]\"){n--;if(n===0){if(a===null){i=i+\"true\"}t.shift();i+=\")})\";try{var s=Tr(e,function(){return Function(i)()},function(){return true});s.source=i;return s}catch(e){fe(re().body,\"htmx:syntax:error\",{error:e,source:i});return null}}}else if(o===\"[\"){n++}if(Qe(o,a,r)){i+=\"((\"+r+\".\"+o+\") ? (\"+r+\".\"+o+\") : (window.\"+o+\"))\"}else{i=i+o}a=t.shift()}}}function y(e,t){var r=\"\";while(e.length>0&&!t.test(e[0])){r+=e.shift()}return r}function tt(e){var t;if(e.length>0&&Ze.test(e[0])){e.shift();t=y(e,Ke).trim();e.shift()}else{t=y(e,x)}return t}var rt=\"input, textarea, select\";function nt(e,t,r){var n=[];var i=Ye(t);do{y(i,Je);var a=i.length;var o=y(i,/[,\\[\\s]/);if(o!==\"\"){if(o===\"every\"){var s={trigger:\"every\"};y(i,Je);s.pollInterval=d(y(i,/[,\\[\\s]/));y(i,Je);var l=et(e,i,\"event\");if(l){s.eventFilter=l}n.push(s)}else if(o.indexOf(\"sse:\")===0){n.push({trigger:\"sse\",sseEvent:o.substr(4)})}else{var u={trigger:o};var l=et(e,i,\"event\");if(l){u.eventFilter=l}while(i.length>0&&i[0]!==\",\"){y(i,Je);var f=i.shift();if(f===\"changed\"){u.changed=true}else if(f===\"once\"){u.once=true}else if(f===\"consume\"){u.consume=true}else if(f===\"delay\"&&i[0]===\":\"){i.shift();u.delay=d(y(i,x))}else if(f===\"from\"&&i[0]===\":\"){i.shift();if(Ze.test(i[0])){var c=tt(i)}else{var c=y(i,x);if(c===\"closest\"||c===\"find\"||c===\"next\"||c===\"previous\"){i.shift();var h=tt(i);if(h.length>0){c+=\" \"+h}}}u.from=c}else if(f===\"target\"&&i[0]===\":\"){i.shift();u.target=tt(i)}else if(f===\"throttle\"&&i[0]===\":\"){i.shift();u.throttle=d(y(i,x))}else if(f===\"queue\"&&i[0]===\":\"){i.shift();u.queue=y(i,x)}else if(f===\"root\"&&i[0]===\":\"){i.shift();u[f]=tt(i)}else if(f===\"threshold\"&&i[0]===\":\"){i.shift();u[f]=y(i,x)}else{fe(e,\"htmx:syntax:error\",{token:i.shift()})}}n.push(u)}}if(i.length===a){fe(e,\"htmx:syntax:error\",{token:i.shift()})}y(i,Je)}while(i[0]===\",\"&&i.shift());if(r){r[t]=n}return n}function it(e){var t=te(e,\"hx-trigger\");var r=[];if(t){var n=Q.config.triggerSpecsCache;r=n&&n[t]||nt(e,t,n)}if(r.length>0){return r}else if(h(e,\"form\")){return[{trigger:\"submit\"}]}else if(h(e,'input[type=\"button\"], input[type=\"submit\"]')){return[{trigger:\"click\"}]}else if(h(e,rt)){return[{trigger:\"change\"}]}else{return[{trigger:\"click\"}]}}function at(e){ae(e).cancelled=true}function ot(e,t,r){var n=ae(e);n.timeout=setTimeout(function(){if(se(e)&&n.cancelled!==true){if(!ct(r,e,Wt(\"hx:poll:trigger\",{triggerSpec:r,target:e}))){t(e)}ot(e,t,r)}},r.pollInterval)}function st(e){return location.hostname===e.hostname&&ee(e,\"href\")&&ee(e,\"href\").indexOf(\"#\")!==0}function lt(t,r,e){if(t.tagName===\"A\"&&st(t)&&(t.target===\"\"||t.target===\"_self\")||t.tagName===\"FORM\"){r.boosted=true;var n,i;if(t.tagName===\"A\"){n=\"get\";i=ee(t,\"href\")}else{var a=ee(t,\"method\");n=a?a.toLowerCase():\"get\";if(n===\"get\"){}i=ee(t,\"action\")}e.forEach(function(e){ht(t,function(e,t){if(v(e,Q.config.disableSelector)){p(e);return}he(n,i,e,t)},r,e,true)})}}function ut(e,t){if(e.type===\"submit\"||e.type===\"click\"){if(t.tagName===\"FORM\"){return true}if(h(t,'input[type=\"submit\"], button')&&v(t,\"form\")!==null){return true}if(t.tagName===\"A\"&&t.href&&(t.getAttribute(\"href\")===\"#\"||t.getAttribute(\"href\").indexOf(\"#\")!==0)){return true}}return false}function ft(e,t){return ae(e).boosted&&e.tagName===\"A\"&&t.type===\"click\"&&(t.ctrlKey||t.metaKey)}function ct(e,t,r){var n=e.eventFilter;if(n){try{return n.call(t,r)!==true}catch(e){fe(re().body,\"htmx:eventFilter:error\",{error:e,source:n.source});return true}}return false}function ht(a,o,e,s,l){var u=ae(a);var t;if(s.from){t=Z(a,s.from)}else{t=[a]}if(s.changed){t.forEach(function(e){var t=ae(e);t.lastValue=e.value})}oe(t,function(n){var i=function(e){if(!se(a)){n.removeEventListener(s.trigger,i);return}if(ft(a,e)){return}if(l||ut(e,a)){e.preventDefault()}if(ct(s,a,e)){return}var t=ae(e);t.triggerSpec=s;if(t.handledFor==null){t.handledFor=[]}if(t.handledFor.indexOf(a)<0){t.handledFor.push(a);if(s.consume){e.stopPropagation()}if(s.target&&e.target){if(!h(e.target,s.target)){return}}if(s.once){if(u.triggeredOnce){return}else{u.triggeredOnce=true}}if(s.changed){var r=ae(n);if(r.lastValue===n.value){return}r.lastValue=n.value}if(u.delayed){clearTimeout(u.delayed)}if(u.throttle){return}if(s.throttle>0){if(!u.throttle){o(a,e);u.throttle=setTimeout(function(){u.throttle=null},s.throttle)}}else if(s.delay>0){u.delayed=setTimeout(function(){o(a,e)},s.delay)}else{ce(a,\"htmx:trigger\");o(a,e)}}};if(e.listenerInfos==null){e.listenerInfos=[]}e.listenerInfos.push({trigger:s.trigger,listener:i,on:n});n.addEventListener(s.trigger,i)})}var vt=false;var dt=null;function gt(){if(!dt){dt=function(){vt=true};window.addEventListener(\"scroll\",dt);setInterval(function(){if(vt){vt=false;oe(re().querySelectorAll(\"[hx-trigger='revealed'],[data-hx-trigger='revealed']\"),function(e){mt(e)})}},200)}}function mt(t){if(!o(t,\"data-hx-revealed\")&&X(t)){t.setAttribute(\"data-hx-revealed\",\"true\");var e=ae(t);if(e.initHash){ce(t,\"revealed\")}else{t.addEventListener(\"htmx:afterProcessNode\",function(e){ce(t,\"revealed\")},{once:true})}}}function pt(e,t,r){var n=D(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]===\"connect\"){xt(e,a[1],0)}if(a[0]===\"send\"){bt(e)}}}function xt(s,r,n){if(!se(s)){return}if(r.indexOf(\"/\")==0){var e=location.hostname+(location.port?\":\"+location.port:\"\");if(location.protocol==\"https:\"){r=\"wss://\"+e+r}else if(location.protocol==\"http:\"){r=\"ws://\"+e+r}}var t=Q.createWebSocket(r);t.onerror=function(e){fe(s,\"htmx:wsError\",{error:e,socket:t});yt(s)};t.onclose=function(e){if([1006,1012,1013].indexOf(e.code)>=0){var t=wt(n);setTimeout(function(){xt(s,r,n+1)},t)}};t.onopen=function(e){n=0};ae(s).webSocket=t;t.addEventListener(\"message\",function(e){if(yt(s)){return}var t=e.data;R(s,function(e){t=e.transformResponse(t,null,s)});var r=T(s);var n=l(t);var i=M(n.children);for(var a=0;a<i.length;a++){var o=i[a];Ee(te(o,\"hx-swap-oob\")||\"true\",o,r)}nr(r.tasks)})}function yt(e){if(!se(e)){ae(e).webSocket.close();return true}}function bt(u){var f=c(u,function(e){return ae(e).webSocket!=null});if(f){u.addEventListener(it(u)[0].trigger,function(e){var t=ae(f).webSocket;var r=xr(u,f);var n=dr(u,\"post\");var i=n.errors;var a=n.values;var o=Hr(u);var s=le(a,o);var l=yr(s,u);l[\"HEADERS\"]=r;if(i&&i.length>0){ce(u,\"htmx:validation:halted\",i);return}t.send(JSON.stringify(l));if(ut(e,u)){e.preventDefault()}})}else{fe(u,\"htmx:noWebSocketSourceError\")}}function wt(e){var t=Q.config.wsReconnectDelay;if(typeof t===\"function\"){return t(e)}if(t===\"full-jitter\"){var r=Math.min(e,6);var n=1e3*Math.pow(2,r);return n*Math.random()}b('htmx.config.wsReconnectDelay must either be a function or the string \"full-jitter\"')}function St(e,t,r){var n=D(r);for(var i=0;i<n.length;i++){var a=n[i].split(/:(.+)/);if(a[0]===\"connect\"){Et(e,a[1])}if(a[0]===\"swap\"){Ct(e,a[1])}}}function Et(t,e){var r=Q.createEventSource(e);r.onerror=function(e){fe(t,\"htmx:sseError\",{error:e,source:r});Tt(t)};ae(t).sseEventSource=r}function Ct(a,o){var s=c(a,Ot);if(s){var l=ae(s).sseEventSource;var u=function(e){if(Tt(s)){return}if(!se(a)){l.removeEventListener(o,u);return}var t=e.data;R(a,function(e){t=e.transformResponse(t,null,a)});var r=wr(a);var n=ye(a);var i=T(a);je(r.swapStyle,n,a,t,i);nr(i.tasks);ce(a,\"htmx:sseMessage\",e)};ae(a).sseListener=u;l.addEventListener(o,u)}else{fe(a,\"htmx:noSSESourceError\")}}function Rt(e,t,r){var n=c(e,Ot);if(n){var i=ae(n).sseEventSource;var a=function(){if(!Tt(n)){if(se(e)){t(e)}else{i.removeEventListener(r,a)}}};ae(e).sseListener=a;i.addEventListener(r,a)}else{fe(e,\"htmx:noSSESourceError\")}}function Tt(e){if(!se(e)){ae(e).sseEventSource.close();return true}}function Ot(e){return ae(e).sseEventSource!=null}function qt(e,t,r,n){var i=function(){if(!r.loaded){r.loaded=true;t(e)}};if(n>0){setTimeout(i,n)}else{i()}}function Ht(t,i,e){var a=false;oe(w,function(r){if(o(t,\"hx-\"+r)){var n=te(t,\"hx-\"+r);a=true;i.path=n;i.verb=r;e.forEach(function(e){Lt(t,e,i,function(e,t){if(v(e,Q.config.disableSelector)){p(e);return}he(r,n,e,t)})})}});return a}function Lt(n,e,t,r){if(e.sseEvent){Rt(n,r,e.sseEvent)}else if(e.trigger===\"revealed\"){gt();ht(n,r,t,e);mt(n)}else if(e.trigger===\"intersect\"){var i={};if(e.root){i.root=ue(n,e.root)}if(e.threshold){i.threshold=parseFloat(e.threshold)}var a=new IntersectionObserver(function(e){for(var t=0;t<e.length;t++){var r=e[t];if(r.isIntersecting){ce(n,\"intersect\");break}}},i);a.observe(n);ht(n,r,t,e)}else if(e.trigger===\"load\"){if(!ct(e,n,Wt(\"load\",{elt:n}))){qt(n,r,t,e.delay)}}else if(e.pollInterval>0){t.polling=true;ot(n,r,e)}else{ht(n,r,t,e)}}function At(e){if(Q.config.allowScriptTags&&(e.type===\"text/javascript\"||e.type===\"module\"||e.type===\"\")){var t=re().createElement(\"script\");oe(e.attributes,function(e){t.setAttribute(e.name,e.value)});t.textContent=e.textContent;t.async=false;if(Q.config.inlineScriptNonce){t.nonce=Q.config.inlineScriptNonce}var r=e.parentElement;try{r.insertBefore(t,e)}catch(e){b(e)}finally{if(e.parentElement){e.parentElement.removeChild(e)}}}}function Nt(e){if(h(e,\"script\")){At(e)}oe(f(e,\"script\"),function(e){At(e)})}function It(e){var t=e.attributes;for(var r=0;r<t.length;r++){var n=t[r].name;if(s(n,\"hx-on:\")||s(n,\"data-hx-on:\")||s(n,\"hx-on-\")||s(n,\"data-hx-on-\")){return true}}return false}function kt(e){var t=null;var r=[];if(It(e)){r.push(e)}if(document.evaluate){var n=document.evaluate('.//*[@*[ starts-with(name(), \"hx-on:\") or starts-with(name(), \"data-hx-on:\") or'+' starts-with(name(), \"hx-on-\") or starts-with(name(), \"data-hx-on-\") ]]',e);while(t=n.iterateNext())r.push(t)}else{var i=e.getElementsByTagName(\"*\");for(var a=0;a<i.length;a++){if(It(i[a])){r.push(i[a])}}}return r}function Pt(e){if(e.querySelectorAll){var t=\", [hx-boost] a, [data-hx-boost] a, a[hx-boost], a[data-hx-boost]\";var r=e.querySelectorAll(i+t+\", form, [type='submit'], [hx-sse], [data-hx-sse], [hx-ws],\"+\" [data-hx-ws], [hx-ext], [data-hx-ext], [hx-trigger], [data-hx-trigger], [hx-on], [data-hx-on]\");return r}else{return[]}}function Mt(e){var t=v(e.target,\"button, input[type='submit']\");var r=Dt(e);if(r){r.lastButtonClicked=t}}function Xt(e){var t=Dt(e);if(t){t.lastButtonClicked=null}}function Dt(e){var t=v(e.target,\"button, input[type='submit']\");if(!t){return}var r=g(\"#\"+ee(t,\"form\"))||v(t,\"form\");if(!r){return}return ae(r)}function Ut(e){e.addEventListener(\"click\",Mt);e.addEventListener(\"focusin\",Mt);e.addEventListener(\"focusout\",Xt)}function Bt(e){var t=Ye(e);var r=0;for(var n=0;n<t.length;n++){const i=t[n];if(i===\"{\"){r++}else if(i===\"}\"){r--}}return r}function Ft(t,e,r){var n=ae(t);if(!Array.isArray(n.onHandlers)){n.onHandlers=[]}var i;var a=function(e){return Tr(t,function(){if(!i){i=new Function(\"event\",r)}i.call(t,e)})};t.addEventListener(e,a);n.onHandlers.push({event:e,listener:a})}function Vt(e){var t=te(e,\"hx-on\");if(t){var r={};var n=t.split(\"\\n\");var i=null;var a=0;while(n.length>0){var o=n.shift();var s=o.match(/^\\s*([a-zA-Z:\\-\\.]+:)(.*)/);if(a===0&&s){o.split(\":\");i=s[1].slice(0,-1);r[i]=s[2]}else{r[i]+=o}a+=Bt(o)}for(var l in r){Ft(e,l,r[l])}}}function jt(e){Ae(e);for(var t=0;t<e.attributes.length;t++){var r=e.attributes[t].name;var n=e.attributes[t].value;if(s(r,\"hx-on\")||s(r,\"data-hx-on\")){var i=r.indexOf(\"-on\")+3;var a=r.slice(i,i+1);if(a===\"-\"||a===\":\"){var o=r.slice(i+1);if(s(o,\":\")){o=\"htmx\"+o}else if(s(o,\"-\")){o=\"htmx:\"+o.slice(1)}else if(s(o,\"htmx-\")){o=\"htmx:\"+o.slice(5)}Ft(e,o,n)}}}}function _t(t){if(v(t,Q.config.disableSelector)){p(t);return}var r=ae(t);if(r.initHash!==Le(t)){Ne(t);r.initHash=Le(t);Vt(t);ce(t,\"htmx:beforeProcessNode\");if(t.value){r.lastValue=t.value}var e=it(t);var n=Ht(t,r,e);if(!n){if(ne(t,\"hx-boost\")===\"true\"){lt(t,r,e)}else if(o(t,\"hx-trigger\")){e.forEach(function(e){Lt(t,e,r,function(){})})}}if(t.tagName===\"FORM\"||ee(t,\"type\")===\"submit\"&&o(t,\"form\")){Ut(t)}var i=te(t,\"hx-sse\");if(i){St(t,r,i)}var a=te(t,\"hx-ws\");if(a){pt(t,r,a)}ce(t,\"htmx:afterProcessNode\")}}function zt(e){e=g(e);if(v(e,Q.config.disableSelector)){p(e);return}_t(e);oe(Pt(e),function(e){_t(e)});oe(kt(e),jt)}function $t(e){return e.replace(/([a-z0-9])([A-Z])/g,\"$1-$2\").toLowerCase()}function Wt(e,t){var r;if(window.CustomEvent&&typeof window.CustomEvent===\"function\"){r=new CustomEvent(e,{bubbles:true,cancelable:true,detail:t})}else{r=re().createEvent(\"CustomEvent\");r.initCustomEvent(e,true,true,t)}return r}function fe(e,t,r){ce(e,t,le({error:t},r))}function Gt(e){return e===\"htmx:afterProcessNode\"}function R(e,t){oe(Fr(e),function(e){try{t(e)}catch(e){b(e)}})}function b(e){if(console.error){console.error(e)}else if(console.log){console.log(\"ERROR: \",e)}}function ce(e,t,r){e=g(e);if(r==null){r={}}r[\"elt\"]=e;var n=Wt(t,r);if(Q.logger&&!Gt(t)){Q.logger(e,t,r)}if(r.error){b(r.error);ce(e,\"htmx:error\",{errorInfo:r})}var i=e.dispatchEvent(n);var a=$t(t);if(i&&a!==t){var o=Wt(a,n.detail);i=i&&e.dispatchEvent(o)}R(e,function(e){i=i&&(e.onEvent(t,n)!==false&&!n.defaultPrevented)});return i}var Jt=location.pathname+location.search;function Zt(){var e=re().querySelector(\"[hx-history-elt],[data-hx-history-elt]\");return e||re().body}function Kt(e,t,r,n){if(!U()){return}if(Q.config.historyCacheSize<=0){localStorage.removeItem(\"htmx-history-cache\");return}e=B(e);var i=E(localStorage.getItem(\"htmx-history-cache\"))||[];for(var a=0;a<i.length;a++){if(i[a].url===e){i.splice(a,1);break}}var o={url:e,content:t,title:r,scroll:n};ce(re().body,\"htmx:historyItemCreated\",{item:o,cache:i});i.push(o);while(i.length>Q.config.historyCacheSize){i.shift()}while(i.length>0){try{localStorage.setItem(\"htmx-history-cache\",JSON.stringify(i));break}catch(e){fe(re().body,\"htmx:historyCacheError\",{cause:e,cache:i});i.shift()}}}function Yt(e){if(!U()){return null}e=B(e);var t=E(localStorage.getItem(\"htmx-history-cache\"))||[];for(var r=0;r<t.length;r++){if(t[r].url===e){return t[r]}}return null}function Qt(e){var t=Q.config.requestClass;var r=e.cloneNode(true);oe(f(r,\".\"+t),function(e){n(e,t)});return r.innerHTML}function er(){var e=Zt();var t=Jt||location.pathname+location.search;var r;try{r=re().querySelector('[hx-history=\"false\" i],[data-hx-history=\"false\" i]')}catch(e){r=re().querySelector('[hx-history=\"false\"],[data-hx-history=\"false\"]')}if(!r){ce(re().body,\"htmx:beforeHistorySave\",{path:t,historyElt:e});Kt(t,Qt(e),re().title,window.scrollY)}if(Q.config.historyEnabled)history.replaceState({htmx:true},re().title,window.location.href)}function tr(e){if(Q.config.getCacheBusterParam){e=e.replace(/org\\.htmx\\.cache-buster=[^&]*&?/,\"\");if(G(e,\"&\")||G(e,\"?\")){e=e.slice(0,-1)}}if(Q.config.historyEnabled){history.pushState({htmx:true},\"\",e)}Jt=e}function rr(e){if(Q.config.historyEnabled)history.replaceState({htmx:true},\"\",e);Jt=e}function nr(e){oe(e,function(e){e.call()})}function ir(a){var e=new XMLHttpRequest;var o={path:a,xhr:e};ce(re().body,\"htmx:historyCacheMiss\",o);e.open(\"GET\",a,true);e.setRequestHeader(\"HX-Request\",\"true\");e.setRequestHeader(\"HX-History-Restore-Request\",\"true\");e.setRequestHeader(\"HX-Current-URL\",re().location.href);e.onload=function(){if(this.status>=200&&this.status<400){ce(re().body,\"htmx:historyCacheMissLoad\",o);var e=l(this.response);e=e.querySelector(\"[hx-history-elt],[data-hx-history-elt]\")||e;var t=Zt();var r=T(t);var n=Ve(this.response);if(n){var i=C(\"title\");if(i){i.innerHTML=n}else{window.document.title=n}}Ue(t,e,r);nr(r.tasks);Jt=a;ce(re().body,\"htmx:historyRestore\",{path:a,cacheMiss:true,serverResponse:this.response})}else{fe(re().body,\"htmx:historyCacheMissLoadError\",o)}};e.send()}function ar(e){er();e=e||location.pathname+location.search;var t=Yt(e);if(t){var r=l(t.content);var n=Zt();var i=T(n);Ue(n,r,i);nr(i.tasks);document.title=t.title;setTimeout(function(){window.scrollTo(0,t.scroll)},0);Jt=e;ce(re().body,\"htmx:historyRestore\",{path:e,item:t})}else{if(Q.config.refreshOnHistoryMiss){window.location.reload(true)}else{ir(e)}}}function or(e){var t=pe(e,\"hx-indicator\");if(t==null){t=[e]}oe(t,function(e){var t=ae(e);t.requestCount=(t.requestCount||0)+1;e.classList[\"add\"].call(e.classList,Q.config.requestClass)});return t}function sr(e){var t=pe(e,\"hx-disabled-elt\");if(t==null){t=[]}oe(t,function(e){var t=ae(e);t.requestCount=(t.requestCount||0)+1;e.setAttribute(\"disabled\",\"\")});return t}function lr(e,t){oe(e,function(e){var t=ae(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.classList[\"remove\"].call(e.classList,Q.config.requestClass)}});oe(t,function(e){var t=ae(e);t.requestCount=(t.requestCount||0)-1;if(t.requestCount===0){e.removeAttribute(\"disabled\")}})}function ur(e,t){for(var r=0;r<e.length;r++){var n=e[r];if(n.isSameNode(t)){return true}}return false}function fr(e){if(e.name===\"\"||e.name==null||e.disabled||v(e,\"fieldset[disabled]\")){return false}if(e.type===\"button\"||e.type===\"submit\"||e.tagName===\"image\"||e.tagName===\"reset\"||e.tagName===\"file\"){return false}if(e.type===\"checkbox\"||e.type===\"radio\"){return e.checked}return true}function cr(e,t,r){if(e!=null&&t!=null){var n=r[e];if(n===undefined){r[e]=t}else if(Array.isArray(n)){if(Array.isArray(t)){r[e]=n.concat(t)}else{n.push(t)}}else{if(Array.isArray(t)){r[e]=[n].concat(t)}else{r[e]=[n,t]}}}}function hr(t,r,n,e,i){if(e==null||ur(t,e)){return}else{t.push(e)}if(fr(e)){var a=ee(e,\"name\");var o=e.value;if(e.multiple&&e.tagName===\"SELECT\"){o=M(e.querySelectorAll(\"option:checked\")).map(function(e){return e.value})}if(e.files){o=M(e.files)}cr(a,o,r);if(i){vr(e,n)}}if(h(e,\"form\")){var s=e.elements;oe(s,function(e){hr(t,r,n,e,i)})}}function vr(e,t){if(e.willValidate){ce(e,\"htmx:validation:validate\");if(!e.checkValidity()){t.push({elt:e,message:e.validationMessage,validity:e.validity});ce(e,\"htmx:validation:failed\",{message:e.validationMessage,validity:e.validity})}}}function dr(e,t){var r=[];var n={};var i={};var a=[];var o=ae(e);if(o.lastButtonClicked&&!se(o.lastButtonClicked)){o.lastButtonClicked=null}var s=h(e,\"form\")&&e.noValidate!==true||te(e,\"hx-validate\")===\"true\";if(o.lastButtonClicked){s=s&&o.lastButtonClicked.formNoValidate!==true}if(t!==\"get\"){hr(r,i,a,v(e,\"form\"),s)}hr(r,n,a,e,s);if(o.lastButtonClicked||e.tagName===\"BUTTON\"||e.tagName===\"INPUT\"&&ee(e,\"type\")===\"submit\"){var l=o.lastButtonClicked||e;var u=ee(l,\"name\");cr(u,l.value,i)}var f=pe(e,\"hx-include\");oe(f,function(e){hr(r,n,a,e,s);if(!h(e,\"form\")){oe(e.querySelectorAll(rt),function(e){hr(r,n,a,e,s)})}});n=le(n,i);return{errors:a,values:n}}function gr(e,t,r){if(e!==\"\"){e+=\"&\"}if(String(r)===\"[object Object]\"){r=JSON.stringify(r)}var n=encodeURIComponent(r);e+=encodeURIComponent(t)+\"=\"+n;return e}function mr(e){var t=\"\";for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){oe(n,function(e){t=gr(t,r,e)})}else{t=gr(t,r,n)}}}return t}function pr(e){var t=new FormData;for(var r in e){if(e.hasOwnProperty(r)){var n=e[r];if(Array.isArray(n)){oe(n,function(e){t.append(r,e)})}else{t.append(r,n)}}}return t}function xr(e,t,r){var n={\"HX-Request\":\"true\",\"HX-Trigger\":ee(e,\"id\"),\"HX-Trigger-Name\":ee(e,\"name\"),\"HX-Target\":te(t,\"id\"),\"HX-Current-URL\":re().location.href};Rr(e,\"hx-headers\",false,n);if(r!==undefined){n[\"HX-Prompt\"]=r}if(ae(e).boosted){n[\"HX-Boosted\"]=\"true\"}return n}function yr(t,e){var r=ne(e,\"hx-params\");if(r){if(r===\"none\"){return{}}else if(r===\"*\"){return t}else if(r.indexOf(\"not \")===0){oe(r.substr(4).split(\",\"),function(e){e=e.trim();delete t[e]});return t}else{var n={};oe(r.split(\",\"),function(e){e=e.trim();n[e]=t[e]});return n}}else{return t}}function br(e){return ee(e,\"href\")&&ee(e,\"href\").indexOf(\"#\")>=0}function wr(e,t){var r=t?t:ne(e,\"hx-swap\");var n={swapStyle:ae(e).boosted?\"innerHTML\":Q.config.defaultSwapStyle,swapDelay:Q.config.defaultSwapDelay,settleDelay:Q.config.defaultSettleDelay};if(Q.config.scrollIntoViewOnBoost&&ae(e).boosted&&!br(e)){n[\"show\"]=\"top\"}if(r){var i=D(r);if(i.length>0){for(var a=0;a<i.length;a++){var o=i[a];if(o.indexOf(\"swap:\")===0){n[\"swapDelay\"]=d(o.substr(5))}else if(o.indexOf(\"settle:\")===0){n[\"settleDelay\"]=d(o.substr(7))}else if(o.indexOf(\"transition:\")===0){n[\"transition\"]=o.substr(11)===\"true\"}else if(o.indexOf(\"ignoreTitle:\")===0){n[\"ignoreTitle\"]=o.substr(12)===\"true\"}else if(o.indexOf(\"scroll:\")===0){var s=o.substr(7);var l=s.split(\":\");var u=l.pop();var f=l.length>0?l.join(\":\"):null;n[\"scroll\"]=u;n[\"scrollTarget\"]=f}else if(o.indexOf(\"show:\")===0){var c=o.substr(5);var l=c.split(\":\");var h=l.pop();var f=l.length>0?l.join(\":\"):null;n[\"show\"]=h;n[\"showTarget\"]=f}else if(o.indexOf(\"focus-scroll:\")===0){var v=o.substr(\"focus-scroll:\".length);n[\"focusScroll\"]=v==\"true\"}else if(a==0){n[\"swapStyle\"]=o}else{b(\"Unknown modifier in hx-swap: \"+o)}}}}return n}function Sr(e){return ne(e,\"hx-encoding\")===\"multipart/form-data\"||h(e,\"form\")&&ee(e,\"enctype\")===\"multipart/form-data\"}function Er(t,r,n){var i=null;R(r,function(e){if(i==null){i=e.encodeParameters(t,n,r)}});if(i!=null){return i}else{if(Sr(r)){return pr(n)}else{return mr(n)}}}function T(e){return{tasks:[],elts:[e]}}function Cr(e,t){var r=e[0];var n=e[e.length-1];if(t.scroll){var i=null;if(t.scrollTarget){i=ue(r,t.scrollTarget)}if(t.scroll===\"top\"&&(r||i)){i=i||r;i.scrollTop=0}if(t.scroll===\"bottom\"&&(n||i)){i=i||n;i.scrollTop=i.scrollHeight}}if(t.show){var i=null;if(t.showTarget){var a=t.showTarget;if(t.showTarget===\"window\"){a=\"body\"}i=ue(r,a)}if(t.show===\"top\"&&(r||i)){i=i||r;i.scrollIntoView({block:\"start\",behavior:Q.config.scrollBehavior})}if(t.show===\"bottom\"&&(n||i)){i=i||n;i.scrollIntoView({block:\"end\",behavior:Q.config.scrollBehavior})}}}function Rr(e,t,r,n){if(n==null){n={}}if(e==null){return n}var i=te(e,t);if(i){var a=i.trim();var o=r;if(a===\"unset\"){return null}if(a.indexOf(\"javascript:\")===0){a=a.substr(11);o=true}else if(a.indexOf(\"js:\")===0){a=a.substr(3);o=true}if(a.indexOf(\"{\")!==0){a=\"{\"+a+\"}\"}var s;if(o){s=Tr(e,function(){return Function(\"return (\"+a+\")\")()},{})}else{s=E(a)}for(var l in s){if(s.hasOwnProperty(l)){if(n[l]==null){n[l]=s[l]}}}}return Rr(u(e),t,r,n)}function Tr(e,t,r){if(Q.config.allowEval){return t()}else{fe(e,\"htmx:evalDisallowedError\");return r}}function Or(e,t){return Rr(e,\"hx-vars\",true,t)}function qr(e,t){return Rr(e,\"hx-vals\",false,t)}function Hr(e){return le(Or(e),qr(e))}function Lr(t,r,n){if(n!==null){try{t.setRequestHeader(r,n)}catch(e){t.setRequestHeader(r,encodeURIComponent(n));t.setRequestHeader(r+\"-URI-AutoEncoded\",\"true\")}}}function Ar(t){if(t.responseURL&&typeof URL!==\"undefined\"){try{var e=new URL(t.responseURL);return e.pathname+e.search}catch(e){fe(re().body,\"htmx:badResponseUrl\",{url:t.responseURL})}}}function O(e,t){return t.test(e.getAllResponseHeaders())}function Nr(e,t,r){e=e.toLowerCase();if(r){if(r instanceof Element||I(r,\"String\")){return he(e,t,null,null,{targetOverride:g(r),returnPromise:true})}else{return he(e,t,g(r.source),r.event,{handler:r.handler,headers:r.headers,values:r.values,targetOverride:g(r.target),swapOverride:r.swap,select:r.select,returnPromise:true})}}else{return he(e,t,null,null,{returnPromise:true})}}function Ir(e){var t=[];while(e){t.push(e);e=e.parentElement}return t}function kr(e,t,r){var n;var i;if(typeof URL===\"function\"){i=new URL(t,document.location.href);var a=document.location.origin;n=a===i.origin}else{i=t;n=s(t,document.location.origin)}if(Q.config.selfRequestsOnly){if(!n){return false}}return ce(e,\"htmx:validateUrl\",le({url:i,sameHost:n},r))}function he(t,r,n,i,a,e){var o=null;var s=null;a=a!=null?a:{};if(a.returnPromise&&typeof Promise!==\"undefined\"){var l=new Promise(function(e,t){o=e;s=t})}if(n==null){n=re().body}var M=a.handler||Mr;var X=a.select||null;if(!se(n)){ie(o);return l}var u=a.targetOverride||ye(n);if(u==null||u==me){fe(n,\"htmx:targetError\",{target:te(n,\"hx-target\")});ie(s);return l}var f=ae(n);var c=f.lastButtonClicked;if(c){var h=ee(c,\"formaction\");if(h!=null){r=h}var v=ee(c,\"formmethod\");if(v!=null){if(v.toLowerCase()!==\"dialog\"){t=v}}}var d=ne(n,\"hx-confirm\");if(e===undefined){var D=function(e){return he(t,r,n,i,a,!!e)};var U={target:u,elt:n,path:r,verb:t,triggeringEvent:i,etc:a,issueRequest:D,question:d};if(ce(n,\"htmx:confirm\",U)===false){ie(o);return l}}var g=n;var m=ne(n,\"hx-sync\");var p=null;var x=false;if(m){var B=m.split(\":\");var F=B[0].trim();if(F===\"this\"){g=xe(n,\"hx-sync\")}else{g=ue(n,F)}m=(B[1]||\"drop\").trim();f=ae(g);if(m===\"drop\"&&f.xhr&&f.abortable!==true){ie(o);return l}else if(m===\"abort\"){if(f.xhr){ie(o);return l}else{x=true}}else if(m===\"replace\"){ce(g,\"htmx:abort\")}else if(m.indexOf(\"queue\")===0){var V=m.split(\" \");p=(V[1]||\"last\").trim()}}if(f.xhr){if(f.abortable){ce(g,\"htmx:abort\")}else{if(p==null){if(i){var y=ae(i);if(y&&y.triggerSpec&&y.triggerSpec.queue){p=y.triggerSpec.queue}}if(p==null){p=\"last\"}}if(f.queuedRequests==null){f.queuedRequests=[]}if(p===\"first\"&&f.queuedRequests.length===0){f.queuedRequests.push(function(){he(t,r,n,i,a)})}else if(p===\"all\"){f.queuedRequests.push(function(){he(t,r,n,i,a)})}else if(p===\"last\"){f.queuedRequests=[];f.queuedRequests.push(function(){he(t,r,n,i,a)})}ie(o);return l}}var b=new XMLHttpRequest;f.xhr=b;f.abortable=x;var w=function(){f.xhr=null;f.abortable=false;if(f.queuedRequests!=null&&f.queuedRequests.length>0){var e=f.queuedRequests.shift();e()}};var j=ne(n,\"hx-prompt\");if(j){var S=prompt(j);if(S===null||!ce(n,\"htmx:prompt\",{prompt:S,target:u})){ie(o);w();return l}}if(d&&!e){if(!confirm(d)){ie(o);w();return l}}var E=xr(n,u,S);if(t!==\"get\"&&!Sr(n)){E[\"Content-Type\"]=\"application/x-www-form-urlencoded\"}if(a.headers){E=le(E,a.headers)}var _=dr(n,t);var C=_.errors;var R=_.values;if(a.values){R=le(R,a.values)}var z=Hr(n);var $=le(R,z);var T=yr($,n);if(Q.config.getCacheBusterParam&&t===\"get\"){T[\"org.htmx.cache-buster\"]=ee(u,\"id\")||\"true\"}if(r==null||r===\"\"){r=re().location.href}var O=Rr(n,\"hx-request\");var W=ae(n).boosted;var q=Q.config.methodsThatUseUrlParams.indexOf(t)>=0;var H={boosted:W,useUrlParams:q,parameters:T,unfilteredParameters:$,headers:E,target:u,verb:t,errors:C,withCredentials:a.credentials||O.credentials||Q.config.withCredentials,timeout:a.timeout||O.timeout||Q.config.timeout,path:r,triggeringEvent:i};if(!ce(n,\"htmx:configRequest\",H)){ie(o);w();return l}r=H.path;t=H.verb;E=H.headers;T=H.parameters;C=H.errors;q=H.useUrlParams;if(C&&C.length>0){ce(n,\"htmx:validation:halted\",H);ie(o);w();return l}var G=r.split(\"#\");var J=G[0];var L=G[1];var A=r;if(q){A=J;var Z=Object.keys(T).length!==0;if(Z){if(A.indexOf(\"?\")<0){A+=\"?\"}else{A+=\"&\"}A+=mr(T);if(L){A+=\"#\"+L}}}if(!kr(n,A,H)){fe(n,\"htmx:invalidPath\",H);ie(s);return l}b.open(t.toUpperCase(),A,true);b.overrideMimeType(\"text/html\");b.withCredentials=H.withCredentials;b.timeout=H.timeout;if(O.noHeaders){}else{for(var N in E){if(E.hasOwnProperty(N)){var K=E[N];Lr(b,N,K)}}}var I={xhr:b,target:u,requestConfig:H,etc:a,boosted:W,select:X,pathInfo:{requestPath:r,finalRequestPath:A,anchor:L}};b.onload=function(){try{var e=Ir(n);I.pathInfo.responsePath=Ar(b);M(n,I);lr(k,P);ce(n,\"htmx:afterRequest\",I);ce(n,\"htmx:afterOnLoad\",I);if(!se(n)){var t=null;while(e.length>0&&t==null){var r=e.shift();if(se(r)){t=r}}if(t){ce(t,\"htmx:afterRequest\",I);ce(t,\"htmx:afterOnLoad\",I)}}ie(o);w()}catch(e){fe(n,\"htmx:onLoadError\",le({error:e},I));throw e}};b.onerror=function(){lr(k,P);fe(n,\"htmx:afterRequest\",I);fe(n,\"htmx:sendError\",I);ie(s);w()};b.onabort=function(){lr(k,P);fe(n,\"htmx:afterRequest\",I);fe(n,\"htmx:sendAbort\",I);ie(s);w()};b.ontimeout=function(){lr(k,P);fe(n,\"htmx:afterRequest\",I);fe(n,\"htmx:timeout\",I);ie(s);w()};if(!ce(n,\"htmx:beforeRequest\",I)){ie(o);w();return l}var k=or(n);var P=sr(n);oe([\"loadstart\",\"loadend\",\"progress\",\"abort\"],function(t){oe([b,b.upload],function(e){e.addEventListener(t,function(e){ce(n,\"htmx:xhr:\"+t,{lengthComputable:e.lengthComputable,loaded:e.loaded,total:e.total})})})});ce(n,\"htmx:beforeSend\",I);var Y=q?null:Er(b,n,T);b.send(Y);return l}function Pr(e,t){var r=t.xhr;var n=null;var i=null;if(O(r,/HX-Push:/i)){n=r.getResponseHeader(\"HX-Push\");i=\"push\"}else if(O(r,/HX-Push-Url:/i)){n=r.getResponseHeader(\"HX-Push-Url\");i=\"push\"}else if(O(r,/HX-Replace-Url:/i)){n=r.getResponseHeader(\"HX-Replace-Url\");i=\"replace\"}if(n){if(n===\"false\"){return{}}else{return{type:i,path:n}}}var a=t.pathInfo.finalRequestPath;var o=t.pathInfo.responsePath;var s=ne(e,\"hx-push-url\");var l=ne(e,\"hx-replace-url\");var u=ae(e).boosted;var f=null;var c=null;if(s){f=\"push\";c=s}else if(l){f=\"replace\";c=l}else if(u){f=\"push\";c=o||a}if(c){if(c===\"false\"){return{}}if(c===\"true\"){c=o||a}if(t.pathInfo.anchor&&c.indexOf(\"#\")===-1){c=c+\"#\"+t.pathInfo.anchor}return{type:f,path:c}}else{return{}}}function Mr(l,u){var f=u.xhr;var c=u.target;var e=u.etc;var t=u.requestConfig;var h=u.select;if(!ce(l,\"htmx:beforeOnLoad\",u))return;if(O(f,/HX-Trigger:/i)){_e(f,\"HX-Trigger\",l)}if(O(f,/HX-Location:/i)){er();var r=f.getResponseHeader(\"HX-Location\");var v;if(r.indexOf(\"{\")===0){v=E(r);r=v[\"path\"];delete v[\"path\"]}Nr(\"GET\",r,v).then(function(){tr(r)});return}var n=O(f,/HX-Refresh:/i)&&\"true\"===f.getResponseHeader(\"HX-Refresh\");if(O(f,/HX-Redirect:/i)){location.href=f.getResponseHeader(\"HX-Redirect\");n&&location.reload();return}if(n){location.reload();return}if(O(f,/HX-Retarget:/i)){if(f.getResponseHeader(\"HX-Retarget\")===\"this\"){u.target=l}else{u.target=ue(l,f.getResponseHeader(\"HX-Retarget\"))}}var d=Pr(l,u);var i=f.status>=200&&f.status<400&&f.status!==204;var g=f.response;var a=f.status>=400;var m=Q.config.ignoreTitle;var o=le({shouldSwap:i,serverResponse:g,isError:a,ignoreTitle:m},u);if(!ce(c,\"htmx:beforeSwap\",o))return;c=o.target;g=o.serverResponse;a=o.isError;m=o.ignoreTitle;u.target=c;u.failed=a;u.successful=!a;if(o.shouldSwap){if(f.status===286){at(l)}R(l,function(e){g=e.transformResponse(g,f,l)});if(d.type){er()}var s=e.swapOverride;if(O(f,/HX-Reswap:/i)){s=f.getResponseHeader(\"HX-Reswap\")}var v=wr(l,s);if(v.hasOwnProperty(\"ignoreTitle\")){m=v.ignoreTitle}c.classList.add(Q.config.swappingClass);var p=null;var x=null;var y=function(){try{var e=document.activeElement;var t={};try{t={elt:e,start:e?e.selectionStart:null,end:e?e.selectionEnd:null}}catch(e){}var r;if(h){r=h}if(O(f,/HX-Reselect:/i)){r=f.getResponseHeader(\"HX-Reselect\")}if(d.type){ce(re().body,\"htmx:beforeHistoryUpdate\",le({history:d},u));if(d.type===\"push\"){tr(d.path);ce(re().body,\"htmx:pushedIntoHistory\",{path:d.path})}else{rr(d.path);ce(re().body,\"htmx:replacedInHistory\",{path:d.path})}}var n=T(c);je(v.swapStyle,c,l,g,n,r);if(t.elt&&!se(t.elt)&&ee(t.elt,\"id\")){var i=document.getElementById(ee(t.elt,\"id\"));var a={preventScroll:v.focusScroll!==undefined?!v.focusScroll:!Q.config.defaultFocusScroll};if(i){if(t.start&&i.setSelectionRange){try{i.setSelectionRange(t.start,t.end)}catch(e){}}i.focus(a)}}c.classList.remove(Q.config.swappingClass);oe(n.elts,function(e){if(e.classList){e.classList.add(Q.config.settlingClass)}ce(e,\"htmx:afterSwap\",u)});if(O(f,/HX-Trigger-After-Swap:/i)){var o=l;if(!se(l)){o=re().body}_e(f,\"HX-Trigger-After-Swap\",o)}var s=function(){oe(n.tasks,function(e){e.call()});oe(n.elts,function(e){if(e.classList){e.classList.remove(Q.config.settlingClass)}ce(e,\"htmx:afterSettle\",u)});if(u.pathInfo.anchor){var e=re().getElementById(u.pathInfo.anchor);if(e){e.scrollIntoView({block:\"start\",behavior:\"auto\"})}}if(n.title&&!m){var t=C(\"title\");if(t){t.innerHTML=n.title}else{window.document.title=n.title}}Cr(n.elts,v);if(O(f,/HX-Trigger-After-Settle:/i)){var r=l;if(!se(l)){r=re().body}_e(f,\"HX-Trigger-After-Settle\",r)}ie(p)};if(v.settleDelay>0){setTimeout(s,v.settleDelay)}else{s()}}catch(e){fe(l,\"htmx:swapError\",u);ie(x);throw e}};var b=Q.config.globalViewTransitions;if(v.hasOwnProperty(\"transition\")){b=v.transition}if(b&&ce(l,\"htmx:beforeTransition\",u)&&typeof Promise!==\"undefined\"&&document.startViewTransition){var w=new Promise(function(e,t){p=e;x=t});var S=y;y=function(){document.startViewTransition(function(){S();return w})}}if(v.swapDelay>0){setTimeout(y,v.swapDelay)}else{y()}}if(a){fe(l,\"htmx:responseError\",le({error:\"Response Status Error Code \"+f.status+\" from \"+u.pathInfo.requestPath},u))}}var Xr={};function Dr(){return{init:function(e){return null},onEvent:function(e,t){return true},transformResponse:function(e,t,r){return e},isInlineSwap:function(e){return false},handleSwap:function(e,t,r,n){return false},encodeParameters:function(e,t,r){return null}}}function Ur(e,t){if(t.init){t.init(r)}Xr[e]=le(Dr(),t)}function Br(e){delete Xr[e]}function Fr(e,r,n){if(e==undefined){return r}if(r==undefined){r=[]}if(n==undefined){n=[]}var t=te(e,\"hx-ext\");if(t){oe(t.split(\",\"),function(e){e=e.replace(/ /g,\"\");if(e.slice(0,7)==\"ignore:\"){n.push(e.slice(7));return}if(n.indexOf(e)<0){var t=Xr[e];if(t&&r.indexOf(t)<0){r.push(t)}}})}return Fr(u(e),r,n)}var Vr=false;re().addEventListener(\"DOMContentLoaded\",function(){Vr=true});function jr(e){if(Vr||re().readyState===\"complete\"){e()}else{re().addEventListener(\"DOMContentLoaded\",e)}}function _r(){if(Q.config.includeIndicatorStyles!==false){re().head.insertAdjacentHTML(\"beforeend\",\"<style>                      .\"+Q.config.indicatorClass+\"{opacity:0}                      .\"+Q.config.requestClass+\" .\"+Q.config.indicatorClass+\"{opacity:1; transition: opacity 200ms ease-in;}                      .\"+Q.config.requestClass+\".\"+Q.config.indicatorClass+\"{opacity:1; transition: opacity 200ms ease-in;}                    </style>\")}}function zr(){var e=re().querySelector('meta[name=\"htmx-config\"]');if(e){return E(e.content)}else{return null}}function $r(){var e=zr();if(e){Q.config=le(Q.config,e)}}jr(function(){$r();_r();var e=re().body;zt(e);var t=re().querySelectorAll(\"[hx-trigger='restored'],[data-hx-trigger='restored']\");e.addEventListener(\"htmx:abort\",function(e){var t=e.target;var r=ae(t);if(r&&r.xhr){r.xhr.abort()}});const r=window.onpopstate?window.onpopstate.bind(window):null;window.onpopstate=function(e){if(e.state&&e.state.htmx){ar();oe(t,function(e){ce(e,\"htmx:restored\",{document:re(),triggerEvent:ce})})}else{if(r){r(e)}}};setTimeout(function(){ce(e,\"htmx:load\",{});e=null},0)});return Q}()});", "export function setupCopyText() {\n    document.querySelectorAll(\".copy-text\").forEach((el) => {\n        if (el.dataset.target) {\n            el.onclick = (ev) => {\n                ev.preventDefault();\n                navigator.clipboard.writeText(el.dataset.target).then(() => {\n                    const toast = document.createElement(\"span\");\n                    toast.classList = ['ml2 pa1 bg-dark-gray white f7 br2 absolute']\n                    toast.innerText = \"Copied!\";\n                    ev.target.after(toast);\n                    setTimeout(() => {\n                        toast.parentNode.removeChild(toast);\n                    }, 2000);\n                });\n            };\n        }\n    });\n}", "const BUTTON_OFFSET = 17;\n\nexport function setupTables() {\n    var table_wrapper = document.querySelector('.search-results-wrapper');\n\n    if (!table_wrapper) {\n        return;\n    }\n\n    // fix the width of the header cells\n    var table = table_wrapper.querySelector('table');\n    var thead = table.querySelector('thead');\n    var tbody = table.querySelector('tbody');\n    var header_cells = thead.querySelectorAll('th');\n    var table_rows = tbody.querySelectorAll('tr');\n    var first_row = table_rows[0].querySelectorAll('td');\n    first_row.forEach(function (cell, i) {\n        var width = window.getComputedStyle(cell).width;\n        header_cells[i].style.width = width;\n    });\n    // make the table fixed\n    table.style.width = `${thead.getBoundingClientRect().width}px`;\n    table.style.tableLayout = 'fixed';\n\n    // make a copy of the table with just thead\n    var table_copy = table.cloneNode(true);\n    table_copy.querySelector('tbody').remove();\n    table_copy.classList.add('fixed-header');\n    table_copy.style.marginBottom = '0';\n\n    // add a wrapper for the copy\n    var table_copy_wrapper = document.createElement('div');\n    table_copy_wrapper.style.backgroundColor = 'white';\n    table_copy_wrapper.style.overflow = 'hidden';\n    table_copy_wrapper.style.width = `${table_wrapper.getBoundingClientRect().width}px`;\n\n    // add the table copy to the wrapper\n    table_copy_wrapper.appendChild(table_copy);\n\n    // insert the copy before the original table\n    table_wrapper.insertBefore(table_copy_wrapper, table_wrapper.querySelector('table'));\n\n    // get the left offset of the original table\n    var table_offset_left = thead.getBoundingClientRect().left;\n    var table_offset_top = thead.getBoundingClientRect().top;\n\n    // fix the new table to the top of the viewport\n    table_copy_wrapper.style.position = 'fixed';\n    table_copy_wrapper.style.top = '0';\n    if (table_offset_top < BUTTON_OFFSET) {\n        table_copy_wrapper.style.opacity = '1';\n    } else {\n        table_copy_wrapper.style.opacity = '0';\n    }\n    // table_copy.style.top = `${table_offset_top}px`;\n    table_copy_wrapper.style.left = `${table_offset_left}px`;\n    table_copy_wrapper.style.zIndex = '2';\n\n    // when the original header scrolls horizontally, scroll the copy\n    table_wrapper.addEventListener('scroll', function () {\n        // table_copy_wrapper.style.left = `${table_offset_left - table_wrapper.scrollLeft}px`;\n        table_copy_wrapper.scrollLeft = table_wrapper.scrollLeft;\n    });\n\n    // when the body scrolls vertically, show or hide the copy\n    window.addEventListener('scroll', function () {\n        var table_offset_top = thead.getBoundingClientRect().top;\n        if (table_offset_top < BUTTON_OFFSET) {\n            table_copy_wrapper.style.opacity = '1';\n        } else {\n            table_copy_wrapper.style.opacity = '0';\n        }\n    });\n\n}", "// packages/alpinejs/src/scheduler.js\nvar flushPending = false;\nvar flushing = false;\nvar queue = [];\nvar lastFlushedIndex = -1;\nfunction scheduler(callback) {\n  queueJob(callback);\n}\nfunction queueJob(job) {\n  if (!queue.includes(job))\n    queue.push(job);\n  queueFlush();\n}\nfunction dequeueJob(job) {\n  let index = queue.indexOf(job);\n  if (index !== -1 && index > lastFlushedIndex)\n    queue.splice(index, 1);\n}\nfunction queueFlush() {\n  if (!flushing && !flushPending) {\n    flushPending = true;\n    queueMicrotask(flushJobs);\n  }\n}\nfunction flushJobs() {\n  flushPending = false;\n  flushing = true;\n  for (let i = 0; i < queue.length; i++) {\n    queue[i]();\n    lastFlushedIndex = i;\n  }\n  queue.length = 0;\n  lastFlushedIndex = -1;\n  flushing = false;\n}\n\n// packages/alpinejs/src/reactivity.js\nvar reactive;\nvar effect;\nvar release;\nvar raw;\nvar shouldSchedule = true;\nfunction disableEffectScheduling(callback) {\n  shouldSchedule = false;\n  callback();\n  shouldSchedule = true;\n}\nfunction setReactivityEngine(engine) {\n  reactive = engine.reactive;\n  release = engine.release;\n  effect = (callback) => engine.effect(callback, { scheduler: (task) => {\n    if (shouldSchedule) {\n      scheduler(task);\n    } else {\n      task();\n    }\n  } });\n  raw = engine.raw;\n}\nfunction overrideEffect(override) {\n  effect = override;\n}\nfunction elementBoundEffect(el) {\n  let cleanup2 = () => {\n  };\n  let wrappedEffect = (callback) => {\n    let effectReference = effect(callback);\n    if (!el._x_effects) {\n      el._x_effects = /* @__PURE__ */ new Set();\n      el._x_runEffects = () => {\n        el._x_effects.forEach((i) => i());\n      };\n    }\n    el._x_effects.add(effectReference);\n    cleanup2 = () => {\n      if (effectReference === void 0)\n        return;\n      el._x_effects.delete(effectReference);\n      release(effectReference);\n    };\n    return effectReference;\n  };\n  return [wrappedEffect, () => {\n    cleanup2();\n  }];\n}\n\n// packages/alpinejs/src/utils/dispatch.js\nfunction dispatch(el, name, detail = {}) {\n  el.dispatchEvent(\n    new CustomEvent(name, {\n      detail,\n      bubbles: true,\n      // Allows events to pass the shadow DOM barrier.\n      composed: true,\n      cancelable: true\n    })\n  );\n}\n\n// packages/alpinejs/src/utils/walk.js\nfunction walk(el, callback) {\n  if (typeof ShadowRoot === \"function\" && el instanceof ShadowRoot) {\n    Array.from(el.children).forEach((el2) => walk(el2, callback));\n    return;\n  }\n  let skip = false;\n  callback(el, () => skip = true);\n  if (skip)\n    return;\n  let node = el.firstElementChild;\n  while (node) {\n    walk(node, callback, false);\n    node = node.nextElementSibling;\n  }\n}\n\n// packages/alpinejs/src/utils/warn.js\nfunction warn(message, ...args) {\n  console.warn(`Alpine Warning: ${message}`, ...args);\n}\n\n// packages/alpinejs/src/lifecycle.js\nvar started = false;\nfunction start() {\n  if (started)\n    warn(\"Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems.\");\n  started = true;\n  if (!document.body)\n    warn(\"Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?\");\n  dispatch(document, \"alpine:init\");\n  dispatch(document, \"alpine:initializing\");\n  startObservingMutations();\n  onElAdded((el) => initTree(el, walk));\n  onElRemoved((el) => destroyTree(el));\n  onAttributesAdded((el, attrs) => {\n    directives(el, attrs).forEach((handle) => handle());\n  });\n  let outNestedComponents = (el) => !closestRoot(el.parentElement, true);\n  Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => {\n    initTree(el);\n  });\n  dispatch(document, \"alpine:initialized\");\n}\nvar rootSelectorCallbacks = [];\nvar initSelectorCallbacks = [];\nfunction rootSelectors() {\n  return rootSelectorCallbacks.map((fn) => fn());\n}\nfunction allSelectors() {\n  return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn());\n}\nfunction addRootSelector(selectorCallback) {\n  rootSelectorCallbacks.push(selectorCallback);\n}\nfunction addInitSelector(selectorCallback) {\n  initSelectorCallbacks.push(selectorCallback);\n}\nfunction closestRoot(el, includeInitSelectors = false) {\n  return findClosest(el, (element) => {\n    const selectors = includeInitSelectors ? allSelectors() : rootSelectors();\n    if (selectors.some((selector) => element.matches(selector)))\n      return true;\n  });\n}\nfunction findClosest(el, callback) {\n  if (!el)\n    return;\n  if (callback(el))\n    return el;\n  if (el._x_teleportBack)\n    el = el._x_teleportBack;\n  if (!el.parentElement)\n    return;\n  return findClosest(el.parentElement, callback);\n}\nfunction isRoot(el) {\n  return rootSelectors().some((selector) => el.matches(selector));\n}\nvar initInterceptors = [];\nfunction interceptInit(callback) {\n  initInterceptors.push(callback);\n}\nfunction initTree(el, walker = walk, intercept = () => {\n}) {\n  deferHandlingDirectives(() => {\n    walker(el, (el2, skip) => {\n      intercept(el2, skip);\n      initInterceptors.forEach((i) => i(el2, skip));\n      directives(el2, el2.attributes).forEach((handle) => handle());\n      el2._x_ignore && skip();\n    });\n  });\n}\nfunction destroyTree(root) {\n  walk(root, (el) => {\n    cleanupAttributes(el);\n    cleanupElement(el);\n  });\n}\n\n// packages/alpinejs/src/mutation.js\nvar onAttributeAddeds = [];\nvar onElRemoveds = [];\nvar onElAddeds = [];\nfunction onElAdded(callback) {\n  onElAddeds.push(callback);\n}\nfunction onElRemoved(el, callback) {\n  if (typeof callback === \"function\") {\n    if (!el._x_cleanups)\n      el._x_cleanups = [];\n    el._x_cleanups.push(callback);\n  } else {\n    callback = el;\n    onElRemoveds.push(callback);\n  }\n}\nfunction onAttributesAdded(callback) {\n  onAttributeAddeds.push(callback);\n}\nfunction onAttributeRemoved(el, name, callback) {\n  if (!el._x_attributeCleanups)\n    el._x_attributeCleanups = {};\n  if (!el._x_attributeCleanups[name])\n    el._x_attributeCleanups[name] = [];\n  el._x_attributeCleanups[name].push(callback);\n}\nfunction cleanupAttributes(el, names) {\n  if (!el._x_attributeCleanups)\n    return;\n  Object.entries(el._x_attributeCleanups).forEach(([name, value]) => {\n    if (names === void 0 || names.includes(name)) {\n      value.forEach((i) => i());\n      delete el._x_attributeCleanups[name];\n    }\n  });\n}\nfunction cleanupElement(el) {\n  if (el._x_cleanups) {\n    while (el._x_cleanups.length)\n      el._x_cleanups.pop()();\n  }\n}\nvar observer = new MutationObserver(onMutate);\nvar currentlyObserving = false;\nfunction startObservingMutations() {\n  observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true });\n  currentlyObserving = true;\n}\nfunction stopObservingMutations() {\n  flushObserver();\n  observer.disconnect();\n  currentlyObserving = false;\n}\nvar recordQueue = [];\nvar willProcessRecordQueue = false;\nfunction flushObserver() {\n  recordQueue = recordQueue.concat(observer.takeRecords());\n  if (recordQueue.length && !willProcessRecordQueue) {\n    willProcessRecordQueue = true;\n    queueMicrotask(() => {\n      processRecordQueue();\n      willProcessRecordQueue = false;\n    });\n  }\n}\nfunction processRecordQueue() {\n  onMutate(recordQueue);\n  recordQueue.length = 0;\n}\nfunction mutateDom(callback) {\n  if (!currentlyObserving)\n    return callback();\n  stopObservingMutations();\n  let result = callback();\n  startObservingMutations();\n  return result;\n}\nvar isCollecting = false;\nvar deferredMutations = [];\nfunction deferMutations() {\n  isCollecting = true;\n}\nfunction flushAndStopDeferringMutations() {\n  isCollecting = false;\n  onMutate(deferredMutations);\n  deferredMutations = [];\n}\nfunction onMutate(mutations) {\n  if (isCollecting) {\n    deferredMutations = deferredMutations.concat(mutations);\n    return;\n  }\n  let addedNodes = [];\n  let removedNodes = [];\n  let addedAttributes = /* @__PURE__ */ new Map();\n  let removedAttributes = /* @__PURE__ */ new Map();\n  for (let i = 0; i < mutations.length; i++) {\n    if (mutations[i].target._x_ignoreMutationObserver)\n      continue;\n    if (mutations[i].type === \"childList\") {\n      mutations[i].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node));\n      mutations[i].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node));\n    }\n    if (mutations[i].type === \"attributes\") {\n      let el = mutations[i].target;\n      let name = mutations[i].attributeName;\n      let oldValue = mutations[i].oldValue;\n      let add2 = () => {\n        if (!addedAttributes.has(el))\n          addedAttributes.set(el, []);\n        addedAttributes.get(el).push({ name, value: el.getAttribute(name) });\n      };\n      let remove = () => {\n        if (!removedAttributes.has(el))\n          removedAttributes.set(el, []);\n        removedAttributes.get(el).push(name);\n      };\n      if (el.hasAttribute(name) && oldValue === null) {\n        add2();\n      } else if (el.hasAttribute(name)) {\n        remove();\n        add2();\n      } else {\n        remove();\n      }\n    }\n  }\n  removedAttributes.forEach((attrs, el) => {\n    cleanupAttributes(el, attrs);\n  });\n  addedAttributes.forEach((attrs, el) => {\n    onAttributeAddeds.forEach((i) => i(el, attrs));\n  });\n  for (let node of removedNodes) {\n    if (addedNodes.includes(node))\n      continue;\n    onElRemoveds.forEach((i) => i(node));\n    destroyTree(node);\n  }\n  addedNodes.forEach((node) => {\n    node._x_ignoreSelf = true;\n    node._x_ignore = true;\n  });\n  for (let node of addedNodes) {\n    if (removedNodes.includes(node))\n      continue;\n    if (!node.isConnected)\n      continue;\n    delete node._x_ignoreSelf;\n    delete node._x_ignore;\n    onElAddeds.forEach((i) => i(node));\n    node._x_ignore = true;\n    node._x_ignoreSelf = true;\n  }\n  addedNodes.forEach((node) => {\n    delete node._x_ignoreSelf;\n    delete node._x_ignore;\n  });\n  addedNodes = null;\n  removedNodes = null;\n  addedAttributes = null;\n  removedAttributes = null;\n}\n\n// packages/alpinejs/src/scope.js\nfunction scope(node) {\n  return mergeProxies(closestDataStack(node));\n}\nfunction addScopeToNode(node, data2, referenceNode) {\n  node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)];\n  return () => {\n    node._x_dataStack = node._x_dataStack.filter((i) => i !== data2);\n  };\n}\nfunction closestDataStack(node) {\n  if (node._x_dataStack)\n    return node._x_dataStack;\n  if (typeof ShadowRoot === \"function\" && node instanceof ShadowRoot) {\n    return closestDataStack(node.host);\n  }\n  if (!node.parentNode) {\n    return [];\n  }\n  return closestDataStack(node.parentNode);\n}\nfunction mergeProxies(objects) {\n  return new Proxy({ objects }, mergeProxyTrap);\n}\nvar mergeProxyTrap = {\n  ownKeys({ objects }) {\n    return Array.from(\n      new Set(objects.flatMap((i) => Object.keys(i)))\n    );\n  },\n  has({ objects }, name) {\n    if (name == Symbol.unscopables)\n      return false;\n    return objects.some(\n      (obj) => Object.prototype.hasOwnProperty.call(obj, name)\n    );\n  },\n  get({ objects }, name, thisProxy) {\n    if (name == \"toJSON\")\n      return collapseProxies;\n    return Reflect.get(\n      objects.find(\n        (obj) => Object.prototype.hasOwnProperty.call(obj, name)\n      ) || {},\n      name,\n      thisProxy\n    );\n  },\n  set({ objects }, name, value) {\n    return Reflect.set(\n      objects.find(\n        (obj) => Object.prototype.hasOwnProperty.call(obj, name)\n      ) || objects[objects.length - 1],\n      name,\n      value\n    );\n  }\n};\nfunction collapseProxies() {\n  let keys = Reflect.ownKeys(this);\n  return keys.reduce((acc, key) => {\n    acc[key] = Reflect.get(this, key);\n    return acc;\n  }, {});\n}\n\n// packages/alpinejs/src/interceptor.js\nfunction initInterceptors2(data2) {\n  let isObject2 = (val) => typeof val === \"object\" && !Array.isArray(val) && val !== null;\n  let recurse = (obj, basePath = \"\") => {\n    Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => {\n      if (enumerable === false || value === void 0)\n        return;\n      let path = basePath === \"\" ? key : `${basePath}.${key}`;\n      if (typeof value === \"object\" && value !== null && value._x_interceptor) {\n        obj[key] = value.initialize(data2, path, key);\n      } else {\n        if (isObject2(value) && value !== obj && !(value instanceof Element)) {\n          recurse(value, path);\n        }\n      }\n    });\n  };\n  return recurse(data2);\n}\nfunction interceptor(callback, mutateObj = () => {\n}) {\n  let obj = {\n    initialValue: void 0,\n    _x_interceptor: true,\n    initialize(data2, path, key) {\n      return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key);\n    }\n  };\n  mutateObj(obj);\n  return (initialValue) => {\n    if (typeof initialValue === \"object\" && initialValue !== null && initialValue._x_interceptor) {\n      let initialize = obj.initialize.bind(obj);\n      obj.initialize = (data2, path, key) => {\n        let innerValue = initialValue.initialize(data2, path, key);\n        obj.initialValue = innerValue;\n        return initialize(data2, path, key);\n      };\n    } else {\n      obj.initialValue = initialValue;\n    }\n    return obj;\n  };\n}\nfunction get(obj, path) {\n  return path.split(\".\").reduce((carry, segment) => carry[segment], obj);\n}\nfunction set(obj, path, value) {\n  if (typeof path === \"string\")\n    path = path.split(\".\");\n  if (path.length === 1)\n    obj[path[0]] = value;\n  else if (path.length === 0)\n    throw error;\n  else {\n    if (obj[path[0]])\n      return set(obj[path[0]], path.slice(1), value);\n    else {\n      obj[path[0]] = {};\n      return set(obj[path[0]], path.slice(1), value);\n    }\n  }\n}\n\n// packages/alpinejs/src/magics.js\nvar magics = {};\nfunction magic(name, callback) {\n  magics[name] = callback;\n}\nfunction injectMagics(obj, el) {\n  Object.entries(magics).forEach(([name, callback]) => {\n    let memoizedUtilities = null;\n    function getUtilities() {\n      if (memoizedUtilities) {\n        return memoizedUtilities;\n      } else {\n        let [utilities, cleanup2] = getElementBoundUtilities(el);\n        memoizedUtilities = { interceptor, ...utilities };\n        onElRemoved(el, cleanup2);\n        return memoizedUtilities;\n      }\n    }\n    Object.defineProperty(obj, `$${name}`, {\n      get() {\n        return callback(el, getUtilities());\n      },\n      enumerable: false\n    });\n  });\n  return obj;\n}\n\n// packages/alpinejs/src/utils/error.js\nfunction tryCatch(el, expression, callback, ...args) {\n  try {\n    return callback(...args);\n  } catch (e) {\n    handleError(e, el, expression);\n  }\n}\nfunction handleError(error2, el, expression = void 0) {\n  Object.assign(error2, { el, expression });\n  console.warn(`Alpine Expression Error: ${error2.message}\n\n${expression ? 'Expression: \"' + expression + '\"\\n\\n' : \"\"}`, el);\n  setTimeout(() => {\n    throw error2;\n  }, 0);\n}\n\n// packages/alpinejs/src/evaluator.js\nvar shouldAutoEvaluateFunctions = true;\nfunction dontAutoEvaluateFunctions(callback) {\n  let cache = shouldAutoEvaluateFunctions;\n  shouldAutoEvaluateFunctions = false;\n  let result = callback();\n  shouldAutoEvaluateFunctions = cache;\n  return result;\n}\nfunction evaluate(el, expression, extras = {}) {\n  let result;\n  evaluateLater(el, expression)((value) => result = value, extras);\n  return result;\n}\nfunction evaluateLater(...args) {\n  return theEvaluatorFunction(...args);\n}\nvar theEvaluatorFunction = normalEvaluator;\nfunction setEvaluator(newEvaluator) {\n  theEvaluatorFunction = newEvaluator;\n}\nfunction normalEvaluator(el, expression) {\n  let overriddenMagics = {};\n  injectMagics(overriddenMagics, el);\n  let dataStack = [overriddenMagics, ...closestDataStack(el)];\n  let evaluator = typeof expression === \"function\" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el);\n  return tryCatch.bind(null, el, expression, evaluator);\n}\nfunction generateEvaluatorFromFunction(dataStack, func) {\n  return (receiver = () => {\n  }, { scope: scope2 = {}, params = [] } = {}) => {\n    let result = func.apply(mergeProxies([scope2, ...dataStack]), params);\n    runIfTypeOfFunction(receiver, result);\n  };\n}\nvar evaluatorMemo = {};\nfunction generateFunctionFromString(expression, el) {\n  if (evaluatorMemo[expression]) {\n    return evaluatorMemo[expression];\n  }\n  let AsyncFunction = Object.getPrototypeOf(async function() {\n  }).constructor;\n  let rightSideSafeExpression = /^[\\n\\s]*if.*\\(.*\\)/.test(expression.trim()) || /^(let|const)\\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression;\n  const safeAsyncFunction = () => {\n    try {\n      let func2 = new AsyncFunction(\n        [\"__self\", \"scope\"],\n        `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`\n      );\n      Object.defineProperty(func2, \"name\", {\n        value: `[Alpine] ${expression}`\n      });\n      return func2;\n    } catch (error2) {\n      handleError(error2, el, expression);\n      return Promise.resolve();\n    }\n  };\n  let func = safeAsyncFunction();\n  evaluatorMemo[expression] = func;\n  return func;\n}\nfunction generateEvaluatorFromString(dataStack, expression, el) {\n  let func = generateFunctionFromString(expression, el);\n  return (receiver = () => {\n  }, { scope: scope2 = {}, params = [] } = {}) => {\n    func.result = void 0;\n    func.finished = false;\n    let completeScope = mergeProxies([scope2, ...dataStack]);\n    if (typeof func === \"function\") {\n      let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression));\n      if (func.finished) {\n        runIfTypeOfFunction(receiver, func.result, completeScope, params, el);\n        func.result = void 0;\n      } else {\n        promise.then((result) => {\n          runIfTypeOfFunction(receiver, result, completeScope, params, el);\n        }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0);\n      }\n    }\n  };\n}\nfunction runIfTypeOfFunction(receiver, value, scope2, params, el) {\n  if (shouldAutoEvaluateFunctions && typeof value === \"function\") {\n    let result = value.apply(scope2, params);\n    if (result instanceof Promise) {\n      result.then((i) => runIfTypeOfFunction(receiver, i, scope2, params)).catch((error2) => handleError(error2, el, value));\n    } else {\n      receiver(result);\n    }\n  } else if (typeof value === \"object\" && value instanceof Promise) {\n    value.then((i) => receiver(i));\n  } else {\n    receiver(value);\n  }\n}\n\n// packages/alpinejs/src/directives.js\nvar prefixAsString = \"x-\";\nfunction prefix(subject = \"\") {\n  return prefixAsString + subject;\n}\nfunction setPrefix(newPrefix) {\n  prefixAsString = newPrefix;\n}\nvar directiveHandlers = {};\nfunction directive(name, callback) {\n  directiveHandlers[name] = callback;\n  return {\n    before(directive2) {\n      if (!directiveHandlers[directive2]) {\n        console.warn(\n          \"Cannot find directive `${directive}`. `${name}` will use the default order of execution\"\n        );\n        return;\n      }\n      const pos = directiveOrder.indexOf(directive2);\n      directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf(\"DEFAULT\"), 0, name);\n    }\n  };\n}\nfunction directives(el, attributes, originalAttributeOverride) {\n  attributes = Array.from(attributes);\n  if (el._x_virtualDirectives) {\n    let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value }));\n    let staticAttributes = attributesOnly(vAttributes);\n    vAttributes = vAttributes.map((attribute) => {\n      if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n        return {\n          name: `x-bind:${attribute.name}`,\n          value: `\"${attribute.value}\"`\n        };\n      }\n      return attribute;\n    });\n    attributes = attributes.concat(vAttributes);\n  }\n  let transformedAttributeMap = {};\n  let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority);\n  return directives2.map((directive2) => {\n    return getDirectiveHandler(el, directive2);\n  });\n}\nfunction attributesOnly(attributes) {\n  return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr));\n}\nvar isDeferringHandlers = false;\nvar directiveHandlerStacks = /* @__PURE__ */ new Map();\nvar currentHandlerStackKey = Symbol();\nfunction deferHandlingDirectives(callback) {\n  isDeferringHandlers = true;\n  let key = Symbol();\n  currentHandlerStackKey = key;\n  directiveHandlerStacks.set(key, []);\n  let flushHandlers = () => {\n    while (directiveHandlerStacks.get(key).length)\n      directiveHandlerStacks.get(key).shift()();\n    directiveHandlerStacks.delete(key);\n  };\n  let stopDeferring = () => {\n    isDeferringHandlers = false;\n    flushHandlers();\n  };\n  callback(flushHandlers);\n  stopDeferring();\n}\nfunction getElementBoundUtilities(el) {\n  let cleanups = [];\n  let cleanup2 = (callback) => cleanups.push(callback);\n  let [effect3, cleanupEffect] = elementBoundEffect(el);\n  cleanups.push(cleanupEffect);\n  let utilities = {\n    Alpine: alpine_default,\n    effect: effect3,\n    cleanup: cleanup2,\n    evaluateLater: evaluateLater.bind(evaluateLater, el),\n    evaluate: evaluate.bind(evaluate, el)\n  };\n  let doCleanup = () => cleanups.forEach((i) => i());\n  return [utilities, doCleanup];\n}\nfunction getDirectiveHandler(el, directive2) {\n  let noop = () => {\n  };\n  let handler4 = directiveHandlers[directive2.type] || noop;\n  let [utilities, cleanup2] = getElementBoundUtilities(el);\n  onAttributeRemoved(el, directive2.original, cleanup2);\n  let fullHandler = () => {\n    if (el._x_ignore || el._x_ignoreSelf)\n      return;\n    handler4.inline && handler4.inline(el, directive2, utilities);\n    handler4 = handler4.bind(handler4, el, directive2, utilities);\n    isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4();\n  };\n  fullHandler.runCleanups = cleanup2;\n  return fullHandler;\n}\nvar startingWith = (subject, replacement) => ({ name, value }) => {\n  if (name.startsWith(subject))\n    name = name.replace(subject, replacement);\n  return { name, value };\n};\nvar into = (i) => i;\nfunction toTransformedAttributes(callback = () => {\n}) {\n  return ({ name, value }) => {\n    let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => {\n      return transform(carry);\n    }, { name, value });\n    if (newName !== name)\n      callback(newName, name);\n    return { name: newName, value: newValue };\n  };\n}\nvar attributeTransformers = [];\nfunction mapAttributes(callback) {\n  attributeTransformers.push(callback);\n}\nfunction outNonAlpineAttributes({ name }) {\n  return alpineAttributeRegex().test(name);\n}\nvar alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\\\b`);\nfunction toParsedDirectives(transformedAttributeMap, originalAttributeOverride) {\n  return ({ name, value }) => {\n    let typeMatch = name.match(alpineAttributeRegex());\n    let valueMatch = name.match(/:([a-zA-Z0-9\\-:]+)/);\n    let modifiers = name.match(/\\.[^.\\]]+(?=[^\\]]*$)/g) || [];\n    let original = originalAttributeOverride || transformedAttributeMap[name] || name;\n    return {\n      type: typeMatch ? typeMatch[1] : null,\n      value: valueMatch ? valueMatch[1] : null,\n      modifiers: modifiers.map((i) => i.replace(\".\", \"\")),\n      expression: value,\n      original\n    };\n  };\n}\nvar DEFAULT = \"DEFAULT\";\nvar directiveOrder = [\n  \"ignore\",\n  \"ref\",\n  \"data\",\n  \"id\",\n  \"bind\",\n  \"init\",\n  \"for\",\n  \"model\",\n  \"modelable\",\n  \"transition\",\n  \"show\",\n  \"if\",\n  DEFAULT,\n  \"teleport\"\n];\nfunction byPriority(a, b) {\n  let typeA = directiveOrder.indexOf(a.type) === -1 ? DEFAULT : a.type;\n  let typeB = directiveOrder.indexOf(b.type) === -1 ? DEFAULT : b.type;\n  return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB);\n}\n\n// packages/alpinejs/src/nextTick.js\nvar tickStack = [];\nvar isHolding = false;\nfunction nextTick(callback = () => {\n}) {\n  queueMicrotask(() => {\n    isHolding || setTimeout(() => {\n      releaseNextTicks();\n    });\n  });\n  return new Promise((res) => {\n    tickStack.push(() => {\n      callback();\n      res();\n    });\n  });\n}\nfunction releaseNextTicks() {\n  isHolding = false;\n  while (tickStack.length)\n    tickStack.shift()();\n}\nfunction holdNextTicks() {\n  isHolding = true;\n}\n\n// packages/alpinejs/src/utils/classes.js\nfunction setClasses(el, value) {\n  if (Array.isArray(value)) {\n    return setClassesFromString(el, value.join(\" \"));\n  } else if (typeof value === \"object\" && value !== null) {\n    return setClassesFromObject(el, value);\n  } else if (typeof value === \"function\") {\n    return setClasses(el, value());\n  }\n  return setClassesFromString(el, value);\n}\nfunction setClassesFromString(el, classString) {\n  let split = (classString2) => classString2.split(\" \").filter(Boolean);\n  let missingClasses = (classString2) => classString2.split(\" \").filter((i) => !el.classList.contains(i)).filter(Boolean);\n  let addClassesAndReturnUndo = (classes) => {\n    el.classList.add(...classes);\n    return () => {\n      el.classList.remove(...classes);\n    };\n  };\n  classString = classString === true ? classString = \"\" : classString || \"\";\n  return addClassesAndReturnUndo(missingClasses(classString));\n}\nfunction setClassesFromObject(el, classObject) {\n  let split = (classString) => classString.split(\" \").filter(Boolean);\n  let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean);\n  let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean);\n  let added = [];\n  let removed = [];\n  forRemove.forEach((i) => {\n    if (el.classList.contains(i)) {\n      el.classList.remove(i);\n      removed.push(i);\n    }\n  });\n  forAdd.forEach((i) => {\n    if (!el.classList.contains(i)) {\n      el.classList.add(i);\n      added.push(i);\n    }\n  });\n  return () => {\n    removed.forEach((i) => el.classList.add(i));\n    added.forEach((i) => el.classList.remove(i));\n  };\n}\n\n// packages/alpinejs/src/utils/styles.js\nfunction setStyles(el, value) {\n  if (typeof value === \"object\" && value !== null) {\n    return setStylesFromObject(el, value);\n  }\n  return setStylesFromString(el, value);\n}\nfunction setStylesFromObject(el, value) {\n  let previousStyles = {};\n  Object.entries(value).forEach(([key, value2]) => {\n    previousStyles[key] = el.style[key];\n    if (!key.startsWith(\"--\")) {\n      key = kebabCase(key);\n    }\n    el.style.setProperty(key, value2);\n  });\n  setTimeout(() => {\n    if (el.style.length === 0) {\n      el.removeAttribute(\"style\");\n    }\n  });\n  return () => {\n    setStyles(el, previousStyles);\n  };\n}\nfunction setStylesFromString(el, value) {\n  let cache = el.getAttribute(\"style\", value);\n  el.setAttribute(\"style\", value);\n  return () => {\n    el.setAttribute(\"style\", cache || \"\");\n  };\n}\nfunction kebabCase(subject) {\n  return subject.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n}\n\n// packages/alpinejs/src/utils/once.js\nfunction once(callback, fallback = () => {\n}) {\n  let called = false;\n  return function() {\n    if (!called) {\n      called = true;\n      callback.apply(this, arguments);\n    } else {\n      fallback.apply(this, arguments);\n    }\n  };\n}\n\n// packages/alpinejs/src/directives/x-transition.js\ndirective(\"transition\", (el, { value, modifiers, expression }, { evaluate: evaluate2 }) => {\n  if (typeof expression === \"function\")\n    expression = evaluate2(expression);\n  if (expression === false)\n    return;\n  if (!expression || typeof expression === \"boolean\") {\n    registerTransitionsFromHelper(el, modifiers, value);\n  } else {\n    registerTransitionsFromClassString(el, expression, value);\n  }\n});\nfunction registerTransitionsFromClassString(el, classString, stage) {\n  registerTransitionObject(el, setClasses, \"\");\n  let directiveStorageMap = {\n    \"enter\": (classes) => {\n      el._x_transition.enter.during = classes;\n    },\n    \"enter-start\": (classes) => {\n      el._x_transition.enter.start = classes;\n    },\n    \"enter-end\": (classes) => {\n      el._x_transition.enter.end = classes;\n    },\n    \"leave\": (classes) => {\n      el._x_transition.leave.during = classes;\n    },\n    \"leave-start\": (classes) => {\n      el._x_transition.leave.start = classes;\n    },\n    \"leave-end\": (classes) => {\n      el._x_transition.leave.end = classes;\n    }\n  };\n  directiveStorageMap[stage](classString);\n}\nfunction registerTransitionsFromHelper(el, modifiers, stage) {\n  registerTransitionObject(el, setStyles);\n  let doesntSpecify = !modifiers.includes(\"in\") && !modifiers.includes(\"out\") && !stage;\n  let transitioningIn = doesntSpecify || modifiers.includes(\"in\") || [\"enter\"].includes(stage);\n  let transitioningOut = doesntSpecify || modifiers.includes(\"out\") || [\"leave\"].includes(stage);\n  if (modifiers.includes(\"in\") && !doesntSpecify) {\n    modifiers = modifiers.filter((i, index) => index < modifiers.indexOf(\"out\"));\n  }\n  if (modifiers.includes(\"out\") && !doesntSpecify) {\n    modifiers = modifiers.filter((i, index) => index > modifiers.indexOf(\"out\"));\n  }\n  let wantsAll = !modifiers.includes(\"opacity\") && !modifiers.includes(\"scale\");\n  let wantsOpacity = wantsAll || modifiers.includes(\"opacity\");\n  let wantsScale = wantsAll || modifiers.includes(\"scale\");\n  let opacityValue = wantsOpacity ? 0 : 1;\n  let scaleValue = wantsScale ? modifierValue(modifiers, \"scale\", 95) / 100 : 1;\n  let delay = modifierValue(modifiers, \"delay\", 0) / 1e3;\n  let origin = modifierValue(modifiers, \"origin\", \"center\");\n  let property = \"opacity, transform\";\n  let durationIn = modifierValue(modifiers, \"duration\", 150) / 1e3;\n  let durationOut = modifierValue(modifiers, \"duration\", 75) / 1e3;\n  let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`;\n  if (transitioningIn) {\n    el._x_transition.enter.during = {\n      transformOrigin: origin,\n      transitionDelay: `${delay}s`,\n      transitionProperty: property,\n      transitionDuration: `${durationIn}s`,\n      transitionTimingFunction: easing\n    };\n    el._x_transition.enter.start = {\n      opacity: opacityValue,\n      transform: `scale(${scaleValue})`\n    };\n    el._x_transition.enter.end = {\n      opacity: 1,\n      transform: `scale(1)`\n    };\n  }\n  if (transitioningOut) {\n    el._x_transition.leave.during = {\n      transformOrigin: origin,\n      transitionDelay: `${delay}s`,\n      transitionProperty: property,\n      transitionDuration: `${durationOut}s`,\n      transitionTimingFunction: easing\n    };\n    el._x_transition.leave.start = {\n      opacity: 1,\n      transform: `scale(1)`\n    };\n    el._x_transition.leave.end = {\n      opacity: opacityValue,\n      transform: `scale(${scaleValue})`\n    };\n  }\n}\nfunction registerTransitionObject(el, setFunction, defaultValue = {}) {\n  if (!el._x_transition)\n    el._x_transition = {\n      enter: { during: defaultValue, start: defaultValue, end: defaultValue },\n      leave: { during: defaultValue, start: defaultValue, end: defaultValue },\n      in(before = () => {\n      }, after = () => {\n      }) {\n        transition(el, setFunction, {\n          during: this.enter.during,\n          start: this.enter.start,\n          end: this.enter.end\n        }, before, after);\n      },\n      out(before = () => {\n      }, after = () => {\n      }) {\n        transition(el, setFunction, {\n          during: this.leave.during,\n          start: this.leave.start,\n          end: this.leave.end\n        }, before, after);\n      }\n    };\n}\nwindow.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) {\n  const nextTick2 = document.visibilityState === \"visible\" ? requestAnimationFrame : setTimeout;\n  let clickAwayCompatibleShow = () => nextTick2(show);\n  if (value) {\n    if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) {\n      el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow();\n    } else {\n      el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow();\n    }\n    return;\n  }\n  el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => {\n    el._x_transition.out(() => {\n    }, () => resolve(hide));\n    el._x_transitioning.beforeCancel(() => reject({ isFromCancelledTransition: true }));\n  }) : Promise.resolve(hide);\n  queueMicrotask(() => {\n    let closest = closestHide(el);\n    if (closest) {\n      if (!closest._x_hideChildren)\n        closest._x_hideChildren = [];\n      closest._x_hideChildren.push(el);\n    } else {\n      nextTick2(() => {\n        let hideAfterChildren = (el2) => {\n          let carry = Promise.all([\n            el2._x_hidePromise,\n            ...(el2._x_hideChildren || []).map(hideAfterChildren)\n          ]).then(([i]) => i());\n          delete el2._x_hidePromise;\n          delete el2._x_hideChildren;\n          return carry;\n        };\n        hideAfterChildren(el).catch((e) => {\n          if (!e.isFromCancelledTransition)\n            throw e;\n        });\n      });\n    }\n  });\n};\nfunction closestHide(el) {\n  let parent = el.parentNode;\n  if (!parent)\n    return;\n  return parent._x_hidePromise ? parent : closestHide(parent);\n}\nfunction transition(el, setFunction, { during, start: start2, end } = {}, before = () => {\n}, after = () => {\n}) {\n  if (el._x_transitioning)\n    el._x_transitioning.cancel();\n  if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) {\n    before();\n    after();\n    return;\n  }\n  let undoStart, undoDuring, undoEnd;\n  performTransition(el, {\n    start() {\n      undoStart = setFunction(el, start2);\n    },\n    during() {\n      undoDuring = setFunction(el, during);\n    },\n    before,\n    end() {\n      undoStart();\n      undoEnd = setFunction(el, end);\n    },\n    after,\n    cleanup() {\n      undoDuring();\n      undoEnd();\n    }\n  });\n}\nfunction performTransition(el, stages) {\n  let interrupted, reachedBefore, reachedEnd;\n  let finish = once(() => {\n    mutateDom(() => {\n      interrupted = true;\n      if (!reachedBefore)\n        stages.before();\n      if (!reachedEnd) {\n        stages.end();\n        releaseNextTicks();\n      }\n      stages.after();\n      if (el.isConnected)\n        stages.cleanup();\n      delete el._x_transitioning;\n    });\n  });\n  el._x_transitioning = {\n    beforeCancels: [],\n    beforeCancel(callback) {\n      this.beforeCancels.push(callback);\n    },\n    cancel: once(function() {\n      while (this.beforeCancels.length) {\n        this.beforeCancels.shift()();\n      }\n      ;\n      finish();\n    }),\n    finish\n  };\n  mutateDom(() => {\n    stages.start();\n    stages.during();\n  });\n  holdNextTicks();\n  requestAnimationFrame(() => {\n    if (interrupted)\n      return;\n    let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, \"\").replace(\"s\", \"\")) * 1e3;\n    let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, \"\").replace(\"s\", \"\")) * 1e3;\n    if (duration === 0)\n      duration = Number(getComputedStyle(el).animationDuration.replace(\"s\", \"\")) * 1e3;\n    mutateDom(() => {\n      stages.before();\n    });\n    reachedBefore = true;\n    requestAnimationFrame(() => {\n      if (interrupted)\n        return;\n      mutateDom(() => {\n        stages.end();\n      });\n      releaseNextTicks();\n      setTimeout(el._x_transitioning.finish, duration + delay);\n      reachedEnd = true;\n    });\n  });\n}\nfunction modifierValue(modifiers, key, fallback) {\n  if (modifiers.indexOf(key) === -1)\n    return fallback;\n  const rawValue = modifiers[modifiers.indexOf(key) + 1];\n  if (!rawValue)\n    return fallback;\n  if (key === \"scale\") {\n    if (isNaN(rawValue))\n      return fallback;\n  }\n  if (key === \"duration\" || key === \"delay\") {\n    let match = rawValue.match(/([0-9]+)ms/);\n    if (match)\n      return match[1];\n  }\n  if (key === \"origin\") {\n    if ([\"top\", \"right\", \"left\", \"center\", \"bottom\"].includes(modifiers[modifiers.indexOf(key) + 2])) {\n      return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(\" \");\n    }\n  }\n  return rawValue;\n}\n\n// packages/alpinejs/src/clone.js\nvar isCloning = false;\nfunction skipDuringClone(callback, fallback = () => {\n}) {\n  return (...args) => isCloning ? fallback(...args) : callback(...args);\n}\nfunction onlyDuringClone(callback) {\n  return (...args) => isCloning && callback(...args);\n}\nfunction cloneNode(from, to) {\n  if (from._x_dataStack) {\n    to._x_dataStack = from._x_dataStack;\n    to.setAttribute(\"data-has-alpine-state\", true);\n  }\n  isCloning = true;\n  dontRegisterReactiveSideEffects(() => {\n    initTree(to, (el, callback) => {\n      callback(el, () => {\n      });\n    });\n  });\n  isCloning = false;\n}\nvar isCloningLegacy = false;\nfunction clone(oldEl, newEl) {\n  if (!newEl._x_dataStack)\n    newEl._x_dataStack = oldEl._x_dataStack;\n  isCloning = true;\n  isCloningLegacy = true;\n  dontRegisterReactiveSideEffects(() => {\n    cloneTree(newEl);\n  });\n  isCloning = false;\n  isCloningLegacy = false;\n}\nfunction cloneTree(el) {\n  let hasRunThroughFirstEl = false;\n  let shallowWalker = (el2, callback) => {\n    walk(el2, (el3, skip) => {\n      if (hasRunThroughFirstEl && isRoot(el3))\n        return skip();\n      hasRunThroughFirstEl = true;\n      callback(el3, skip);\n    });\n  };\n  initTree(el, shallowWalker);\n}\nfunction dontRegisterReactiveSideEffects(callback) {\n  let cache = effect;\n  overrideEffect((callback2, el) => {\n    let storedEffect = cache(callback2);\n    release(storedEffect);\n    return () => {\n    };\n  });\n  callback();\n  overrideEffect(cache);\n}\nfunction shouldSkipRegisteringDataDuringClone(el) {\n  if (!isCloning)\n    return false;\n  if (isCloningLegacy)\n    return true;\n  return el.hasAttribute(\"data-has-alpine-state\");\n}\n\n// packages/alpinejs/src/utils/bind.js\nfunction bind(el, name, value, modifiers = []) {\n  if (!el._x_bindings)\n    el._x_bindings = reactive({});\n  el._x_bindings[name] = value;\n  name = modifiers.includes(\"camel\") ? camelCase(name) : name;\n  switch (name) {\n    case \"value\":\n      bindInputValue(el, value);\n      break;\n    case \"style\":\n      bindStyles(el, value);\n      break;\n    case \"class\":\n      bindClasses(el, value);\n      break;\n    case \"selected\":\n    case \"checked\":\n      bindAttributeAndProperty(el, name, value);\n      break;\n    default:\n      bindAttribute(el, name, value);\n      break;\n  }\n}\nfunction bindInputValue(el, value) {\n  if (el.type === \"radio\") {\n    if (el.attributes.value === void 0) {\n      el.value = value;\n    }\n    if (window.fromModel) {\n      el.checked = checkedAttrLooseCompare(el.value, value);\n    }\n  } else if (el.type === \"checkbox\") {\n    if (Number.isInteger(value)) {\n      el.value = value;\n    } else if (!Array.isArray(value) && typeof value !== \"boolean\" && ![null, void 0].includes(value)) {\n      el.value = String(value);\n    } else {\n      if (Array.isArray(value)) {\n        el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value));\n      } else {\n        el.checked = !!value;\n      }\n    }\n  } else if (el.tagName === \"SELECT\") {\n    updateSelect(el, value);\n  } else {\n    if (el.value === value)\n      return;\n    el.value = value === void 0 ? \"\" : value;\n  }\n}\nfunction bindClasses(el, value) {\n  if (el._x_undoAddedClasses)\n    el._x_undoAddedClasses();\n  el._x_undoAddedClasses = setClasses(el, value);\n}\nfunction bindStyles(el, value) {\n  if (el._x_undoAddedStyles)\n    el._x_undoAddedStyles();\n  el._x_undoAddedStyles = setStyles(el, value);\n}\nfunction bindAttributeAndProperty(el, name, value) {\n  bindAttribute(el, name, value);\n  setPropertyIfChanged(el, name, value);\n}\nfunction bindAttribute(el, name, value) {\n  if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) {\n    el.removeAttribute(name);\n  } else {\n    if (isBooleanAttr(name))\n      value = name;\n    setIfChanged(el, name, value);\n  }\n}\nfunction setIfChanged(el, attrName, value) {\n  if (el.getAttribute(attrName) != value) {\n    el.setAttribute(attrName, value);\n  }\n}\nfunction setPropertyIfChanged(el, propName, value) {\n  if (el[propName] !== value) {\n    el[propName] = value;\n  }\n}\nfunction updateSelect(el, value) {\n  const arrayWrappedValue = [].concat(value).map((value2) => {\n    return value2 + \"\";\n  });\n  Array.from(el.options).forEach((option) => {\n    option.selected = arrayWrappedValue.includes(option.value);\n  });\n}\nfunction camelCase(subject) {\n  return subject.toLowerCase().replace(/-(\\w)/g, (match, char) => char.toUpperCase());\n}\nfunction checkedAttrLooseCompare(valueA, valueB) {\n  return valueA == valueB;\n}\nfunction isBooleanAttr(attrName) {\n  const booleanAttributes = [\n    \"disabled\",\n    \"checked\",\n    \"required\",\n    \"readonly\",\n    \"hidden\",\n    \"open\",\n    \"selected\",\n    \"autofocus\",\n    \"itemscope\",\n    \"multiple\",\n    \"novalidate\",\n    \"allowfullscreen\",\n    \"allowpaymentrequest\",\n    \"formnovalidate\",\n    \"autoplay\",\n    \"controls\",\n    \"loop\",\n    \"muted\",\n    \"playsinline\",\n    \"default\",\n    \"ismap\",\n    \"reversed\",\n    \"async\",\n    \"defer\",\n    \"nomodule\"\n  ];\n  return booleanAttributes.includes(attrName);\n}\nfunction attributeShouldntBePreservedIfFalsy(name) {\n  return ![\"aria-pressed\", \"aria-checked\", \"aria-expanded\", \"aria-selected\"].includes(name);\n}\nfunction getBinding(el, name, fallback) {\n  if (el._x_bindings && el._x_bindings[name] !== void 0)\n    return el._x_bindings[name];\n  return getAttributeBinding(el, name, fallback);\n}\nfunction extractProp(el, name, fallback, extract = true) {\n  if (el._x_bindings && el._x_bindings[name] !== void 0)\n    return el._x_bindings[name];\n  if (el._x_inlineBindings && el._x_inlineBindings[name] !== void 0) {\n    let binding = el._x_inlineBindings[name];\n    binding.extract = extract;\n    return dontAutoEvaluateFunctions(() => {\n      return evaluate(el, binding.expression);\n    });\n  }\n  return getAttributeBinding(el, name, fallback);\n}\nfunction getAttributeBinding(el, name, fallback) {\n  let attr = el.getAttribute(name);\n  if (attr === null)\n    return typeof fallback === \"function\" ? fallback() : fallback;\n  if (attr === \"\")\n    return true;\n  if (isBooleanAttr(name)) {\n    return !![name, \"true\"].includes(attr);\n  }\n  return attr;\n}\n\n// packages/alpinejs/src/utils/debounce.js\nfunction debounce(func, wait) {\n  var timeout;\n  return function() {\n    var context = this, args = arguments;\n    var later = function() {\n      timeout = null;\n      func.apply(context, args);\n    };\n    clearTimeout(timeout);\n    timeout = setTimeout(later, wait);\n  };\n}\n\n// packages/alpinejs/src/utils/throttle.js\nfunction throttle(func, limit) {\n  let inThrottle;\n  return function() {\n    let context = this, args = arguments;\n    if (!inThrottle) {\n      func.apply(context, args);\n      inThrottle = true;\n      setTimeout(() => inThrottle = false, limit);\n    }\n  };\n}\n\n// packages/alpinejs/src/entangle.js\nfunction entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) {\n  let firstRun = true;\n  let outerHash, innerHash, outerHashLatest, innerHashLatest;\n  let reference = effect(() => {\n    let outer, inner;\n    if (firstRun) {\n      outer = outerGet();\n      innerSet(JSON.parse(JSON.stringify(outer)));\n      inner = innerGet();\n      firstRun = false;\n    } else {\n      outer = outerGet();\n      inner = innerGet();\n      outerHashLatest = JSON.stringify(outer);\n      innerHashLatest = JSON.stringify(inner);\n      if (outerHashLatest !== outerHash) {\n        inner = innerGet();\n        innerSet(outer);\n        inner = outer;\n      } else {\n        outerSet(JSON.parse(innerHashLatest ?? null));\n        outer = inner;\n      }\n    }\n    outerHash = JSON.stringify(outer);\n    innerHash = JSON.stringify(inner);\n  });\n  return () => {\n    release(reference);\n  };\n}\n\n// packages/alpinejs/src/plugin.js\nfunction plugin(callback) {\n  let callbacks = Array.isArray(callback) ? callback : [callback];\n  callbacks.forEach((i) => i(alpine_default));\n}\n\n// packages/alpinejs/src/store.js\nvar stores = {};\nvar isReactive = false;\nfunction store(name, value) {\n  if (!isReactive) {\n    stores = reactive(stores);\n    isReactive = true;\n  }\n  if (value === void 0) {\n    return stores[name];\n  }\n  stores[name] = value;\n  if (typeof value === \"object\" && value !== null && value.hasOwnProperty(\"init\") && typeof value.init === \"function\") {\n    stores[name].init();\n  }\n  initInterceptors2(stores[name]);\n}\nfunction getStores() {\n  return stores;\n}\n\n// packages/alpinejs/src/binds.js\nvar binds = {};\nfunction bind2(name, bindings) {\n  let getBindings = typeof bindings !== \"function\" ? () => bindings : bindings;\n  if (name instanceof Element) {\n    return applyBindingsObject(name, getBindings());\n  } else {\n    binds[name] = getBindings;\n  }\n  return () => {\n  };\n}\nfunction injectBindingProviders(obj) {\n  Object.entries(binds).forEach(([name, callback]) => {\n    Object.defineProperty(obj, name, {\n      get() {\n        return (...args) => {\n          return callback(...args);\n        };\n      }\n    });\n  });\n  return obj;\n}\nfunction applyBindingsObject(el, obj, original) {\n  let cleanupRunners = [];\n  while (cleanupRunners.length)\n    cleanupRunners.pop()();\n  let attributes = Object.entries(obj).map(([name, value]) => ({ name, value }));\n  let staticAttributes = attributesOnly(attributes);\n  attributes = attributes.map((attribute) => {\n    if (staticAttributes.find((attr) => attr.name === attribute.name)) {\n      return {\n        name: `x-bind:${attribute.name}`,\n        value: `\"${attribute.value}\"`\n      };\n    }\n    return attribute;\n  });\n  directives(el, attributes, original).map((handle) => {\n    cleanupRunners.push(handle.runCleanups);\n    handle();\n  });\n  return () => {\n    while (cleanupRunners.length)\n      cleanupRunners.pop()();\n  };\n}\n\n// packages/alpinejs/src/datas.js\nvar datas = {};\nfunction data(name, callback) {\n  datas[name] = callback;\n}\nfunction injectDataProviders(obj, context) {\n  Object.entries(datas).forEach(([name, callback]) => {\n    Object.defineProperty(obj, name, {\n      get() {\n        return (...args) => {\n          return callback.bind(context)(...args);\n        };\n      },\n      enumerable: false\n    });\n  });\n  return obj;\n}\n\n// packages/alpinejs/src/alpine.js\nvar Alpine = {\n  get reactive() {\n    return reactive;\n  },\n  get release() {\n    return release;\n  },\n  get effect() {\n    return effect;\n  },\n  get raw() {\n    return raw;\n  },\n  version: \"3.13.1\",\n  flushAndStopDeferringMutations,\n  dontAutoEvaluateFunctions,\n  disableEffectScheduling,\n  startObservingMutations,\n  stopObservingMutations,\n  setReactivityEngine,\n  onAttributeRemoved,\n  onAttributesAdded,\n  closestDataStack,\n  skipDuringClone,\n  onlyDuringClone,\n  addRootSelector,\n  addInitSelector,\n  addScopeToNode,\n  deferMutations,\n  mapAttributes,\n  evaluateLater,\n  interceptInit,\n  setEvaluator,\n  mergeProxies,\n  extractProp,\n  findClosest,\n  onElRemoved,\n  closestRoot,\n  destroyTree,\n  interceptor,\n  // INTERNAL: not public API and is subject to change without major release.\n  transition,\n  // INTERNAL\n  setStyles,\n  // INTERNAL\n  mutateDom,\n  directive,\n  entangle,\n  throttle,\n  debounce,\n  evaluate,\n  initTree,\n  nextTick,\n  prefixed: prefix,\n  prefix: setPrefix,\n  plugin,\n  magic,\n  store,\n  start,\n  clone,\n  // INTERNAL\n  cloneNode,\n  // INTERNAL\n  bound: getBinding,\n  $data: scope,\n  walk,\n  data,\n  bind: bind2\n};\nvar alpine_default = Alpine;\n\n// node_modules/@vue/shared/dist/shared.esm-bundler.js\nfunction makeMap(str, expectsLowerCase) {\n  const map = /* @__PURE__ */ Object.create(null);\n  const list = str.split(\",\");\n  for (let i = 0; i < list.length; i++) {\n    map[list[i]] = true;\n  }\n  return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val];\n}\nvar specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;\nvar isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`);\nvar EMPTY_OBJ = true ? Object.freeze({}) : {};\nvar EMPTY_ARR = true ? Object.freeze([]) : [];\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar hasOwn = (val, key) => hasOwnProperty.call(val, key);\nvar isArray = Array.isArray;\nvar isMap = (val) => toTypeString(val) === \"[object Map]\";\nvar isString = (val) => typeof val === \"string\";\nvar isSymbol = (val) => typeof val === \"symbol\";\nvar isObject = (val) => val !== null && typeof val === \"object\";\nvar objectToString = Object.prototype.toString;\nvar toTypeString = (value) => objectToString.call(value);\nvar toRawType = (value) => {\n  return toTypeString(value).slice(8, -1);\n};\nvar isIntegerKey = (key) => isString(key) && key !== \"NaN\" && key[0] !== \"-\" && \"\" + parseInt(key, 10) === key;\nvar cacheStringFunction = (fn) => {\n  const cache = /* @__PURE__ */ Object.create(null);\n  return (str) => {\n    const hit = cache[str];\n    return hit || (cache[str] = fn(str));\n  };\n};\nvar camelizeRE = /-(\\w)/g;\nvar camelize = cacheStringFunction((str) => {\n  return str.replace(camelizeRE, (_, c) => c ? c.toUpperCase() : \"\");\n});\nvar hyphenateRE = /\\B([A-Z])/g;\nvar hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, \"-$1\").toLowerCase());\nvar capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1));\nvar toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``);\nvar hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue);\n\n// node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js\nvar targetMap = /* @__PURE__ */ new WeakMap();\nvar effectStack = [];\nvar activeEffect;\nvar ITERATE_KEY = Symbol(true ? \"iterate\" : \"\");\nvar MAP_KEY_ITERATE_KEY = Symbol(true ? \"Map key iterate\" : \"\");\nfunction isEffect(fn) {\n  return fn && fn._isEffect === true;\n}\nfunction effect2(fn, options = EMPTY_OBJ) {\n  if (isEffect(fn)) {\n    fn = fn.raw;\n  }\n  const effect3 = createReactiveEffect(fn, options);\n  if (!options.lazy) {\n    effect3();\n  }\n  return effect3;\n}\nfunction stop(effect3) {\n  if (effect3.active) {\n    cleanup(effect3);\n    if (effect3.options.onStop) {\n      effect3.options.onStop();\n    }\n    effect3.active = false;\n  }\n}\nvar uid = 0;\nfunction createReactiveEffect(fn, options) {\n  const effect3 = function reactiveEffect() {\n    if (!effect3.active) {\n      return fn();\n    }\n    if (!effectStack.includes(effect3)) {\n      cleanup(effect3);\n      try {\n        enableTracking();\n        effectStack.push(effect3);\n        activeEffect = effect3;\n        return fn();\n      } finally {\n        effectStack.pop();\n        resetTracking();\n        activeEffect = effectStack[effectStack.length - 1];\n      }\n    }\n  };\n  effect3.id = uid++;\n  effect3.allowRecurse = !!options.allowRecurse;\n  effect3._isEffect = true;\n  effect3.active = true;\n  effect3.raw = fn;\n  effect3.deps = [];\n  effect3.options = options;\n  return effect3;\n}\nfunction cleanup(effect3) {\n  const { deps } = effect3;\n  if (deps.length) {\n    for (let i = 0; i < deps.length; i++) {\n      deps[i].delete(effect3);\n    }\n    deps.length = 0;\n  }\n}\nvar shouldTrack = true;\nvar trackStack = [];\nfunction pauseTracking() {\n  trackStack.push(shouldTrack);\n  shouldTrack = false;\n}\nfunction enableTracking() {\n  trackStack.push(shouldTrack);\n  shouldTrack = true;\n}\nfunction resetTracking() {\n  const last = trackStack.pop();\n  shouldTrack = last === void 0 ? true : last;\n}\nfunction track(target, type, key) {\n  if (!shouldTrack || activeEffect === void 0) {\n    return;\n  }\n  let depsMap = targetMap.get(target);\n  if (!depsMap) {\n    targetMap.set(target, depsMap = /* @__PURE__ */ new Map());\n  }\n  let dep = depsMap.get(key);\n  if (!dep) {\n    depsMap.set(key, dep = /* @__PURE__ */ new Set());\n  }\n  if (!dep.has(activeEffect)) {\n    dep.add(activeEffect);\n    activeEffect.deps.push(dep);\n    if (activeEffect.options.onTrack) {\n      activeEffect.options.onTrack({\n        effect: activeEffect,\n        target,\n        type,\n        key\n      });\n    }\n  }\n}\nfunction trigger(target, type, key, newValue, oldValue, oldTarget) {\n  const depsMap = targetMap.get(target);\n  if (!depsMap) {\n    return;\n  }\n  const effects = /* @__PURE__ */ new Set();\n  const add2 = (effectsToAdd) => {\n    if (effectsToAdd) {\n      effectsToAdd.forEach((effect3) => {\n        if (effect3 !== activeEffect || effect3.allowRecurse) {\n          effects.add(effect3);\n        }\n      });\n    }\n  };\n  if (type === \"clear\") {\n    depsMap.forEach(add2);\n  } else if (key === \"length\" && isArray(target)) {\n    depsMap.forEach((dep, key2) => {\n      if (key2 === \"length\" || key2 >= newValue) {\n        add2(dep);\n      }\n    });\n  } else {\n    if (key !== void 0) {\n      add2(depsMap.get(key));\n    }\n    switch (type) {\n      case \"add\":\n        if (!isArray(target)) {\n          add2(depsMap.get(ITERATE_KEY));\n          if (isMap(target)) {\n            add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n          }\n        } else if (isIntegerKey(key)) {\n          add2(depsMap.get(\"length\"));\n        }\n        break;\n      case \"delete\":\n        if (!isArray(target)) {\n          add2(depsMap.get(ITERATE_KEY));\n          if (isMap(target)) {\n            add2(depsMap.get(MAP_KEY_ITERATE_KEY));\n          }\n        }\n        break;\n      case \"set\":\n        if (isMap(target)) {\n          add2(depsMap.get(ITERATE_KEY));\n        }\n        break;\n    }\n  }\n  const run = (effect3) => {\n    if (effect3.options.onTrigger) {\n      effect3.options.onTrigger({\n        effect: effect3,\n        target,\n        key,\n        type,\n        newValue,\n        oldValue,\n        oldTarget\n      });\n    }\n    if (effect3.options.scheduler) {\n      effect3.options.scheduler(effect3);\n    } else {\n      effect3();\n    }\n  };\n  effects.forEach(run);\n}\nvar isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);\nvar builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));\nvar get2 = /* @__PURE__ */ createGetter();\nvar readonlyGet = /* @__PURE__ */ createGetter(true);\nvar arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations();\nfunction createArrayInstrumentations() {\n  const instrumentations = {};\n  [\"includes\", \"indexOf\", \"lastIndexOf\"].forEach((key) => {\n    instrumentations[key] = function(...args) {\n      const arr = toRaw(this);\n      for (let i = 0, l = this.length; i < l; i++) {\n        track(arr, \"get\", i + \"\");\n      }\n      const res = arr[key](...args);\n      if (res === -1 || res === false) {\n        return arr[key](...args.map(toRaw));\n      } else {\n        return res;\n      }\n    };\n  });\n  [\"push\", \"pop\", \"shift\", \"unshift\", \"splice\"].forEach((key) => {\n    instrumentations[key] = function(...args) {\n      pauseTracking();\n      const res = toRaw(this)[key].apply(this, args);\n      resetTracking();\n      return res;\n    };\n  });\n  return instrumentations;\n}\nfunction createGetter(isReadonly = false, shallow = false) {\n  return function get3(target, key, receiver) {\n    if (key === \"__v_isReactive\") {\n      return !isReadonly;\n    } else if (key === \"__v_isReadonly\") {\n      return isReadonly;\n    } else if (key === \"__v_raw\" && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) {\n      return target;\n    }\n    const targetIsArray = isArray(target);\n    if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) {\n      return Reflect.get(arrayInstrumentations, key, receiver);\n    }\n    const res = Reflect.get(target, key, receiver);\n    if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) {\n      return res;\n    }\n    if (!isReadonly) {\n      track(target, \"get\", key);\n    }\n    if (shallow) {\n      return res;\n    }\n    if (isRef(res)) {\n      const shouldUnwrap = !targetIsArray || !isIntegerKey(key);\n      return shouldUnwrap ? res.value : res;\n    }\n    if (isObject(res)) {\n      return isReadonly ? readonly(res) : reactive2(res);\n    }\n    return res;\n  };\n}\nvar set2 = /* @__PURE__ */ createSetter();\nfunction createSetter(shallow = false) {\n  return function set3(target, key, value, receiver) {\n    let oldValue = target[key];\n    if (!shallow) {\n      value = toRaw(value);\n      oldValue = toRaw(oldValue);\n      if (!isArray(target) && isRef(oldValue) && !isRef(value)) {\n        oldValue.value = value;\n        return true;\n      }\n    }\n    const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key);\n    const result = Reflect.set(target, key, value, receiver);\n    if (target === toRaw(receiver)) {\n      if (!hadKey) {\n        trigger(target, \"add\", key, value);\n      } else if (hasChanged(value, oldValue)) {\n        trigger(target, \"set\", key, value, oldValue);\n      }\n    }\n    return result;\n  };\n}\nfunction deleteProperty(target, key) {\n  const hadKey = hasOwn(target, key);\n  const oldValue = target[key];\n  const result = Reflect.deleteProperty(target, key);\n  if (result && hadKey) {\n    trigger(target, \"delete\", key, void 0, oldValue);\n  }\n  return result;\n}\nfunction has(target, key) {\n  const result = Reflect.has(target, key);\n  if (!isSymbol(key) || !builtInSymbols.has(key)) {\n    track(target, \"has\", key);\n  }\n  return result;\n}\nfunction ownKeys(target) {\n  track(target, \"iterate\", isArray(target) ? \"length\" : ITERATE_KEY);\n  return Reflect.ownKeys(target);\n}\nvar mutableHandlers = {\n  get: get2,\n  set: set2,\n  deleteProperty,\n  has,\n  ownKeys\n};\nvar readonlyHandlers = {\n  get: readonlyGet,\n  set(target, key) {\n    if (true) {\n      console.warn(`Set operation on key \"${String(key)}\" failed: target is readonly.`, target);\n    }\n    return true;\n  },\n  deleteProperty(target, key) {\n    if (true) {\n      console.warn(`Delete operation on key \"${String(key)}\" failed: target is readonly.`, target);\n    }\n    return true;\n  }\n};\nvar toReactive = (value) => isObject(value) ? reactive2(value) : value;\nvar toReadonly = (value) => isObject(value) ? readonly(value) : value;\nvar toShallow = (value) => value;\nvar getProto = (v) => Reflect.getPrototypeOf(v);\nfunction get$1(target, key, isReadonly = false, isShallow = false) {\n  target = target[\n    \"__v_raw\"\n    /* RAW */\n  ];\n  const rawTarget = toRaw(target);\n  const rawKey = toRaw(key);\n  if (key !== rawKey) {\n    !isReadonly && track(rawTarget, \"get\", key);\n  }\n  !isReadonly && track(rawTarget, \"get\", rawKey);\n  const { has: has2 } = getProto(rawTarget);\n  const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n  if (has2.call(rawTarget, key)) {\n    return wrap(target.get(key));\n  } else if (has2.call(rawTarget, rawKey)) {\n    return wrap(target.get(rawKey));\n  } else if (target !== rawTarget) {\n    target.get(key);\n  }\n}\nfunction has$1(key, isReadonly = false) {\n  const target = this[\n    \"__v_raw\"\n    /* RAW */\n  ];\n  const rawTarget = toRaw(target);\n  const rawKey = toRaw(key);\n  if (key !== rawKey) {\n    !isReadonly && track(rawTarget, \"has\", key);\n  }\n  !isReadonly && track(rawTarget, \"has\", rawKey);\n  return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);\n}\nfunction size(target, isReadonly = false) {\n  target = target[\n    \"__v_raw\"\n    /* RAW */\n  ];\n  !isReadonly && track(toRaw(target), \"iterate\", ITERATE_KEY);\n  return Reflect.get(target, \"size\", target);\n}\nfunction add(value) {\n  value = toRaw(value);\n  const target = toRaw(this);\n  const proto = getProto(target);\n  const hadKey = proto.has.call(target, value);\n  if (!hadKey) {\n    target.add(value);\n    trigger(target, \"add\", value, value);\n  }\n  return this;\n}\nfunction set$1(key, value) {\n  value = toRaw(value);\n  const target = toRaw(this);\n  const { has: has2, get: get3 } = getProto(target);\n  let hadKey = has2.call(target, key);\n  if (!hadKey) {\n    key = toRaw(key);\n    hadKey = has2.call(target, key);\n  } else if (true) {\n    checkIdentityKeys(target, has2, key);\n  }\n  const oldValue = get3.call(target, key);\n  target.set(key, value);\n  if (!hadKey) {\n    trigger(target, \"add\", key, value);\n  } else if (hasChanged(value, oldValue)) {\n    trigger(target, \"set\", key, value, oldValue);\n  }\n  return this;\n}\nfunction deleteEntry(key) {\n  const target = toRaw(this);\n  const { has: has2, get: get3 } = getProto(target);\n  let hadKey = has2.call(target, key);\n  if (!hadKey) {\n    key = toRaw(key);\n    hadKey = has2.call(target, key);\n  } else if (true) {\n    checkIdentityKeys(target, has2, key);\n  }\n  const oldValue = get3 ? get3.call(target, key) : void 0;\n  const result = target.delete(key);\n  if (hadKey) {\n    trigger(target, \"delete\", key, void 0, oldValue);\n  }\n  return result;\n}\nfunction clear() {\n  const target = toRaw(this);\n  const hadItems = target.size !== 0;\n  const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0;\n  const result = target.clear();\n  if (hadItems) {\n    trigger(target, \"clear\", void 0, void 0, oldTarget);\n  }\n  return result;\n}\nfunction createForEach(isReadonly, isShallow) {\n  return function forEach(callback, thisArg) {\n    const observed = this;\n    const target = observed[\n      \"__v_raw\"\n      /* RAW */\n    ];\n    const rawTarget = toRaw(target);\n    const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n    !isReadonly && track(rawTarget, \"iterate\", ITERATE_KEY);\n    return target.forEach((value, key) => {\n      return callback.call(thisArg, wrap(value), wrap(key), observed);\n    });\n  };\n}\nfunction createIterableMethod(method, isReadonly, isShallow) {\n  return function(...args) {\n    const target = this[\n      \"__v_raw\"\n      /* RAW */\n    ];\n    const rawTarget = toRaw(target);\n    const targetIsMap = isMap(rawTarget);\n    const isPair = method === \"entries\" || method === Symbol.iterator && targetIsMap;\n    const isKeyOnly = method === \"keys\" && targetIsMap;\n    const innerIterator = target[method](...args);\n    const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive;\n    !isReadonly && track(rawTarget, \"iterate\", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY);\n    return {\n      // iterator protocol\n      next() {\n        const { value, done } = innerIterator.next();\n        return done ? { value, done } : {\n          value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value),\n          done\n        };\n      },\n      // iterable protocol\n      [Symbol.iterator]() {\n        return this;\n      }\n    };\n  };\n}\nfunction createReadonlyMethod(type) {\n  return function(...args) {\n    if (true) {\n      const key = args[0] ? `on key \"${args[0]}\" ` : ``;\n      console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this));\n    }\n    return type === \"delete\" ? false : this;\n  };\n}\nfunction createInstrumentations() {\n  const mutableInstrumentations2 = {\n    get(key) {\n      return get$1(this, key);\n    },\n    get size() {\n      return size(this);\n    },\n    has: has$1,\n    add,\n    set: set$1,\n    delete: deleteEntry,\n    clear,\n    forEach: createForEach(false, false)\n  };\n  const shallowInstrumentations2 = {\n    get(key) {\n      return get$1(this, key, false, true);\n    },\n    get size() {\n      return size(this);\n    },\n    has: has$1,\n    add,\n    set: set$1,\n    delete: deleteEntry,\n    clear,\n    forEach: createForEach(false, true)\n  };\n  const readonlyInstrumentations2 = {\n    get(key) {\n      return get$1(this, key, true);\n    },\n    get size() {\n      return size(this, true);\n    },\n    has(key) {\n      return has$1.call(this, key, true);\n    },\n    add: createReadonlyMethod(\n      \"add\"\n      /* ADD */\n    ),\n    set: createReadonlyMethod(\n      \"set\"\n      /* SET */\n    ),\n    delete: createReadonlyMethod(\n      \"delete\"\n      /* DELETE */\n    ),\n    clear: createReadonlyMethod(\n      \"clear\"\n      /* CLEAR */\n    ),\n    forEach: createForEach(true, false)\n  };\n  const shallowReadonlyInstrumentations2 = {\n    get(key) {\n      return get$1(this, key, true, true);\n    },\n    get size() {\n      return size(this, true);\n    },\n    has(key) {\n      return has$1.call(this, key, true);\n    },\n    add: createReadonlyMethod(\n      \"add\"\n      /* ADD */\n    ),\n    set: createReadonlyMethod(\n      \"set\"\n      /* SET */\n    ),\n    delete: createReadonlyMethod(\n      \"delete\"\n      /* DELETE */\n    ),\n    clear: createReadonlyMethod(\n      \"clear\"\n      /* CLEAR */\n    ),\n    forEach: createForEach(true, true)\n  };\n  const iteratorMethods = [\"keys\", \"values\", \"entries\", Symbol.iterator];\n  iteratorMethods.forEach((method) => {\n    mutableInstrumentations2[method] = createIterableMethod(method, false, false);\n    readonlyInstrumentations2[method] = createIterableMethod(method, true, false);\n    shallowInstrumentations2[method] = createIterableMethod(method, false, true);\n    shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true);\n  });\n  return [\n    mutableInstrumentations2,\n    readonlyInstrumentations2,\n    shallowInstrumentations2,\n    shallowReadonlyInstrumentations2\n  ];\n}\nvar [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations();\nfunction createInstrumentationGetter(isReadonly, shallow) {\n  const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations;\n  return (target, key, receiver) => {\n    if (key === \"__v_isReactive\") {\n      return !isReadonly;\n    } else if (key === \"__v_isReadonly\") {\n      return isReadonly;\n    } else if (key === \"__v_raw\") {\n      return target;\n    }\n    return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver);\n  };\n}\nvar mutableCollectionHandlers = {\n  get: /* @__PURE__ */ createInstrumentationGetter(false, false)\n};\nvar readonlyCollectionHandlers = {\n  get: /* @__PURE__ */ createInstrumentationGetter(true, false)\n};\nfunction checkIdentityKeys(target, has2, key) {\n  const rawKey = toRaw(key);\n  if (rawKey !== key && has2.call(target, rawKey)) {\n    const type = toRawType(target);\n    console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`);\n  }\n}\nvar reactiveMap = /* @__PURE__ */ new WeakMap();\nvar shallowReactiveMap = /* @__PURE__ */ new WeakMap();\nvar readonlyMap = /* @__PURE__ */ new WeakMap();\nvar shallowReadonlyMap = /* @__PURE__ */ new WeakMap();\nfunction targetTypeMap(rawType) {\n  switch (rawType) {\n    case \"Object\":\n    case \"Array\":\n      return 1;\n    case \"Map\":\n    case \"Set\":\n    case \"WeakMap\":\n    case \"WeakSet\":\n      return 2;\n    default:\n      return 0;\n  }\n}\nfunction getTargetType(value) {\n  return value[\n    \"__v_skip\"\n    /* SKIP */\n  ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value));\n}\nfunction reactive2(target) {\n  if (target && target[\n    \"__v_isReadonly\"\n    /* IS_READONLY */\n  ]) {\n    return target;\n  }\n  return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap);\n}\nfunction readonly(target) {\n  return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap);\n}\nfunction createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) {\n  if (!isObject(target)) {\n    if (true) {\n      console.warn(`value cannot be made reactive: ${String(target)}`);\n    }\n    return target;\n  }\n  if (target[\n    \"__v_raw\"\n    /* RAW */\n  ] && !(isReadonly && target[\n    \"__v_isReactive\"\n    /* IS_REACTIVE */\n  ])) {\n    return target;\n  }\n  const existingProxy = proxyMap.get(target);\n  if (existingProxy) {\n    return existingProxy;\n  }\n  const targetType = getTargetType(target);\n  if (targetType === 0) {\n    return target;\n  }\n  const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers);\n  proxyMap.set(target, proxy);\n  return proxy;\n}\nfunction toRaw(observed) {\n  return observed && toRaw(observed[\n    \"__v_raw\"\n    /* RAW */\n  ]) || observed;\n}\nfunction isRef(r) {\n  return Boolean(r && r.__v_isRef === true);\n}\n\n// packages/alpinejs/src/magics/$nextTick.js\nmagic(\"nextTick\", () => nextTick);\n\n// packages/alpinejs/src/magics/$dispatch.js\nmagic(\"dispatch\", (el) => dispatch.bind(dispatch, el));\n\n// packages/alpinejs/src/magics/$watch.js\nmagic(\"watch\", (el, { evaluateLater: evaluateLater2, effect: effect3 }) => (key, callback) => {\n  let evaluate2 = evaluateLater2(key);\n  let firstTime = true;\n  let oldValue;\n  let effectReference = effect3(() => evaluate2((value) => {\n    JSON.stringify(value);\n    if (!firstTime) {\n      queueMicrotask(() => {\n        callback(value, oldValue);\n        oldValue = value;\n      });\n    } else {\n      oldValue = value;\n    }\n    firstTime = false;\n  }));\n  el._x_effects.delete(effectReference);\n});\n\n// packages/alpinejs/src/magics/$store.js\nmagic(\"store\", getStores);\n\n// packages/alpinejs/src/magics/$data.js\nmagic(\"data\", (el) => scope(el));\n\n// packages/alpinejs/src/magics/$root.js\nmagic(\"root\", (el) => closestRoot(el));\n\n// packages/alpinejs/src/magics/$refs.js\nmagic(\"refs\", (el) => {\n  if (el._x_refs_proxy)\n    return el._x_refs_proxy;\n  el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el));\n  return el._x_refs_proxy;\n});\nfunction getArrayOfRefObject(el) {\n  let refObjects = [];\n  let currentEl = el;\n  while (currentEl) {\n    if (currentEl._x_refs)\n      refObjects.push(currentEl._x_refs);\n    currentEl = currentEl.parentNode;\n  }\n  return refObjects;\n}\n\n// packages/alpinejs/src/ids.js\nvar globalIdMemo = {};\nfunction findAndIncrementId(name) {\n  if (!globalIdMemo[name])\n    globalIdMemo[name] = 0;\n  return ++globalIdMemo[name];\n}\nfunction closestIdRoot(el, name) {\n  return findClosest(el, (element) => {\n    if (element._x_ids && element._x_ids[name])\n      return true;\n  });\n}\nfunction setIdRoot(el, name) {\n  if (!el._x_ids)\n    el._x_ids = {};\n  if (!el._x_ids[name])\n    el._x_ids[name] = findAndIncrementId(name);\n}\n\n// packages/alpinejs/src/magics/$id.js\nmagic(\"id\", (el) => (name, key = null) => {\n  let root = closestIdRoot(el, name);\n  let id = root ? root._x_ids[name] : findAndIncrementId(name);\n  return key ? `${name}-${id}-${key}` : `${name}-${id}`;\n});\n\n// packages/alpinejs/src/magics/$el.js\nmagic(\"el\", (el) => el);\n\n// packages/alpinejs/src/magics/index.js\nwarnMissingPluginMagic(\"Focus\", \"focus\", \"focus\");\nwarnMissingPluginMagic(\"Persist\", \"persist\", \"persist\");\nfunction warnMissingPluginMagic(name, magicName, slug) {\n  magic(magicName, (el) => warn(`You can't use [$${magicName}] without first installing the \"${name}\" plugin here: https://alpinejs.dev/plugins/${slug}`, el));\n}\n\n// packages/alpinejs/src/directives/x-modelable.js\ndirective(\"modelable\", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2, cleanup: cleanup2 }) => {\n  let func = evaluateLater2(expression);\n  let innerGet = () => {\n    let result;\n    func((i) => result = i);\n    return result;\n  };\n  let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`);\n  let innerSet = (val) => evaluateInnerSet(() => {\n  }, { scope: { \"__placeholder\": val } });\n  let initialValue = innerGet();\n  innerSet(initialValue);\n  queueMicrotask(() => {\n    if (!el._x_model)\n      return;\n    el._x_removeModelListeners[\"default\"]();\n    let outerGet = el._x_model.get;\n    let outerSet = el._x_model.set;\n    let releaseEntanglement = entangle(\n      {\n        get() {\n          return outerGet();\n        },\n        set(value) {\n          outerSet(value);\n        }\n      },\n      {\n        get() {\n          return innerGet();\n        },\n        set(value) {\n          innerSet(value);\n        }\n      }\n    );\n    cleanup2(releaseEntanglement);\n  });\n});\n\n// packages/alpinejs/src/directives/x-teleport.js\ndirective(\"teleport\", (el, { modifiers, expression }, { cleanup: cleanup2 }) => {\n  if (el.tagName.toLowerCase() !== \"template\")\n    warn(\"x-teleport can only be used on a <template> tag\", el);\n  let target = getTarget(expression);\n  let clone2 = el.content.cloneNode(true).firstElementChild;\n  el._x_teleport = clone2;\n  clone2._x_teleportBack = el;\n  el.setAttribute(\"data-teleport-template\", true);\n  clone2.setAttribute(\"data-teleport-target\", true);\n  if (el._x_forwardEvents) {\n    el._x_forwardEvents.forEach((eventName) => {\n      clone2.addEventListener(eventName, (e) => {\n        e.stopPropagation();\n        el.dispatchEvent(new e.constructor(e.type, e));\n      });\n    });\n  }\n  addScopeToNode(clone2, {}, el);\n  let placeInDom = (clone3, target2, modifiers2) => {\n    if (modifiers2.includes(\"prepend\")) {\n      target2.parentNode.insertBefore(clone3, target2);\n    } else if (modifiers2.includes(\"append\")) {\n      target2.parentNode.insertBefore(clone3, target2.nextSibling);\n    } else {\n      target2.appendChild(clone3);\n    }\n  };\n  mutateDom(() => {\n    placeInDom(clone2, target, modifiers);\n    initTree(clone2);\n    clone2._x_ignore = true;\n  });\n  el._x_teleportPutBack = () => {\n    let target2 = getTarget(expression);\n    mutateDom(() => {\n      placeInDom(el._x_teleport, target2, modifiers);\n    });\n  };\n  cleanup2(() => clone2.remove());\n});\nvar teleportContainerDuringClone = document.createElement(\"div\");\nfunction getTarget(expression) {\n  let target = skipDuringClone(() => {\n    return document.querySelector(expression);\n  }, () => {\n    return teleportContainerDuringClone;\n  })();\n  if (!target)\n    warn(`Cannot find x-teleport element for selector: \"${expression}\"`);\n  return target;\n}\n\n// packages/alpinejs/src/directives/x-ignore.js\nvar handler = () => {\n};\nhandler.inline = (el, { modifiers }, { cleanup: cleanup2 }) => {\n  modifiers.includes(\"self\") ? el._x_ignoreSelf = true : el._x_ignore = true;\n  cleanup2(() => {\n    modifiers.includes(\"self\") ? delete el._x_ignoreSelf : delete el._x_ignore;\n  });\n};\ndirective(\"ignore\", handler);\n\n// packages/alpinejs/src/directives/x-effect.js\ndirective(\"effect\", (el, { expression }, { effect: effect3 }) => effect3(evaluateLater(el, expression)));\n\n// packages/alpinejs/src/utils/on.js\nfunction on(el, event, modifiers, callback) {\n  let listenerTarget = el;\n  let handler4 = (e) => callback(e);\n  let options = {};\n  let wrapHandler = (callback2, wrapper) => (e) => wrapper(callback2, e);\n  if (modifiers.includes(\"dot\"))\n    event = dotSyntax(event);\n  if (modifiers.includes(\"camel\"))\n    event = camelCase2(event);\n  if (modifiers.includes(\"passive\"))\n    options.passive = true;\n  if (modifiers.includes(\"capture\"))\n    options.capture = true;\n  if (modifiers.includes(\"window\"))\n    listenerTarget = window;\n  if (modifiers.includes(\"document\"))\n    listenerTarget = document;\n  if (modifiers.includes(\"debounce\")) {\n    let nextModifier = modifiers[modifiers.indexOf(\"debounce\") + 1] || \"invalid-wait\";\n    let wait = isNumeric(nextModifier.split(\"ms\")[0]) ? Number(nextModifier.split(\"ms\")[0]) : 250;\n    handler4 = debounce(handler4, wait);\n  }\n  if (modifiers.includes(\"throttle\")) {\n    let nextModifier = modifiers[modifiers.indexOf(\"throttle\") + 1] || \"invalid-wait\";\n    let wait = isNumeric(nextModifier.split(\"ms\")[0]) ? Number(nextModifier.split(\"ms\")[0]) : 250;\n    handler4 = throttle(handler4, wait);\n  }\n  if (modifiers.includes(\"prevent\"))\n    handler4 = wrapHandler(handler4, (next, e) => {\n      e.preventDefault();\n      next(e);\n    });\n  if (modifiers.includes(\"stop\"))\n    handler4 = wrapHandler(handler4, (next, e) => {\n      e.stopPropagation();\n      next(e);\n    });\n  if (modifiers.includes(\"self\"))\n    handler4 = wrapHandler(handler4, (next, e) => {\n      e.target === el && next(e);\n    });\n  if (modifiers.includes(\"away\") || modifiers.includes(\"outside\")) {\n    listenerTarget = document;\n    handler4 = wrapHandler(handler4, (next, e) => {\n      if (el.contains(e.target))\n        return;\n      if (e.target.isConnected === false)\n        return;\n      if (el.offsetWidth < 1 && el.offsetHeight < 1)\n        return;\n      if (el._x_isShown === false)\n        return;\n      next(e);\n    });\n  }\n  if (modifiers.includes(\"once\")) {\n    handler4 = wrapHandler(handler4, (next, e) => {\n      next(e);\n      listenerTarget.removeEventListener(event, handler4, options);\n    });\n  }\n  handler4 = wrapHandler(handler4, (next, e) => {\n    if (isKeyEvent(event)) {\n      if (isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers)) {\n        return;\n      }\n    }\n    next(e);\n  });\n  listenerTarget.addEventListener(event, handler4, options);\n  return () => {\n    listenerTarget.removeEventListener(event, handler4, options);\n  };\n}\nfunction dotSyntax(subject) {\n  return subject.replace(/-/g, \".\");\n}\nfunction camelCase2(subject) {\n  return subject.toLowerCase().replace(/-(\\w)/g, (match, char) => char.toUpperCase());\n}\nfunction isNumeric(subject) {\n  return !Array.isArray(subject) && !isNaN(subject);\n}\nfunction kebabCase2(subject) {\n  if ([\" \", \"_\"].includes(\n    subject\n  ))\n    return subject;\n  return subject.replace(/([a-z])([A-Z])/g, \"$1-$2\").replace(/[_\\s]/, \"-\").toLowerCase();\n}\nfunction isKeyEvent(event) {\n  return [\"keydown\", \"keyup\"].includes(event);\n}\nfunction isListeningForASpecificKeyThatHasntBeenPressed(e, modifiers) {\n  let keyModifiers = modifiers.filter((i) => {\n    return ![\"window\", \"document\", \"prevent\", \"stop\", \"once\", \"capture\"].includes(i);\n  });\n  if (keyModifiers.includes(\"debounce\")) {\n    let debounceIndex = keyModifiers.indexOf(\"debounce\");\n    keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || \"invalid-wait\").split(\"ms\")[0]) ? 2 : 1);\n  }\n  if (keyModifiers.includes(\"throttle\")) {\n    let debounceIndex = keyModifiers.indexOf(\"throttle\");\n    keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || \"invalid-wait\").split(\"ms\")[0]) ? 2 : 1);\n  }\n  if (keyModifiers.length === 0)\n    return false;\n  if (keyModifiers.length === 1 && keyToModifiers(e.key).includes(keyModifiers[0]))\n    return false;\n  const systemKeyModifiers = [\"ctrl\", \"shift\", \"alt\", \"meta\", \"cmd\", \"super\"];\n  const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier));\n  keyModifiers = keyModifiers.filter((i) => !selectedSystemKeyModifiers.includes(i));\n  if (selectedSystemKeyModifiers.length > 0) {\n    const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => {\n      if (modifier === \"cmd\" || modifier === \"super\")\n        modifier = \"meta\";\n      return e[`${modifier}Key`];\n    });\n    if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) {\n      if (keyToModifiers(e.key).includes(keyModifiers[0]))\n        return false;\n    }\n  }\n  return true;\n}\nfunction keyToModifiers(key) {\n  if (!key)\n    return [];\n  key = kebabCase2(key);\n  let modifierToKeyMap = {\n    \"ctrl\": \"control\",\n    \"slash\": \"/\",\n    \"space\": \" \",\n    \"spacebar\": \" \",\n    \"cmd\": \"meta\",\n    \"esc\": \"escape\",\n    \"up\": \"arrow-up\",\n    \"down\": \"arrow-down\",\n    \"left\": \"arrow-left\",\n    \"right\": \"arrow-right\",\n    \"period\": \".\",\n    \"equal\": \"=\",\n    \"minus\": \"-\",\n    \"underscore\": \"_\"\n  };\n  modifierToKeyMap[key] = key;\n  return Object.keys(modifierToKeyMap).map((modifier) => {\n    if (modifierToKeyMap[modifier] === key)\n      return modifier;\n  }).filter((modifier) => modifier);\n}\n\n// packages/alpinejs/src/directives/x-model.js\ndirective(\"model\", (el, { modifiers, expression }, { effect: effect3, cleanup: cleanup2 }) => {\n  let scopeTarget = el;\n  if (modifiers.includes(\"parent\")) {\n    scopeTarget = el.parentNode;\n  }\n  let evaluateGet = evaluateLater(scopeTarget, expression);\n  let evaluateSet;\n  if (typeof expression === \"string\") {\n    evaluateSet = evaluateLater(scopeTarget, `${expression} = __placeholder`);\n  } else if (typeof expression === \"function\" && typeof expression() === \"string\") {\n    evaluateSet = evaluateLater(scopeTarget, `${expression()} = __placeholder`);\n  } else {\n    evaluateSet = () => {\n    };\n  }\n  let getValue = () => {\n    let result;\n    evaluateGet((value) => result = value);\n    return isGetterSetter(result) ? result.get() : result;\n  };\n  let setValue = (value) => {\n    let result;\n    evaluateGet((value2) => result = value2);\n    if (isGetterSetter(result)) {\n      result.set(value);\n    } else {\n      evaluateSet(() => {\n      }, {\n        scope: { \"__placeholder\": value }\n      });\n    }\n  };\n  if (typeof expression === \"string\" && el.type === \"radio\") {\n    mutateDom(() => {\n      if (!el.hasAttribute(\"name\"))\n        el.setAttribute(\"name\", expression);\n    });\n  }\n  var event = el.tagName.toLowerCase() === \"select\" || [\"checkbox\", \"radio\"].includes(el.type) || modifiers.includes(\"lazy\") ? \"change\" : \"input\";\n  let removeListener = isCloning ? () => {\n  } : on(el, event, modifiers, (e) => {\n    setValue(getInputValue(el, modifiers, e, getValue()));\n  });\n  if (modifiers.includes(\"fill\")) {\n    if ([null, \"\"].includes(getValue()) || el.type === \"checkbox\" && Array.isArray(getValue())) {\n      el.dispatchEvent(new Event(event, {}));\n    }\n  }\n  if (!el._x_removeModelListeners)\n    el._x_removeModelListeners = {};\n  el._x_removeModelListeners[\"default\"] = removeListener;\n  cleanup2(() => el._x_removeModelListeners[\"default\"]());\n  if (el.form) {\n    let removeResetListener = on(el.form, \"reset\", [], (e) => {\n      nextTick(() => el._x_model && el._x_model.set(el.value));\n    });\n    cleanup2(() => removeResetListener());\n  }\n  el._x_model = {\n    get() {\n      return getValue();\n    },\n    set(value) {\n      setValue(value);\n    }\n  };\n  el._x_forceModelUpdate = (value) => {\n    if (value === void 0 && typeof expression === \"string\" && expression.match(/\\./))\n      value = \"\";\n    window.fromModel = true;\n    mutateDom(() => bind(el, \"value\", value));\n    delete window.fromModel;\n  };\n  effect3(() => {\n    let value = getValue();\n    if (modifiers.includes(\"unintrusive\") && document.activeElement.isSameNode(el))\n      return;\n    el._x_forceModelUpdate(value);\n  });\n});\nfunction getInputValue(el, modifiers, event, currentValue) {\n  return mutateDom(() => {\n    if (event instanceof CustomEvent && event.detail !== void 0)\n      return event.detail !== null && event.detail !== void 0 ? event.detail : event.target.value;\n    else if (el.type === \"checkbox\") {\n      if (Array.isArray(currentValue)) {\n        let newValue = modifiers.includes(\"number\") ? safeParseNumber(event.target.value) : event.target.value;\n        return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue));\n      } else {\n        return event.target.checked;\n      }\n    } else if (el.tagName.toLowerCase() === \"select\" && el.multiple) {\n      return modifiers.includes(\"number\") ? Array.from(event.target.selectedOptions).map((option) => {\n        let rawValue = option.value || option.text;\n        return safeParseNumber(rawValue);\n      }) : Array.from(event.target.selectedOptions).map((option) => {\n        return option.value || option.text;\n      });\n    } else {\n      let rawValue = event.target.value;\n      return modifiers.includes(\"number\") ? safeParseNumber(rawValue) : modifiers.includes(\"trim\") ? rawValue.trim() : rawValue;\n    }\n  });\n}\nfunction safeParseNumber(rawValue) {\n  let number = rawValue ? parseFloat(rawValue) : null;\n  return isNumeric2(number) ? number : rawValue;\n}\nfunction checkedAttrLooseCompare2(valueA, valueB) {\n  return valueA == valueB;\n}\nfunction isNumeric2(subject) {\n  return !Array.isArray(subject) && !isNaN(subject);\n}\nfunction isGetterSetter(value) {\n  return value !== null && typeof value === \"object\" && typeof value.get === \"function\" && typeof value.set === \"function\";\n}\n\n// packages/alpinejs/src/directives/x-cloak.js\ndirective(\"cloak\", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix(\"cloak\")))));\n\n// packages/alpinejs/src/directives/x-init.js\naddInitSelector(() => `[${prefix(\"init\")}]`);\ndirective(\"init\", skipDuringClone((el, { expression }, { evaluate: evaluate2 }) => {\n  if (typeof expression === \"string\") {\n    return !!expression.trim() && evaluate2(expression, {}, false);\n  }\n  return evaluate2(expression, {}, false);\n}));\n\n// packages/alpinejs/src/directives/x-text.js\ndirective(\"text\", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => {\n  let evaluate2 = evaluateLater2(expression);\n  effect3(() => {\n    evaluate2((value) => {\n      mutateDom(() => {\n        el.textContent = value;\n      });\n    });\n  });\n});\n\n// packages/alpinejs/src/directives/x-html.js\ndirective(\"html\", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => {\n  let evaluate2 = evaluateLater2(expression);\n  effect3(() => {\n    evaluate2((value) => {\n      mutateDom(() => {\n        el.innerHTML = value;\n        el._x_ignoreSelf = true;\n        initTree(el);\n        delete el._x_ignoreSelf;\n      });\n    });\n  });\n});\n\n// packages/alpinejs/src/directives/x-bind.js\nmapAttributes(startingWith(\":\", into(prefix(\"bind:\"))));\nvar handler2 = (el, { value, modifiers, expression, original }, { effect: effect3 }) => {\n  if (!value) {\n    let bindingProviders = {};\n    injectBindingProviders(bindingProviders);\n    let getBindings = evaluateLater(el, expression);\n    getBindings((bindings) => {\n      applyBindingsObject(el, bindings, original);\n    }, { scope: bindingProviders });\n    return;\n  }\n  if (value === \"key\")\n    return storeKeyForXFor(el, expression);\n  if (el._x_inlineBindings && el._x_inlineBindings[value] && el._x_inlineBindings[value].extract) {\n    return;\n  }\n  let evaluate2 = evaluateLater(el, expression);\n  effect3(() => evaluate2((result) => {\n    if (result === void 0 && typeof expression === \"string\" && expression.match(/\\./)) {\n      result = \"\";\n    }\n    mutateDom(() => bind(el, value, result, modifiers));\n  }));\n};\nhandler2.inline = (el, { value, modifiers, expression }) => {\n  if (!value)\n    return;\n  if (!el._x_inlineBindings)\n    el._x_inlineBindings = {};\n  el._x_inlineBindings[value] = { expression, extract: false };\n};\ndirective(\"bind\", handler2);\nfunction storeKeyForXFor(el, expression) {\n  el._x_keyExpression = expression;\n}\n\n// packages/alpinejs/src/directives/x-data.js\naddRootSelector(() => `[${prefix(\"data\")}]`);\ndirective(\"data\", (el, { expression }, { cleanup: cleanup2 }) => {\n  if (shouldSkipRegisteringDataDuringClone(el))\n    return;\n  expression = expression === \"\" ? \"{}\" : expression;\n  let magicContext = {};\n  injectMagics(magicContext, el);\n  let dataProviderContext = {};\n  injectDataProviders(dataProviderContext, magicContext);\n  let data2 = evaluate(el, expression, { scope: dataProviderContext });\n  if (data2 === void 0 || data2 === true)\n    data2 = {};\n  injectMagics(data2, el);\n  let reactiveData = reactive(data2);\n  initInterceptors2(reactiveData);\n  let undo = addScopeToNode(el, reactiveData);\n  reactiveData[\"init\"] && evaluate(el, reactiveData[\"init\"]);\n  cleanup2(() => {\n    reactiveData[\"destroy\"] && evaluate(el, reactiveData[\"destroy\"]);\n    undo();\n  });\n});\n\n// packages/alpinejs/src/directives/x-show.js\ndirective(\"show\", (el, { modifiers, expression }, { effect: effect3 }) => {\n  let evaluate2 = evaluateLater(el, expression);\n  if (!el._x_doHide)\n    el._x_doHide = () => {\n      mutateDom(() => {\n        el.style.setProperty(\"display\", \"none\", modifiers.includes(\"important\") ? \"important\" : void 0);\n      });\n    };\n  if (!el._x_doShow)\n    el._x_doShow = () => {\n      mutateDom(() => {\n        if (el.style.length === 1 && el.style.display === \"none\") {\n          el.removeAttribute(\"style\");\n        } else {\n          el.style.removeProperty(\"display\");\n        }\n      });\n    };\n  let hide = () => {\n    el._x_doHide();\n    el._x_isShown = false;\n  };\n  let show = () => {\n    el._x_doShow();\n    el._x_isShown = true;\n  };\n  let clickAwayCompatibleShow = () => setTimeout(show);\n  let toggle = once(\n    (value) => value ? show() : hide(),\n    (value) => {\n      if (typeof el._x_toggleAndCascadeWithTransitions === \"function\") {\n        el._x_toggleAndCascadeWithTransitions(el, value, show, hide);\n      } else {\n        value ? clickAwayCompatibleShow() : hide();\n      }\n    }\n  );\n  let oldValue;\n  let firstTime = true;\n  effect3(() => evaluate2((value) => {\n    if (!firstTime && value === oldValue)\n      return;\n    if (modifiers.includes(\"immediate\"))\n      value ? clickAwayCompatibleShow() : hide();\n    toggle(value);\n    oldValue = value;\n    firstTime = false;\n  }));\n});\n\n// packages/alpinejs/src/directives/x-for.js\ndirective(\"for\", (el, { expression }, { effect: effect3, cleanup: cleanup2 }) => {\n  let iteratorNames = parseForExpression(expression);\n  let evaluateItems = evaluateLater(el, iteratorNames.items);\n  let evaluateKey = evaluateLater(\n    el,\n    // the x-bind:key expression is stored for our use instead of evaluated.\n    el._x_keyExpression || \"index\"\n  );\n  el._x_prevKeys = [];\n  el._x_lookup = {};\n  effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey));\n  cleanup2(() => {\n    Object.values(el._x_lookup).forEach((el2) => el2.remove());\n    delete el._x_prevKeys;\n    delete el._x_lookup;\n  });\n});\nfunction loop(el, iteratorNames, evaluateItems, evaluateKey) {\n  let isObject2 = (i) => typeof i === \"object\" && !Array.isArray(i);\n  let templateEl = el;\n  evaluateItems((items) => {\n    if (isNumeric3(items) && items >= 0) {\n      items = Array.from(Array(items).keys(), (i) => i + 1);\n    }\n    if (items === void 0)\n      items = [];\n    let lookup = el._x_lookup;\n    let prevKeys = el._x_prevKeys;\n    let scopes = [];\n    let keys = [];\n    if (isObject2(items)) {\n      items = Object.entries(items).map(([key, value]) => {\n        let scope2 = getIterationScopeVariables(iteratorNames, value, key, items);\n        evaluateKey((value2) => keys.push(value2), { scope: { index: key, ...scope2 } });\n        scopes.push(scope2);\n      });\n    } else {\n      for (let i = 0; i < items.length; i++) {\n        let scope2 = getIterationScopeVariables(iteratorNames, items[i], i, items);\n        evaluateKey((value) => keys.push(value), { scope: { index: i, ...scope2 } });\n        scopes.push(scope2);\n      }\n    }\n    let adds = [];\n    let moves = [];\n    let removes = [];\n    let sames = [];\n    for (let i = 0; i < prevKeys.length; i++) {\n      let key = prevKeys[i];\n      if (keys.indexOf(key) === -1)\n        removes.push(key);\n    }\n    prevKeys = prevKeys.filter((key) => !removes.includes(key));\n    let lastKey = \"template\";\n    for (let i = 0; i < keys.length; i++) {\n      let key = keys[i];\n      let prevIndex = prevKeys.indexOf(key);\n      if (prevIndex === -1) {\n        prevKeys.splice(i, 0, key);\n        adds.push([lastKey, i]);\n      } else if (prevIndex !== i) {\n        let keyInSpot = prevKeys.splice(i, 1)[0];\n        let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0];\n        prevKeys.splice(i, 0, keyForSpot);\n        prevKeys.splice(prevIndex, 0, keyInSpot);\n        moves.push([keyInSpot, keyForSpot]);\n      } else {\n        sames.push(key);\n      }\n      lastKey = key;\n    }\n    for (let i = 0; i < removes.length; i++) {\n      let key = removes[i];\n      if (!!lookup[key]._x_effects) {\n        lookup[key]._x_effects.forEach(dequeueJob);\n      }\n      lookup[key].remove();\n      lookup[key] = null;\n      delete lookup[key];\n    }\n    for (let i = 0; i < moves.length; i++) {\n      let [keyInSpot, keyForSpot] = moves[i];\n      let elInSpot = lookup[keyInSpot];\n      let elForSpot = lookup[keyForSpot];\n      let marker = document.createElement(\"div\");\n      mutateDom(() => {\n        if (!elForSpot)\n          warn(`x-for \":key\" is undefined or invalid`, templateEl);\n        elForSpot.after(marker);\n        elInSpot.after(elForSpot);\n        elForSpot._x_currentIfEl && elForSpot.after(elForSpot._x_currentIfEl);\n        marker.before(elInSpot);\n        elInSpot._x_currentIfEl && elInSpot.after(elInSpot._x_currentIfEl);\n        marker.remove();\n      });\n      elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)]);\n    }\n    for (let i = 0; i < adds.length; i++) {\n      let [lastKey2, index] = adds[i];\n      let lastEl = lastKey2 === \"template\" ? templateEl : lookup[lastKey2];\n      if (lastEl._x_currentIfEl)\n        lastEl = lastEl._x_currentIfEl;\n      let scope2 = scopes[index];\n      let key = keys[index];\n      let clone2 = document.importNode(templateEl.content, true).firstElementChild;\n      let reactiveScope = reactive(scope2);\n      addScopeToNode(clone2, reactiveScope, templateEl);\n      clone2._x_refreshXForScope = (newScope) => {\n        Object.entries(newScope).forEach(([key2, value]) => {\n          reactiveScope[key2] = value;\n        });\n      };\n      mutateDom(() => {\n        lastEl.after(clone2);\n        initTree(clone2);\n      });\n      if (typeof key === \"object\") {\n        warn(\"x-for key cannot be an object, it must be a string or an integer\", templateEl);\n      }\n      lookup[key] = clone2;\n    }\n    for (let i = 0; i < sames.length; i++) {\n      lookup[sames[i]]._x_refreshXForScope(scopes[keys.indexOf(sames[i])]);\n    }\n    templateEl._x_prevKeys = keys;\n  });\n}\nfunction parseForExpression(expression) {\n  let forIteratorRE = /,([^,\\}\\]]*)(?:,([^,\\}\\]]*))?$/;\n  let stripParensRE = /^\\s*\\(|\\)\\s*$/g;\n  let forAliasRE = /([\\s\\S]*?)\\s+(?:in|of)\\s+([\\s\\S]*)/;\n  let inMatch = expression.match(forAliasRE);\n  if (!inMatch)\n    return;\n  let res = {};\n  res.items = inMatch[2].trim();\n  let item = inMatch[1].replace(stripParensRE, \"\").trim();\n  let iteratorMatch = item.match(forIteratorRE);\n  if (iteratorMatch) {\n    res.item = item.replace(forIteratorRE, \"\").trim();\n    res.index = iteratorMatch[1].trim();\n    if (iteratorMatch[2]) {\n      res.collection = iteratorMatch[2].trim();\n    }\n  } else {\n    res.item = item;\n  }\n  return res;\n}\nfunction getIterationScopeVariables(iteratorNames, item, index, items) {\n  let scopeVariables = {};\n  if (/^\\[.*\\]$/.test(iteratorNames.item) && Array.isArray(item)) {\n    let names = iteratorNames.item.replace(\"[\", \"\").replace(\"]\", \"\").split(\",\").map((i) => i.trim());\n    names.forEach((name, i) => {\n      scopeVariables[name] = item[i];\n    });\n  } else if (/^\\{.*\\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === \"object\") {\n    let names = iteratorNames.item.replace(\"{\", \"\").replace(\"}\", \"\").split(\",\").map((i) => i.trim());\n    names.forEach((name) => {\n      scopeVariables[name] = item[name];\n    });\n  } else {\n    scopeVariables[iteratorNames.item] = item;\n  }\n  if (iteratorNames.index)\n    scopeVariables[iteratorNames.index] = index;\n  if (iteratorNames.collection)\n    scopeVariables[iteratorNames.collection] = items;\n  return scopeVariables;\n}\nfunction isNumeric3(subject) {\n  return !Array.isArray(subject) && !isNaN(subject);\n}\n\n// packages/alpinejs/src/directives/x-ref.js\nfunction handler3() {\n}\nhandler3.inline = (el, { expression }, { cleanup: cleanup2 }) => {\n  let root = closestRoot(el);\n  if (!root._x_refs)\n    root._x_refs = {};\n  root._x_refs[expression] = el;\n  cleanup2(() => delete root._x_refs[expression]);\n};\ndirective(\"ref\", handler3);\n\n// packages/alpinejs/src/directives/x-if.js\ndirective(\"if\", (el, { expression }, { effect: effect3, cleanup: cleanup2 }) => {\n  if (el.tagName.toLowerCase() !== \"template\")\n    warn(\"x-if can only be used on a <template> tag\", el);\n  let evaluate2 = evaluateLater(el, expression);\n  let show = () => {\n    if (el._x_currentIfEl)\n      return el._x_currentIfEl;\n    let clone2 = el.content.cloneNode(true).firstElementChild;\n    addScopeToNode(clone2, {}, el);\n    mutateDom(() => {\n      el.after(clone2);\n      initTree(clone2);\n    });\n    el._x_currentIfEl = clone2;\n    el._x_undoIf = () => {\n      walk(clone2, (node) => {\n        if (!!node._x_effects) {\n          node._x_effects.forEach(dequeueJob);\n        }\n      });\n      clone2.remove();\n      delete el._x_currentIfEl;\n    };\n    return clone2;\n  };\n  let hide = () => {\n    if (!el._x_undoIf)\n      return;\n    el._x_undoIf();\n    delete el._x_undoIf;\n  };\n  effect3(() => evaluate2((value) => {\n    value ? show() : hide();\n  }));\n  cleanup2(() => el._x_undoIf && el._x_undoIf());\n});\n\n// packages/alpinejs/src/directives/x-id.js\ndirective(\"id\", (el, { expression }, { evaluate: evaluate2 }) => {\n  let names = evaluate2(expression);\n  names.forEach((name) => setIdRoot(el, name));\n});\n\n// packages/alpinejs/src/directives/x-on.js\nmapAttributes(startingWith(\"@\", into(prefix(\"on:\"))));\ndirective(\"on\", skipDuringClone((el, { value, modifiers, expression }, { cleanup: cleanup2 }) => {\n  let evaluate2 = expression ? evaluateLater(el, expression) : () => {\n  };\n  if (el.tagName.toLowerCase() === \"template\") {\n    if (!el._x_forwardEvents)\n      el._x_forwardEvents = [];\n    if (!el._x_forwardEvents.includes(value))\n      el._x_forwardEvents.push(value);\n  }\n  let removeListener = on(el, value, modifiers, (e) => {\n    evaluate2(() => {\n    }, { scope: { \"$event\": e }, params: [e] });\n  });\n  cleanup2(() => removeListener());\n}));\n\n// packages/alpinejs/src/directives/index.js\nwarnMissingPluginDirective(\"Collapse\", \"collapse\", \"collapse\");\nwarnMissingPluginDirective(\"Intersect\", \"intersect\", \"intersect\");\nwarnMissingPluginDirective(\"Focus\", \"trap\", \"focus\");\nwarnMissingPluginDirective(\"Mask\", \"mask\", \"mask\");\nfunction warnMissingPluginDirective(name, directiveName, slug) {\n  directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the \"${name}\" plugin here: https://alpinejs.dev/plugins/${slug}`, el));\n}\n\n// packages/alpinejs/src/index.js\nalpine_default.setEvaluator(normalEvaluator);\nalpine_default.setReactivityEngine({ reactive: reactive2, effect: effect2, release: stop, raw: toRaw });\nvar src_default = alpine_default;\n\n// packages/alpinejs/builds/module.js\nvar module_default = src_default;\nexport {\n  module_default as default\n};\n", "// packages/mask/src/index.js\nfunction src_default(Alpine) {\n  Alpine.directive(\"mask\", (el, { value, expression }, { effect, evaluateLater }) => {\n    let templateFn = () => expression;\n    let lastInputValue = \"\";\n    queueMicrotask(() => {\n      if ([\"function\", \"dynamic\"].includes(value)) {\n        let evaluator = evaluateLater(expression);\n        effect(() => {\n          templateFn = (input) => {\n            let result;\n            Alpine.dontAutoEvaluateFunctions(() => {\n              evaluator((value2) => {\n                result = typeof value2 === \"function\" ? value2(input) : value2;\n              }, { scope: {\n                // These are \"magics\" we'll make available to the x-mask:function:\n                \"$input\": input,\n                \"$money\": formatMoney.bind({ el })\n              } });\n            });\n            return result;\n          };\n          processInputValue(el, false);\n        });\n      } else {\n        processInputValue(el, false);\n      }\n      if (el._x_model)\n        el._x_model.set(el.value);\n    });\n    el.addEventListener(\"input\", () => processInputValue(el));\n    el.addEventListener(\"blur\", () => processInputValue(el, false));\n    function processInputValue(el2, shouldRestoreCursor = true) {\n      let input = el2.value;\n      let template = templateFn(input);\n      if (!template || template === \"false\")\n        return false;\n      if (lastInputValue.length - el2.value.length === 1) {\n        return lastInputValue = el2.value;\n      }\n      let setInput = () => {\n        lastInputValue = el2.value = formatInput(input, template);\n      };\n      if (shouldRestoreCursor) {\n        restoreCursorPosition(el2, template, () => {\n          setInput();\n        });\n      } else {\n        setInput();\n      }\n    }\n    function formatInput(input, template) {\n      if (input === \"\")\n        return \"\";\n      let strippedDownInput = stripDown(template, input);\n      let rebuiltInput = buildUp(template, strippedDownInput);\n      return rebuiltInput;\n    }\n  }).before(\"model\");\n}\nfunction restoreCursorPosition(el, template, callback) {\n  let cursorPosition = el.selectionStart;\n  let unformattedValue = el.value;\n  callback();\n  let beforeLeftOfCursorBeforeFormatting = unformattedValue.slice(0, cursorPosition);\n  let newPosition = buildUp(\n    template,\n    stripDown(\n      template,\n      beforeLeftOfCursorBeforeFormatting\n    )\n  ).length;\n  el.setSelectionRange(newPosition, newPosition);\n}\nfunction stripDown(template, input) {\n  let inputToBeStripped = input;\n  let output = \"\";\n  let regexes = {\n    \"9\": /[0-9]/,\n    \"a\": /[a-zA-Z]/,\n    \"*\": /[a-zA-Z0-9]/\n  };\n  let wildcardTemplate = \"\";\n  for (let i = 0; i < template.length; i++) {\n    if ([\"9\", \"a\", \"*\"].includes(template[i])) {\n      wildcardTemplate += template[i];\n      continue;\n    }\n    for (let j = 0; j < inputToBeStripped.length; j++) {\n      if (inputToBeStripped[j] === template[i]) {\n        inputToBeStripped = inputToBeStripped.slice(0, j) + inputToBeStripped.slice(j + 1);\n        break;\n      }\n    }\n  }\n  for (let i = 0; i < wildcardTemplate.length; i++) {\n    let found = false;\n    for (let j = 0; j < inputToBeStripped.length; j++) {\n      if (regexes[wildcardTemplate[i]].test(inputToBeStripped[j])) {\n        output += inputToBeStripped[j];\n        inputToBeStripped = inputToBeStripped.slice(0, j) + inputToBeStripped.slice(j + 1);\n        found = true;\n        break;\n      }\n    }\n    if (!found)\n      break;\n  }\n  return output;\n}\nfunction buildUp(template, input) {\n  let clean = Array.from(input);\n  let output = \"\";\n  for (let i = 0; i < template.length; i++) {\n    if (![\"9\", \"a\", \"*\"].includes(template[i])) {\n      output += template[i];\n      continue;\n    }\n    if (clean.length === 0)\n      break;\n    output += clean.shift();\n  }\n  return output;\n}\nfunction formatMoney(input, delimiter = \".\", thousands, precision = 2) {\n  if (input === \"-\")\n    return \"-\";\n  if (/^\\D+$/.test(input))\n    return \"9\";\n  if (thousands === null || thousands === void 0) {\n    thousands = delimiter === \",\" ? \".\" : \",\";\n  }\n  let addThousands = (input2, thousands2) => {\n    let output = \"\";\n    let counter = 0;\n    for (let i = input2.length - 1; i >= 0; i--) {\n      if (input2[i] === thousands2)\n        continue;\n      if (counter === 3) {\n        output = input2[i] + thousands2 + output;\n        counter = 0;\n      } else {\n        output = input2[i] + output;\n      }\n      counter++;\n    }\n    return output;\n  };\n  let minus = input.startsWith(\"-\") ? \"-\" : \"\";\n  let strippedInput = input.replaceAll(new RegExp(`[^0-9\\\\${delimiter}]`, \"g\"), \"\");\n  let template = Array.from({ length: strippedInput.split(delimiter)[0].length }).fill(\"9\").join(\"\");\n  template = `${minus}${addThousands(template, thousands)}`;\n  if (precision > 0 && input.includes(delimiter))\n    template += `${delimiter}` + \"9\".repeat(precision);\n  queueMicrotask(() => {\n    if (this.el.value.endsWith(delimiter))\n      return;\n    if (this.el.value[this.el.selectionStart - 1] === delimiter) {\n      this.el.setSelectionRange(this.el.selectionStart - 1, this.el.selectionStart - 1);\n    }\n  });\n  return template;\n}\n\n// packages/mask/builds/module.js\nvar module_default = src_default;\nexport {\n  module_default as default,\n  stripDown\n};\n", "// src/dialog.js\nfunction dialog_default(Alpine) {\n  Alpine.directive(\"htmldialog\", fylgjaAlpineDialog);\n  function fylgjaAlpineDialog(el, { expression, modifiers }, { evaluateLater, cleanup }) {\n    const evaluate = expression.length ? evaluateLater(expression) : () => {\n    };\n    const lockPageScroll = modifiers.includes(\"noscroll\");\n    const closeby = modifierValue(modifiers, \"closeby\", \"any\");\n    el.style.display = null;\n    el.hidden = false;\n    el.style.length === 0 && el.removeAttribute(\"style\");\n    el.addEventListener(\"keydown\", escapeDialog);\n    el.addEventListener(\"click\", backdropDialog);\n    el.addEventListener(\"submit\", methodDialog);\n    function scrollLock(use = true) {\n      document.body.style.overflow = use ? \"hidden\" : \"\";\n    }\n    function methodDialog(event) {\n      if (event.target.getAttribute(\"method\") === \"dialog\" || event.submitter && event.submitter.getAttribute(\"formmethod\") === \"dialog\") {\n        evaluate();\n      }\n    }\n    function escapeDialog(event) {\n      if (event.key !== \"Escape\") return;\n      event.preventDefault();\n      if (closeby !== \"any\" && closeby !== \"closerequest\") return;\n      evaluate();\n    }\n    function backdropDialog(event) {\n      if (event.target !== el || closeby !== \"any\") return;\n      const rect = el.getBoundingClientRect();\n      const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;\n      if (isInDialog) return;\n      evaluate();\n    }\n    el._x_doShow = () => {\n      if (el.hasAttribute(\"open\")) return;\n      el.showModal();\n      scrollLock(lockPageScroll);\n    };\n    el._x_doHide = () => {\n      if (!el.hasAttribute(\"open\")) return;\n      el.close();\n      scrollLock(false);\n    };\n    cleanup(() => {\n      el.removeEventListener(\"keydown\", escapeDialog);\n      el.removeEventListener(\"click\", backdropDialog);\n      el.removeEventListener(\"submit\", methodDialog);\n      scrollLock(false);\n    });\n  }\n}\nfunction modifierValue(modifiers, key, fallback) {\n  if (modifiers.indexOf(key) === -1) return fallback;\n  const rawValue = modifiers[modifiers.indexOf(key) + 1];\n  if (!rawValue) return fallback;\n  if (key === \"closeby\") {\n    const allowedValues = [\"auto\", \"none\", \"closerequest\", \"any\"];\n    const options = allowedValues.join(\", \");\n    if (!allowedValues.includes(rawValue)) {\n      console.warn(\n        `\"${rawValue}\" is not one of the allowed values for closeby: ${options}`\n      );\n      return fallback;\n    }\n  }\n  return rawValue;\n}\n\n// src/module.js\nvar module_default = dialog_default;\nexport {\n  module_default as default\n};\n", "/*!\n * @kurkle/color v0.3.2\n * https://github.com/kurkle/color#readme\n * (c) 2023 Jukka Kurkela\n * Released under the MIT License\n */\nfunction round(v) {\n  return v + 0.5 | 0;\n}\nconst lim = (v, l, h) => Math.max(Math.min(v, h), l);\nfunction p2b(v) {\n  return lim(round(v * 2.55), 0, 255);\n}\nfunction b2p(v) {\n  return lim(round(v / 2.55), 0, 100);\n}\nfunction n2b(v) {\n  return lim(round(v * 255), 0, 255);\n}\nfunction b2n(v) {\n  return lim(round(v / 2.55) / 100, 0, 1);\n}\nfunction n2p(v) {\n  return lim(round(v * 100), 0, 100);\n}\n\nconst map$1 = {0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15};\nconst hex = [...'0123456789ABCDEF'];\nconst h1 = b => hex[b & 0xF];\nconst h2 = b => hex[(b & 0xF0) >> 4] + hex[b & 0xF];\nconst eq = b => ((b & 0xF0) >> 4) === (b & 0xF);\nconst isShort = v => eq(v.r) && eq(v.g) && eq(v.b) && eq(v.a);\nfunction hexParse(str) {\n  var len = str.length;\n  var ret;\n  if (str[0] === '#') {\n    if (len === 4 || len === 5) {\n      ret = {\n        r: 255 & map$1[str[1]] * 17,\n        g: 255 & map$1[str[2]] * 17,\n        b: 255 & map$1[str[3]] * 17,\n        a: len === 5 ? map$1[str[4]] * 17 : 255\n      };\n    } else if (len === 7 || len === 9) {\n      ret = {\n        r: map$1[str[1]] << 4 | map$1[str[2]],\n        g: map$1[str[3]] << 4 | map$1[str[4]],\n        b: map$1[str[5]] << 4 | map$1[str[6]],\n        a: len === 9 ? (map$1[str[7]] << 4 | map$1[str[8]]) : 255\n      };\n    }\n  }\n  return ret;\n}\nconst alpha = (a, f) => a < 255 ? f(a) : '';\nfunction hexString(v) {\n  var f = isShort(v) ? h1 : h2;\n  return v\n    ? '#' + f(v.r) + f(v.g) + f(v.b) + alpha(v.a, f)\n    : undefined;\n}\n\nconst HUE_RE = /^(hsla?|hwb|hsv)\\(\\s*([-+.e\\d]+)(?:deg)?[\\s,]+([-+.e\\d]+)%[\\s,]+([-+.e\\d]+)%(?:[\\s,]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction hsl2rgbn(h, s, l) {\n  const a = s * Math.min(l, 1 - l);\n  const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n  return [f(0), f(8), f(4)];\n}\nfunction hsv2rgbn(h, s, v) {\n  const f = (n, k = (n + h / 60) % 6) => v - v * s * Math.max(Math.min(k, 4 - k, 1), 0);\n  return [f(5), f(3), f(1)];\n}\nfunction hwb2rgbn(h, w, b) {\n  const rgb = hsl2rgbn(h, 1, 0.5);\n  let i;\n  if (w + b > 1) {\n    i = 1 / (w + b);\n    w *= i;\n    b *= i;\n  }\n  for (i = 0; i < 3; i++) {\n    rgb[i] *= 1 - w - b;\n    rgb[i] += w;\n  }\n  return rgb;\n}\nfunction hueValue(r, g, b, d, max) {\n  if (r === max) {\n    return ((g - b) / d) + (g < b ? 6 : 0);\n  }\n  if (g === max) {\n    return (b - r) / d + 2;\n  }\n  return (r - g) / d + 4;\n}\nfunction rgb2hsl(v) {\n  const range = 255;\n  const r = v.r / range;\n  const g = v.g / range;\n  const b = v.b / range;\n  const max = Math.max(r, g, b);\n  const min = Math.min(r, g, b);\n  const l = (max + min) / 2;\n  let h, s, d;\n  if (max !== min) {\n    d = max - min;\n    s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n    h = hueValue(r, g, b, d, max);\n    h = h * 60 + 0.5;\n  }\n  return [h | 0, s || 0, l];\n}\nfunction calln(f, a, b, c) {\n  return (\n    Array.isArray(a)\n      ? f(a[0], a[1], a[2])\n      : f(a, b, c)\n  ).map(n2b);\n}\nfunction hsl2rgb(h, s, l) {\n  return calln(hsl2rgbn, h, s, l);\n}\nfunction hwb2rgb(h, w, b) {\n  return calln(hwb2rgbn, h, w, b);\n}\nfunction hsv2rgb(h, s, v) {\n  return calln(hsv2rgbn, h, s, v);\n}\nfunction hue(h) {\n  return (h % 360 + 360) % 360;\n}\nfunction hueParse(str) {\n  const m = HUE_RE.exec(str);\n  let a = 255;\n  let v;\n  if (!m) {\n    return;\n  }\n  if (m[5] !== v) {\n    a = m[6] ? p2b(+m[5]) : n2b(+m[5]);\n  }\n  const h = hue(+m[2]);\n  const p1 = +m[3] / 100;\n  const p2 = +m[4] / 100;\n  if (m[1] === 'hwb') {\n    v = hwb2rgb(h, p1, p2);\n  } else if (m[1] === 'hsv') {\n    v = hsv2rgb(h, p1, p2);\n  } else {\n    v = hsl2rgb(h, p1, p2);\n  }\n  return {\n    r: v[0],\n    g: v[1],\n    b: v[2],\n    a: a\n  };\n}\nfunction rotate(v, deg) {\n  var h = rgb2hsl(v);\n  h[0] = hue(h[0] + deg);\n  h = hsl2rgb(h);\n  v.r = h[0];\n  v.g = h[1];\n  v.b = h[2];\n}\nfunction hslString(v) {\n  if (!v) {\n    return;\n  }\n  const a = rgb2hsl(v);\n  const h = a[0];\n  const s = n2p(a[1]);\n  const l = n2p(a[2]);\n  return v.a < 255\n    ? `hsla(${h}, ${s}%, ${l}%, ${b2n(v.a)})`\n    : `hsl(${h}, ${s}%, ${l}%)`;\n}\n\nconst map = {\n  x: 'dark',\n  Z: 'light',\n  Y: 're',\n  X: 'blu',\n  W: 'gr',\n  V: 'medium',\n  U: 'slate',\n  A: 'ee',\n  T: 'ol',\n  S: 'or',\n  B: 'ra',\n  C: 'lateg',\n  D: 'ights',\n  R: 'in',\n  Q: 'turquois',\n  E: 'hi',\n  P: 'ro',\n  O: 'al',\n  N: 'le',\n  M: 'de',\n  L: 'yello',\n  F: 'en',\n  K: 'ch',\n  G: 'arks',\n  H: 'ea',\n  I: 'ightg',\n  J: 'wh'\n};\nconst names$1 = {\n  OiceXe: 'f0f8ff',\n  antiquewEte: 'faebd7',\n  aqua: 'ffff',\n  aquamarRe: '7fffd4',\n  azuY: 'f0ffff',\n  beige: 'f5f5dc',\n  bisque: 'ffe4c4',\n  black: '0',\n  blanKedOmond: 'ffebcd',\n  Xe: 'ff',\n  XeviTet: '8a2be2',\n  bPwn: 'a52a2a',\n  burlywood: 'deb887',\n  caMtXe: '5f9ea0',\n  KartYuse: '7fff00',\n  KocTate: 'd2691e',\n  cSO: 'ff7f50',\n  cSnflowerXe: '6495ed',\n  cSnsilk: 'fff8dc',\n  crimson: 'dc143c',\n  cyan: 'ffff',\n  xXe: '8b',\n  xcyan: '8b8b',\n  xgTMnPd: 'b8860b',\n  xWay: 'a9a9a9',\n  xgYF: '6400',\n  xgYy: 'a9a9a9',\n  xkhaki: 'bdb76b',\n  xmagFta: '8b008b',\n  xTivegYF: '556b2f',\n  xSange: 'ff8c00',\n  xScEd: '9932cc',\n  xYd: '8b0000',\n  xsOmon: 'e9967a',\n  xsHgYF: '8fbc8f',\n  xUXe: '483d8b',\n  xUWay: '2f4f4f',\n  xUgYy: '2f4f4f',\n  xQe: 'ced1',\n  xviTet: '9400d3',\n  dAppRk: 'ff1493',\n  dApskyXe: 'bfff',\n  dimWay: '696969',\n  dimgYy: '696969',\n  dodgerXe: '1e90ff',\n  fiYbrick: 'b22222',\n  flSOwEte: 'fffaf0',\n  foYstWAn: '228b22',\n  fuKsia: 'ff00ff',\n  gaRsbSo: 'dcdcdc',\n  ghostwEte: 'f8f8ff',\n  gTd: 'ffd700',\n  gTMnPd: 'daa520',\n  Way: '808080',\n  gYF: '8000',\n  gYFLw: 'adff2f',\n  gYy: '808080',\n  honeyMw: 'f0fff0',\n  hotpRk: 'ff69b4',\n  RdianYd: 'cd5c5c',\n  Rdigo: '4b0082',\n  ivSy: 'fffff0',\n  khaki: 'f0e68c',\n  lavFMr: 'e6e6fa',\n  lavFMrXsh: 'fff0f5',\n  lawngYF: '7cfc00',\n  NmoncEffon: 'fffacd',\n  ZXe: 'add8e6',\n  ZcSO: 'f08080',\n  Zcyan: 'e0ffff',\n  ZgTMnPdLw: 'fafad2',\n  ZWay: 'd3d3d3',\n  ZgYF: '90ee90',\n  ZgYy: 'd3d3d3',\n  ZpRk: 'ffb6c1',\n  ZsOmon: 'ffa07a',\n  ZsHgYF: '20b2aa',\n  ZskyXe: '87cefa',\n  ZUWay: '778899',\n  ZUgYy: '778899',\n  ZstAlXe: 'b0c4de',\n  ZLw: 'ffffe0',\n  lime: 'ff00',\n  limegYF: '32cd32',\n  lRF: 'faf0e6',\n  magFta: 'ff00ff',\n  maPon: '800000',\n  VaquamarRe: '66cdaa',\n  VXe: 'cd',\n  VScEd: 'ba55d3',\n  VpurpN: '9370db',\n  VsHgYF: '3cb371',\n  VUXe: '7b68ee',\n  VsprRggYF: 'fa9a',\n  VQe: '48d1cc',\n  VviTetYd: 'c71585',\n  midnightXe: '191970',\n  mRtcYam: 'f5fffa',\n  mistyPse: 'ffe4e1',\n  moccasR: 'ffe4b5',\n  navajowEte: 'ffdead',\n  navy: '80',\n  Tdlace: 'fdf5e6',\n  Tive: '808000',\n  TivedBb: '6b8e23',\n  Sange: 'ffa500',\n  SangeYd: 'ff4500',\n  ScEd: 'da70d6',\n  pOegTMnPd: 'eee8aa',\n  pOegYF: '98fb98',\n  pOeQe: 'afeeee',\n  pOeviTetYd: 'db7093',\n  papayawEp: 'ffefd5',\n  pHKpuff: 'ffdab9',\n  peru: 'cd853f',\n  pRk: 'ffc0cb',\n  plum: 'dda0dd',\n  powMrXe: 'b0e0e6',\n  purpN: '800080',\n  YbeccapurpN: '663399',\n  Yd: 'ff0000',\n  Psybrown: 'bc8f8f',\n  PyOXe: '4169e1',\n  saddNbPwn: '8b4513',\n  sOmon: 'fa8072',\n  sandybPwn: 'f4a460',\n  sHgYF: '2e8b57',\n  sHshell: 'fff5ee',\n  siFna: 'a0522d',\n  silver: 'c0c0c0',\n  skyXe: '87ceeb',\n  UXe: '6a5acd',\n  UWay: '708090',\n  UgYy: '708090',\n  snow: 'fffafa',\n  sprRggYF: 'ff7f',\n  stAlXe: '4682b4',\n  tan: 'd2b48c',\n  teO: '8080',\n  tEstN: 'd8bfd8',\n  tomato: 'ff6347',\n  Qe: '40e0d0',\n  viTet: 'ee82ee',\n  JHt: 'f5deb3',\n  wEte: 'ffffff',\n  wEtesmoke: 'f5f5f5',\n  Lw: 'ffff00',\n  LwgYF: '9acd32'\n};\nfunction unpack() {\n  const unpacked = {};\n  const keys = Object.keys(names$1);\n  const tkeys = Object.keys(map);\n  let i, j, k, ok, nk;\n  for (i = 0; i < keys.length; i++) {\n    ok = nk = keys[i];\n    for (j = 0; j < tkeys.length; j++) {\n      k = tkeys[j];\n      nk = nk.replace(k, map[k]);\n    }\n    k = parseInt(names$1[ok], 16);\n    unpacked[nk] = [k >> 16 & 0xFF, k >> 8 & 0xFF, k & 0xFF];\n  }\n  return unpacked;\n}\n\nlet names;\nfunction nameParse(str) {\n  if (!names) {\n    names = unpack();\n    names.transparent = [0, 0, 0, 0];\n  }\n  const a = names[str.toLowerCase()];\n  return a && {\n    r: a[0],\n    g: a[1],\n    b: a[2],\n    a: a.length === 4 ? a[3] : 255\n  };\n}\n\nconst RGB_RE = /^rgba?\\(\\s*([-+.\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?[\\s,]+([-+.e\\d]+)(%)?(?:[\\s,/]+([-+.e\\d]+)(%)?)?\\s*\\)$/;\nfunction rgbParse(str) {\n  const m = RGB_RE.exec(str);\n  let a = 255;\n  let r, g, b;\n  if (!m) {\n    return;\n  }\n  if (m[7] !== r) {\n    const v = +m[7];\n    a = m[8] ? p2b(v) : lim(v * 255, 0, 255);\n  }\n  r = +m[1];\n  g = +m[3];\n  b = +m[5];\n  r = 255 & (m[2] ? p2b(r) : lim(r, 0, 255));\n  g = 255 & (m[4] ? p2b(g) : lim(g, 0, 255));\n  b = 255 & (m[6] ? p2b(b) : lim(b, 0, 255));\n  return {\n    r: r,\n    g: g,\n    b: b,\n    a: a\n  };\n}\nfunction rgbString(v) {\n  return v && (\n    v.a < 255\n      ? `rgba(${v.r}, ${v.g}, ${v.b}, ${b2n(v.a)})`\n      : `rgb(${v.r}, ${v.g}, ${v.b})`\n  );\n}\n\nconst to = v => v <= 0.0031308 ? v * 12.92 : Math.pow(v, 1.0 / 2.4) * 1.055 - 0.055;\nconst from = v => v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);\nfunction interpolate(rgb1, rgb2, t) {\n  const r = from(b2n(rgb1.r));\n  const g = from(b2n(rgb1.g));\n  const b = from(b2n(rgb1.b));\n  return {\n    r: n2b(to(r + t * (from(b2n(rgb2.r)) - r))),\n    g: n2b(to(g + t * (from(b2n(rgb2.g)) - g))),\n    b: n2b(to(b + t * (from(b2n(rgb2.b)) - b))),\n    a: rgb1.a + t * (rgb2.a - rgb1.a)\n  };\n}\n\nfunction modHSL(v, i, ratio) {\n  if (v) {\n    let tmp = rgb2hsl(v);\n    tmp[i] = Math.max(0, Math.min(tmp[i] + tmp[i] * ratio, i === 0 ? 360 : 1));\n    tmp = hsl2rgb(tmp);\n    v.r = tmp[0];\n    v.g = tmp[1];\n    v.b = tmp[2];\n  }\n}\nfunction clone(v, proto) {\n  return v ? Object.assign(proto || {}, v) : v;\n}\nfunction fromObject(input) {\n  var v = {r: 0, g: 0, b: 0, a: 255};\n  if (Array.isArray(input)) {\n    if (input.length >= 3) {\n      v = {r: input[0], g: input[1], b: input[2], a: 255};\n      if (input.length > 3) {\n        v.a = n2b(input[3]);\n      }\n    }\n  } else {\n    v = clone(input, {r: 0, g: 0, b: 0, a: 1});\n    v.a = n2b(v.a);\n  }\n  return v;\n}\nfunction functionParse(str) {\n  if (str.charAt(0) === 'r') {\n    return rgbParse(str);\n  }\n  return hueParse(str);\n}\nclass Color {\n  constructor(input) {\n    if (input instanceof Color) {\n      return input;\n    }\n    const type = typeof input;\n    let v;\n    if (type === 'object') {\n      v = fromObject(input);\n    } else if (type === 'string') {\n      v = hexParse(input) || nameParse(input) || functionParse(input);\n    }\n    this._rgb = v;\n    this._valid = !!v;\n  }\n  get valid() {\n    return this._valid;\n  }\n  get rgb() {\n    var v = clone(this._rgb);\n    if (v) {\n      v.a = b2n(v.a);\n    }\n    return v;\n  }\n  set rgb(obj) {\n    this._rgb = fromObject(obj);\n  }\n  rgbString() {\n    return this._valid ? rgbString(this._rgb) : undefined;\n  }\n  hexString() {\n    return this._valid ? hexString(this._rgb) : undefined;\n  }\n  hslString() {\n    return this._valid ? hslString(this._rgb) : undefined;\n  }\n  mix(color, weight) {\n    if (color) {\n      const c1 = this.rgb;\n      const c2 = color.rgb;\n      let w2;\n      const p = weight === w2 ? 0.5 : weight;\n      const w = 2 * p - 1;\n      const a = c1.a - c2.a;\n      const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n      w2 = 1 - w1;\n      c1.r = 0xFF & w1 * c1.r + w2 * c2.r + 0.5;\n      c1.g = 0xFF & w1 * c1.g + w2 * c2.g + 0.5;\n      c1.b = 0xFF & w1 * c1.b + w2 * c2.b + 0.5;\n      c1.a = p * c1.a + (1 - p) * c2.a;\n      this.rgb = c1;\n    }\n    return this;\n  }\n  interpolate(color, t) {\n    if (color) {\n      this._rgb = interpolate(this._rgb, color._rgb, t);\n    }\n    return this;\n  }\n  clone() {\n    return new Color(this.rgb);\n  }\n  alpha(a) {\n    this._rgb.a = n2b(a);\n    return this;\n  }\n  clearer(ratio) {\n    const rgb = this._rgb;\n    rgb.a *= 1 - ratio;\n    return this;\n  }\n  greyscale() {\n    const rgb = this._rgb;\n    const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);\n    rgb.r = rgb.g = rgb.b = val;\n    return this;\n  }\n  opaquer(ratio) {\n    const rgb = this._rgb;\n    rgb.a *= 1 + ratio;\n    return this;\n  }\n  negate() {\n    const v = this._rgb;\n    v.r = 255 - v.r;\n    v.g = 255 - v.g;\n    v.b = 255 - v.b;\n    return this;\n  }\n  lighten(ratio) {\n    modHSL(this._rgb, 2, ratio);\n    return this;\n  }\n  darken(ratio) {\n    modHSL(this._rgb, 2, -ratio);\n    return this;\n  }\n  saturate(ratio) {\n    modHSL(this._rgb, 1, ratio);\n    return this;\n  }\n  desaturate(ratio) {\n    modHSL(this._rgb, 1, -ratio);\n    return this;\n  }\n  rotate(deg) {\n    rotate(this._rgb, deg);\n    return this;\n  }\n}\n\nfunction index_esm(input) {\n  return new Color(input);\n}\n\nexport { Color, b2n, b2p, index_esm as default, hexParse, hexString, hsl2rgb, hslString, hsv2rgb, hueParse, hwb2rgb, lim, n2b, n2p, nameParse, p2b, rgb2hsl, rgbParse, rgbString, rotate, round };\n", "/**\n * @namespace Chart.helpers\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ActiveDataPoint, ChartEvent} from '../types/index.js';\n\n/**\n * An empty function that can be used, for example, for optional callback.\n */\nexport function noop() {\n  /* noop */\n}\n\n/**\n * Returns a unique id, sequentially generated from a global variable.\n */\nexport const uid = (() => {\n  let id = 0;\n  return () => id++;\n})();\n\n/**\n * Returns true if `value` is neither null nor undefined, else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isNullOrUndef(value: unknown): value is null | undefined {\n  return value === null || typeof value === 'undefined';\n}\n\n/**\n * Returns true if `value` is an array (including typed arrays), else returns false.\n * @param value - The value to test.\n * @function\n */\nexport function isArray<T = unknown>(value: unknown): value is T[] {\n  if (Array.isArray && Array.isArray(value)) {\n    return true;\n  }\n  const type = Object.prototype.toString.call(value);\n  if (type.slice(0, 7) === '[object' && type.slice(-6) === 'Array]') {\n    return true;\n  }\n  return false;\n}\n\n/**\n * Returns true if `value` is an object (excluding null), else returns false.\n * @param value - The value to test.\n * @since 2.7.0\n */\nexport function isObject(value: unknown): value is AnyObject {\n  return value !== null && Object.prototype.toString.call(value) === '[object Object]';\n}\n\n/**\n * Returns true if `value` is a finite number, else returns false\n * @param value  - The value to test.\n */\nfunction isNumberFinite(value: unknown): value is number {\n  return (typeof value === 'number' || value instanceof Number) && isFinite(+value);\n}\nexport {\n  isNumberFinite as isFinite,\n};\n\n/**\n * Returns `value` if finite, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is not finite.\n */\nexport function finiteOrDefault(value: unknown, defaultValue: number) {\n  return isNumberFinite(value) ? value : defaultValue;\n}\n\n/**\n * Returns `value` if defined, else returns `defaultValue`.\n * @param value - The value to return if defined.\n * @param defaultValue - The value to return if `value` is undefined.\n */\nexport function valueOrDefault<T>(value: T | undefined, defaultValue: T) {\n  return typeof value === 'undefined' ? defaultValue : value;\n}\n\nexport const toPercentage = (value: number | string, dimension: number) =>\n  typeof value === 'string' && value.endsWith('%') ?\n    parseFloat(value) / 100\n    : +value / dimension;\n\nexport const toDimension = (value: number | string, dimension: number) =>\n  typeof value === 'string' && value.endsWith('%') ?\n    parseFloat(value) / 100 * dimension\n    : +value;\n\n/**\n * Calls `fn` with the given `args` in the scope defined by `thisArg` and returns the\n * value returned by `fn`. If `fn` is not a function, this method returns undefined.\n * @param fn - The function to call.\n * @param args - The arguments with which `fn` should be called.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n */\nexport function callback<T extends (this: TA, ...restArgs: unknown[]) => R, TA, R>(\n  fn: T | undefined,\n  args: unknown[],\n  thisArg?: TA\n): R | undefined {\n  if (fn && typeof fn.call === 'function') {\n    return fn.apply(thisArg, args);\n  }\n}\n\n/**\n * Note(SB) for performance sake, this method should only be used when loopable type\n * is unknown or in none intensive code (not called often and small loopable). Else\n * it's preferable to use a regular for() loop and save extra function calls.\n * @param loopable - The object or array to be iterated.\n * @param fn - The function to call for each item.\n * @param [thisArg] - The value of `this` provided for the call to `fn`.\n * @param [reverse] - If true, iterates backward on the loopable.\n */\nexport function each<T, TA>(\n  loopable: Record<string, T>,\n  fn: (this: TA, v: T, i: string) => void,\n  thisArg?: TA,\n  reverse?: boolean\n): void;\nexport function each<T, TA>(\n  loopable: T[],\n  fn: (this: TA, v: T, i: number) => void,\n  thisArg?: TA,\n  reverse?: boolean\n): void;\nexport function each<T, TA>(\n  loopable: T[] | Record<string, T>,\n  fn: (this: TA, v: T, i: any) => void,\n  thisArg?: TA,\n  reverse?: boolean\n) {\n  let i: number, len: number, keys: string[];\n  if (isArray(loopable)) {\n    len = loopable.length;\n    if (reverse) {\n      for (i = len - 1; i >= 0; i--) {\n        fn.call(thisArg, loopable[i], i);\n      }\n    } else {\n      for (i = 0; i < len; i++) {\n        fn.call(thisArg, loopable[i], i);\n      }\n    }\n  } else if (isObject(loopable)) {\n    keys = Object.keys(loopable);\n    len = keys.length;\n    for (i = 0; i < len; i++) {\n      fn.call(thisArg, loopable[keys[i]], keys[i]);\n    }\n  }\n}\n\n/**\n * Returns true if the `a0` and `a1` arrays have the same content, else returns false.\n * @param a0 - The array to compare\n * @param a1 - The array to compare\n * @private\n */\nexport function _elementsEqual(a0: ActiveDataPoint[], a1: ActiveDataPoint[]) {\n  let i: number, ilen: number, v0: ActiveDataPoint, v1: ActiveDataPoint;\n\n  if (!a0 || !a1 || a0.length !== a1.length) {\n    return false;\n  }\n\n  for (i = 0, ilen = a0.length; i < ilen; ++i) {\n    v0 = a0[i];\n    v1 = a1[i];\n\n    if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\n/**\n * Returns a deep copy of `source` without keeping references on objects and arrays.\n * @param source - The value to clone.\n */\nexport function clone<T>(source: T): T {\n  if (isArray(source)) {\n    return source.map(clone) as unknown as T;\n  }\n\n  if (isObject(source)) {\n    const target = Object.create(null);\n    const keys = Object.keys(source);\n    const klen = keys.length;\n    let k = 0;\n\n    for (; k < klen; ++k) {\n      target[keys[k]] = clone(source[keys[k]]);\n    }\n\n    return target;\n  }\n\n  return source;\n}\n\nfunction isValidKey(key: string) {\n  return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;\n}\n\n/**\n * The default merger when Chart.helpers.merge is called without merger option.\n * Note(SB): also used by mergeConfig and mergeScaleConfig as fallback.\n * @private\n */\nexport function _merger(key: string, target: AnyObject, source: AnyObject, options: AnyObject) {\n  if (!isValidKey(key)) {\n    return;\n  }\n\n  const tval = target[key];\n  const sval = source[key];\n\n  if (isObject(tval) && isObject(sval)) {\n    // eslint-disable-next-line @typescript-eslint/no-use-before-define\n    merge(tval, sval, options);\n  } else {\n    target[key] = clone(sval);\n  }\n}\n\nexport interface MergeOptions {\n  merger?: (key: string, target: AnyObject, source: AnyObject, options?: AnyObject) => void;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` with the given `options`.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @param [options] - Merging options:\n * @param [options.merger] - The merge method (key, target, source, options)\n * @returns The `target` object.\n */\nexport function merge<T>(target: T, source: [], options?: MergeOptions): T;\nexport function merge<T, S1>(target: T, source: S1, options?: MergeOptions): T & S1;\nexport function merge<T, S1>(target: T, source: [S1], options?: MergeOptions): T & S1;\nexport function merge<T, S1, S2>(target: T, source: [S1, S2], options?: MergeOptions): T & S1 & S2;\nexport function merge<T, S1, S2, S3>(target: T, source: [S1, S2, S3], options?: MergeOptions): T & S1 & S2 & S3;\nexport function merge<T, S1, S2, S3, S4>(\n  target: T,\n  source: [S1, S2, S3, S4],\n  options?: MergeOptions\n): T & S1 & S2 & S3 & S4;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject;\nexport function merge<T>(target: T, source: AnyObject[], options?: MergeOptions): AnyObject {\n  const sources = isArray(source) ? source : [source];\n  const ilen = sources.length;\n\n  if (!isObject(target)) {\n    return target as AnyObject;\n  }\n\n  options = options || {};\n  const merger = options.merger || _merger;\n  let current: AnyObject;\n\n  for (let i = 0; i < ilen; ++i) {\n    current = sources[i];\n    if (!isObject(current)) {\n      continue;\n    }\n\n    const keys = Object.keys(current);\n    for (let k = 0, klen = keys.length; k < klen; ++k) {\n      merger(keys[k], target, current, options as AnyObject);\n    }\n  }\n\n  return target;\n}\n\n/**\n * Recursively deep copies `source` properties into `target` *only* if not defined in target.\n * IMPORTANT: `target` is not cloned and will be updated with `source` properties.\n * @param target - The target object in which all sources are merged into.\n * @param source - Object(s) to merge into `target`.\n * @returns The `target` object.\n */\nexport function mergeIf<T>(target: T, source: []): T;\nexport function mergeIf<T, S1>(target: T, source: S1): T & S1;\nexport function mergeIf<T, S1>(target: T, source: [S1]): T & S1;\nexport function mergeIf<T, S1, S2>(target: T, source: [S1, S2]): T & S1 & S2;\nexport function mergeIf<T, S1, S2, S3>(target: T, source: [S1, S2, S3]): T & S1 & S2 & S3;\nexport function mergeIf<T, S1, S2, S3, S4>(target: T, source: [S1, S2, S3, S4]): T & S1 & S2 & S3 & S4;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject;\nexport function mergeIf<T>(target: T, source: AnyObject[]): AnyObject {\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  return merge<T>(target, source, {merger: _mergerIf});\n}\n\n/**\n * Merges source[key] in target[key] only if target[key] is undefined.\n * @private\n */\nexport function _mergerIf(key: string, target: AnyObject, source: AnyObject) {\n  if (!isValidKey(key)) {\n    return;\n  }\n\n  const tval = target[key];\n  const sval = source[key];\n\n  if (isObject(tval) && isObject(sval)) {\n    mergeIf(tval, sval);\n  } else if (!Object.prototype.hasOwnProperty.call(target, key)) {\n    target[key] = clone(sval);\n  }\n}\n\n/**\n * @private\n */\nexport function _deprecated(scope: string, value: unknown, previous: string, current: string) {\n  if (value !== undefined) {\n    console.warn(scope + ': \"' + previous +\n      '\" is deprecated. Please use \"' + current + '\" instead');\n  }\n}\n\n// resolveObjectKey resolver cache\nconst keyResolvers = {\n  // Chart.helpers.core resolveObjectKey should resolve empty key to root object\n  '': v => v,\n  // default resolvers\n  x: o => o.x,\n  y: o => o.y\n};\n\n/**\n * @private\n */\nexport function _splitKey(key: string) {\n  const parts = key.split('.');\n  const keys: string[] = [];\n  let tmp = '';\n  for (const part of parts) {\n    tmp += part;\n    if (tmp.endsWith('\\\\')) {\n      tmp = tmp.slice(0, -1) + '.';\n    } else {\n      keys.push(tmp);\n      tmp = '';\n    }\n  }\n  return keys;\n}\n\nfunction _getKeyResolver(key: string) {\n  const keys = _splitKey(key);\n  return obj => {\n    for (const k of keys) {\n      if (k === '') {\n        // For backward compatibility:\n        // Chart.helpers.core resolveObjectKey should break at empty key\n        break;\n      }\n      obj = obj && obj[k];\n    }\n    return obj;\n  };\n}\n\nexport function resolveObjectKey(obj: AnyObject, key: string): any {\n  const resolver = keyResolvers[key] || (keyResolvers[key] = _getKeyResolver(key));\n  return resolver(obj);\n}\n\n/**\n * @private\n */\nexport function _capitalize(str: string) {\n  return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\n\nexport const defined = (value: unknown) => typeof value !== 'undefined';\n\nexport const isFunction = (value: unknown): value is (...args: any[]) => any => typeof value === 'function';\n\n// Adapted from https://stackoverflow.com/questions/31128855/comparing-ecma6-sets-for-equality#31129384\nexport const setsEqual = <T>(a: Set<T>, b: Set<T>) => {\n  if (a.size !== b.size) {\n    return false;\n  }\n\n  for (const item of a) {\n    if (!b.has(item)) {\n      return false;\n    }\n  }\n\n  return true;\n};\n\n/**\n * @param e - The event\n * @private\n */\nexport function _isClickEvent(e: ChartEvent) {\n  return e.type === 'mouseup' || e.type === 'click' || e.type === 'contextmenu';\n}\n", "import type {Point} from '../types/geometric.js';\nimport {isFinite as isFiniteNumber} from './helpers.core.js';\n\n/**\n * @alias Chart.helpers.math\n * @namespace\n */\n\nexport const PI = Math.PI;\nexport const TAU = 2 * PI;\nexport const PITAU = TAU + PI;\nexport const INFINITY = Number.POSITIVE_INFINITY;\nexport const RAD_PER_DEG = PI / 180;\nexport const HALF_PI = PI / 2;\nexport const QUARTER_PI = PI / 4;\nexport const TWO_THIRDS_PI = PI * 2 / 3;\n\nexport const log10 = Math.log10;\nexport const sign = Math.sign;\n\nexport function almostEquals(x: number, y: number, epsilon: number) {\n  return Math.abs(x - y) < epsilon;\n}\n\n/**\n * Implementation of the nice number algorithm used in determining where axis labels will go\n */\nexport function niceNum(range: number) {\n  const roundedRange = Math.round(range);\n  range = almostEquals(range, roundedRange, range / 1000) ? roundedRange : range;\n  const niceRange = Math.pow(10, Math.floor(log10(range)));\n  const fraction = range / niceRange;\n  const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;\n  return niceFraction * niceRange;\n}\n\n/**\n * Returns an array of factors sorted from 1 to sqrt(value)\n * @private\n */\nexport function _factorize(value: number) {\n  const result: number[] = [];\n  const sqrt = Math.sqrt(value);\n  let i: number;\n\n  for (i = 1; i < sqrt; i++) {\n    if (value % i === 0) {\n      result.push(i);\n      result.push(value / i);\n    }\n  }\n  if (sqrt === (sqrt | 0)) { // if value is a square number\n    result.push(sqrt);\n  }\n\n  result.sort((a, b) => a - b).pop();\n  return result;\n}\n\nexport function isNumber(n: unknown): n is number {\n  return !isNaN(parseFloat(n as string)) && isFinite(n as number);\n}\n\nexport function almostWhole(x: number, epsilon: number) {\n  const rounded = Math.round(x);\n  return ((rounded - epsilon) <= x) && ((rounded + epsilon) >= x);\n}\n\n/**\n * @private\n */\nexport function _setMinAndMaxByKey(\n  array: Record<string, number>[],\n  target: { min: number, max: number },\n  property: string\n) {\n  let i: number, ilen: number, value: number;\n\n  for (i = 0, ilen = array.length; i < ilen; i++) {\n    value = array[i][property];\n    if (!isNaN(value)) {\n      target.min = Math.min(target.min, value);\n      target.max = Math.max(target.max, value);\n    }\n  }\n}\n\nexport function toRadians(degrees: number) {\n  return degrees * (PI / 180);\n}\n\nexport function toDegrees(radians: number) {\n  return radians * (180 / PI);\n}\n\n/**\n * Returns the number of decimal places\n * i.e. the number of digits after the decimal point, of the value of this Number.\n * @param x - A number.\n * @returns The number of decimal places.\n * @private\n */\nexport function _decimalPlaces(x: number) {\n  if (!isFiniteNumber(x)) {\n    return;\n  }\n  let e = 1;\n  let p = 0;\n  while (Math.round(x * e) / e !== x) {\n    e *= 10;\n    p++;\n  }\n  return p;\n}\n\n// Gets the angle from vertical upright to the point about a centre.\nexport function getAngleFromPoint(\n  centrePoint: Point,\n  anglePoint: Point\n) {\n  const distanceFromXCenter = anglePoint.x - centrePoint.x;\n  const distanceFromYCenter = anglePoint.y - centrePoint.y;\n  const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);\n\n  let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);\n\n  if (angle < (-0.5 * PI)) {\n    angle += TAU; // make sure the returned angle is in the range of (-PI/2, 3PI/2]\n  }\n\n  return {\n    angle,\n    distance: radialDistanceFromCenter\n  };\n}\n\nexport function distanceBetweenPoints(pt1: Point, pt2: Point) {\n  return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));\n}\n\n/**\n * Shortest distance between angles, in either direction.\n * @private\n */\nexport function _angleDiff(a: number, b: number) {\n  return (a - b + PITAU) % TAU - PI;\n}\n\n/**\n * Normalize angle to be between 0 and 2*PI\n * @private\n */\nexport function _normalizeAngle(a: number) {\n  return (a % TAU + TAU) % TAU;\n}\n\n/**\n * @private\n */\nexport function _angleBetween(angle: number, start: number, end: number, sameAngleIsFullCircle?: boolean) {\n  const a = _normalizeAngle(angle);\n  const s = _normalizeAngle(start);\n  const e = _normalizeAngle(end);\n  const angleToStart = _normalizeAngle(s - a);\n  const angleToEnd = _normalizeAngle(e - a);\n  const startToAngle = _normalizeAngle(a - s);\n  const endToAngle = _normalizeAngle(a - e);\n  return a === s || a === e || (sameAngleIsFullCircle && s === e)\n    || (angleToStart > angleToEnd && startToAngle < endToAngle);\n}\n\n/**\n * Limit `value` between `min` and `max`\n * @param value\n * @param min\n * @param max\n * @private\n */\nexport function _limitValue(value: number, min: number, max: number) {\n  return Math.max(min, Math.min(max, value));\n}\n\n/**\n * @param {number} value\n * @private\n */\nexport function _int16Range(value: number) {\n  return _limitValue(value, -32768, 32767);\n}\n\n/**\n * @param value\n * @param start\n * @param end\n * @param [epsilon]\n * @private\n */\nexport function _isBetween(value: number, start: number, end: number, epsilon = 1e-6) {\n  return value >= Math.min(start, end) - epsilon && value <= Math.max(start, end) + epsilon;\n}\n", "import {_capitalize} from './helpers.core.js';\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param value - value to find\n * @param cmp\n * @private\n */\nexport function _lookup(\n  table: number[],\n  value: number,\n  cmp?: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup<T>(\n  table: T[],\n  value: number,\n  cmp: (value: number) => boolean\n): {lo: number, hi: number};\nexport function _lookup(\n  table: unknown[],\n  value: number,\n  cmp?: (value: number) => boolean\n) {\n  cmp = cmp || ((index) => table[index] < value);\n  let hi = table.length - 1;\n  let lo = 0;\n  let mid: number;\n\n  while (hi - lo > 1) {\n    mid = (lo + hi) >> 1;\n    if (cmp(mid)) {\n      lo = mid;\n    } else {\n      hi = mid;\n    }\n  }\n\n  return {lo, hi};\n}\n\n/**\n * Binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @param last - lookup last index\n * @private\n */\nexport const _lookupByKey = (\n  table: Record<string, number>[],\n  key: string,\n  value: number,\n  last?: boolean\n) =>\n  _lookup(table, value, last\n    ? index => {\n      const ti = table[index][key];\n      return ti < value || ti === value && table[index + 1][key] === value;\n    }\n    : index => table[index][key] < value);\n\n/**\n * Reverse binary search\n * @param table - the table search. must be sorted!\n * @param key - property name for the value in each entry\n * @param value - value to find\n * @private\n */\nexport const _rlookupByKey = (\n  table: Record<string, number>[],\n  key: string,\n  value: number\n) =>\n  _lookup(table, value, index => table[index][key] >= value);\n\n/**\n * Return subset of `values` between `min` and `max` inclusive.\n * Values are assumed to be in sorted order.\n * @param values - sorted array of values\n * @param min - min value\n * @param max - max value\n */\nexport function _filterBetween(values: number[], min: number, max: number) {\n  let start = 0;\n  let end = values.length;\n\n  while (start < end && values[start] < min) {\n    start++;\n  }\n  while (end > start && values[end - 1] > max) {\n    end--;\n  }\n\n  return start > 0 || end < values.length\n    ? values.slice(start, end)\n    : values;\n}\n\nconst arrayEvents = ['push', 'pop', 'shift', 'splice', 'unshift'] as const;\n\nexport interface ArrayListener<T> {\n  _onDataPush?(...item: T[]): void;\n  _onDataPop?(): void;\n  _onDataShift?(): void;\n  _onDataSplice?(index: number, deleteCount: number, ...items: T[]): void;\n  _onDataUnshift?(...item: T[]): void;\n}\n\n/**\n * Hooks the array methods that add or remove values ('push', pop', 'shift', 'splice',\n * 'unshift') and notify the listener AFTER the array has been altered. Listeners are\n * called on the '_onData*' callbacks (e.g. _onDataPush, etc.) with same arguments.\n */\nexport function listenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function listenArrayEvents(array, listener) {\n  if (array._chartjs) {\n    array._chartjs.listeners.push(listener);\n    return;\n  }\n\n  Object.defineProperty(array, '_chartjs', {\n    configurable: true,\n    enumerable: false,\n    value: {\n      listeners: [listener]\n    }\n  });\n\n  arrayEvents.forEach((key) => {\n    const method = '_onData' + _capitalize(key);\n    const base = array[key];\n\n    Object.defineProperty(array, key, {\n      configurable: true,\n      enumerable: false,\n      value(...args) {\n        const res = base.apply(this, args);\n\n        array._chartjs.listeners.forEach((object) => {\n          if (typeof object[method] === 'function') {\n            object[method](...args);\n          }\n        });\n\n        return res;\n      }\n    });\n  });\n}\n\n\n/**\n * Removes the given array event listener and cleanup extra attached properties (such as\n * the _chartjs stub and overridden methods) if array doesn't have any more listeners.\n */\nexport function unlistenArrayEvents<T>(array: T[], listener: ArrayListener<T>): void;\nexport function unlistenArrayEvents(array, listener) {\n  const stub = array._chartjs;\n  if (!stub) {\n    return;\n  }\n\n  const listeners = stub.listeners;\n  const index = listeners.indexOf(listener);\n  if (index !== -1) {\n    listeners.splice(index, 1);\n  }\n\n  if (listeners.length > 0) {\n    return;\n  }\n\n  arrayEvents.forEach((key) => {\n    delete array[key];\n  });\n\n  delete array._chartjs;\n}\n\n/**\n * @param items\n */\nexport function _arrayUnique<T>(items: T[]) {\n  const set = new Set<T>(items);\n\n  if (set.size === items.length) {\n    return items;\n  }\n\n  return Array.from(set);\n}\n", "import type {ChartMeta, PointElement} from '../types/index.js';\n\nimport {_limitValue} from './helpers.math.js';\nimport {_lookupByKey} from './helpers.collection.js';\n\nexport function fontString(pixelSize: number, fontStyle: string, fontFamily: string) {\n  return fontStyle + ' ' + pixelSize + 'px ' + fontFamily;\n}\n\n/**\n* Request animation polyfill\n*/\nexport const requestAnimFrame = (function() {\n  if (typeof window === 'undefined') {\n    return function(callback) {\n      return callback();\n    };\n  }\n  return window.requestAnimationFrame;\n}());\n\n/**\n * Throttles calling `fn` once per animation frame\n * Latest arguments are used on the actual call\n */\nexport function throttled<TArgs extends Array<any>>(\n  fn: (...args: TArgs) => void,\n  thisArg: any,\n) {\n  let argsToUse = [] as TArgs;\n  let ticking = false;\n\n  return function(...args: TArgs) {\n    // Save the args for use later\n    argsToUse = args;\n    if (!ticking) {\n      ticking = true;\n      requestAnimFrame.call(window, () => {\n        ticking = false;\n        fn.apply(thisArg, argsToUse);\n      });\n    }\n  };\n}\n\n/**\n * Debounces calling `fn` for `delay` ms\n */\nexport function debounce<TArgs extends Array<any>>(fn: (...args: TArgs) => void, delay: number) {\n  let timeout;\n  return function(...args: TArgs) {\n    if (delay) {\n      clearTimeout(timeout);\n      timeout = setTimeout(fn, delay, args);\n    } else {\n      fn.apply(this, args);\n    }\n    return delay;\n  };\n}\n\n/**\n * Converts 'start' to 'left', 'end' to 'right' and others to 'center'\n * @private\n */\nexport const _toLeftRightCenter = (align: 'start' | 'end' | 'center') => align === 'start' ? 'left' : align === 'end' ? 'right' : 'center';\n\n/**\n * Returns `start`, `end` or `(start + end) / 2` depending on `align`. Defaults to `center`\n * @private\n */\nexport const _alignStartEnd = (align: 'start' | 'end' | 'center', start: number, end: number) => align === 'start' ? start : align === 'end' ? end : (start + end) / 2;\n\n/**\n * Returns `left`, `right` or `(left + right) / 2` depending on `align`. Defaults to `left`\n * @private\n */\nexport const _textX = (align: 'left' | 'right' | 'center', left: number, right: number, rtl: boolean) => {\n  const check = rtl ? 'left' : 'right';\n  return align === check ? right : align === 'center' ? (left + right) / 2 : left;\n};\n\n/**\n * Return start and count of visible points.\n * @private\n */\nexport function _getStartAndCountOfVisiblePoints(meta: ChartMeta<'line' | 'scatter'>, points: PointElement[], animationsDisabled: boolean) {\n  const pointCount = points.length;\n\n  let start = 0;\n  let count = pointCount;\n\n  if (meta._sorted) {\n    const {iScale, _parsed} = meta;\n    const axis = iScale.axis;\n    const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n    if (minDefined) {\n      start = _limitValue(Math.min(\n        // @ts-expect-error Need to type _parsed\n        _lookupByKey(_parsed, axis, min).lo,\n        // @ts-expect-error Need to fix types on _lookupByKey\n        animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min)).lo),\n      0, pointCount - 1);\n    }\n    if (maxDefined) {\n      count = _limitValue(Math.max(\n        // @ts-expect-error Need to type _parsed\n        _lookupByKey(_parsed, iScale.axis, max, true).hi + 1,\n        // @ts-expect-error Need to fix types on _lookupByKey\n        animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max), true).hi + 1),\n      start, pointCount) - start;\n    } else {\n      count = pointCount - start;\n    }\n  }\n\n  return {start, count};\n}\n\n/**\n * Checks if the scale ranges have changed.\n * @param {object} meta - dataset meta.\n * @returns {boolean}\n * @private\n */\nexport function _scaleRangesChanged(meta) {\n  const {xScale, yScale, _scaleRanges} = meta;\n  const newRanges = {\n    xmin: xScale.min,\n    xmax: xScale.max,\n    ymin: yScale.min,\n    ymax: yScale.max\n  };\n  if (!_scaleRanges) {\n    meta._scaleRanges = newRanges;\n    return true;\n  }\n  const changed = _scaleRanges.xmin !== xScale.min\n\t\t|| _scaleRanges.xmax !== xScale.max\n\t\t|| _scaleRanges.ymin !== yScale.min\n\t\t|| _scaleRanges.ymax !== yScale.max;\n\n  Object.assign(_scaleRanges, newRanges);\n  return changed;\n}\n", "import {PI, TAU, HALF_PI} from './helpers.math.js';\n\nconst atEdge = (t: number) => t === 0 || t === 1;\nconst elasticIn = (t: number, s: number, p: number) => -(Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * TAU / p));\nconst elasticOut = (t: number, s: number, p: number) => Math.pow(2, -10 * t) * Math.sin((t - s) * TAU / p) + 1;\n\n/**\n * Easing functions adapted from Robert Penner's easing equations.\n * @namespace Chart.helpers.easing.effects\n * @see http://www.robertpenner.com/easing/\n */\nconst effects = {\n  linear: (t: number) => t,\n\n  easeInQuad: (t: number) => t * t,\n\n  easeOutQuad: (t: number) => -t * (t - 2),\n\n  easeInOutQuad: (t: number) => ((t /= 0.5) < 1)\n    ? 0.5 * t * t\n    : -0.5 * ((--t) * (t - 2) - 1),\n\n  easeInCubic: (t: number) => t * t * t,\n\n  easeOutCubic: (t: number) => (t -= 1) * t * t + 1,\n\n  easeInOutCubic: (t: number) => ((t /= 0.5) < 1)\n    ? 0.5 * t * t * t\n    : 0.5 * ((t -= 2) * t * t + 2),\n\n  easeInQuart: (t: number) => t * t * t * t,\n\n  easeOutQuart: (t: number) => -((t -= 1) * t * t * t - 1),\n\n  easeInOutQuart: (t: number) => ((t /= 0.5) < 1)\n    ? 0.5 * t * t * t * t\n    : -0.5 * ((t -= 2) * t * t * t - 2),\n\n  easeInQuint: (t: number) => t * t * t * t * t,\n\n  easeOutQuint: (t: number) => (t -= 1) * t * t * t * t + 1,\n\n  easeInOutQuint: (t: number) => ((t /= 0.5) < 1)\n    ? 0.5 * t * t * t * t * t\n    : 0.5 * ((t -= 2) * t * t * t * t + 2),\n\n  easeInSine: (t: number) => -Math.cos(t * HALF_PI) + 1,\n\n  easeOutSine: (t: number) => Math.sin(t * HALF_PI),\n\n  easeInOutSine: (t: number) => -0.5 * (Math.cos(PI * t) - 1),\n\n  easeInExpo: (t: number) => (t === 0) ? 0 : Math.pow(2, 10 * (t - 1)),\n\n  easeOutExpo: (t: number) => (t === 1) ? 1 : -Math.pow(2, -10 * t) + 1,\n\n  easeInOutExpo: (t: number) => atEdge(t) ? t : t < 0.5\n    ? 0.5 * Math.pow(2, 10 * (t * 2 - 1))\n    : 0.5 * (-Math.pow(2, -10 * (t * 2 - 1)) + 2),\n\n  easeInCirc: (t: number) => (t >= 1) ? t : -(Math.sqrt(1 - t * t) - 1),\n\n  easeOutCirc: (t: number) => Math.sqrt(1 - (t -= 1) * t),\n\n  easeInOutCirc: (t: number) => ((t /= 0.5) < 1)\n    ? -0.5 * (Math.sqrt(1 - t * t) - 1)\n    : 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1),\n\n  easeInElastic: (t: number) => atEdge(t) ? t : elasticIn(t, 0.075, 0.3),\n\n  easeOutElastic: (t: number) => atEdge(t) ? t : elasticOut(t, 0.075, 0.3),\n\n  easeInOutElastic(t: number) {\n    const s = 0.1125;\n    const p = 0.45;\n    return atEdge(t) ? t :\n      t < 0.5\n        ? 0.5 * elasticIn(t * 2, s, p)\n        : 0.5 + 0.5 * elasticOut(t * 2 - 1, s, p);\n  },\n\n  easeInBack(t: number) {\n    const s = 1.70158;\n    return t * t * ((s + 1) * t - s);\n  },\n\n  easeOutBack(t: number) {\n    const s = 1.70158;\n    return (t -= 1) * t * ((s + 1) * t + s) + 1;\n  },\n\n  easeInOutBack(t: number) {\n    let s = 1.70158;\n    if ((t /= 0.5) < 1) {\n      return 0.5 * (t * t * (((s *= (1.525)) + 1) * t - s));\n    }\n    return 0.5 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2);\n  },\n\n  easeInBounce: (t: number) => 1 - effects.easeOutBounce(1 - t),\n\n  easeOutBounce(t: number) {\n    const m = 7.5625;\n    const d = 2.75;\n    if (t < (1 / d)) {\n      return m * t * t;\n    }\n    if (t < (2 / d)) {\n      return m * (t -= (1.5 / d)) * t + 0.75;\n    }\n    if (t < (2.5 / d)) {\n      return m * (t -= (2.25 / d)) * t + 0.9375;\n    }\n    return m * (t -= (2.625 / d)) * t + 0.984375;\n  },\n\n  easeInOutBounce: (t: number) => (t < 0.5)\n    ? effects.easeInBounce(t * 2) * 0.5\n    : effects.easeOutBounce(t * 2 - 1) * 0.5 + 0.5,\n} as const;\n\nexport type EasingFunction = keyof typeof effects\n\nexport default effects;\n", "import {Color} from '@kurkle/color';\n\nexport function isPatternOrGradient(value: unknown): value is CanvasPattern | CanvasGradient {\n  if (value && typeof value === 'object') {\n    const type = value.toString();\n    return type === '[object CanvasPattern]' || type === '[object CanvasGradient]';\n  }\n\n  return false;\n}\n\nexport function color(value: CanvasGradient): CanvasGradient;\nexport function color(value: CanvasPattern): CanvasPattern;\nexport function color(\n  value:\n  | string\n  | { r: number; g: number; b: number; a: number }\n  | [number, number, number]\n  | [number, number, number, number]\n): Color;\nexport function color(value) {\n  return isPatternOrGradient(value) ? value : new Color(value);\n}\n\nexport function getHoverColor(value: CanvasGradient): CanvasGradient;\nexport function getHoverColor(value: CanvasPattern): CanvasPattern;\nexport function getHoverColor(value: string): string;\nexport function getHoverColor(value) {\n  return isPatternOrGradient(value)\n    ? value\n    : new Color(value).saturate(0.5).darken(0.1).hexString();\n}\n", "const numbers = ['x', 'y', 'borderWidth', 'radius', 'tension'];\nconst colors = ['color', 'borderColor', 'backgroundColor'];\n\nexport function applyAnimationsDefaults(defaults) {\n  defaults.set('animation', {\n    delay: undefined,\n    duration: 1000,\n    easing: 'easeOutQuart',\n    fn: undefined,\n    from: undefined,\n    loop: undefined,\n    to: undefined,\n    type: undefined,\n  });\n\n  defaults.describe('animation', {\n    _fallback: false,\n    _indexable: false,\n    _scriptable: (name) => name !== 'onProgress' && name !== 'onComplete' && name !== 'fn',\n  });\n\n  defaults.set('animations', {\n    colors: {\n      type: 'color',\n      properties: colors\n    },\n    numbers: {\n      type: 'number',\n      properties: numbers\n    },\n  });\n\n  defaults.describe('animations', {\n    _fallback: 'animation',\n  });\n\n  defaults.set('transitions', {\n    active: {\n      animation: {\n        duration: 400\n      }\n    },\n    resize: {\n      animation: {\n        duration: 0\n      }\n    },\n    show: {\n      animations: {\n        colors: {\n          from: 'transparent'\n        },\n        visible: {\n          type: 'boolean',\n          duration: 0 // show immediately\n        },\n      }\n    },\n    hide: {\n      animations: {\n        colors: {\n          to: 'transparent'\n        },\n        visible: {\n          type: 'boolean',\n          easing: 'linear',\n          fn: v => v | 0 // for keeping the dataset visible all the way through the animation\n        },\n      }\n    }\n  });\n}\n", "export function applyLayoutsDefaults(defaults) {\n  defaults.set('layout', {\n    autoPadding: true,\n    padding: {\n      top: 0,\n      right: 0,\n      bottom: 0,\n      left: 0\n    }\n  });\n}\n", "\nconst intlCache = new Map<string, Intl.NumberFormat>();\n\nfunction getNumberFormat(locale: string, options?: Intl.NumberFormatOptions) {\n  options = options || {};\n  const cacheKey = locale + JSON.stringify(options);\n  let formatter = intlCache.get(cacheKey);\n  if (!formatter) {\n    formatter = new Intl.NumberFormat(locale, options);\n    intlCache.set(cacheKey, formatter);\n  }\n  return formatter;\n}\n\nexport function formatNumber(num: number, locale: string, options?: Intl.NumberFormatOptions) {\n  return getNumberFormat(locale, options).format(num);\n}\n", "import {isArray} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {log10} from '../helpers/helpers.math.js';\n\n/**\n * Namespace to hold formatters for different types of ticks\n * @namespace Chart.Ticks.formatters\n */\nconst formatters = {\n  /**\n   * Formatter for value labels\n   * @method Chart.Ticks.formatters.values\n   * @param value the value to display\n   * @return {string|string[]} the label to display\n   */\n  values(value) {\n    return isArray(value) ? /** @type {string[]} */ (value) : '' + value;\n  },\n\n  /**\n   * Formatter for numeric ticks\n   * @method Chart.Ticks.formatters.numeric\n   * @param tickValue {number} the value to be formatted\n   * @param index {number} the position of the tickValue parameter in the ticks array\n   * @param ticks {object[]} the list of ticks being converted\n   * @return {string} string representation of the tickValue parameter\n   */\n  numeric(tickValue, index, ticks) {\n    if (tickValue === 0) {\n      return '0'; // never show decimal places for 0\n    }\n\n    const locale = this.chart.options.locale;\n    let notation;\n    let delta = tickValue; // This is used when there are less than 2 ticks as the tick interval.\n\n    if (ticks.length > 1) {\n      // all ticks are small or there huge numbers; use scientific notation\n      const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));\n      if (maxTick < 1e-4 || maxTick > 1e+15) {\n        notation = 'scientific';\n      }\n\n      delta = calculateDelta(tickValue, ticks);\n    }\n\n    const logDelta = log10(Math.abs(delta));\n\n    // When datasets have values approaching Number.MAX_VALUE, the tick calculations might result in\n    // infinity and eventually NaN. Passing NaN for minimumFractionDigits or maximumFractionDigits\n    // will make the number formatter throw. So instead we check for isNaN and use a fallback value.\n    //\n    // toFixed has a max of 20 decimal places\n    const numDecimal = isNaN(logDelta) ? 1 : Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);\n\n    const options = {notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal};\n    Object.assign(options, this.options.ticks.format);\n\n    return formatNumber(tickValue, locale, options);\n  },\n\n\n  /**\n   * Formatter for logarithmic ticks\n   * @method Chart.Ticks.formatters.logarithmic\n   * @param tickValue {number} the value to be formatted\n   * @param index {number} the position of the tickValue parameter in the ticks array\n   * @param ticks {object[]} the list of ticks being converted\n   * @return {string} string representation of the tickValue parameter\n   */\n  logarithmic(tickValue, index, ticks) {\n    if (tickValue === 0) {\n      return '0';\n    }\n    const remain = ticks[index].significand || (tickValue / (Math.pow(10, Math.floor(log10(tickValue)))));\n    if ([1, 2, 3, 5, 10, 15].includes(remain) || index > 0.8 * ticks.length) {\n      return formatters.numeric.call(this, tickValue, index, ticks);\n    }\n    return '';\n  }\n\n};\n\n\nfunction calculateDelta(tickValue, ticks) {\n  // Figure out how many digits to show\n  // The space between the first two ticks might be smaller than normal spacing\n  let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;\n\n  // If we have a number like 2.5 as the delta, figure out how many decimal places we need\n  if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {\n    // not an integer\n    delta = tickValue - Math.floor(tickValue);\n  }\n  return delta;\n}\n\n/**\n * Namespace to hold static tick generation functions\n * @namespace Chart.Ticks\n */\nexport default {formatters};\n", "import Ticks from './core.ticks.js';\n\nexport function applyScaleDefaults(defaults) {\n  defaults.set('scale', {\n    display: true,\n    offset: false,\n    reverse: false,\n    beginAtZero: false,\n\n    /**\n     * Scale boundary strategy (bypassed by min/max time options)\n     * - `data`: make sure data are fully visible, ticks outside are removed\n     * - `ticks`: make sure ticks are fully visible, data outside are truncated\n     * @see https://github.com/chartjs/Chart.js/pull/4556\n     * @since 3.0.0\n     */\n    bounds: 'ticks',\n\n    clip: true,\n\n    /**\n     * Addition grace added to max and reduced from min data value.\n     * @since 3.0.0\n     */\n    grace: 0,\n\n    // grid line settings\n    grid: {\n      display: true,\n      lineWidth: 1,\n      drawOnChartArea: true,\n      drawTicks: true,\n      tickLength: 8,\n      tickWidth: (_ctx, options) => options.lineWidth,\n      tickColor: (_ctx, options) => options.color,\n      offset: false,\n    },\n\n    border: {\n      display: true,\n      dash: [],\n      dashOffset: 0.0,\n      width: 1\n    },\n\n    // scale title\n    title: {\n      // display property\n      display: false,\n\n      // actual label\n      text: '',\n\n      // top/bottom padding\n      padding: {\n        top: 4,\n        bottom: 4\n      }\n    },\n\n    // label settings\n    ticks: {\n      minRotation: 0,\n      maxRotation: 50,\n      mirror: false,\n      textStrokeWidth: 0,\n      textStrokeColor: '',\n      padding: 3,\n      display: true,\n      autoSkip: true,\n      autoSkipPadding: 3,\n      labelOffset: 0,\n      // We pass through arrays to be rendered as multiline labels, we convert Others to strings here.\n      callback: Ticks.formatters.values,\n      minor: {},\n      major: {},\n      align: 'center',\n      crossAlign: 'near',\n\n      showLabelBackdrop: false,\n      backdropColor: 'rgba(255, 255, 255, 0.75)',\n      backdropPadding: 2,\n    }\n  });\n\n  defaults.route('scale.ticks', 'color', '', 'color');\n  defaults.route('scale.grid', 'color', '', 'borderColor');\n  defaults.route('scale.border', 'color', '', 'borderColor');\n  defaults.route('scale.title', 'color', '', 'color');\n\n  defaults.describe('scale', {\n    _fallback: false,\n    _scriptable: (name) => !name.startsWith('before') && !name.startsWith('after') && name !== 'callback' && name !== 'parser',\n    _indexable: (name) => name !== 'borderDash' && name !== 'tickBorderDash' && name !== 'dash',\n  });\n\n  defaults.describe('scales', {\n    _fallback: 'scale',\n  });\n\n  defaults.describe('scale.ticks', {\n    _scriptable: (name) => name !== 'backdropPadding' && name !== 'callback',\n    _indexable: (name) => name !== 'backdropPadding',\n  });\n}\n", "import {getHoverColor} from '../helpers/helpers.color.js';\nimport {isObject, merge, valueOrDefault} from '../helpers/helpers.core.js';\nimport {applyAnimationsDefaults} from './core.animations.defaults.js';\nimport {applyLayoutsDefaults} from './core.layouts.defaults.js';\nimport {applyScaleDefaults} from './core.scale.defaults.js';\n\nexport const overrides = Object.create(null);\nexport const descriptors = Object.create(null);\n\n/**\n * @param {object} node\n * @param {string} key\n * @return {object}\n */\nfunction getScope(node, key) {\n  if (!key) {\n    return node;\n  }\n  const keys = key.split('.');\n  for (let i = 0, n = keys.length; i < n; ++i) {\n    const k = keys[i];\n    node = node[k] || (node[k] = Object.create(null));\n  }\n  return node;\n}\n\nfunction set(root, scope, values) {\n  if (typeof scope === 'string') {\n    return merge(getScope(root, scope), values);\n  }\n  return merge(getScope(root, ''), scope);\n}\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Defaults {\n  constructor(_descriptors, _appliers) {\n    this.animation = undefined;\n    this.backgroundColor = 'rgba(0,0,0,0.1)';\n    this.borderColor = 'rgba(0,0,0,0.1)';\n    this.color = '#666';\n    this.datasets = {};\n    this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();\n    this.elements = {};\n    this.events = [\n      'mousemove',\n      'mouseout',\n      'click',\n      'touchstart',\n      'touchmove'\n    ];\n    this.font = {\n      family: \"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif\",\n      size: 12,\n      style: 'normal',\n      lineHeight: 1.2,\n      weight: null\n    };\n    this.hover = {};\n    this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);\n    this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);\n    this.hoverColor = (ctx, options) => getHoverColor(options.color);\n    this.indexAxis = 'x';\n    this.interaction = {\n      mode: 'nearest',\n      intersect: true,\n      includeInvisible: false\n    };\n    this.maintainAspectRatio = true;\n    this.onHover = null;\n    this.onClick = null;\n    this.parsing = true;\n    this.plugins = {};\n    this.responsive = true;\n    this.scale = undefined;\n    this.scales = {};\n    this.showLine = true;\n    this.drawActiveElementsOnTop = true;\n\n    this.describe(_descriptors);\n    this.apply(_appliers);\n  }\n\n  /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n  set(scope, values) {\n    return set(this, scope, values);\n  }\n\n  /**\n\t * @param {string} scope\n\t */\n  get(scope) {\n    return getScope(this, scope);\n  }\n\n  /**\n\t * @param {string|object} scope\n\t * @param {object} [values]\n\t */\n  describe(scope, values) {\n    return set(descriptors, scope, values);\n  }\n\n  override(scope, values) {\n    return set(overrides, scope, values);\n  }\n\n  /**\n\t * Routes the named defaults to fallback to another scope/name.\n\t * This routing is useful when those target values, like defaults.color, are changed runtime.\n\t * If the values would be copied, the runtime change would not take effect. By routing, the\n\t * fallback is evaluated at each access, so its always up to date.\n\t *\n\t * Example:\n\t *\n\t * \tdefaults.route('elements.arc', 'backgroundColor', '', 'color')\n\t *   - reads the backgroundColor from defaults.color when undefined locally\n\t *\n\t * @param {string} scope Scope this route applies to.\n\t * @param {string} name Property name that should be routed to different namespace when not defined here.\n\t * @param {string} targetScope The namespace where those properties should be routed to.\n\t * Empty string ('') is the root of defaults.\n\t * @param {string} targetName The target name in the target scope the property should be routed to.\n\t */\n  route(scope, name, targetScope, targetName) {\n    const scopeObject = getScope(this, scope);\n    const targetScopeObject = getScope(this, targetScope);\n    const privateName = '_' + name;\n\n    Object.defineProperties(scopeObject, {\n      // A private property is defined to hold the actual value, when this property is set in its scope (set in the setter)\n      [privateName]: {\n        value: scopeObject[name],\n        writable: true\n      },\n      // The actual property is defined as getter/setter so we can do the routing when value is not locally set.\n      [name]: {\n        enumerable: true,\n        get() {\n          const local = this[privateName];\n          const target = targetScopeObject[targetName];\n          if (isObject(local)) {\n            return Object.assign({}, target, local);\n          }\n          return valueOrDefault(local, target);\n        },\n        set(value) {\n          this[privateName] = value;\n        }\n      }\n    });\n  }\n\n  apply(appliers) {\n    appliers.forEach((apply) => apply(this));\n  }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Defaults({\n  _scriptable: (name) => !name.startsWith('on'),\n  _indexable: (name) => name !== 'events',\n  hover: {\n    _fallback: 'interaction'\n  },\n  interaction: {\n    _scriptable: false,\n    _indexable: false,\n  }\n}, [applyAnimationsDefaults, applyLayoutsDefaults, applyScaleDefaults]);\n", "import type {\n  Chart,\n  Point,\n  FontSpec,\n  CanvasFontSpec,\n  PointStyle,\n  RenderTextOpts,\n  BackdropOptions\n} from '../types/index.js';\nimport type {\n  TRBL,\n  SplinePoint,\n  RoundedRect,\n  TRBLCorners\n} from '../types/geometric.js';\nimport {isArray, isNullOrUndef} from './helpers.core.js';\nimport {PI, TAU, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, RAD_PER_DEG} from './helpers.math.js';\n\n/**\n * Converts the given font object into a CSS font string.\n * @param font - A font object.\n * @return The CSS font string. See https://developer.mozilla.org/en-US/docs/Web/CSS/font\n * @private\n */\nexport function toFontString(font: FontSpec) {\n  if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {\n    return null;\n  }\n\n  return (font.style ? font.style + ' ' : '')\n\t\t+ (font.weight ? font.weight + ' ' : '')\n\t\t+ font.size + 'px '\n\t\t+ font.family;\n}\n\n/**\n * @private\n */\nexport function _measureText(\n  ctx: CanvasRenderingContext2D,\n  data: Record<string, number>,\n  gc: string[],\n  longest: number,\n  string: string\n) {\n  let textWidth = data[string];\n  if (!textWidth) {\n    textWidth = data[string] = ctx.measureText(string).width;\n    gc.push(string);\n  }\n  if (textWidth > longest) {\n    longest = textWidth;\n  }\n  return longest;\n}\n\ntype Thing = string | undefined | null\ntype Things = (Thing | Thing[])[]\n\n/**\n * @private\n */\n// eslint-disable-next-line complexity\nexport function _longestText(\n  ctx: CanvasRenderingContext2D,\n  font: string,\n  arrayOfThings: Things,\n  cache?: {data?: Record<string, number>, garbageCollect?: string[], font?: string}\n) {\n  cache = cache || {};\n  let data = cache.data = cache.data || {};\n  let gc = cache.garbageCollect = cache.garbageCollect || [];\n\n  if (cache.font !== font) {\n    data = cache.data = {};\n    gc = cache.garbageCollect = [];\n    cache.font = font;\n  }\n\n  ctx.save();\n\n  ctx.font = font;\n  let longest = 0;\n  const ilen = arrayOfThings.length;\n  let i: number, j: number, jlen: number, thing: Thing | Thing[], nestedThing: Thing | Thing[];\n  for (i = 0; i < ilen; i++) {\n    thing = arrayOfThings[i];\n\n    // Undefined strings and arrays should not be measured\n    if (thing !== undefined && thing !== null && !isArray(thing)) {\n      longest = _measureText(ctx, data, gc, longest, thing);\n    } else if (isArray(thing)) {\n      // if it is an array lets measure each element\n      // to do maybe simplify this function a bit so we can do this more recursively?\n      for (j = 0, jlen = thing.length; j < jlen; j++) {\n        nestedThing = thing[j];\n        // Undefined strings and arrays should not be measured\n        if (nestedThing !== undefined && nestedThing !== null && !isArray(nestedThing)) {\n          longest = _measureText(ctx, data, gc, longest, nestedThing);\n        }\n      }\n    }\n  }\n\n  ctx.restore();\n\n  const gcLen = gc.length / 2;\n  if (gcLen > arrayOfThings.length) {\n    for (i = 0; i < gcLen; i++) {\n      delete data[gc[i]];\n    }\n    gc.splice(0, gcLen);\n  }\n  return longest;\n}\n\n/**\n * Returns the aligned pixel value to avoid anti-aliasing blur\n * @param chart - The chart instance.\n * @param pixel - A pixel value.\n * @param width - The width of the element.\n * @returns The aligned pixel value.\n * @private\n */\nexport function _alignPixel(chart: Chart, pixel: number, width: number) {\n  const devicePixelRatio = chart.currentDevicePixelRatio;\n  const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;\n  return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;\n}\n\n/**\n * Clears the entire canvas.\n */\nexport function clearCanvas(canvas: HTMLCanvasElement, ctx?: CanvasRenderingContext2D) {\n  ctx = ctx || canvas.getContext('2d');\n\n  ctx.save();\n  // canvas.width and canvas.height do not consider the canvas transform,\n  // while clearRect does\n  ctx.resetTransform();\n  ctx.clearRect(0, 0, canvas.width, canvas.height);\n  ctx.restore();\n}\n\nexport interface DrawPointOptions {\n  pointStyle: PointStyle;\n  rotation?: number;\n  radius: number;\n  borderWidth: number;\n}\n\nexport function drawPoint(\n  ctx: CanvasRenderingContext2D,\n  options: DrawPointOptions,\n  x: number,\n  y: number\n) {\n  // eslint-disable-next-line @typescript-eslint/no-use-before-define\n  drawPointLegend(ctx, options, x, y, null);\n}\n\n// eslint-disable-next-line complexity\nexport function drawPointLegend(\n  ctx: CanvasRenderingContext2D,\n  options: DrawPointOptions,\n  x: number,\n  y: number,\n  w: number\n) {\n  let type: string, xOffset: number, yOffset: number, size: number, cornerRadius: number, width: number, xOffsetW: number, yOffsetW: number;\n  const style = options.pointStyle;\n  const rotation = options.rotation;\n  const radius = options.radius;\n  let rad = (rotation || 0) * RAD_PER_DEG;\n\n  if (style && typeof style === 'object') {\n    type = style.toString();\n    if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') {\n      ctx.save();\n      ctx.translate(x, y);\n      ctx.rotate(rad);\n      ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n      ctx.restore();\n      return;\n    }\n  }\n\n  if (isNaN(radius) || radius <= 0) {\n    return;\n  }\n\n  ctx.beginPath();\n\n  switch (style) {\n  // Default includes circle\n    default:\n      if (w) {\n        ctx.ellipse(x, y, w / 2, radius, 0, 0, TAU);\n      } else {\n        ctx.arc(x, y, radius, 0, TAU);\n      }\n      ctx.closePath();\n      break;\n    case 'triangle':\n      width = w ? w / 2 : radius;\n      ctx.moveTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n      rad += TWO_THIRDS_PI;\n      ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n      rad += TWO_THIRDS_PI;\n      ctx.lineTo(x + Math.sin(rad) * width, y - Math.cos(rad) * radius);\n      ctx.closePath();\n      break;\n    case 'rectRounded':\n    // NOTE: the rounded rect implementation changed to use `arc` instead of\n    // `quadraticCurveTo` since it generates better results when rect is\n    // almost a circle. 0.516 (instead of 0.5) produces results with visually\n    // closer proportion to the previous impl and it is inscribed in the\n    // circle with `radius`. For more details, see the following PRs:\n    // https://github.com/chartjs/Chart.js/issues/5597\n    // https://github.com/chartjs/Chart.js/issues/5858\n      cornerRadius = radius * 0.516;\n      size = radius - cornerRadius;\n      xOffset = Math.cos(rad + QUARTER_PI) * size;\n      xOffsetW = Math.cos(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n      yOffset = Math.sin(rad + QUARTER_PI) * size;\n      yOffsetW = Math.sin(rad + QUARTER_PI) * (w ? w / 2 - cornerRadius : size);\n      ctx.arc(x - xOffsetW, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n      ctx.arc(x + yOffsetW, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n      ctx.arc(x + xOffsetW, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n      ctx.arc(x - yOffsetW, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n      ctx.closePath();\n      break;\n    case 'rect':\n      if (!rotation) {\n        size = Math.SQRT1_2 * radius;\n        width = w ? w / 2 : size;\n        ctx.rect(x - width, y - size, 2 * width, 2 * size);\n        break;\n      }\n      rad += QUARTER_PI;\n    /* falls through */\n    case 'rectRot':\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      ctx.closePath();\n      break;\n    case 'crossRot':\n      rad += QUARTER_PI;\n    /* falls through */\n    case 'cross':\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.moveTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      break;\n    case 'star':\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.moveTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      rad += QUARTER_PI;\n      xOffsetW = Math.cos(rad) * (w ? w / 2 : radius);\n      xOffset = Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      yOffsetW = Math.sin(rad) * (w ? w / 2 : radius);\n      ctx.moveTo(x - xOffsetW, y - yOffset);\n      ctx.lineTo(x + xOffsetW, y + yOffset);\n      ctx.moveTo(x + yOffsetW, y - xOffset);\n      ctx.lineTo(x - yOffsetW, y + xOffset);\n      break;\n    case 'line':\n      xOffset = w ? w / 2 : Math.cos(rad) * radius;\n      yOffset = Math.sin(rad) * radius;\n      ctx.moveTo(x - xOffset, y - yOffset);\n      ctx.lineTo(x + xOffset, y + yOffset);\n      break;\n    case 'dash':\n      ctx.moveTo(x, y);\n      ctx.lineTo(x + Math.cos(rad) * (w ? w / 2 : radius), y + Math.sin(rad) * radius);\n      break;\n    case false:\n      ctx.closePath();\n      break;\n  }\n\n  ctx.fill();\n  if (options.borderWidth > 0) {\n    ctx.stroke();\n  }\n}\n\n/**\n * Returns true if the point is inside the rectangle\n * @param point - The point to test\n * @param area - The rectangle\n * @param margin - allowed margin\n * @private\n */\nexport function _isPointInArea(\n  point: Point,\n  area: TRBL,\n  margin?: number\n) {\n  margin = margin || 0.5; // margin - default is to match rounded decimals\n\n  return !area || (point && point.x > area.left - margin && point.x < area.right + margin &&\n\t\tpoint.y > area.top - margin && point.y < area.bottom + margin);\n}\n\nexport function clipArea(ctx: CanvasRenderingContext2D, area: TRBL) {\n  ctx.save();\n  ctx.beginPath();\n  ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);\n  ctx.clip();\n}\n\nexport function unclipArea(ctx: CanvasRenderingContext2D) {\n  ctx.restore();\n}\n\n/**\n * @private\n */\nexport function _steppedLineTo(\n  ctx: CanvasRenderingContext2D,\n  previous: Point,\n  target: Point,\n  flip?: boolean,\n  mode?: string\n) {\n  if (!previous) {\n    return ctx.lineTo(target.x, target.y);\n  }\n  if (mode === 'middle') {\n    const midpoint = (previous.x + target.x) / 2.0;\n    ctx.lineTo(midpoint, previous.y);\n    ctx.lineTo(midpoint, target.y);\n  } else if (mode === 'after' !== !!flip) {\n    ctx.lineTo(previous.x, target.y);\n  } else {\n    ctx.lineTo(target.x, previous.y);\n  }\n  ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @private\n */\nexport function _bezierCurveTo(\n  ctx: CanvasRenderingContext2D,\n  previous: SplinePoint,\n  target: SplinePoint,\n  flip?: boolean\n) {\n  if (!previous) {\n    return ctx.lineTo(target.x, target.y);\n  }\n  ctx.bezierCurveTo(\n    flip ? previous.cp1x : previous.cp2x,\n    flip ? previous.cp1y : previous.cp2y,\n    flip ? target.cp2x : target.cp1x,\n    flip ? target.cp2y : target.cp1y,\n    target.x,\n    target.y);\n}\n\nfunction setRenderOpts(ctx: CanvasRenderingContext2D, opts: RenderTextOpts) {\n  if (opts.translation) {\n    ctx.translate(opts.translation[0], opts.translation[1]);\n  }\n\n  if (!isNullOrUndef(opts.rotation)) {\n    ctx.rotate(opts.rotation);\n  }\n\n  if (opts.color) {\n    ctx.fillStyle = opts.color;\n  }\n\n  if (opts.textAlign) {\n    ctx.textAlign = opts.textAlign;\n  }\n\n  if (opts.textBaseline) {\n    ctx.textBaseline = opts.textBaseline;\n  }\n}\n\nfunction decorateText(\n  ctx: CanvasRenderingContext2D,\n  x: number,\n  y: number,\n  line: string,\n  opts: RenderTextOpts\n) {\n  if (opts.strikethrough || opts.underline) {\n    /**\n     * Now that IE11 support has been dropped, we can use more\n     * of the TextMetrics object. The actual bounding boxes\n     * are unflagged in Chrome, Firefox, Edge, and Safari so they\n     * can be safely used.\n     * See https://developer.mozilla.org/en-US/docs/Web/API/TextMetrics#Browser_compatibility\n     */\n    const metrics = ctx.measureText(line);\n    const left = x - metrics.actualBoundingBoxLeft;\n    const right = x + metrics.actualBoundingBoxRight;\n    const top = y - metrics.actualBoundingBoxAscent;\n    const bottom = y + metrics.actualBoundingBoxDescent;\n    const yDecoration = opts.strikethrough ? (top + bottom) / 2 : bottom;\n\n    ctx.strokeStyle = ctx.fillStyle;\n    ctx.beginPath();\n    ctx.lineWidth = opts.decorationWidth || 2;\n    ctx.moveTo(left, yDecoration);\n    ctx.lineTo(right, yDecoration);\n    ctx.stroke();\n  }\n}\n\nfunction drawBackdrop(ctx: CanvasRenderingContext2D, opts: BackdropOptions) {\n  const oldColor = ctx.fillStyle;\n\n  ctx.fillStyle = opts.color as string;\n  ctx.fillRect(opts.left, opts.top, opts.width, opts.height);\n  ctx.fillStyle = oldColor;\n}\n\n/**\n * Render text onto the canvas\n */\nexport function renderText(\n  ctx: CanvasRenderingContext2D,\n  text: string | string[],\n  x: number,\n  y: number,\n  font: CanvasFontSpec,\n  opts: RenderTextOpts = {}\n) {\n  const lines = isArray(text) ? text : [text];\n  const stroke = opts.strokeWidth > 0 && opts.strokeColor !== '';\n  let i: number, line: string;\n\n  ctx.save();\n  ctx.font = font.string;\n  setRenderOpts(ctx, opts);\n\n  for (i = 0; i < lines.length; ++i) {\n    line = lines[i];\n\n    if (opts.backdrop) {\n      drawBackdrop(ctx, opts.backdrop);\n    }\n\n    if (stroke) {\n      if (opts.strokeColor) {\n        ctx.strokeStyle = opts.strokeColor;\n      }\n\n      if (!isNullOrUndef(opts.strokeWidth)) {\n        ctx.lineWidth = opts.strokeWidth;\n      }\n\n      ctx.strokeText(line, x, y, opts.maxWidth);\n    }\n\n    ctx.fillText(line, x, y, opts.maxWidth);\n    decorateText(ctx, x, y, line, opts);\n\n    y += Number(font.lineHeight);\n  }\n\n  ctx.restore();\n}\n\n/**\n * Add a path of a rectangle with rounded corners to the current sub-path\n * @param ctx - Context\n * @param rect - Bounding rect\n */\nexport function addRoundedRectPath(\n  ctx: CanvasRenderingContext2D,\n  rect: RoundedRect & { radius: TRBLCorners }\n) {\n  const {x, y, w, h, radius} = rect;\n\n  // top left arc\n  ctx.arc(x + radius.topLeft, y + radius.topLeft, radius.topLeft, 1.5 * PI, PI, true);\n\n  // line from top left to bottom left\n  ctx.lineTo(x, y + h - radius.bottomLeft);\n\n  // bottom left arc\n  ctx.arc(x + radius.bottomLeft, y + h - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);\n\n  // line from bottom left to bottom right\n  ctx.lineTo(x + w - radius.bottomRight, y + h);\n\n  // bottom right arc\n  ctx.arc(x + w - radius.bottomRight, y + h - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);\n\n  // line from bottom right to top right\n  ctx.lineTo(x + w, y + radius.topRight);\n\n  // top right arc\n  ctx.arc(x + w - radius.topRight, y + radius.topRight, radius.topRight, 0, -HALF_PI, true);\n\n  // line from top right to top left\n  ctx.lineTo(x + radius.topLeft, y);\n}\n", "import defaults from '../core/core.defaults.js';\nimport {isArray, isObject, toDimension, valueOrDefault} from './helpers.core.js';\nimport {toFontString} from './helpers.canvas.js';\nimport type {ChartArea, FontSpec, Point} from '../types/index.js';\nimport type {TRBL, TRBLCorners} from '../types/geometric.js';\n\nconst LINE_HEIGHT = /^(normal|(\\d+(?:\\.\\d+)?)(px|em|%)?)$/;\nconst FONT_STYLE = /^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;\n\n/**\n * @alias Chart.helpers.options\n * @namespace\n */\n/**\n * Converts the given line height `value` in pixels for a specific font `size`.\n * @param value - The lineHeight to parse (eg. 1.6, '14px', '75%', '1.6em').\n * @param size - The font size (in pixels) used to resolve relative `value`.\n * @returns The effective line height in pixels (size * 1.2 if value is invalid).\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/line-height\n * @since 2.7.0\n */\nexport function toLineHeight(value: number | string, size: number): number {\n  const matches = ('' + value).match(LINE_HEIGHT);\n  if (!matches || matches[1] === 'normal') {\n    return size * 1.2;\n  }\n\n  value = +matches[2];\n\n  switch (matches[3]) {\n    case 'px':\n      return value;\n    case '%':\n      value /= 100;\n      break;\n    default:\n      break;\n  }\n\n  return size * value;\n}\n\nconst numberOrZero = (v: unknown) => +v || 0;\n\n/**\n * @param value\n * @param props\n */\nexport function _readValueToProps<K extends string>(value: number | Record<K, number>, props: K[]): Record<K, number>;\nexport function _readValueToProps<K extends string, T extends string>(value: number | Record<K & T, number>, props: Record<T, K>): Record<T, number>;\nexport function _readValueToProps(value: number | Record<string, number>, props: string[] | Record<string, string>) {\n  const ret = {};\n  const objProps = isObject(props);\n  const keys = objProps ? Object.keys(props) : props;\n  const read = isObject(value)\n    ? objProps\n      ? prop => valueOrDefault(value[prop], value[props[prop]])\n      : prop => value[prop]\n    : () => value;\n\n  for (const prop of keys) {\n    ret[prop] = numberOrZero(read(prop));\n  }\n  return ret;\n}\n\n/**\n * Converts the given value into a TRBL object.\n * @param value - If a number, set the value to all TRBL component,\n *  else, if an object, use defined properties and sets undefined ones to 0.\n *  x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left)\n * @since 3.0.0\n */\nexport function toTRBL(value: number | TRBL | Point) {\n  return _readValueToProps(value, {top: 'y', right: 'x', bottom: 'y', left: 'x'});\n}\n\n/**\n * Converts the given value into a TRBL corners object (similar with css border-radius).\n * @param value - If a number, set the value to all TRBL corner components,\n *  else, if an object, use defined properties and sets undefined ones to 0.\n * @returns The TRBL corner values (topLeft, topRight, bottomLeft, bottomRight)\n * @since 3.0.0\n */\nexport function toTRBLCorners(value: number | TRBLCorners) {\n  return _readValueToProps(value, ['topLeft', 'topRight', 'bottomLeft', 'bottomRight']);\n}\n\n/**\n * Converts the given value into a padding object with pre-computed width/height.\n * @param value - If a number, set the value to all TRBL component,\n *  else, if an object, use defined properties and sets undefined ones to 0.\n *  x / y are shorthands for same value for left/right and top/bottom.\n * @returns The padding values (top, right, bottom, left, width, height)\n * @since 2.7.0\n */\nexport function toPadding(value?: number | TRBL): ChartArea {\n  const obj = toTRBL(value) as ChartArea;\n\n  obj.width = obj.left + obj.right;\n  obj.height = obj.top + obj.bottom;\n\n  return obj;\n}\n\n/**\n * Parses font options and returns the font object.\n * @param options - A object that contains font options to be parsed.\n * @param fallback - A object that contains fallback font options.\n * @return The font object.\n * @private\n */\n\nexport function toFont(options: Partial<FontSpec>, fallback?: Partial<FontSpec>) {\n  options = options || {};\n  fallback = fallback || defaults.font as FontSpec;\n\n  let size = valueOrDefault(options.size, fallback.size);\n\n  if (typeof size === 'string') {\n    size = parseInt(size, 10);\n  }\n  let style = valueOrDefault(options.style, fallback.style);\n  if (style && !('' + style).match(FONT_STYLE)) {\n    console.warn('Invalid font style specified: \"' + style + '\"');\n    style = undefined;\n  }\n\n  const font = {\n    family: valueOrDefault(options.family, fallback.family),\n    lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),\n    size,\n    style,\n    weight: valueOrDefault(options.weight, fallback.weight),\n    string: ''\n  };\n\n  font.string = toFontString(font);\n  return font;\n}\n\n/**\n * Evaluates the given `inputs` sequentially and returns the first defined value.\n * @param inputs - An array of values, falling back to the last value.\n * @param context - If defined and the current value is a function, the value\n * is called with `context` as first argument and the result becomes the new input.\n * @param index - If defined and the current value is an array, the value\n * at `index` become the new input.\n * @param info - object to return information about resolution in\n * @param info.cacheable - Will be set to `false` if option is not cacheable.\n * @since 2.7.0\n */\nexport function resolve(inputs: Array<unknown>, context?: object, index?: number, info?: { cacheable: boolean }) {\n  let cacheable = true;\n  let i: number, ilen: number, value: unknown;\n\n  for (i = 0, ilen = inputs.length; i < ilen; ++i) {\n    value = inputs[i];\n    if (value === undefined) {\n      continue;\n    }\n    if (context !== undefined && typeof value === 'function') {\n      value = value(context);\n      cacheable = false;\n    }\n    if (index !== undefined && isArray(value)) {\n      value = value[index % value.length];\n      cacheable = false;\n    }\n    if (value !== undefined) {\n      if (info && !cacheable) {\n        info.cacheable = false;\n      }\n      return value;\n    }\n  }\n}\n\n/**\n * @param minmax\n * @param grace\n * @param beginAtZero\n * @private\n */\nexport function _addGrace(minmax: { min: number; max: number; }, grace: number | string, beginAtZero: boolean) {\n  const {min, max} = minmax;\n  const change = toDimension(grace, (max - min) / 2);\n  const keepZero = (value: number, add: number) => beginAtZero && value === 0 ? 0 : value + add;\n  return {\n    min: keepZero(min, -Math.abs(change)),\n    max: keepZero(max, change)\n  };\n}\n\n/**\n * Create a context inheriting parentContext\n * @param parentContext\n * @param context\n * @returns\n */\nexport function createContext<T extends object>(parentContext: null, context: T): T;\nexport function createContext<T extends object, P extends T>(parentContext: P, context: T): P & T;\nexport function createContext(parentContext: object, context: object) {\n  return Object.assign(Object.create(parentContext), context);\n}\n", "/* eslint-disable @typescript-eslint/no-use-before-define */\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartMeta} from '../types/index.js';\nimport type {\n  ResolverObjectKey,\n  ResolverCache,\n  ResolverProxy,\n  DescriptorDefaults,\n  Descriptor,\n  ContextCache,\n  ContextProxy\n} from './helpers.config.types.js';\nimport {isArray, isFunction, isObject, resolveObjectKey, _capitalize} from './helpers.core.js';\n\nexport * from './helpers.config.types.js';\n\n/**\n * Creates a Proxy for resolving raw values for options.\n * @param scopes - The option scopes to look for values, in resolution order\n * @param prefixes - The prefixes for values, in resolution order.\n * @param rootScopes - The root option scopes\n * @param fallback - Parent scopes fallback\n * @param getTarget - callback for getting the target for changed values\n * @returns Proxy\n * @private\n */\nexport function _createResolver<\n  T extends AnyObject[] = AnyObject[],\n  R extends AnyObject[] = T\n>(\n  scopes: T,\n  prefixes = [''],\n  rootScopes?: R,\n  fallback?: ResolverObjectKey,\n  getTarget = () => scopes[0]\n) {\n  const finalRootScopes = rootScopes || scopes;\n  if (typeof fallback === 'undefined') {\n    fallback = _resolve('_fallback', scopes);\n  }\n  const cache: ResolverCache<T, R> = {\n    [Symbol.toStringTag]: 'Object',\n    _cacheable: true,\n    _scopes: scopes,\n    _rootScopes: finalRootScopes,\n    _fallback: fallback,\n    _getTarget: getTarget,\n    override: (scope: AnyObject) => _createResolver([scope, ...scopes], prefixes, finalRootScopes, fallback),\n  };\n  return new Proxy(cache, {\n    /**\n     * A trap for the delete operator.\n     */\n    deleteProperty(target, prop: string) {\n      delete target[prop]; // remove from cache\n      delete target._keys; // remove cached keys\n      delete scopes[0][prop]; // remove from top level scope\n      return true;\n    },\n\n    /**\n     * A trap for getting property values.\n     */\n    get(target, prop: string) {\n      return _cached(target, prop,\n        () => _resolveWithPrefixes(prop, prefixes, scopes, target));\n    },\n\n    /**\n     * A trap for Object.getOwnPropertyDescriptor.\n     * Also used by Object.hasOwnProperty.\n     */\n    getOwnPropertyDescriptor(target, prop) {\n      return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);\n    },\n\n    /**\n     * A trap for Object.getPrototypeOf.\n     */\n    getPrototypeOf() {\n      return Reflect.getPrototypeOf(scopes[0]);\n    },\n\n    /**\n     * A trap for the in operator.\n     */\n    has(target, prop: string) {\n      return getKeysFromAllScopes(target).includes(prop);\n    },\n\n    /**\n     * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n     */\n    ownKeys(target) {\n      return getKeysFromAllScopes(target);\n    },\n\n    /**\n     * A trap for setting property values.\n     */\n    set(target, prop: string, value) {\n      const storage = target._storage || (target._storage = getTarget());\n      target[prop] = storage[prop] = value; // set to top level scope + cache\n      delete target._keys; // remove cached keys\n      return true;\n    }\n  }) as ResolverProxy<T, R>;\n}\n\n/**\n * Returns an Proxy for resolving option values with context.\n * @param proxy - The Proxy returned by `_createResolver`\n * @param context - Context object for scriptable/indexable options\n * @param subProxy - The proxy provided for scriptable options\n * @param descriptorDefaults - Defaults for descriptors\n * @private\n */\nexport function _attachContext<\n  T extends AnyObject[] = AnyObject[],\n  R extends AnyObject[] = T\n>(\n  proxy: ResolverProxy<T, R>,\n  context: AnyObject,\n  subProxy?: ResolverProxy<T, R>,\n  descriptorDefaults?: DescriptorDefaults\n) {\n  const cache: ContextCache<T, R> = {\n    _cacheable: false,\n    _proxy: proxy,\n    _context: context,\n    _subProxy: subProxy,\n    _stack: new Set(),\n    _descriptors: _descriptors(proxy, descriptorDefaults),\n    setContext: (ctx: AnyObject) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),\n    override: (scope: AnyObject) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)\n  };\n  return new Proxy(cache, {\n    /**\n     * A trap for the delete operator.\n     */\n    deleteProperty(target, prop) {\n      delete target[prop]; // remove from cache\n      delete proxy[prop]; // remove from proxy\n      return true;\n    },\n\n    /**\n     * A trap for getting property values.\n     */\n    get(target, prop: string, receiver) {\n      return _cached(target, prop,\n        () => _resolveWithContext(target, prop, receiver));\n    },\n\n    /**\n     * A trap for Object.getOwnPropertyDescriptor.\n     * Also used by Object.hasOwnProperty.\n     */\n    getOwnPropertyDescriptor(target, prop) {\n      return target._descriptors.allKeys\n        ? Reflect.has(proxy, prop) ? {enumerable: true, configurable: true} : undefined\n        : Reflect.getOwnPropertyDescriptor(proxy, prop);\n    },\n\n    /**\n     * A trap for Object.getPrototypeOf.\n     */\n    getPrototypeOf() {\n      return Reflect.getPrototypeOf(proxy);\n    },\n\n    /**\n     * A trap for the in operator.\n     */\n    has(target, prop) {\n      return Reflect.has(proxy, prop);\n    },\n\n    /**\n     * A trap for Object.getOwnPropertyNames and Object.getOwnPropertySymbols.\n     */\n    ownKeys() {\n      return Reflect.ownKeys(proxy);\n    },\n\n    /**\n     * A trap for setting property values.\n     */\n    set(target, prop, value) {\n      proxy[prop] = value; // set to proxy\n      delete target[prop]; // remove from cache\n      return true;\n    }\n  }) as ContextProxy<T, R>;\n}\n\n/**\n * @private\n */\nexport function _descriptors(\n  proxy: ResolverCache,\n  defaults: DescriptorDefaults = {scriptable: true, indexable: true}\n): Descriptor {\n  const {_scriptable = defaults.scriptable, _indexable = defaults.indexable, _allKeys = defaults.allKeys} = proxy;\n  return {\n    allKeys: _allKeys,\n    scriptable: _scriptable,\n    indexable: _indexable,\n    isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,\n    isIndexable: isFunction(_indexable) ? _indexable : () => _indexable\n  };\n}\n\nconst readKey = (prefix: string, name: string) => prefix ? prefix + _capitalize(name) : name;\nconst needsSubResolver = (prop: string, value: unknown) => isObject(value) && prop !== 'adapters' &&\n  (Object.getPrototypeOf(value) === null || value.constructor === Object);\n\nfunction _cached(\n  target: AnyObject,\n  prop: string,\n  resolve: () => unknown\n) {\n  if (Object.prototype.hasOwnProperty.call(target, prop)) {\n    return target[prop];\n  }\n\n  const value = resolve();\n  // cache the resolved value\n  target[prop] = value;\n  return value;\n}\n\nfunction _resolveWithContext(\n  target: ContextCache,\n  prop: string,\n  receiver: AnyObject\n) {\n  const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n  let value = _proxy[prop]; // resolve from proxy\n\n  // resolve with context\n  if (isFunction(value) && descriptors.isScriptable(prop)) {\n    value = _resolveScriptable(prop, value, target, receiver);\n  }\n  if (isArray(value) && value.length) {\n    value = _resolveArray(prop, value, target, descriptors.isIndexable);\n  }\n  if (needsSubResolver(prop, value)) {\n    // if the resolved value is an object, create a sub resolver for it\n    value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors);\n  }\n  return value;\n}\n\nfunction _resolveScriptable(\n  prop: string,\n  getValue: (ctx: AnyObject, sub: AnyObject) => unknown,\n  target: ContextCache,\n  receiver: AnyObject\n) {\n  const {_proxy, _context, _subProxy, _stack} = target;\n  if (_stack.has(prop)) {\n    throw new Error('Recursion detected: ' + Array.from(_stack).join('->') + '->' + prop);\n  }\n  _stack.add(prop);\n  let value = getValue(_context, _subProxy || receiver);\n  _stack.delete(prop);\n  if (needsSubResolver(prop, value)) {\n    // When scriptable option returns an object, create a resolver on that.\n    value = createSubResolver(_proxy._scopes, _proxy, prop, value);\n  }\n  return value;\n}\n\nfunction _resolveArray(\n  prop: string,\n  value: unknown[],\n  target: ContextCache,\n  isIndexable: (key: string) => boolean\n) {\n  const {_proxy, _context, _subProxy, _descriptors: descriptors} = target;\n\n  if (typeof _context.index !== 'undefined' && isIndexable(prop)) {\n    return value[_context.index % value.length];\n  } else if (isObject(value[0])) {\n    // Array of objects, return array or resolvers\n    const arr = value;\n    const scopes = _proxy._scopes.filter(s => s !== arr);\n    value = [];\n    for (const item of arr) {\n      const resolver = createSubResolver(scopes, _proxy, prop, item);\n      value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors));\n    }\n  }\n  return value;\n}\n\nfunction resolveFallback(\n  fallback: ResolverObjectKey | ((prop: ResolverObjectKey, value: unknown) => ResolverObjectKey),\n  prop: ResolverObjectKey,\n  value: unknown\n) {\n  return isFunction(fallback) ? fallback(prop, value) : fallback;\n}\n\nconst getScope = (key: ResolverObjectKey, parent: AnyObject) => key === true ? parent\n  : typeof key === 'string' ? resolveObjectKey(parent, key) : undefined;\n\nfunction addScopes(\n  set: Set<AnyObject>,\n  parentScopes: AnyObject[],\n  key: ResolverObjectKey,\n  parentFallback: ResolverObjectKey,\n  value: unknown\n) {\n  for (const parent of parentScopes) {\n    const scope = getScope(key, parent);\n    if (scope) {\n      set.add(scope);\n      const fallback = resolveFallback(scope._fallback, key, value);\n      if (typeof fallback !== 'undefined' && fallback !== key && fallback !== parentFallback) {\n        // When we reach the descriptor that defines a new _fallback, return that.\n        // The fallback will resume to that new scope.\n        return fallback;\n      }\n    } else if (scope === false && typeof parentFallback !== 'undefined' && key !== parentFallback) {\n      // Fallback to `false` results to `false`, when falling back to different key.\n      // For example `interaction` from `hover` or `plugins.tooltip` and `animation` from `animations`\n      return null;\n    }\n  }\n  return false;\n}\n\nfunction createSubResolver(\n  parentScopes: AnyObject[],\n  resolver: ResolverCache,\n  prop: ResolverObjectKey,\n  value: unknown\n) {\n  const rootScopes = resolver._rootScopes;\n  const fallback = resolveFallback(resolver._fallback, prop, value);\n  const allScopes = [...parentScopes, ...rootScopes];\n  const set = new Set<AnyObject>();\n  set.add(value);\n  let key = addScopesFromKey(set, allScopes, prop, fallback || prop, value);\n  if (key === null) {\n    return false;\n  }\n  if (typeof fallback !== 'undefined' && fallback !== prop) {\n    key = addScopesFromKey(set, allScopes, fallback, key, value);\n    if (key === null) {\n      return false;\n    }\n  }\n  return _createResolver(Array.from(set), [''], rootScopes, fallback,\n    () => subGetTarget(resolver, prop as string, value));\n}\n\nfunction addScopesFromKey(\n  set: Set<AnyObject>,\n  allScopes: AnyObject[],\n  key: ResolverObjectKey,\n  fallback: ResolverObjectKey,\n  item: unknown\n) {\n  while (key) {\n    key = addScopes(set, allScopes, key, fallback, item);\n  }\n  return key;\n}\n\nfunction subGetTarget(\n  resolver: ResolverCache,\n  prop: string,\n  value: unknown\n) {\n  const parent = resolver._getTarget();\n  if (!(prop in parent)) {\n    parent[prop] = {};\n  }\n  const target = parent[prop];\n  if (isArray(target) && isObject(value)) {\n    // For array of objects, the object is used to store updated values\n    return value;\n  }\n  return target || {};\n}\n\nfunction _resolveWithPrefixes(\n  prop: string,\n  prefixes: string[],\n  scopes: AnyObject[],\n  proxy: ResolverProxy\n) {\n  let value: unknown;\n  for (const prefix of prefixes) {\n    value = _resolve(readKey(prefix, prop), scopes);\n    if (typeof value !== 'undefined') {\n      return needsSubResolver(prop, value)\n        ? createSubResolver(scopes, proxy, prop, value)\n        : value;\n    }\n  }\n}\n\nfunction _resolve(key: string, scopes: AnyObject[]) {\n  for (const scope of scopes) {\n    if (!scope) {\n      continue;\n    }\n    const value = scope[key];\n    if (typeof value !== 'undefined') {\n      return value;\n    }\n  }\n}\n\nfunction getKeysFromAllScopes(target: ResolverCache) {\n  let keys = target._keys;\n  if (!keys) {\n    keys = target._keys = resolveKeysFromAllScopes(target._scopes);\n  }\n  return keys;\n}\n\nfunction resolveKeysFromAllScopes(scopes: AnyObject[]) {\n  const set = new Set<string>();\n  for (const scope of scopes) {\n    for (const key of Object.keys(scope).filter(k => !k.startsWith('_'))) {\n      set.add(key);\n    }\n  }\n  return Array.from(set);\n}\n\nexport function _parseObjectDataRadialScale(\n  meta: ChartMeta<'line' | 'scatter'>,\n  data: AnyObject[],\n  start: number,\n  count: number\n) {\n  const {iScale} = meta;\n  const {key = 'r'} = this._parsing;\n  const parsed = new Array<{r: unknown}>(count);\n  let i: number, ilen: number, index: number, item: AnyObject;\n\n  for (i = 0, ilen = count; i < ilen; ++i) {\n    index = i + start;\n    item = data[index];\n    parsed[i] = {\n      r: iScale.parse(resolveObjectKey(item, key), index)\n    };\n  }\n  return parsed;\n}\n", "import {almostEquals, distanceBetweenPoints, sign} from './helpers.math.js';\nimport {_isPointInArea} from './helpers.canvas.js';\nimport type {ChartArea} from '../types/index.js';\nimport type {SplinePoint} from '../types/geometric.js';\n\nconst EPSILON = Number.EPSILON || 1e-14;\n\ntype OptionalSplinePoint = SplinePoint | false\nconst getPoint = (points: SplinePoint[], i: number): OptionalSplinePoint => i < points.length && !points[i].skip && points[i];\nconst getValueAxis = (indexAxis: 'x' | 'y') => indexAxis === 'x' ? 'y' : 'x';\n\nexport function splineCurve(\n  firstPoint: SplinePoint,\n  middlePoint: SplinePoint,\n  afterPoint: SplinePoint,\n  t: number\n): {\n    previous: SplinePoint\n    next: SplinePoint\n  } {\n  // Props to Rob Spencer at scaled innovation for his post on splining between points\n  // http://scaledinnovation.com/analytics/splines/aboutSplines.html\n\n  // This function must also respect \"skipped\" points\n\n  const previous = firstPoint.skip ? middlePoint : firstPoint;\n  const current = middlePoint;\n  const next = afterPoint.skip ? middlePoint : afterPoint;\n  const d01 = distanceBetweenPoints(current, previous);\n  const d12 = distanceBetweenPoints(next, current);\n\n  let s01 = d01 / (d01 + d12);\n  let s12 = d12 / (d01 + d12);\n\n  // If all points are the same, s01 & s02 will be inf\n  s01 = isNaN(s01) ? 0 : s01;\n  s12 = isNaN(s12) ? 0 : s12;\n\n  const fa = t * s01; // scaling factor for triangle Ta\n  const fb = t * s12;\n\n  return {\n    previous: {\n      x: current.x - fa * (next.x - previous.x),\n      y: current.y - fa * (next.y - previous.y)\n    },\n    next: {\n      x: current.x + fb * (next.x - previous.x),\n      y: current.y + fb * (next.y - previous.y)\n    }\n  };\n}\n\n/**\n * Adjust tangents to ensure monotonic properties\n */\nfunction monotoneAdjust(points: SplinePoint[], deltaK: number[], mK: number[]) {\n  const pointsLen = points.length;\n\n  let alphaK: number, betaK: number, tauK: number, squaredMagnitude: number, pointCurrent: OptionalSplinePoint;\n  let pointAfter = getPoint(points, 0);\n  for (let i = 0; i < pointsLen - 1; ++i) {\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent || !pointAfter) {\n      continue;\n    }\n\n    if (almostEquals(deltaK[i], 0, EPSILON)) {\n      mK[i] = mK[i + 1] = 0;\n      continue;\n    }\n\n    alphaK = mK[i] / deltaK[i];\n    betaK = mK[i + 1] / deltaK[i];\n    squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);\n    if (squaredMagnitude <= 9) {\n      continue;\n    }\n\n    tauK = 3 / Math.sqrt(squaredMagnitude);\n    mK[i] = alphaK * tauK * deltaK[i];\n    mK[i + 1] = betaK * tauK * deltaK[i];\n  }\n}\n\nfunction monotoneCompute(points: SplinePoint[], mK: number[], indexAxis: 'x' | 'y' = 'x') {\n  const valueAxis = getValueAxis(indexAxis);\n  const pointsLen = points.length;\n  let delta: number, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n  let pointAfter = getPoint(points, 0);\n\n  for (let i = 0; i < pointsLen; ++i) {\n    pointBefore = pointCurrent;\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent) {\n      continue;\n    }\n\n    const iPixel = pointCurrent[indexAxis];\n    const vPixel = pointCurrent[valueAxis];\n    if (pointBefore) {\n      delta = (iPixel - pointBefore[indexAxis]) / 3;\n      pointCurrent[`cp1${indexAxis}`] = iPixel - delta;\n      pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i];\n    }\n    if (pointAfter) {\n      delta = (pointAfter[indexAxis] - iPixel) / 3;\n      pointCurrent[`cp2${indexAxis}`] = iPixel + delta;\n      pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i];\n    }\n  }\n}\n\n/**\n * This function calculates Bézier control points in a similar way than |splineCurve|,\n * but preserves monotonicity of the provided data and ensures no local extremums are added\n * between the dataset discrete points due to the interpolation.\n * See : https://en.wikipedia.org/wiki/Monotone_cubic_interpolation\n */\nexport function splineCurveMonotone(points: SplinePoint[], indexAxis: 'x' | 'y' = 'x') {\n  const valueAxis = getValueAxis(indexAxis);\n  const pointsLen = points.length;\n  const deltaK: number[] = Array(pointsLen).fill(0);\n  const mK: number[] = Array(pointsLen);\n\n  // Calculate slopes (deltaK) and initialize tangents (mK)\n  let i, pointBefore: OptionalSplinePoint, pointCurrent: OptionalSplinePoint;\n  let pointAfter = getPoint(points, 0);\n\n  for (i = 0; i < pointsLen; ++i) {\n    pointBefore = pointCurrent;\n    pointCurrent = pointAfter;\n    pointAfter = getPoint(points, i + 1);\n    if (!pointCurrent) {\n      continue;\n    }\n\n    if (pointAfter) {\n      const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];\n\n      // In the case of two points that appear at the same x pixel, slopeDeltaX is 0\n      deltaK[i] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;\n    }\n    mK[i] = !pointBefore ? deltaK[i]\n      : !pointAfter ? deltaK[i - 1]\n        : (sign(deltaK[i - 1]) !== sign(deltaK[i])) ? 0\n          : (deltaK[i - 1] + deltaK[i]) / 2;\n  }\n\n  monotoneAdjust(points, deltaK, mK);\n\n  monotoneCompute(points, mK, indexAxis);\n}\n\nfunction capControlPoint(pt: number, min: number, max: number) {\n  return Math.max(Math.min(pt, max), min);\n}\n\nfunction capBezierPoints(points: SplinePoint[], area: ChartArea) {\n  let i, ilen, point, inArea, inAreaPrev;\n  let inAreaNext = _isPointInArea(points[0], area);\n  for (i = 0, ilen = points.length; i < ilen; ++i) {\n    inAreaPrev = inArea;\n    inArea = inAreaNext;\n    inAreaNext = i < ilen - 1 && _isPointInArea(points[i + 1], area);\n    if (!inArea) {\n      continue;\n    }\n    point = points[i];\n    if (inAreaPrev) {\n      point.cp1x = capControlPoint(point.cp1x, area.left, area.right);\n      point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);\n    }\n    if (inAreaNext) {\n      point.cp2x = capControlPoint(point.cp2x, area.left, area.right);\n      point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);\n    }\n  }\n}\n\n/**\n * @private\n */\nexport function _updateBezierControlPoints(\n  points: SplinePoint[],\n  options,\n  area: ChartArea,\n  loop: boolean,\n  indexAxis: 'x' | 'y'\n) {\n  let i: number, ilen: number, point: SplinePoint, controlPoints: ReturnType<typeof splineCurve>;\n\n  // Only consider points that are drawn in case the spanGaps option is used\n  if (options.spanGaps) {\n    points = points.filter((pt) => !pt.skip);\n  }\n\n  if (options.cubicInterpolationMode === 'monotone') {\n    splineCurveMonotone(points, indexAxis);\n  } else {\n    let prev = loop ? points[points.length - 1] : points[0];\n    for (i = 0, ilen = points.length; i < ilen; ++i) {\n      point = points[i];\n      controlPoints = splineCurve(\n        prev,\n        point,\n        points[Math.min(i + 1, ilen - (loop ? 0 : 1)) % ilen],\n        options.tension\n      );\n      point.cp1x = controlPoints.previous.x;\n      point.cp1y = controlPoints.previous.y;\n      point.cp2x = controlPoints.next.x;\n      point.cp2y = controlPoints.next.y;\n      prev = point;\n    }\n  }\n\n  if (options.capBezierPoints) {\n    capBezierPoints(points, area);\n  }\n}\n", "import type {ChartArea, Scale} from '../types/index.js';\nimport type Chart from '../core/core.controller.js';\nimport type {ChartEvent} from '../types.js';\nimport {INFINITY} from './helpers.math.js';\n\n/**\n * Note: typedefs are auto-exported, so use a made-up `dom` namespace where\n * necessary to avoid duplicates with `export * from './helpers`; see\n * https://github.com/microsoft/TypeScript/issues/46011\n * @typedef { import('../core/core.controller.js').default } dom.Chart\n * @typedef { import('../../types').ChartEvent } ChartEvent\n */\n\n/**\n * @private\n */\nexport function _isDomSupported(): boolean {\n  return typeof window !== 'undefined' && typeof document !== 'undefined';\n}\n\n/**\n * @private\n */\nexport function _getParentNode(domNode: HTMLCanvasElement): HTMLCanvasElement {\n  let parent = domNode.parentNode;\n  if (parent && parent.toString() === '[object ShadowRoot]') {\n    parent = (parent as ShadowRoot).host;\n  }\n  return parent as HTMLCanvasElement;\n}\n\n/**\n * convert max-width/max-height values that may be percentages into a number\n * @private\n */\n\nfunction parseMaxStyle(styleValue: string | number, node: HTMLElement, parentProperty: string) {\n  let valueInPixels: number;\n  if (typeof styleValue === 'string') {\n    valueInPixels = parseInt(styleValue, 10);\n\n    if (styleValue.indexOf('%') !== -1) {\n      // percentage * size in dimension\n      valueInPixels = (valueInPixels / 100) * node.parentNode[parentProperty];\n    }\n  } else {\n    valueInPixels = styleValue;\n  }\n\n  return valueInPixels;\n}\n\nconst getComputedStyle = (element: HTMLElement): CSSStyleDeclaration =>\n  element.ownerDocument.defaultView.getComputedStyle(element, null);\n\nexport function getStyle(el: HTMLElement, property: string): string {\n  return getComputedStyle(el).getPropertyValue(property);\n}\n\nconst positions = ['top', 'right', 'bottom', 'left'];\nfunction getPositionedStyle(styles: CSSStyleDeclaration, style: string, suffix?: string): ChartArea {\n  const result = {} as ChartArea;\n  suffix = suffix ? '-' + suffix : '';\n  for (let i = 0; i < 4; i++) {\n    const pos = positions[i];\n    result[pos] = parseFloat(styles[style + '-' + pos + suffix]) || 0;\n  }\n  result.width = result.left + result.right;\n  result.height = result.top + result.bottom;\n  return result;\n}\n\nconst useOffsetPos = (x: number, y: number, target: HTMLElement | EventTarget) =>\n  (x > 0 || y > 0) && (!target || !(target as HTMLElement).shadowRoot);\n\n/**\n * @param e\n * @param canvas\n * @returns Canvas position\n */\nfunction getCanvasPosition(\n  e: Event | TouchEvent | MouseEvent,\n  canvas: HTMLCanvasElement\n): {\n    x: number;\n    y: number;\n    box: boolean;\n  } {\n  const touches = (e as TouchEvent).touches;\n  const source = (touches && touches.length ? touches[0] : e) as MouseEvent;\n  const {offsetX, offsetY} = source as MouseEvent;\n  let box = false;\n  let x, y;\n  if (useOffsetPos(offsetX, offsetY, e.target)) {\n    x = offsetX;\n    y = offsetY;\n  } else {\n    const rect = canvas.getBoundingClientRect();\n    x = source.clientX - rect.left;\n    y = source.clientY - rect.top;\n    box = true;\n  }\n  return {x, y, box};\n}\n\n/**\n * Gets an event's x, y coordinates, relative to the chart area\n * @param event\n * @param chart\n * @returns x and y coordinates of the event\n */\n\nexport function getRelativePosition(\n  event: Event | ChartEvent | TouchEvent | MouseEvent,\n  chart: Chart\n): { x: number; y: number } {\n  if ('native' in event) {\n    return event;\n  }\n\n  const {canvas, currentDevicePixelRatio} = chart;\n  const style = getComputedStyle(canvas);\n  const borderBox = style.boxSizing === 'border-box';\n  const paddings = getPositionedStyle(style, 'padding');\n  const borders = getPositionedStyle(style, 'border', 'width');\n  const {x, y, box} = getCanvasPosition(event, canvas);\n  const xOffset = paddings.left + (box && borders.left);\n  const yOffset = paddings.top + (box && borders.top);\n\n  let {width, height} = chart;\n  if (borderBox) {\n    width -= paddings.width + borders.width;\n    height -= paddings.height + borders.height;\n  }\n  return {\n    x: Math.round((x - xOffset) / width * canvas.width / currentDevicePixelRatio),\n    y: Math.round((y - yOffset) / height * canvas.height / currentDevicePixelRatio)\n  };\n}\n\nfunction getContainerSize(canvas: HTMLCanvasElement, width: number, height: number): Partial<Scale> {\n  let maxWidth: number, maxHeight: number;\n\n  if (width === undefined || height === undefined) {\n    const container = _getParentNode(canvas);\n    if (!container) {\n      width = canvas.clientWidth;\n      height = canvas.clientHeight;\n    } else {\n      const rect = container.getBoundingClientRect(); // this is the border box of the container\n      const containerStyle = getComputedStyle(container);\n      const containerBorder = getPositionedStyle(containerStyle, 'border', 'width');\n      const containerPadding = getPositionedStyle(containerStyle, 'padding');\n      width = rect.width - containerPadding.width - containerBorder.width;\n      height = rect.height - containerPadding.height - containerBorder.height;\n      maxWidth = parseMaxStyle(containerStyle.maxWidth, container, 'clientWidth');\n      maxHeight = parseMaxStyle(containerStyle.maxHeight, container, 'clientHeight');\n    }\n  }\n  return {\n    width,\n    height,\n    maxWidth: maxWidth || INFINITY,\n    maxHeight: maxHeight || INFINITY\n  };\n}\n\nconst round1 = (v: number) => Math.round(v * 10) / 10;\n\n// eslint-disable-next-line complexity\nexport function getMaximumSize(\n  canvas: HTMLCanvasElement,\n  bbWidth?: number,\n  bbHeight?: number,\n  aspectRatio?: number\n): { width: number; height: number } {\n  const style = getComputedStyle(canvas);\n  const margins = getPositionedStyle(style, 'margin');\n  const maxWidth = parseMaxStyle(style.maxWidth, canvas, 'clientWidth') || INFINITY;\n  const maxHeight = parseMaxStyle(style.maxHeight, canvas, 'clientHeight') || INFINITY;\n  const containerSize = getContainerSize(canvas, bbWidth, bbHeight);\n  let {width, height} = containerSize;\n\n  if (style.boxSizing === 'content-box') {\n    const borders = getPositionedStyle(style, 'border', 'width');\n    const paddings = getPositionedStyle(style, 'padding');\n    width -= paddings.width + borders.width;\n    height -= paddings.height + borders.height;\n  }\n  width = Math.max(0, width - margins.width);\n  height = Math.max(0, aspectRatio ? width / aspectRatio : height - margins.height);\n  width = round1(Math.min(width, maxWidth, containerSize.maxWidth));\n  height = round1(Math.min(height, maxHeight, containerSize.maxHeight));\n  if (width && !height) {\n    // https://github.com/chartjs/Chart.js/issues/4659\n    // If the canvas has width, but no height, default to aspectRatio of 2 (canvas default)\n    height = round1(width / 2);\n  }\n\n  const maintainHeight = bbWidth !== undefined || bbHeight !== undefined;\n\n  if (maintainHeight && aspectRatio && containerSize.height && height > containerSize.height) {\n    height = containerSize.height;\n    width = round1(Math.floor(height * aspectRatio));\n  }\n\n  return {width, height};\n}\n\n/**\n * @param chart\n * @param forceRatio\n * @param forceStyle\n * @returns True if the canvas context size or transformation has changed.\n */\nexport function retinaScale(\n  chart: Chart,\n  forceRatio: number,\n  forceStyle?: boolean\n): boolean | void {\n  const pixelRatio = forceRatio || 1;\n  const deviceHeight = Math.floor(chart.height * pixelRatio);\n  const deviceWidth = Math.floor(chart.width * pixelRatio);\n\n  chart.height = Math.floor(chart.height);\n  chart.width = Math.floor(chart.width);\n\n  const canvas = chart.canvas;\n\n  // If no style has been set on the canvas, the render size is used as display size,\n  // making the chart visually bigger, so let's enforce it to the \"correct\" values.\n  // See https://github.com/chartjs/Chart.js/issues/3575\n  if (canvas.style && (forceStyle || (!canvas.style.height && !canvas.style.width))) {\n    canvas.style.height = `${chart.height}px`;\n    canvas.style.width = `${chart.width}px`;\n  }\n\n  if (chart.currentDevicePixelRatio !== pixelRatio\n      || canvas.height !== deviceHeight\n      || canvas.width !== deviceWidth) {\n    chart.currentDevicePixelRatio = pixelRatio;\n    canvas.height = deviceHeight;\n    canvas.width = deviceWidth;\n    chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);\n    return true;\n  }\n  return false;\n}\n\n/**\n * Detects support for options object argument in addEventListener.\n * https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n * @private\n */\nexport const supportsEventListenerOptions = (function() {\n  let passiveSupported = false;\n  try {\n    const options = {\n      get passive() { // This function will be called when the browser attempts to access the passive property.\n        passiveSupported = true;\n        return false;\n      }\n    } as EventListenerOptions;\n\n    window.addEventListener('test', null, options);\n    window.removeEventListener('test', null, options);\n  } catch (e) {\n    // continue regardless of error\n  }\n  return passiveSupported;\n}());\n\n/**\n * The \"used\" size is the final value of a dimension property after all calculations have\n * been performed. This method uses the computed style of `element` but returns undefined\n * if the computed style is not expressed in pixels. That can happen in some cases where\n * `element` has a size relative to its parent and this last one is not yet displayed,\n * for example because of `display: none` on a parent node.\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/used_value\n * @returns Size in pixels or undefined if unknown.\n */\n\nexport function readUsedSize(\n  element: HTMLElement,\n  property: 'width' | 'height'\n): number | undefined {\n  const value = getStyle(element, property);\n  const matches = value && value.match(/^(\\d+)(\\.\\d+)?px$/);\n  return matches ? +matches[1] : undefined;\n}\n", "import type {Point, SplinePoint} from '../types/geometric.js';\n\n/**\n * @private\n */\nexport function _pointInLine(p1: Point, p2: Point, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n  return {\n    x: p1.x + t * (p2.x - p1.x),\n    y: p1.y + t * (p2.y - p1.y)\n  };\n}\n\n/**\n * @private\n */\nexport function _steppedInterpolation(\n  p1: Point,\n  p2: Point,\n  t: number, mode: 'middle' | 'after' | unknown\n) {\n  return {\n    x: p1.x + t * (p2.x - p1.x),\n    y: mode === 'middle' ? t < 0.5 ? p1.y : p2.y\n      : mode === 'after' ? t < 1 ? p1.y : p2.y\n        : t > 0 ? p2.y : p1.y\n  };\n}\n\n/**\n * @private\n */\nexport function _bezierInterpolation(p1: SplinePoint, p2: SplinePoint, t: number, mode?) { // eslint-disable-line @typescript-eslint/no-unused-vars\n  const cp1 = {x: p1.cp2x, y: p1.cp2y};\n  const cp2 = {x: p2.cp1x, y: p2.cp1y};\n  const a = _pointInLine(p1, cp1, t);\n  const b = _pointInLine(cp1, cp2, t);\n  const c = _pointInLine(cp2, p2, t);\n  const d = _pointInLine(a, b, t);\n  const e = _pointInLine(b, c, t);\n  return _pointInLine(d, e, t);\n}\n", "export interface RTLAdapter {\n  x(x: number): number;\n  setWidth(w: number): void;\n  textAlign(align: 'center' | 'left' | 'right'): 'center' | 'left' | 'right';\n  xPlus(x: number, value: number): number;\n  leftForLtr(x: number, itemWidth: number): number;\n}\n\nconst getRightToLeftAdapter = function(rectX: number, width: number): RTLAdapter {\n  return {\n    x(x) {\n      return rectX + rectX + width - x;\n    },\n    setWidth(w) {\n      width = w;\n    },\n    textAlign(align) {\n      if (align === 'center') {\n        return align;\n      }\n      return align === 'right' ? 'left' : 'right';\n    },\n    xPlus(x, value) {\n      return x - value;\n    },\n    leftForLtr(x, itemWidth) {\n      return x - itemWidth;\n    },\n  };\n};\n\nconst getLeftToRightAdapter = function(): RTLAdapter {\n  return {\n    x(x) {\n      return x;\n    },\n    setWidth(w) { // eslint-disable-line no-unused-vars\n    },\n    textAlign(align) {\n      return align;\n    },\n    xPlus(x, value) {\n      return x + value;\n    },\n    leftForLtr(x, _itemWidth) { // eslint-disable-line @typescript-eslint/no-unused-vars\n      return x;\n    },\n  };\n};\n\nexport function getRtlAdapter(rtl: boolean, rectX: number, width: number) {\n  return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();\n}\n\nexport function overrideTextDirection(ctx: CanvasRenderingContext2D, direction: 'ltr' | 'rtl') {\n  let style: CSSStyleDeclaration, original: [string, string];\n  if (direction === 'ltr' || direction === 'rtl') {\n    style = ctx.canvas.style;\n    original = [\n      style.getPropertyValue('direction'),\n      style.getPropertyPriority('direction'),\n    ];\n\n    style.setProperty('direction', direction, 'important');\n    (ctx as { prevTextDirection?: [string, string] }).prevTextDirection = original;\n  }\n}\n\nexport function restoreTextDirection(ctx: CanvasRenderingContext2D, original?: [string, string]) {\n  if (original !== undefined) {\n    delete (ctx as { prevTextDirection?: [string, string] }).prevTextDirection;\n    ctx.canvas.style.setProperty('direction', original[0], original[1]);\n  }\n}\n", "import {_angleBetween, _angleDiff, _isBetween, _normalizeAngle} from './helpers.math.js';\nimport {createContext} from './helpers.options.js';\nimport {isPatternOrGradient} from './helpers.color.js';\n\n/**\n * @typedef { import('../elements/element.line.js').default } LineElement\n * @typedef { import('../elements/element.point.js').default } PointElement\n * @typedef {{start: number, end: number, loop: boolean, style?: any}} Segment\n */\n\nfunction propertyFn(property) {\n  if (property === 'angle') {\n    return {\n      between: _angleBetween,\n      compare: _angleDiff,\n      normalize: _normalizeAngle,\n    };\n  }\n  return {\n    between: _isBetween,\n    compare: (a, b) => a - b,\n    normalize: x => x\n  };\n}\n\nfunction normalizeSegment({start, end, count, loop, style}) {\n  return {\n    start: start % count,\n    end: end % count,\n    loop: loop && (end - start + 1) % count === 0,\n    style\n  };\n}\n\nfunction getSegment(segment, points, bounds) {\n  const {property, start: startBound, end: endBound} = bounds;\n  const {between, normalize} = propertyFn(property);\n  const count = points.length;\n  // eslint-disable-next-line prefer-const\n  let {start, end, loop} = segment;\n  let i, ilen;\n\n  if (loop) {\n    start += count;\n    end += count;\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      if (!between(normalize(points[start % count][property]), startBound, endBound)) {\n        break;\n      }\n      start--;\n      end--;\n    }\n    start %= count;\n    end %= count;\n  }\n\n  if (end < start) {\n    end += count;\n  }\n  return {start, end, loop, style: segment.style};\n}\n\n/**\n * Returns the sub-segment(s) of a line segment that fall in the given bounds\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} [segment.style] - segment style\n * @param {PointElement[]} points - the points that this segment refers to\n * @param {object} [bounds]\n * @param {string} bounds.property - the property of a `PointElement` we are bounding. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the property\n * @param {number} bounds.end - end value of the property\n * @private\n **/\nexport function _boundSegment(segment, points, bounds) {\n  if (!bounds) {\n    return [segment];\n  }\n\n  const {property, start: startBound, end: endBound} = bounds;\n  const count = points.length;\n  const {compare, between, normalize} = propertyFn(property);\n  const {start, end, loop, style} = getSegment(segment, points, bounds);\n\n  const result = [];\n  let inside = false;\n  let subStart = null;\n  let value, point, prevValue;\n\n  const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;\n  const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);\n  const shouldStart = () => inside || startIsBefore();\n  const shouldStop = () => !inside || endIsBefore();\n\n  for (let i = start, prev = start; i <= end; ++i) {\n    point = points[i % count];\n\n    if (point.skip) {\n      continue;\n    }\n\n    value = normalize(point[property]);\n\n    if (value === prevValue) {\n      continue;\n    }\n\n    inside = between(value, startBound, endBound);\n\n    if (subStart === null && shouldStart()) {\n      subStart = compare(value, startBound) === 0 ? i : prev;\n    }\n\n    if (subStart !== null && shouldStop()) {\n      result.push(normalizeSegment({start: subStart, end: i, loop, count, style}));\n      subStart = null;\n    }\n    prev = i;\n    prevValue = value;\n  }\n\n  if (subStart !== null) {\n    result.push(normalizeSegment({start: subStart, end, loop, count, style}));\n  }\n\n  return result;\n}\n\n\n/**\n * Returns the segments of the line that are inside given bounds\n * @param {LineElement} line\n * @param {object} [bounds]\n * @param {string} bounds.property - the property we are bounding with. `x`, `y` or `angle`.\n * @param {number} bounds.start - start value of the `property`\n * @param {number} bounds.end - end value of the `property`\n * @private\n */\nexport function _boundSegments(line, bounds) {\n  const result = [];\n  const segments = line.segments;\n\n  for (let i = 0; i < segments.length; i++) {\n    const sub = _boundSegment(segments[i], line.points, bounds);\n    if (sub.length) {\n      result.push(...sub);\n    }\n  }\n  return result;\n}\n\n/**\n * Find start and end index of a line.\n */\nfunction findStartAndEnd(points, count, loop, spanGaps) {\n  let start = 0;\n  let end = count - 1;\n\n  if (loop && !spanGaps) {\n    // loop and not spanning gaps, first find a gap to start from\n    while (start < count && !points[start].skip) {\n      start++;\n    }\n  }\n\n  // find first non skipped point (after the first gap possibly)\n  while (start < count && points[start].skip) {\n    start++;\n  }\n\n  // if we looped to count, start needs to be 0\n  start %= count;\n\n  if (loop) {\n    // loop will go past count, if start > 0\n    end += start;\n  }\n\n  while (end > start && points[end % count].skip) {\n    end--;\n  }\n\n  // end could be more than count, normalize\n  end %= count;\n\n  return {start, end};\n}\n\n/**\n * Compute solid segments from Points, when spanGaps === false\n * @param {PointElement[]} points - the points\n * @param {number} start - start index\n * @param {number} max - max index (can go past count on a loop)\n * @param {boolean} loop - boolean indicating that this would be a loop if no gaps are found\n */\nfunction solidSegments(points, start, max, loop) {\n  const count = points.length;\n  const result = [];\n  let last = start;\n  let prev = points[start];\n  let end;\n\n  for (end = start + 1; end <= max; ++end) {\n    const cur = points[end % count];\n    if (cur.skip || cur.stop) {\n      if (!prev.skip) {\n        loop = false;\n        result.push({start: start % count, end: (end - 1) % count, loop});\n        // @ts-ignore\n        start = last = cur.stop ? end : null;\n      }\n    } else {\n      last = end;\n      if (prev.skip) {\n        start = end;\n      }\n    }\n    prev = cur;\n  }\n\n  if (last !== null) {\n    result.push({start: start % count, end: last % count, loop});\n  }\n\n  return result;\n}\n\n/**\n * Compute the continuous segments that define the whole line\n * There can be skipped points within a segment, if spanGaps is true.\n * @param {LineElement} line\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n * @private\n */\nexport function _computeSegments(line, segmentOptions) {\n  const points = line.points;\n  const spanGaps = line.options.spanGaps;\n  const count = points.length;\n\n  if (!count) {\n    return [];\n  }\n\n  const loop = !!line._loop;\n  const {start, end} = findStartAndEnd(points, count, loop, spanGaps);\n\n  if (spanGaps === true) {\n    return splitByStyles(line, [{start, end, loop}], points, segmentOptions);\n  }\n\n  const max = end < start ? end + count : end;\n  const completeLoop = !!line._fullLoop && start === 0 && end === count - 1;\n  return splitByStyles(line, solidSegments(points, start, max, completeLoop), points, segmentOptions);\n}\n\n/**\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction splitByStyles(line, segments, points, segmentOptions) {\n  if (!segmentOptions || !segmentOptions.setContext || !points) {\n    return segments;\n  }\n  return doSplitByStyles(line, segments, points, segmentOptions);\n}\n\n/**\n * @param {LineElement} line\n * @param {Segment[]} segments\n * @param {PointElement[]} points\n * @param {object} [segmentOptions]\n * @return {Segment[]}\n */\nfunction doSplitByStyles(line, segments, points, segmentOptions) {\n  const chartContext = line._chart.getContext();\n  const baseStyle = readStyle(line.options);\n  const {_datasetIndex: datasetIndex, options: {spanGaps}} = line;\n  const count = points.length;\n  const result = [];\n  let prevStyle = baseStyle;\n  let start = segments[0].start;\n  let i = start;\n\n  function addStyle(s, e, l, st) {\n    const dir = spanGaps ? -1 : 1;\n    if (s === e) {\n      return;\n    }\n    // Style can not start/end on a skipped point, adjust indices accordingly\n    s += count;\n    while (points[s % count].skip) {\n      s -= dir;\n    }\n    while (points[e % count].skip) {\n      e += dir;\n    }\n    if (s % count !== e % count) {\n      result.push({start: s % count, end: e % count, loop: l, style: st});\n      prevStyle = st;\n      start = e % count;\n    }\n  }\n\n  for (const segment of segments) {\n    start = spanGaps ? start : segment.start;\n    let prev = points[start % count];\n    let style;\n    for (i = start + 1; i <= segment.end; i++) {\n      const pt = points[i % count];\n      style = readStyle(segmentOptions.setContext(createContext(chartContext, {\n        type: 'segment',\n        p0: prev,\n        p1: pt,\n        p0DataIndex: (i - 1) % count,\n        p1DataIndex: i % count,\n        datasetIndex\n      })));\n      if (styleChanged(style, prevStyle)) {\n        addStyle(start, i - 1, segment.loop, prevStyle);\n      }\n      prev = pt;\n      prevStyle = style;\n    }\n    if (start < i - 1) {\n      addStyle(start, i - 1, segment.loop, prevStyle);\n    }\n  }\n\n  return result;\n}\n\nfunction readStyle(options) {\n  return {\n    backgroundColor: options.backgroundColor,\n    borderCapStyle: options.borderCapStyle,\n    borderDash: options.borderDash,\n    borderDashOffset: options.borderDashOffset,\n    borderJoinStyle: options.borderJoinStyle,\n    borderWidth: options.borderWidth,\n    borderColor: options.borderColor\n  };\n}\n\nfunction styleChanged(style, prevStyle) {\n  if (!prevStyle) {\n    return false;\n  }\n  const cache = [];\n  const replacer = function(key, value) {\n    if (!isPatternOrGradient(value)) {\n      return value;\n    }\n    if (!cache.includes(value)) {\n      cache.push(value);\n    }\n    return cache.indexOf(value);\n  };\n  return JSON.stringify(style, replacer) !== JSON.stringify(prevStyle, replacer);\n}\n", "import {requestAnimFrame} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('./core.animation.js').default } Animation\n * @typedef { import('./core.controller.js').default } Chart\n */\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is export for typedoc\n */\nexport class Animator {\n  constructor() {\n    this._request = null;\n    this._charts = new Map();\n    this._running = false;\n    this._lastDate = undefined;\n  }\n\n  /**\n\t * @private\n\t */\n  _notify(chart, anims, date, type) {\n    const callbacks = anims.listeners[type];\n    const numSteps = anims.duration;\n\n    callbacks.forEach(fn => fn({\n      chart,\n      initial: anims.initial,\n      numSteps,\n      currentStep: Math.min(date - anims.start, numSteps)\n    }));\n  }\n\n  /**\n\t * @private\n\t */\n  _refresh() {\n    if (this._request) {\n      return;\n    }\n    this._running = true;\n\n    this._request = requestAnimFrame.call(window, () => {\n      this._update();\n      this._request = null;\n\n      if (this._running) {\n        this._refresh();\n      }\n    });\n  }\n\n  /**\n\t * @private\n\t */\n  _update(date = Date.now()) {\n    let remaining = 0;\n\n    this._charts.forEach((anims, chart) => {\n      if (!anims.running || !anims.items.length) {\n        return;\n      }\n      const items = anims.items;\n      let i = items.length - 1;\n      let draw = false;\n      let item;\n\n      for (; i >= 0; --i) {\n        item = items[i];\n\n        if (item._active) {\n          if (item._total > anims.duration) {\n            // if the animation has been updated and its duration prolonged,\n            // update to total duration of current animations run (for progress event)\n            anims.duration = item._total;\n          }\n          item.tick(date);\n          draw = true;\n        } else {\n          // Remove the item by replacing it with last item and removing the last\n          // A lot faster than splice.\n          items[i] = items[items.length - 1];\n          items.pop();\n        }\n      }\n\n      if (draw) {\n        chart.draw();\n        this._notify(chart, anims, date, 'progress');\n      }\n\n      if (!items.length) {\n        anims.running = false;\n        this._notify(chart, anims, date, 'complete');\n        anims.initial = false;\n      }\n\n      remaining += items.length;\n    });\n\n    this._lastDate = date;\n\n    if (remaining === 0) {\n      this._running = false;\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _getAnims(chart) {\n    const charts = this._charts;\n    let anims = charts.get(chart);\n    if (!anims) {\n      anims = {\n        running: false,\n        initial: true,\n        items: [],\n        listeners: {\n          complete: [],\n          progress: []\n        }\n      };\n      charts.set(chart, anims);\n    }\n    return anims;\n  }\n\n  /**\n\t * @param {Chart} chart\n\t * @param {string} event - event name\n\t * @param {Function} cb - callback\n\t */\n  listen(chart, event, cb) {\n    this._getAnims(chart).listeners[event].push(cb);\n  }\n\n  /**\n\t * Add animations\n\t * @param {Chart} chart\n\t * @param {Animation[]} items - animations\n\t */\n  add(chart, items) {\n    if (!items || !items.length) {\n      return;\n    }\n    this._getAnims(chart).items.push(...items);\n  }\n\n  /**\n\t * Counts number of active animations for the chart\n\t * @param {Chart} chart\n\t */\n  has(chart) {\n    return this._getAnims(chart).items.length > 0;\n  }\n\n  /**\n\t * Start animating (all charts)\n\t * @param {Chart} chart\n\t */\n  start(chart) {\n    const anims = this._charts.get(chart);\n    if (!anims) {\n      return;\n    }\n    anims.running = true;\n    anims.start = Date.now();\n    anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);\n    this._refresh();\n  }\n\n  running(chart) {\n    if (!this._running) {\n      return false;\n    }\n    const anims = this._charts.get(chart);\n    if (!anims || !anims.running || !anims.items.length) {\n      return false;\n    }\n    return true;\n  }\n\n  /**\n\t * Stop all animations for the chart\n\t * @param {Chart} chart\n\t */\n  stop(chart) {\n    const anims = this._charts.get(chart);\n    if (!anims || !anims.items.length) {\n      return;\n    }\n    const items = anims.items;\n    let i = items.length - 1;\n\n    for (; i >= 0; --i) {\n      items[i].cancel();\n    }\n    anims.items = [];\n    this._notify(chart, anims, Date.now(), 'complete');\n  }\n\n  /**\n\t * Remove chart from Animator\n\t * @param {Chart} chart\n\t */\n  remove(chart) {\n    return this._charts.delete(chart);\n  }\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Animator();\n", "import effects from '../helpers/helpers.easing.js';\nimport {resolve} from '../helpers/helpers.options.js';\nimport {color as helpersColor} from '../helpers/helpers.color.js';\n\nconst transparent = 'transparent';\nconst interpolators = {\n  boolean(from, to, factor) {\n    return factor > 0.5 ? to : from;\n  },\n  /**\n   * @param {string} from\n   * @param {string} to\n   * @param {number} factor\n   */\n  color(from, to, factor) {\n    const c0 = helpersColor(from || transparent);\n    const c1 = c0.valid && helpersColor(to || transparent);\n    return c1 && c1.valid\n      ? c1.mix(c0, factor).hexString()\n      : to;\n  },\n  number(from, to, factor) {\n    return from + (to - from) * factor;\n  }\n};\n\nexport default class Animation {\n  constructor(cfg, target, prop, to) {\n    const currentValue = target[prop];\n\n    to = resolve([cfg.to, to, currentValue, cfg.from]);\n    const from = resolve([cfg.from, currentValue, to]);\n\n    this._active = true;\n    this._fn = cfg.fn || interpolators[cfg.type || typeof from];\n    this._easing = effects[cfg.easing] || effects.linear;\n    this._start = Math.floor(Date.now() + (cfg.delay || 0));\n    this._duration = this._total = Math.floor(cfg.duration);\n    this._loop = !!cfg.loop;\n    this._target = target;\n    this._prop = prop;\n    this._from = from;\n    this._to = to;\n    this._promises = undefined;\n  }\n\n  active() {\n    return this._active;\n  }\n\n  update(cfg, to, date) {\n    if (this._active) {\n      this._notify(false);\n\n      const currentValue = this._target[this._prop];\n      const elapsed = date - this._start;\n      const remain = this._duration - elapsed;\n      this._start = date;\n      this._duration = Math.floor(Math.max(remain, cfg.duration));\n      this._total += elapsed;\n      this._loop = !!cfg.loop;\n      this._to = resolve([cfg.to, to, currentValue, cfg.from]);\n      this._from = resolve([cfg.from, currentValue, to]);\n    }\n  }\n\n  cancel() {\n    if (this._active) {\n      // update current evaluated value, for smoother animations\n      this.tick(Date.now());\n      this._active = false;\n      this._notify(false);\n    }\n  }\n\n  tick(date) {\n    const elapsed = date - this._start;\n    const duration = this._duration;\n    const prop = this._prop;\n    const from = this._from;\n    const loop = this._loop;\n    const to = this._to;\n    let factor;\n\n    this._active = from !== to && (loop || (elapsed < duration));\n\n    if (!this._active) {\n      this._target[prop] = to;\n      this._notify(true);\n      return;\n    }\n\n    if (elapsed < 0) {\n      this._target[prop] = from;\n      return;\n    }\n\n    factor = (elapsed / duration) % 2;\n    factor = loop && factor > 1 ? 2 - factor : factor;\n    factor = this._easing(Math.min(1, Math.max(0, factor)));\n\n    this._target[prop] = this._fn(from, to, factor);\n  }\n\n  wait() {\n    const promises = this._promises || (this._promises = []);\n    return new Promise((res, rej) => {\n      promises.push({res, rej});\n    });\n  }\n\n  _notify(resolved) {\n    const method = resolved ? 'res' : 'rej';\n    const promises = this._promises || [];\n    for (let i = 0; i < promises.length; i++) {\n      promises[i][method]();\n    }\n  }\n}\n", "import animator from './core.animator.js';\nimport Animation from './core.animation.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isObject} from '../helpers/helpers.core.js';\n\nexport default class Animations {\n  constructor(chart, config) {\n    this._chart = chart;\n    this._properties = new Map();\n    this.configure(config);\n  }\n\n  configure(config) {\n    if (!isObject(config)) {\n      return;\n    }\n\n    const animationOptions = Object.keys(defaults.animation);\n    const animatedProps = this._properties;\n\n    Object.getOwnPropertyNames(config).forEach(key => {\n      const cfg = config[key];\n      if (!isObject(cfg)) {\n        return;\n      }\n      const resolved = {};\n      for (const option of animationOptions) {\n        resolved[option] = cfg[option];\n      }\n\n      (isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {\n        if (prop === key || !animatedProps.has(prop)) {\n          animatedProps.set(prop, resolved);\n        }\n      });\n    });\n  }\n\n  /**\n\t * Utility to handle animation of `options`.\n\t * @private\n\t */\n  _animateOptions(target, values) {\n    const newOptions = values.options;\n    const options = resolveTargetOptions(target, newOptions);\n    if (!options) {\n      return [];\n    }\n\n    const animations = this._createAnimations(options, newOptions);\n    if (newOptions.$shared) {\n      // Going to shared options:\n      // After all animations are done, assign the shared options object to the element\n      // So any new updates to the shared options are observed\n      awaitAll(target.options.$animations, newOptions).then(() => {\n        target.options = newOptions;\n      }, () => {\n        // rejected, noop\n      });\n    }\n\n    return animations;\n  }\n\n  /**\n\t * @private\n\t */\n  _createAnimations(target, values) {\n    const animatedProps = this._properties;\n    const animations = [];\n    const running = target.$animations || (target.$animations = {});\n    const props = Object.keys(values);\n    const date = Date.now();\n    let i;\n\n    for (i = props.length - 1; i >= 0; --i) {\n      const prop = props[i];\n      if (prop.charAt(0) === '$') {\n        continue;\n      }\n\n      if (prop === 'options') {\n        animations.push(...this._animateOptions(target, values));\n        continue;\n      }\n      const value = values[prop];\n      let animation = running[prop];\n      const cfg = animatedProps.get(prop);\n\n      if (animation) {\n        if (cfg && animation.active()) {\n          // There is an existing active animation, let's update that\n          animation.update(cfg, value, date);\n          continue;\n        } else {\n          animation.cancel();\n        }\n      }\n      if (!cfg || !cfg.duration) {\n        // not animated, set directly to new value\n        target[prop] = value;\n        continue;\n      }\n\n      running[prop] = animation = new Animation(cfg, target, prop, value);\n      animations.push(animation);\n    }\n    return animations;\n  }\n\n\n  /**\n\t * Update `target` properties to new values, using configured animations\n\t * @param {object} target - object to update\n\t * @param {object} values - new target properties\n\t * @returns {boolean|undefined} - `true` if animations were started\n\t **/\n  update(target, values) {\n    if (this._properties.size === 0) {\n      // Nothing is animated, just apply the new values.\n      Object.assign(target, values);\n      return;\n    }\n\n    const animations = this._createAnimations(target, values);\n\n    if (animations.length) {\n      animator.add(this._chart, animations);\n      return true;\n    }\n  }\n}\n\nfunction awaitAll(animations, properties) {\n  const running = [];\n  const keys = Object.keys(properties);\n  for (let i = 0; i < keys.length; i++) {\n    const anim = animations[keys[i]];\n    if (anim && anim.active()) {\n      running.push(anim.wait());\n    }\n  }\n  // @ts-ignore\n  return Promise.all(running);\n}\n\nfunction resolveTargetOptions(target, newOptions) {\n  if (!newOptions) {\n    return;\n  }\n  let options = target.options;\n  if (!options) {\n    target.options = newOptions;\n    return;\n  }\n  if (options.$shared) {\n    // Going from shared options to distinct one:\n    // Create new options object containing the old shared values and start updating that.\n    target.options = options = Object.assign({}, options, {$shared: false, $animations: {}});\n  }\n  return options;\n}\n", "import Animations from './core.animations.js';\nimport defaults from './core.defaults.js';\nimport {isArray, isFinite, isObject, valueOrDefault, resolveObjectKey, defined} from '../helpers/helpers.core.js';\nimport {listenArrayEvents, unlistenArrayEvents} from '../helpers/helpers.collection.js';\nimport {createContext, sign} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('./core.scale.js').default } Scale\n */\n\nfunction scaleClip(scale, allowedOverflow) {\n  const opts = scale && scale.options || {};\n  const reverse = opts.reverse;\n  const min = opts.min === undefined ? allowedOverflow : 0;\n  const max = opts.max === undefined ? allowedOverflow : 0;\n  return {\n    start: reverse ? max : min,\n    end: reverse ? min : max\n  };\n}\n\nfunction defaultClip(xScale, yScale, allowedOverflow) {\n  if (allowedOverflow === false) {\n    return false;\n  }\n  const x = scaleClip(xScale, allowedOverflow);\n  const y = scaleClip(yScale, allowedOverflow);\n\n  return {\n    top: y.end,\n    right: x.end,\n    bottom: y.start,\n    left: x.start\n  };\n}\n\nfunction toClip(value) {\n  let t, r, b, l;\n\n  if (isObject(value)) {\n    t = value.top;\n    r = value.right;\n    b = value.bottom;\n    l = value.left;\n  } else {\n    t = r = b = l = value;\n  }\n\n  return {\n    top: t,\n    right: r,\n    bottom: b,\n    left: l,\n    disabled: value === false\n  };\n}\n\nfunction getSortedDatasetIndices(chart, filterVisible) {\n  const keys = [];\n  const metasets = chart._getSortedDatasetMetas(filterVisible);\n  let i, ilen;\n\n  for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n    keys.push(metasets[i].index);\n  }\n  return keys;\n}\n\nfunction applyStack(stack, value, dsIndex, options = {}) {\n  const keys = stack.keys;\n  const singleMode = options.mode === 'single';\n  let i, ilen, datasetIndex, otherValue;\n\n  if (value === null) {\n    return;\n  }\n\n  for (i = 0, ilen = keys.length; i < ilen; ++i) {\n    datasetIndex = +keys[i];\n    if (datasetIndex === dsIndex) {\n      if (options.all) {\n        continue;\n      }\n      break;\n    }\n    otherValue = stack.values[datasetIndex];\n    if (isFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {\n      value += otherValue;\n    }\n  }\n  return value;\n}\n\nfunction convertObjectDataToArray(data) {\n  const keys = Object.keys(data);\n  const adata = new Array(keys.length);\n  let i, ilen, key;\n  for (i = 0, ilen = keys.length; i < ilen; ++i) {\n    key = keys[i];\n    adata[i] = {\n      x: key,\n      y: data[key]\n    };\n  }\n  return adata;\n}\n\nfunction isStacked(scale, meta) {\n  const stacked = scale && scale.options.stacked;\n  return stacked || (stacked === undefined && meta.stack !== undefined);\n}\n\nfunction getStackKey(indexScale, valueScale, meta) {\n  return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;\n}\n\nfunction getUserBounds(scale) {\n  const {min, max, minDefined, maxDefined} = scale.getUserBounds();\n  return {\n    min: minDefined ? min : Number.NEGATIVE_INFINITY,\n    max: maxDefined ? max : Number.POSITIVE_INFINITY\n  };\n}\n\nfunction getOrCreateStack(stacks, stackKey, indexValue) {\n  const subStack = stacks[stackKey] || (stacks[stackKey] = {});\n  return subStack[indexValue] || (subStack[indexValue] = {});\n}\n\nfunction getLastIndexInStack(stack, vScale, positive, type) {\n  for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {\n    const value = stack[meta.index];\n    if ((positive && value > 0) || (!positive && value < 0)) {\n      return meta.index;\n    }\n  }\n\n  return null;\n}\n\nfunction updateStacks(controller, parsed) {\n  const {chart, _cachedMeta: meta} = controller;\n  const stacks = chart._stacks || (chart._stacks = {}); // map structure is {stackKey: {datasetIndex: value}}\n  const {iScale, vScale, index: datasetIndex} = meta;\n  const iAxis = iScale.axis;\n  const vAxis = vScale.axis;\n  const key = getStackKey(iScale, vScale, meta);\n  const ilen = parsed.length;\n  let stack;\n\n  for (let i = 0; i < ilen; ++i) {\n    const item = parsed[i];\n    const {[iAxis]: index, [vAxis]: value} = item;\n    const itemStacks = item._stacks || (item._stacks = {});\n    stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index);\n    stack[datasetIndex] = value;\n\n    stack._top = getLastIndexInStack(stack, vScale, true, meta.type);\n    stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);\n\n    const visualValues = stack._visualValues || (stack._visualValues = {});\n    visualValues[datasetIndex] = value;\n  }\n}\n\nfunction getFirstScaleId(chart, axis) {\n  const scales = chart.scales;\n  return Object.keys(scales).filter(key => scales[key].axis === axis).shift();\n}\n\nfunction createDatasetContext(parent, index) {\n  return createContext(parent,\n    {\n      active: false,\n      dataset: undefined,\n      datasetIndex: index,\n      index,\n      mode: 'default',\n      type: 'dataset'\n    }\n  );\n}\n\nfunction createDataContext(parent, index, element) {\n  return createContext(parent, {\n    active: false,\n    dataIndex: index,\n    parsed: undefined,\n    raw: undefined,\n    element,\n    index,\n    mode: 'default',\n    type: 'data'\n  });\n}\n\nfunction clearStacks(meta, items) {\n  // Not using meta.index here, because it might be already updated if the dataset changed location\n  const datasetIndex = meta.controller.index;\n  const axis = meta.vScale && meta.vScale.axis;\n  if (!axis) {\n    return;\n  }\n\n  items = items || meta._parsed;\n  for (const parsed of items) {\n    const stacks = parsed._stacks;\n    if (!stacks || stacks[axis] === undefined || stacks[axis][datasetIndex] === undefined) {\n      return;\n    }\n    delete stacks[axis][datasetIndex];\n    if (stacks[axis]._visualValues !== undefined && stacks[axis]._visualValues[datasetIndex] !== undefined) {\n      delete stacks[axis]._visualValues[datasetIndex];\n    }\n  }\n}\n\nconst isDirectUpdateMode = (mode) => mode === 'reset' || mode === 'none';\nconst cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);\nconst createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked\n  && {keys: getSortedDatasetIndices(chart, true), values: null};\n\nexport default class DatasetController {\n\n  /**\n   * @type {any}\n   */\n  static defaults = {};\n\n  /**\n   * Element type used to generate a meta dataset (e.g. Chart.element.LineElement).\n   */\n  static datasetElementType = null;\n\n  /**\n   * Element type used to generate a meta data (e.g. Chart.element.PointElement).\n   */\n  static dataElementType = null;\n\n  /**\n\t * @param {Chart} chart\n\t * @param {number} datasetIndex\n\t */\n  constructor(chart, datasetIndex) {\n    this.chart = chart;\n    this._ctx = chart.ctx;\n    this.index = datasetIndex;\n    this._cachedDataOpts = {};\n    this._cachedMeta = this.getMeta();\n    this._type = this._cachedMeta.type;\n    this.options = undefined;\n    /** @type {boolean | object} */\n    this._parsing = false;\n    this._data = undefined;\n    this._objectData = undefined;\n    this._sharedOptions = undefined;\n    this._drawStart = undefined;\n    this._drawCount = undefined;\n    this.enableOptionSharing = false;\n    this.supportsDecimation = false;\n    this.$context = undefined;\n    this._syncList = [];\n    this.datasetElementType = new.target.datasetElementType;\n    this.dataElementType = new.target.dataElementType;\n\n    this.initialize();\n  }\n\n  initialize() {\n    const meta = this._cachedMeta;\n    this.configure();\n    this.linkScales();\n    meta._stacked = isStacked(meta.vScale, meta);\n    this.addElements();\n\n    if (this.options.fill && !this.chart.isPluginEnabled('filler')) {\n      console.warn(\"Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options\");\n    }\n  }\n\n  updateIndex(datasetIndex) {\n    if (this.index !== datasetIndex) {\n      clearStacks(this._cachedMeta);\n    }\n    this.index = datasetIndex;\n  }\n\n  linkScales() {\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const dataset = this.getDataset();\n\n    const chooseId = (axis, x, y, r) => axis === 'x' ? x : axis === 'r' ? r : y;\n\n    const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, 'x'));\n    const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, 'y'));\n    const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, 'r'));\n    const indexAxis = meta.indexAxis;\n    const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);\n    const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);\n    meta.xScale = this.getScaleForId(xid);\n    meta.yScale = this.getScaleForId(yid);\n    meta.rScale = this.getScaleForId(rid);\n    meta.iScale = this.getScaleForId(iid);\n    meta.vScale = this.getScaleForId(vid);\n  }\n\n  getDataset() {\n    return this.chart.data.datasets[this.index];\n  }\n\n  getMeta() {\n    return this.chart.getDatasetMeta(this.index);\n  }\n\n  /**\n\t * @param {string} scaleID\n\t * @return {Scale}\n\t */\n  getScaleForId(scaleID) {\n    return this.chart.scales[scaleID];\n  }\n\n  /**\n\t * @private\n\t */\n  _getOtherScale(scale) {\n    const meta = this._cachedMeta;\n    return scale === meta.iScale\n      ? meta.vScale\n      : meta.iScale;\n  }\n\n  reset() {\n    this._update('reset');\n  }\n\n  /**\n\t * @private\n\t */\n  _destroy() {\n    const meta = this._cachedMeta;\n    if (this._data) {\n      unlistenArrayEvents(this._data, this);\n    }\n    if (meta._stacked) {\n      clearStacks(meta);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _dataCheck() {\n    const dataset = this.getDataset();\n    const data = dataset.data || (dataset.data = []);\n    const _data = this._data;\n\n    // In order to correctly handle data addition/deletion animation (and thus simulate\n    // real-time charts), we need to monitor these data modifications and synchronize\n    // the internal metadata accordingly.\n\n    if (isObject(data)) {\n      this._data = convertObjectDataToArray(data);\n    } else if (_data !== data) {\n      if (_data) {\n        // This case happens when the user replaced the data array instance.\n        unlistenArrayEvents(_data, this);\n        // Discard old parsed data and stacks\n        const meta = this._cachedMeta;\n        clearStacks(meta);\n        meta._parsed = [];\n      }\n      if (data && Object.isExtensible(data)) {\n        listenArrayEvents(data, this);\n      }\n      this._syncList = [];\n      this._data = data;\n    }\n  }\n\n  addElements() {\n    const meta = this._cachedMeta;\n\n    this._dataCheck();\n\n    if (this.datasetElementType) {\n      meta.dataset = new this.datasetElementType();\n    }\n  }\n\n  buildOrUpdateElements(resetNewElements) {\n    const meta = this._cachedMeta;\n    const dataset = this.getDataset();\n    let stackChanged = false;\n\n    this._dataCheck();\n\n    // make sure cached _stacked status is current\n    const oldStacked = meta._stacked;\n    meta._stacked = isStacked(meta.vScale, meta);\n\n    // detect change in stack option\n    if (meta.stack !== dataset.stack) {\n      stackChanged = true;\n      // remove values from old stack\n      clearStacks(meta);\n      meta.stack = dataset.stack;\n    }\n\n    // Re-sync meta data in case the user replaced the data array or if we missed\n    // any updates and so make sure that we handle number of datapoints changing.\n    this._resyncElements(resetNewElements);\n\n    // if stack changed, update stack values for the whole dataset\n    if (stackChanged || oldStacked !== meta._stacked) {\n      updateStacks(this, meta._parsed);\n    }\n  }\n\n  /**\n\t * Merges user-supplied and default dataset-level options\n\t * @private\n\t */\n  configure() {\n    const config = this.chart.config;\n    const scopeKeys = config.datasetScopeKeys(this._type);\n    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys, true);\n    this.options = config.createResolver(scopes, this.getContext());\n    this._parsing = this.options.parsing;\n    this._cachedDataOpts = {};\n  }\n\n  /**\n\t * @param {number} start\n\t * @param {number} count\n\t */\n  parse(start, count) {\n    const {_cachedMeta: meta, _data: data} = this;\n    const {iScale, _stacked} = meta;\n    const iAxis = iScale.axis;\n\n    let sorted = start === 0 && count === data.length ? true : meta._sorted;\n    let prev = start > 0 && meta._parsed[start - 1];\n    let i, cur, parsed;\n\n    if (this._parsing === false) {\n      meta._parsed = data;\n      meta._sorted = true;\n      parsed = data;\n    } else {\n      if (isArray(data[start])) {\n        parsed = this.parseArrayData(meta, data, start, count);\n      } else if (isObject(data[start])) {\n        parsed = this.parseObjectData(meta, data, start, count);\n      } else {\n        parsed = this.parsePrimitiveData(meta, data, start, count);\n      }\n\n      const isNotInOrderComparedToPrev = () => cur[iAxis] === null || (prev && cur[iAxis] < prev[iAxis]);\n      for (i = 0; i < count; ++i) {\n        meta._parsed[i + start] = cur = parsed[i];\n        if (sorted) {\n          if (isNotInOrderComparedToPrev()) {\n            sorted = false;\n          }\n          prev = cur;\n        }\n      }\n      meta._sorted = sorted;\n    }\n\n    if (_stacked) {\n      updateStacks(this, parsed);\n    }\n  }\n\n  /**\n\t * Parse array of primitive values\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [1,3,4]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {xScale0: 0, yScale0: 1}\n\t * @protected\n\t */\n  parsePrimitiveData(meta, data, start, count) {\n    const {iScale, vScale} = meta;\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const labels = iScale.getLabels();\n    const singleScale = iScale === vScale;\n    const parsed = new Array(count);\n    let i, ilen, index;\n\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index = i + start;\n      parsed[i] = {\n        [iAxis]: singleScale || iScale.parse(labels[index], index),\n        [vAxis]: vScale.parse(data[index], index)\n      };\n    }\n    return parsed;\n  }\n\n  /**\n\t * Parse array of arrays\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [[1,2],[3,4]]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id.\n\t * Example: {x: 0, y: 1}\n\t * @protected\n\t */\n  parseArrayData(meta, data, start, count) {\n    const {xScale, yScale} = meta;\n    const parsed = new Array(count);\n    let i, ilen, index, item;\n\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index = i + start;\n      item = data[index];\n      parsed[i] = {\n        x: xScale.parse(item[0], index),\n        y: yScale.parse(item[1], index)\n      };\n    }\n    return parsed;\n  }\n\n  /**\n\t * Parse array of objects\n\t * @param {object} meta - dataset meta\n\t * @param {array} data - data array. Example [{x:1, y:5}, {x:2, y:10}]\n\t * @param {number} start - start index\n\t * @param {number} count - number of items to parse\n\t * @returns {object} parsed item - item containing index and a parsed value\n\t * for each scale id. _custom is optional\n\t * Example: {xScale0: 0, yScale0: 1, _custom: {r: 10, foo: 'bar'}}\n\t * @protected\n\t */\n  parseObjectData(meta, data, start, count) {\n    const {xScale, yScale} = meta;\n    const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n    const parsed = new Array(count);\n    let i, ilen, index, item;\n\n    for (i = 0, ilen = count; i < ilen; ++i) {\n      index = i + start;\n      item = data[index];\n      parsed[i] = {\n        x: xScale.parse(resolveObjectKey(item, xAxisKey), index),\n        y: yScale.parse(resolveObjectKey(item, yAxisKey), index)\n      };\n    }\n    return parsed;\n  }\n\n  /**\n\t * @protected\n\t */\n  getParsed(index) {\n    return this._cachedMeta._parsed[index];\n  }\n\n  /**\n\t * @protected\n\t */\n  getDataElement(index) {\n    return this._cachedMeta.data[index];\n  }\n\n  /**\n\t * @protected\n\t */\n  applyStack(scale, parsed, mode) {\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const value = parsed[scale.axis];\n    const stack = {\n      keys: getSortedDatasetIndices(chart, true),\n      values: parsed._stacks[scale.axis]._visualValues\n    };\n    return applyStack(stack, value, meta.index, {mode});\n  }\n\n  /**\n\t * @protected\n\t */\n  updateRangeFromParsed(range, scale, parsed, stack) {\n    const parsedValue = parsed[scale.axis];\n    let value = parsedValue === null ? NaN : parsedValue;\n    const values = stack && parsed._stacks[scale.axis];\n    if (stack && values) {\n      stack.values = values;\n      value = applyStack(stack, parsedValue, this._cachedMeta.index);\n    }\n    range.min = Math.min(range.min, value);\n    range.max = Math.max(range.max, value);\n  }\n\n  /**\n\t * @protected\n\t */\n  getMinMax(scale, canStack) {\n    const meta = this._cachedMeta;\n    const _parsed = meta._parsed;\n    const sorted = meta._sorted && scale === meta.iScale;\n    const ilen = _parsed.length;\n    const otherScale = this._getOtherScale(scale);\n    const stack = createStack(canStack, meta, this.chart);\n    const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n    const {min: otherMin, max: otherMax} = getUserBounds(otherScale);\n    let i, parsed;\n\n    function _skip() {\n      parsed = _parsed[i];\n      const otherValue = parsed[otherScale.axis];\n      return !isFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;\n    }\n\n    for (i = 0; i < ilen; ++i) {\n      if (_skip()) {\n        continue;\n      }\n      this.updateRangeFromParsed(range, scale, parsed, stack);\n      if (sorted) {\n        // if the data is sorted, we don't need to check further from this end of array\n        break;\n      }\n    }\n    if (sorted) {\n      // in the sorted case, find first non-skipped value from other end of array\n      for (i = ilen - 1; i >= 0; --i) {\n        if (_skip()) {\n          continue;\n        }\n        this.updateRangeFromParsed(range, scale, parsed, stack);\n        break;\n      }\n    }\n    return range;\n  }\n\n  getAllParsedValues(scale) {\n    const parsed = this._cachedMeta._parsed;\n    const values = [];\n    let i, ilen, value;\n\n    for (i = 0, ilen = parsed.length; i < ilen; ++i) {\n      value = parsed[i][scale.axis];\n      if (isFinite(value)) {\n        values.push(value);\n      }\n    }\n    return values;\n  }\n\n  /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n  getMaxOverflow() {\n    return false;\n  }\n\n  /**\n\t * @protected\n\t */\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const vScale = meta.vScale;\n    const parsed = this.getParsed(index);\n    return {\n      label: iScale ? '' + iScale.getLabelForValue(parsed[iScale.axis]) : '',\n      value: vScale ? '' + vScale.getLabelForValue(parsed[vScale.axis]) : ''\n    };\n  }\n\n  /**\n\t * @private\n\t */\n  _update(mode) {\n    const meta = this._cachedMeta;\n    this.update(mode || 'default');\n    meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));\n  }\n\n  /**\n\t * @param {string} mode\n\t */\n  update(mode) {} // eslint-disable-line no-unused-vars\n\n  draw() {\n    const ctx = this._ctx;\n    const chart = this.chart;\n    const meta = this._cachedMeta;\n    const elements = meta.data || [];\n    const area = chart.chartArea;\n    const active = [];\n    const start = this._drawStart || 0;\n    const count = this._drawCount || (elements.length - start);\n    const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;\n    let i;\n\n    if (meta.dataset) {\n      meta.dataset.draw(ctx, area, start, count);\n    }\n\n    for (i = start; i < start + count; ++i) {\n      const element = elements[i];\n      if (element.hidden) {\n        continue;\n      }\n      if (element.active && drawActiveElementsOnTop) {\n        active.push(element);\n      } else {\n        element.draw(ctx, area);\n      }\n    }\n\n    for (i = 0; i < active.length; ++i) {\n      active[i].draw(ctx, area);\n    }\n  }\n\n  /**\n\t * Returns a set of predefined style properties that should be used to represent the dataset\n\t * or the data if the index is specified\n\t * @param {number} index - data index\n\t * @param {boolean} [active] - true if hover\n\t * @return {object} style object\n\t */\n  getStyle(index, active) {\n    const mode = active ? 'active' : 'default';\n    return index === undefined && this._cachedMeta.dataset\n      ? this.resolveDatasetElementOptions(mode)\n      : this.resolveDataElementOptions(index || 0, mode);\n  }\n\n  /**\n\t * @protected\n\t */\n  getContext(index, active, mode) {\n    const dataset = this.getDataset();\n    let context;\n    if (index >= 0 && index < this._cachedMeta.data.length) {\n      const element = this._cachedMeta.data[index];\n      context = element.$context ||\n        (element.$context = createDataContext(this.getContext(), index, element));\n      context.parsed = this.getParsed(index);\n      context.raw = dataset.data[index];\n      context.index = context.dataIndex = index;\n    } else {\n      context = this.$context ||\n        (this.$context = createDatasetContext(this.chart.getContext(), this.index));\n      context.dataset = dataset;\n      context.index = context.datasetIndex = this.index;\n    }\n\n    context.active = !!active;\n    context.mode = mode;\n    return context;\n  }\n\n  /**\n\t * @param {string} [mode]\n\t * @protected\n\t */\n  resolveDatasetElementOptions(mode) {\n    return this._resolveElementOptions(this.datasetElementType.id, mode);\n  }\n\n  /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n  resolveDataElementOptions(index, mode) {\n    return this._resolveElementOptions(this.dataElementType.id, mode, index);\n  }\n\n  /**\n\t * @private\n\t */\n  _resolveElementOptions(elementType, mode = 'default', index) {\n    const active = mode === 'active';\n    const cache = this._cachedDataOpts;\n    const cacheKey = elementType + '-' + mode;\n    const cached = cache[cacheKey];\n    const sharing = this.enableOptionSharing && defined(index);\n    if (cached) {\n      return cloneIfNotShared(cached, sharing);\n    }\n    const config = this.chart.config;\n    const scopeKeys = config.datasetElementScopeKeys(this._type, elementType);\n    const prefixes = active ? [`${elementType}Hover`, 'hover', elementType, ''] : [elementType, ''];\n    const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n    const names = Object.keys(defaults.elements[elementType]);\n    // context is provided as a function, and is called only if needed,\n    // so we don't create a context for each element if not needed.\n    const context = () => this.getContext(index, active, mode);\n    const values = config.resolveNamedOptions(scopes, names, context, prefixes);\n\n    if (values.$shared) {\n      // `$shared` indicates this set of options can be shared between multiple elements.\n      // Sharing is used to reduce number of properties to change during animation.\n      values.$shared = sharing;\n\n      // We cache options by `mode`, which can be 'active' for example. This enables us\n      // to have the 'active' element options and 'default' options to switch between\n      // when interacting.\n      cache[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));\n    }\n\n    return values;\n  }\n\n\n  /**\n\t * @private\n\t */\n  _resolveAnimations(index, transition, active) {\n    const chart = this.chart;\n    const cache = this._cachedDataOpts;\n    const cacheKey = `animation-${transition}`;\n    const cached = cache[cacheKey];\n    if (cached) {\n      return cached;\n    }\n    let options;\n    if (chart.options.animation !== false) {\n      const config = this.chart.config;\n      const scopeKeys = config.datasetAnimationScopeKeys(this._type, transition);\n      const scopes = config.getOptionScopes(this.getDataset(), scopeKeys);\n      options = config.createResolver(scopes, this.getContext(index, active, transition));\n    }\n    const animations = new Animations(chart, options && options.animations);\n    if (options && options._cacheable) {\n      cache[cacheKey] = Object.freeze(animations);\n    }\n    return animations;\n  }\n\n  /**\n\t * Utility for getting the options object shared between elements\n\t * @protected\n\t */\n  getSharedOptions(options) {\n    if (!options.$shared) {\n      return;\n    }\n    return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));\n  }\n\n  /**\n\t * Utility for determining if `options` should be included in the updated properties\n\t * @protected\n\t */\n  includeOptions(mode, sharedOptions) {\n    return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;\n  }\n\n  /**\n   * @todo v4, rename to getSharedOptions and remove excess functions\n   */\n  _getSharedOptions(start, mode) {\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const previouslySharedOptions = this._sharedOptions;\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions) || (sharedOptions !== previouslySharedOptions);\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n    return {sharedOptions, includeOptions};\n  }\n\n  /**\n\t * Utility for updating an element with new properties, using animations when appropriate.\n\t * @protected\n\t */\n  updateElement(element, index, properties, mode) {\n    if (isDirectUpdateMode(mode)) {\n      Object.assign(element, properties);\n    } else {\n      this._resolveAnimations(index, mode).update(element, properties);\n    }\n  }\n\n  /**\n\t * Utility to animate the shared options, that are potentially affecting multiple elements.\n\t * @protected\n\t */\n  updateSharedOptions(sharedOptions, mode, newOptions) {\n    if (sharedOptions && !isDirectUpdateMode(mode)) {\n      this._resolveAnimations(undefined, mode).update(sharedOptions, newOptions);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _setStyle(element, index, mode, active) {\n    element.active = active;\n    const options = this.getStyle(index, active);\n    this._resolveAnimations(index, mode, active).update(element, {\n      // When going from active to inactive, we need to update to the shared options.\n      // This way the once hovered element will end up with the same original shared options instance, after animation.\n      options: (!active && this.getSharedOptions(options)) || options\n    });\n  }\n\n  removeHoverStyle(element, datasetIndex, index) {\n    this._setStyle(element, index, 'active', false);\n  }\n\n  setHoverStyle(element, datasetIndex, index) {\n    this._setStyle(element, index, 'active', true);\n  }\n\n  /**\n\t * @private\n\t */\n  _removeDatasetHoverStyle() {\n    const element = this._cachedMeta.dataset;\n\n    if (element) {\n      this._setStyle(element, undefined, 'active', false);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _setDatasetHoverStyle() {\n    const element = this._cachedMeta.dataset;\n\n    if (element) {\n      this._setStyle(element, undefined, 'active', true);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _resyncElements(resetNewElements) {\n    const data = this._data;\n    const elements = this._cachedMeta.data;\n\n    // Apply changes detected through array listeners\n    for (const [method, arg1, arg2] of this._syncList) {\n      this[method](arg1, arg2);\n    }\n    this._syncList = [];\n\n    const numMeta = elements.length;\n    const numData = data.length;\n    const count = Math.min(numData, numMeta);\n\n    if (count) {\n      // TODO: It is not optimal to always parse the old data\n      // This is done because we are not detecting direct assignments:\n      // chart.data.datasets[0].data[5] = 10;\n      // chart.data.datasets[0].data[5].y = 10;\n      this.parse(0, count);\n    }\n\n    if (numData > numMeta) {\n      this._insertElements(numMeta, numData - numMeta, resetNewElements);\n    } else if (numData < numMeta) {\n      this._removeElements(numData, numMeta - numData);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _insertElements(start, count, resetNewElements = true) {\n    const meta = this._cachedMeta;\n    const data = meta.data;\n    const end = start + count;\n    let i;\n\n    const move = (arr) => {\n      arr.length += count;\n      for (i = arr.length - 1; i >= end; i--) {\n        arr[i] = arr[i - count];\n      }\n    };\n    move(data);\n\n    for (i = start; i < end; ++i) {\n      data[i] = new this.dataElementType();\n    }\n\n    if (this._parsing) {\n      move(meta._parsed);\n    }\n    this.parse(start, count);\n\n    if (resetNewElements) {\n      this.updateElements(data, start, count, 'reset');\n    }\n  }\n\n  updateElements(element, start, count, mode) {} // eslint-disable-line no-unused-vars\n\n  /**\n\t * @private\n\t */\n  _removeElements(start, count) {\n    const meta = this._cachedMeta;\n    if (this._parsing) {\n      const removed = meta._parsed.splice(start, count);\n      if (meta._stacked) {\n        clearStacks(meta, removed);\n      }\n    }\n    meta.data.splice(start, count);\n  }\n\n  /**\n\t * @private\n   */\n  _sync(args) {\n    if (this._parsing) {\n      this._syncList.push(args);\n    } else {\n      const [method, arg1, arg2] = args;\n      this[method](arg1, arg2);\n    }\n    this.chart._dataChanges.push([this.index, ...args]);\n  }\n\n  _onDataPush() {\n    const count = arguments.length;\n    this._sync(['_insertElements', this.getDataset().data.length - count, count]);\n  }\n\n  _onDataPop() {\n    this._sync(['_removeElements', this._cachedMeta.data.length - 1, 1]);\n  }\n\n  _onDataShift() {\n    this._sync(['_removeElements', 0, 1]);\n  }\n\n  _onDataSplice(start, count) {\n    if (count) {\n      this._sync(['_removeElements', start, count]);\n    }\n    const newCount = arguments.length - 2;\n    if (newCount) {\n      this._sync(['_insertElements', start, newCount]);\n    }\n  }\n\n  _onDataUnshift() {\n    this._sync(['_insertElements', 0, arguments.length]);\n  }\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {\n  _arrayUnique, isArray, isNullOrUndef,\n  valueOrDefault, resolveObjectKey, sign, defined\n} from '../helpers/index.js';\n\nfunction getAllScaleValues(scale, type) {\n  if (!scale._cache.$bar) {\n    const visibleMetas = scale.getMatchingVisibleMetas(type);\n    let values = [];\n\n    for (let i = 0, ilen = visibleMetas.length; i < ilen; i++) {\n      values = values.concat(visibleMetas[i].controller.getAllParsedValues(scale));\n    }\n    scale._cache.$bar = _arrayUnique(values.sort((a, b) => a - b));\n  }\n  return scale._cache.$bar;\n}\n\n/**\n * Computes the \"optimal\" sample size to maintain bars equally sized while preventing overlap.\n * @private\n */\nfunction computeMinSampleSize(meta) {\n  const scale = meta.iScale;\n  const values = getAllScaleValues(scale, meta.type);\n  let min = scale._length;\n  let i, ilen, curr, prev;\n  const updateMinAndPrev = () => {\n    if (curr === 32767 || curr === -32768) {\n      // Ignore truncated pixels\n      return;\n    }\n    if (defined(prev)) {\n      // curr - prev === 0 is ignored\n      min = Math.min(min, Math.abs(curr - prev) || min);\n    }\n    prev = curr;\n  };\n\n  for (i = 0, ilen = values.length; i < ilen; ++i) {\n    curr = scale.getPixelForValue(values[i]);\n    updateMinAndPrev();\n  }\n\n  prev = undefined;\n  for (i = 0, ilen = scale.ticks.length; i < ilen; ++i) {\n    curr = scale.getPixelForTick(i);\n    updateMinAndPrev();\n  }\n\n  return min;\n}\n\n/**\n * Computes an \"ideal\" category based on the absolute bar thickness or, if undefined or null,\n * uses the smallest interval (see computeMinSampleSize) that prevents bar overlapping. This\n * mode currently always generates bars equally sized (until we introduce scriptable options?).\n * @private\n */\nfunction computeFitCategoryTraits(index, ruler, options, stackCount) {\n  const thickness = options.barThickness;\n  let size, ratio;\n\n  if (isNullOrUndef(thickness)) {\n    size = ruler.min * options.categoryPercentage;\n    ratio = options.barPercentage;\n  } else {\n    // When bar thickness is enforced, category and bar percentages are ignored.\n    // Note(SB): we could add support for relative bar thickness (e.g. barThickness: '50%')\n    // and deprecate barPercentage since this value is ignored when thickness is absolute.\n    size = thickness * stackCount;\n    ratio = 1;\n  }\n\n  return {\n    chunk: size / stackCount,\n    ratio,\n    start: ruler.pixels[index] - (size / 2)\n  };\n}\n\n/**\n * Computes an \"optimal\" category that globally arranges bars side by side (no gap when\n * percentage options are 1), based on the previous and following categories. This mode\n * generates bars with different widths when data are not evenly spaced.\n * @private\n */\nfunction computeFlexCategoryTraits(index, ruler, options, stackCount) {\n  const pixels = ruler.pixels;\n  const curr = pixels[index];\n  let prev = index > 0 ? pixels[index - 1] : null;\n  let next = index < pixels.length - 1 ? pixels[index + 1] : null;\n  const percent = options.categoryPercentage;\n\n  if (prev === null) {\n    // first data: its size is double based on the next point or,\n    // if it's also the last data, we use the scale size.\n    prev = curr - (next === null ? ruler.end - ruler.start : next - curr);\n  }\n\n  if (next === null) {\n    // last data: its size is also double based on the previous point.\n    next = curr + curr - prev;\n  }\n\n  const start = curr - (curr - Math.min(prev, next)) / 2 * percent;\n  const size = Math.abs(next - prev) / 2 * percent;\n\n  return {\n    chunk: size / stackCount,\n    ratio: options.barPercentage,\n    start\n  };\n}\n\nfunction parseFloatBar(entry, item, vScale, i) {\n  const startValue = vScale.parse(entry[0], i);\n  const endValue = vScale.parse(entry[1], i);\n  const min = Math.min(startValue, endValue);\n  const max = Math.max(startValue, endValue);\n  let barStart = min;\n  let barEnd = max;\n\n  if (Math.abs(min) > Math.abs(max)) {\n    barStart = max;\n    barEnd = min;\n  }\n\n  // Store `barEnd` (furthest away from origin) as parsed value,\n  // to make stacking straight forward\n  item[vScale.axis] = barEnd;\n\n  item._custom = {\n    barStart,\n    barEnd,\n    start: startValue,\n    end: endValue,\n    min,\n    max\n  };\n}\n\nfunction parseValue(entry, item, vScale, i) {\n  if (isArray(entry)) {\n    parseFloatBar(entry, item, vScale, i);\n  } else {\n    item[vScale.axis] = vScale.parse(entry, i);\n  }\n  return item;\n}\n\nfunction parseArrayOrPrimitive(meta, data, start, count) {\n  const iScale = meta.iScale;\n  const vScale = meta.vScale;\n  const labels = iScale.getLabels();\n  const singleScale = iScale === vScale;\n  const parsed = [];\n  let i, ilen, item, entry;\n\n  for (i = start, ilen = start + count; i < ilen; ++i) {\n    entry = data[i];\n    item = {};\n    item[iScale.axis] = singleScale || iScale.parse(labels[i], i);\n    parsed.push(parseValue(entry, item, vScale, i));\n  }\n  return parsed;\n}\n\nfunction isFloatBar(custom) {\n  return custom && custom.barStart !== undefined && custom.barEnd !== undefined;\n}\n\nfunction barSign(size, vScale, actualBase) {\n  if (size !== 0) {\n    return sign(size);\n  }\n  return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);\n}\n\nfunction borderProps(properties) {\n  let reverse, start, end, top, bottom;\n  if (properties.horizontal) {\n    reverse = properties.base > properties.x;\n    start = 'left';\n    end = 'right';\n  } else {\n    reverse = properties.base < properties.y;\n    start = 'bottom';\n    end = 'top';\n  }\n  if (reverse) {\n    top = 'end';\n    bottom = 'start';\n  } else {\n    top = 'start';\n    bottom = 'end';\n  }\n  return {start, end, reverse, top, bottom};\n}\n\nfunction setBorderSkipped(properties, options, stack, index) {\n  let edge = options.borderSkipped;\n  const res = {};\n\n  if (!edge) {\n    properties.borderSkipped = res;\n    return;\n  }\n\n  if (edge === true) {\n    properties.borderSkipped = {top: true, right: true, bottom: true, left: true};\n    return;\n  }\n\n  const {start, end, reverse, top, bottom} = borderProps(properties);\n\n  if (edge === 'middle' && stack) {\n    properties.enableBorderRadius = true;\n    if ((stack._top || 0) === index) {\n      edge = top;\n    } else if ((stack._bottom || 0) === index) {\n      edge = bottom;\n    } else {\n      res[parseEdge(bottom, start, end, reverse)] = true;\n      edge = top;\n    }\n  }\n\n  res[parseEdge(edge, start, end, reverse)] = true;\n  properties.borderSkipped = res;\n}\n\nfunction parseEdge(edge, a, b, reverse) {\n  if (reverse) {\n    edge = swap(edge, a, b);\n    edge = startEnd(edge, b, a);\n  } else {\n    edge = startEnd(edge, a, b);\n  }\n  return edge;\n}\n\nfunction swap(orig, v1, v2) {\n  return orig === v1 ? v2 : orig === v2 ? v1 : orig;\n}\n\nfunction startEnd(v, start, end) {\n  return v === 'start' ? start : v === 'end' ? end : v;\n}\n\nfunction setInflateAmount(properties, {inflateAmount}, ratio) {\n  properties.inflateAmount = inflateAmount === 'auto'\n    ? ratio === 1 ? 0.33 : 0\n    : inflateAmount;\n}\n\nexport default class BarController extends DatasetController {\n\n  static id = 'bar';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    datasetElementType: false,\n    dataElementType: 'bar',\n\n    categoryPercentage: 0.8,\n    barPercentage: 0.9,\n    grouped: true,\n\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['x', 'y', 'base', 'width', 'height']\n      }\n    }\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n    scales: {\n      _index_: {\n        type: 'category',\n        offset: true,\n        grid: {\n          offset: true\n        }\n      },\n      _value_: {\n        type: 'linear',\n        beginAtZero: true,\n      }\n    }\n  };\n\n\n  /**\n\t * Overriding primitive data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n  parsePrimitiveData(meta, data, start, count) {\n    return parseArrayOrPrimitive(meta, data, start, count);\n  }\n\n  /**\n\t * Overriding array data parsing since we support mixed primitive/array\n\t * data for float bars\n\t * @protected\n\t */\n  parseArrayData(meta, data, start, count) {\n    return parseArrayOrPrimitive(meta, data, start, count);\n  }\n\n  /**\n\t * Overriding object data parsing since we support mixed primitive/array\n\t * value-scale data for float bars\n\t * @protected\n\t */\n  parseObjectData(meta, data, start, count) {\n    const {iScale, vScale} = meta;\n    const {xAxisKey = 'x', yAxisKey = 'y'} = this._parsing;\n    const iAxisKey = iScale.axis === 'x' ? xAxisKey : yAxisKey;\n    const vAxisKey = vScale.axis === 'x' ? xAxisKey : yAxisKey;\n    const parsed = [];\n    let i, ilen, item, obj;\n    for (i = start, ilen = start + count; i < ilen; ++i) {\n      obj = data[i];\n      item = {};\n      item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i);\n      parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i));\n    }\n    return parsed;\n  }\n\n  /**\n\t * @protected\n\t */\n  updateRangeFromParsed(range, scale, parsed, stack) {\n    super.updateRangeFromParsed(range, scale, parsed, stack);\n    const custom = parsed._custom;\n    if (custom && scale === this._cachedMeta.vScale) {\n      // float bar: only one end of the bar is considered by `super`\n      range.min = Math.min(range.min, custom.min);\n      range.max = Math.max(range.max, custom.max);\n    }\n  }\n\n  /**\n\t * @return {number|boolean}\n\t * @protected\n\t */\n  getMaxOverflow() {\n    return 0;\n  }\n\n  /**\n\t * @protected\n\t */\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const {iScale, vScale} = meta;\n    const parsed = this.getParsed(index);\n    const custom = parsed._custom;\n    const value = isFloatBar(custom)\n      ? '[' + custom.start + ', ' + custom.end + ']'\n      : '' + vScale.getLabelForValue(parsed[vScale.axis]);\n\n    return {\n      label: '' + iScale.getLabelForValue(parsed[iScale.axis]),\n      value\n    };\n  }\n\n  initialize() {\n    this.enableOptionSharing = true;\n\n    super.initialize();\n\n    const meta = this._cachedMeta;\n    meta.stack = this.getDataset().stack;\n  }\n\n  update(mode) {\n    const meta = this._cachedMeta;\n    this.updateElements(meta.data, 0, meta.data.length, mode);\n  }\n\n  updateElements(bars, start, count, mode) {\n    const reset = mode === 'reset';\n    const {index, _cachedMeta: {vScale}} = this;\n    const base = vScale.getBasePixel();\n    const horizontal = vScale.isHorizontal();\n    const ruler = this._getRuler();\n    const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n\n    for (let i = start; i < start + count; i++) {\n      const parsed = this.getParsed(i);\n      const vpixels = reset || isNullOrUndef(parsed[vScale.axis]) ? {base, head: base} : this._calculateBarValuePixels(i);\n      const ipixels = this._calculateBarIndexPixels(i, ruler);\n      const stack = (parsed._stacks || {})[vScale.axis];\n\n      const properties = {\n        horizontal,\n        base: vpixels.base,\n        enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index === stack._top || index === stack._bottom),\n        x: horizontal ? vpixels.head : ipixels.center,\n        y: horizontal ? ipixels.center : vpixels.head,\n        height: horizontal ? ipixels.size : Math.abs(vpixels.size),\n        width: horizontal ? Math.abs(vpixels.size) : ipixels.size\n      };\n\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, bars[i].active ? 'active' : mode);\n      }\n      const options = properties.options || bars[i].options;\n      setBorderSkipped(properties, options, stack, index);\n      setInflateAmount(properties, options, ruler.ratio);\n      this.updateElement(bars[i], i, properties, mode);\n    }\n  }\n\n  /**\n\t * Returns the stacks based on groups and bar visibility.\n\t * @param {number} [last] - The dataset index\n\t * @param {number} [dataIndex] - The data index of the ruler\n\t * @returns {string[]} The list of stack IDs\n\t * @private\n\t */\n  _getStacks(last, dataIndex) {\n    const {iScale} = this._cachedMeta;\n    const metasets = iScale.getMatchingVisibleMetas(this._type)\n      .filter(meta => meta.controller.options.grouped);\n    const stacked = iScale.options.stacked;\n    const stacks = [];\n\n    const skipNull = (meta) => {\n      const parsed = meta.controller.getParsed(dataIndex);\n      const val = parsed && parsed[meta.vScale.axis];\n\n      if (isNullOrUndef(val) || isNaN(val)) {\n        return true;\n      }\n    };\n\n    for (const meta of metasets) {\n      if (dataIndex !== undefined && skipNull(meta)) {\n        continue;\n      }\n\n      // stacked   | meta.stack\n      //           | found | not found | undefined\n      // false     |   x   |     x     |     x\n      // true      |       |     x     |\n      // undefined |       |     x     |     x\n      if (stacked === false || stacks.indexOf(meta.stack) === -1 ||\n\t\t\t\t(stacked === undefined && meta.stack === undefined)) {\n        stacks.push(meta.stack);\n      }\n      if (meta.index === last) {\n        break;\n      }\n    }\n\n    // No stacks? that means there is no visible data. Let's still initialize an `undefined`\n    // stack where possible invisible bars will be located.\n    // https://github.com/chartjs/Chart.js/issues/6368\n    if (!stacks.length) {\n      stacks.push(undefined);\n    }\n\n    return stacks;\n  }\n\n  /**\n\t * Returns the effective number of stacks based on groups and bar visibility.\n\t * @private\n\t */\n  _getStackCount(index) {\n    return this._getStacks(undefined, index).length;\n  }\n\n  /**\n\t * Returns the stack index for the given dataset based on groups and bar visibility.\n\t * @param {number} [datasetIndex] - The dataset index\n\t * @param {string} [name] - The stack name to find\n   * @param {number} [dataIndex]\n\t * @returns {number} The stack index\n\t * @private\n\t */\n  _getStackIndex(datasetIndex, name, dataIndex) {\n    const stacks = this._getStacks(datasetIndex, dataIndex);\n    const index = (name !== undefined)\n      ? stacks.indexOf(name)\n      : -1; // indexOf returns -1 if element is not present\n\n    return (index === -1)\n      ? stacks.length - 1\n      : index;\n  }\n\n  /**\n\t * @private\n\t */\n  _getRuler() {\n    const opts = this.options;\n    const meta = this._cachedMeta;\n    const iScale = meta.iScale;\n    const pixels = [];\n    let i, ilen;\n\n    for (i = 0, ilen = meta.data.length; i < ilen; ++i) {\n      pixels.push(iScale.getPixelForValue(this.getParsed(i)[iScale.axis], i));\n    }\n\n    const barThickness = opts.barThickness;\n    const min = barThickness || computeMinSampleSize(meta);\n\n    return {\n      min,\n      pixels,\n      start: iScale._startPixel,\n      end: iScale._endPixel,\n      stackCount: this._getStackCount(),\n      scale: iScale,\n      grouped: opts.grouped,\n      // bar thickness ratio used for non-grouped bars\n      ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage\n    };\n  }\n\n  /**\n\t * Note: pixel values are not clamped to the scale area.\n\t * @private\n\t */\n  _calculateBarValuePixels(index) {\n    const {_cachedMeta: {vScale, _stacked, index: datasetIndex}, options: {base: baseValue, minBarLength}} = this;\n    const actualBase = baseValue || 0;\n    const parsed = this.getParsed(index);\n    const custom = parsed._custom;\n    const floating = isFloatBar(custom);\n    let value = parsed[vScale.axis];\n    let start = 0;\n    let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;\n    let head, size;\n\n    if (length !== value) {\n      start = length - value;\n      length = value;\n    }\n\n    if (floating) {\n      value = custom.barStart;\n      length = custom.barEnd - custom.barStart;\n      // bars crossing origin are not stacked\n      if (value !== 0 && sign(value) !== sign(custom.barEnd)) {\n        start = 0;\n      }\n      start += value;\n    }\n\n    const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start;\n    let base = vScale.getPixelForValue(startValue);\n\n    if (this.chart.getDataVisibility(index)) {\n      head = vScale.getPixelForValue(start + length);\n    } else {\n      // When not visible, no height\n      head = base;\n    }\n\n    size = head - base;\n\n    if (Math.abs(size) < minBarLength) {\n      size = barSign(size, vScale, actualBase) * minBarLength;\n      if (value === actualBase) {\n        base -= size / 2;\n      }\n      const startPixel = vScale.getPixelForDecimal(0);\n      const endPixel = vScale.getPixelForDecimal(1);\n      const min = Math.min(startPixel, endPixel);\n      const max = Math.max(startPixel, endPixel);\n      base = Math.max(Math.min(base, max), min);\n      head = base + size;\n\n      if (_stacked && !floating) {\n        // visual data coordinates after applying minBarLength\n        parsed._stacks[vScale.axis]._visualValues[datasetIndex] = vScale.getValueForPixel(head) - vScale.getValueForPixel(base);\n      }\n    }\n\n    if (base === vScale.getPixelForValue(actualBase)) {\n      const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;\n      base += halfGrid;\n      size -= halfGrid;\n    }\n\n    return {\n      size,\n      base,\n      head,\n      center: head + size / 2\n    };\n  }\n\n  /**\n\t * @private\n\t */\n  _calculateBarIndexPixels(index, ruler) {\n    const scale = ruler.scale;\n    const options = this.options;\n    const skipNull = options.skipNull;\n    const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);\n    let center, size;\n    if (ruler.grouped) {\n      const stackCount = skipNull ? this._getStackCount(index) : ruler.stackCount;\n      const range = options.barThickness === 'flex'\n        ? computeFlexCategoryTraits(index, ruler, options, stackCount)\n        : computeFitCategoryTraits(index, ruler, options, stackCount);\n\n      const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index : undefined);\n      center = range.start + (range.chunk * stackIndex) + (range.chunk / 2);\n      size = Math.min(maxBarThickness, range.chunk * range.ratio);\n    } else {\n      // For non-grouped bar charts, exact pixel values are used\n      center = scale.getPixelForValue(this.getParsed(index)[scale.axis], index);\n      size = Math.min(maxBarThickness, ruler.min * ruler.ratio);\n    }\n\n    return {\n      base: center - size / 2,\n      head: center + size / 2,\n      center,\n      size\n    };\n  }\n\n  draw() {\n    const meta = this._cachedMeta;\n    const vScale = meta.vScale;\n    const rects = meta.data;\n    const ilen = rects.length;\n    let i = 0;\n\n    for (; i < ilen; ++i) {\n      if (this.getParsed(i)[vScale.axis] !== null) {\n        rects[i].draw(this._ctx);\n      }\n    }\n  }\n\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {valueOrDefault} from '../helpers/helpers.core.js';\n\nexport default class BubbleController extends DatasetController {\n\n  static id = 'bubble';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    datasetElementType: false,\n    dataElementType: 'point',\n\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['x', 'y', 'borderWidth', 'radius']\n      }\n    }\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n    scales: {\n      x: {\n        type: 'linear'\n      },\n      y: {\n        type: 'linear'\n      }\n    }\n  };\n\n  initialize() {\n    this.enableOptionSharing = true;\n    super.initialize();\n  }\n\n  /**\n\t * Parse array of primitive values\n\t * @protected\n\t */\n  parsePrimitiveData(meta, data, start, count) {\n    const parsed = super.parsePrimitiveData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      parsed[i]._custom = this.resolveDataElementOptions(i + start).radius;\n    }\n    return parsed;\n  }\n\n  /**\n\t * Parse array of arrays\n\t * @protected\n\t */\n  parseArrayData(meta, data, start, count) {\n    const parsed = super.parseArrayData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      const item = data[start + i];\n      parsed[i]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i + start).radius);\n    }\n    return parsed;\n  }\n\n  /**\n\t * Parse array of objects\n\t * @protected\n\t */\n  parseObjectData(meta, data, start, count) {\n    const parsed = super.parseObjectData(meta, data, start, count);\n    for (let i = 0; i < parsed.length; i++) {\n      const item = data[start + i];\n      parsed[i]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i + start).radius);\n    }\n    return parsed;\n  }\n\n  /**\n\t * @protected\n\t */\n  getMaxOverflow() {\n    const data = this._cachedMeta.data;\n\n    let max = 0;\n    for (let i = data.length - 1; i >= 0; --i) {\n      max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n    }\n    return max > 0 && max;\n  }\n\n  /**\n\t * @protected\n\t */\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const labels = this.chart.data.labels || [];\n    const {xScale, yScale} = meta;\n    const parsed = this.getParsed(index);\n    const x = xScale.getLabelForValue(parsed.x);\n    const y = yScale.getLabelForValue(parsed.y);\n    const r = parsed._custom;\n\n    return {\n      label: labels[index] || '',\n      value: '(' + x + ', ' + y + (r ? ', ' + r : '') + ')'\n    };\n  }\n\n  update(mode) {\n    const points = this._cachedMeta.data;\n\n    // Update Points\n    this.updateElements(points, 0, points.length, mode);\n  }\n\n  updateElements(points, start, count, mode) {\n    const reset = mode === 'reset';\n    const {iScale, vScale} = this._cachedMeta;\n    const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n\n    for (let i = start; i < start + count; i++) {\n      const point = points[i];\n      const parsed = !reset && this.getParsed(i);\n      const properties = {};\n      const iPixel = properties[iAxis] = reset ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);\n      const vPixel = properties[vAxis] = reset ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);\n\n      properties.skip = isNaN(iPixel) || isNaN(vPixel);\n\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n\n        if (reset) {\n          properties.options.radius = 0;\n        }\n      }\n\n      this.updateElement(point, i, properties, mode);\n    }\n  }\n\n  /**\n\t * @param {number} index\n\t * @param {string} [mode]\n\t * @protected\n\t */\n  resolveDataElementOptions(index, mode) {\n    const parsed = this.getParsed(index);\n    let values = super.resolveDataElementOptions(index, mode);\n\n    // In case values were cached (and thus frozen), we need to clone the values\n    if (values.$shared) {\n      values = Object.assign({}, values, {$shared: false});\n    }\n\n    // Custom radius resolution\n    const radius = values.radius;\n    if (mode !== 'active') {\n      values.radius = 0;\n    }\n    values.radius += valueOrDefault(parsed && parsed._custom, radius);\n\n    return values;\n  }\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {isObject, resolveObjectKey, toPercentage, toDimension, valueOrDefault} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {toRadians, PI, TAU, HALF_PI, _angleBetween} from '../helpers/helpers.math.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nfunction getRatioAndOffset(rotation, circumference, cutout) {\n  let ratioX = 1;\n  let ratioY = 1;\n  let offsetX = 0;\n  let offsetY = 0;\n  // If the chart's circumference isn't a full circle, calculate size as a ratio of the width/height of the arc\n  if (circumference < TAU) {\n    const startAngle = rotation;\n    const endAngle = startAngle + circumference;\n    const startX = Math.cos(startAngle);\n    const startY = Math.sin(startAngle);\n    const endX = Math.cos(endAngle);\n    const endY = Math.sin(endAngle);\n    const calcMax = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a, a * cutout, b, b * cutout);\n    const calcMin = (angle, a, b) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a, a * cutout, b, b * cutout);\n    const maxX = calcMax(0, startX, endX);\n    const maxY = calcMax(HALF_PI, startY, endY);\n    const minX = calcMin(PI, startX, endX);\n    const minY = calcMin(PI + HALF_PI, startY, endY);\n    ratioX = (maxX - minX) / 2;\n    ratioY = (maxY - minY) / 2;\n    offsetX = -(maxX + minX) / 2;\n    offsetY = -(maxY + minY) / 2;\n  }\n  return {ratioX, ratioY, offsetX, offsetY};\n}\n\nexport default class DoughnutController extends DatasetController {\n\n  static id = 'doughnut';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    datasetElementType: false,\n    dataElementType: 'arc',\n    animation: {\n      // Boolean - Whether we animate the rotation of the Doughnut\n      animateRotate: true,\n      // Boolean - Whether we animate scaling the Doughnut from the centre\n      animateScale: false\n    },\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['circumference', 'endAngle', 'innerRadius', 'outerRadius', 'startAngle', 'x', 'y', 'offset', 'borderWidth', 'spacing']\n      },\n    },\n    // The percentage of the chart that we cut out of the middle.\n    cutout: '50%',\n\n    // The rotation of the chart, where the first data arc begins.\n    rotation: 0,\n\n    // The total circumference of the chart.\n    circumference: 360,\n\n    // The outer radius of the chart\n    radius: '100%',\n\n    // Spacing between arcs\n    spacing: 0,\n\n    indexAxis: 'r',\n  };\n\n  static descriptors = {\n    _scriptable: (name) => name !== 'spacing',\n    _indexable: (name) => name !== 'spacing' && !name.startsWith('borderDash') && !name.startsWith('hoverBorderDash'),\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n    aspectRatio: 1,\n\n    // Need to override these to give a nice default\n    plugins: {\n      legend: {\n        labels: {\n          generateLabels(chart) {\n            const data = chart.data;\n            if (data.labels.length && data.datasets.length) {\n              const {labels: {pointStyle, color}} = chart.legend.options;\n\n              return data.labels.map((label, i) => {\n                const meta = chart.getDatasetMeta(0);\n                const style = meta.controller.getStyle(i);\n\n                return {\n                  text: label,\n                  fillStyle: style.backgroundColor,\n                  strokeStyle: style.borderColor,\n                  fontColor: color,\n                  lineWidth: style.borderWidth,\n                  pointStyle: pointStyle,\n                  hidden: !chart.getDataVisibility(i),\n\n                  // Extra data used for toggling the correct item\n                  index: i\n                };\n              });\n            }\n            return [];\n          }\n        },\n\n        onClick(e, legendItem, legend) {\n          legend.chart.toggleDataVisibility(legendItem.index);\n          legend.chart.update();\n        }\n      }\n    }\n  };\n\n  constructor(chart, datasetIndex) {\n    super(chart, datasetIndex);\n\n    this.enableOptionSharing = true;\n    this.innerRadius = undefined;\n    this.outerRadius = undefined;\n    this.offsetX = undefined;\n    this.offsetY = undefined;\n  }\n\n  linkScales() {}\n\n  /**\n\t * Override data parsing, since we are not using scales\n\t */\n  parse(start, count) {\n    const data = this.getDataset().data;\n    const meta = this._cachedMeta;\n\n    if (this._parsing === false) {\n      meta._parsed = data;\n    } else {\n      let getter = (i) => +data[i];\n\n      if (isObject(data[start])) {\n        const {key = 'value'} = this._parsing;\n        getter = (i) => +resolveObjectKey(data[i], key);\n      }\n\n      let i, ilen;\n      for (i = start, ilen = start + count; i < ilen; ++i) {\n        meta._parsed[i] = getter(i);\n      }\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _getRotation() {\n    return toRadians(this.options.rotation - 90);\n  }\n\n  /**\n\t * @private\n\t */\n  _getCircumference() {\n    return toRadians(this.options.circumference);\n  }\n\n  /**\n\t * Get the maximal rotation & circumference extents\n\t * across all visible datasets.\n\t */\n  _getRotationExtents() {\n    let min = TAU;\n    let max = -TAU;\n\n    for (let i = 0; i < this.chart.data.datasets.length; ++i) {\n      if (this.chart.isDatasetVisible(i) && this.chart.getDatasetMeta(i).type === this._type) {\n        const controller = this.chart.getDatasetMeta(i).controller;\n        const rotation = controller._getRotation();\n        const circumference = controller._getCircumference();\n\n        min = Math.min(min, rotation);\n        max = Math.max(max, rotation + circumference);\n      }\n    }\n\n    return {\n      rotation: min,\n      circumference: max - min,\n    };\n  }\n\n  /**\n\t * @param {string} mode\n\t */\n  update(mode) {\n    const chart = this.chart;\n    const {chartArea} = chart;\n    const meta = this._cachedMeta;\n    const arcs = meta.data;\n    const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;\n    const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);\n    const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);\n    const chartWeight = this._getRingWeight(this.index);\n\n    // Compute the maximal rotation & circumference limits.\n    // If we only consider our dataset, this can cause problems when two datasets\n    // are both less than a circle with different rotations (starting angles)\n    const {circumference, rotation} = this._getRotationExtents();\n    const {ratioX, ratioY, offsetX, offsetY} = getRatioAndOffset(rotation, circumference, cutout);\n    const maxWidth = (chartArea.width - spacing) / ratioX;\n    const maxHeight = (chartArea.height - spacing) / ratioY;\n    const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);\n    const outerRadius = toDimension(this.options.radius, maxRadius);\n    const innerRadius = Math.max(outerRadius * cutout, 0);\n    const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();\n    this.offsetX = offsetX * outerRadius;\n    this.offsetY = offsetY * outerRadius;\n\n    meta.total = this.calculateTotal();\n\n    this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);\n    this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);\n\n    this.updateElements(arcs, 0, arcs.length, mode);\n  }\n\n  /**\n   * @private\n   */\n  _circumference(i, reset) {\n    const opts = this.options;\n    const meta = this._cachedMeta;\n    const circumference = this._getCircumference();\n    if ((reset && opts.animation.animateRotate) || !this.chart.getDataVisibility(i) || meta._parsed[i] === null || meta.data[i].hidden) {\n      return 0;\n    }\n    return this.calculateCircumference(meta._parsed[i] * circumference / TAU);\n  }\n\n  updateElements(arcs, start, count, mode) {\n    const reset = mode === 'reset';\n    const chart = this.chart;\n    const chartArea = chart.chartArea;\n    const opts = chart.options;\n    const animationOpts = opts.animation;\n    const centerX = (chartArea.left + chartArea.right) / 2;\n    const centerY = (chartArea.top + chartArea.bottom) / 2;\n    const animateScale = reset && animationOpts.animateScale;\n    const innerRadius = animateScale ? 0 : this.innerRadius;\n    const outerRadius = animateScale ? 0 : this.outerRadius;\n    const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n    let startAngle = this._getRotation();\n    let i;\n\n    for (i = 0; i < start; ++i) {\n      startAngle += this._circumference(i, reset);\n    }\n\n    for (i = start; i < start + count; ++i) {\n      const circumference = this._circumference(i, reset);\n      const arc = arcs[i];\n      const properties = {\n        x: centerX + this.offsetX,\n        y: centerY + this.offsetY,\n        startAngle,\n        endAngle: startAngle + circumference,\n        circumference,\n        outerRadius,\n        innerRadius\n      };\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, arc.active ? 'active' : mode);\n      }\n      startAngle += circumference;\n\n      this.updateElement(arc, i, properties, mode);\n    }\n  }\n\n  calculateTotal() {\n    const meta = this._cachedMeta;\n    const metaData = meta.data;\n    let total = 0;\n    let i;\n\n    for (i = 0; i < metaData.length; i++) {\n      const value = meta._parsed[i];\n      if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i) && !metaData[i].hidden) {\n        total += Math.abs(value);\n      }\n    }\n\n    return total;\n  }\n\n  calculateCircumference(value) {\n    const total = this._cachedMeta.total;\n    if (total > 0 && !isNaN(value)) {\n      return TAU * (Math.abs(value) / total);\n    }\n    return 0;\n  }\n\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const chart = this.chart;\n    const labels = chart.data.labels || [];\n    const value = formatNumber(meta._parsed[index], chart.options.locale);\n\n    return {\n      label: labels[index] || '',\n      value,\n    };\n  }\n\n  getMaxBorderWidth(arcs) {\n    let max = 0;\n    const chart = this.chart;\n    let i, ilen, meta, controller, options;\n\n    if (!arcs) {\n      // Find the outmost visible dataset\n      for (i = 0, ilen = chart.data.datasets.length; i < ilen; ++i) {\n        if (chart.isDatasetVisible(i)) {\n          meta = chart.getDatasetMeta(i);\n          arcs = meta.data;\n          controller = meta.controller;\n          break;\n        }\n      }\n    }\n\n    if (!arcs) {\n      return 0;\n    }\n\n    for (i = 0, ilen = arcs.length; i < ilen; ++i) {\n      options = controller.resolveDataElementOptions(i);\n      if (options.borderAlign !== 'inner') {\n        max = Math.max(max, options.borderWidth || 0, options.hoverBorderWidth || 0);\n      }\n    }\n    return max;\n  }\n\n  getMaxOffset(arcs) {\n    let max = 0;\n\n    for (let i = 0, ilen = arcs.length; i < ilen; ++i) {\n      const options = this.resolveDataElementOptions(i);\n      max = Math.max(max, options.offset || 0, options.hoverOffset || 0);\n    }\n    return max;\n  }\n\n  /**\n\t * Get radius length offset of the dataset in relation to the visible datasets weights. This allows determining the inner and outer radius correctly\n\t * @private\n\t */\n  _getRingWeightOffset(datasetIndex) {\n    let ringWeightOffset = 0;\n\n    for (let i = 0; i < datasetIndex; ++i) {\n      if (this.chart.isDatasetVisible(i)) {\n        ringWeightOffset += this._getRingWeight(i);\n      }\n    }\n\n    return ringWeightOffset;\n  }\n\n  /**\n\t * @private\n\t */\n  _getRingWeight(datasetIndex) {\n    return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);\n  }\n\n  /**\n\t * Returns the sum of all visible data set weights.\n\t * @private\n\t */\n  _getVisibleDatasetWeightTotal() {\n    return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;\n  }\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class LineController extends DatasetController {\n\n  static id = 'line';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    datasetElementType: 'line',\n    dataElementType: 'point',\n\n    showLine: true,\n    spanGaps: false,\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n    scales: {\n      _index_: {\n        type: 'category',\n      },\n      _value_: {\n        type: 'linear',\n      },\n    }\n  };\n\n  initialize() {\n    this.enableOptionSharing = true;\n    this.supportsDecimation = true;\n    super.initialize();\n  }\n\n  update(mode) {\n    const meta = this._cachedMeta;\n    const {dataset: line, data: points = [], _dataset} = meta;\n    // @ts-ignore\n    const animationsDisabled = this.chart._animationsDisabled;\n    let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n    this._drawStart = start;\n    this._drawCount = count;\n\n    if (_scaleRangesChanged(meta)) {\n      start = 0;\n      count = points.length;\n    }\n\n    // Update Line\n    line._chart = this.chart;\n    line._datasetIndex = this.index;\n    line._decimated = !!_dataset._decimated;\n    line.points = points;\n\n    const options = this.resolveDatasetElementOptions(mode);\n    if (!this.options.showLine) {\n      options.borderWidth = 0;\n    }\n    options.segment = this.options.segment;\n    this.updateElement(line, undefined, {\n      animated: !animationsDisabled,\n      options\n    }, mode);\n\n    // Update Points\n    this.updateElements(points, start, count, mode);\n  }\n\n  updateElements(points, start, count, mode) {\n    const reset = mode === 'reset';\n    const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n    const {sharedOptions, includeOptions} = this._getSharedOptions(start, mode);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const {spanGaps, segment} = this.options;\n    const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n    const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n    const end = start + count;\n    const pointsCount = points.length;\n    let prevParsed = start > 0 && this.getParsed(start - 1);\n\n    for (let i = 0; i < pointsCount; ++i) {\n      const point = points[i];\n      const properties = directUpdate ? point : {};\n\n      if (i < start || i >= end) {\n        properties.skip = true;\n        continue;\n      }\n\n      const parsed = this.getParsed(i);\n      const nullData = isNullOrUndef(parsed[vAxis]);\n      const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n      const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n      properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n      properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n      if (segment) {\n        properties.parsed = parsed;\n        properties.raw = _dataset.data[i];\n      }\n\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n      }\n\n      if (!directUpdate) {\n        this.updateElement(point, i, properties, mode);\n      }\n\n      prevParsed = parsed;\n    }\n  }\n\n  /**\n\t * @protected\n\t */\n  getMaxOverflow() {\n    const meta = this._cachedMeta;\n    const dataset = meta.dataset;\n    const border = dataset.options && dataset.options.borderWidth || 0;\n    const data = meta.data || [];\n    if (!data.length) {\n      return border;\n    }\n    const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n    const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n    return Math.max(border, firstPoint, lastPoint) / 2;\n  }\n\n  draw() {\n    const meta = this._cachedMeta;\n    meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);\n    super.draw();\n  }\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {toRadians, PI, formatNumber, _parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class PolarAreaController extends DatasetController {\n\n  static id = 'polarArea';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    dataElementType: 'arc',\n    animation: {\n      animateRotate: true,\n      animateScale: true\n    },\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['x', 'y', 'startAngle', 'endAngle', 'innerRadius', 'outerRadius']\n      },\n    },\n    indexAxis: 'r',\n    startAngle: 0,\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n    aspectRatio: 1,\n\n    plugins: {\n      legend: {\n        labels: {\n          generateLabels(chart) {\n            const data = chart.data;\n            if (data.labels.length && data.datasets.length) {\n              const {labels: {pointStyle, color}} = chart.legend.options;\n\n              return data.labels.map((label, i) => {\n                const meta = chart.getDatasetMeta(0);\n                const style = meta.controller.getStyle(i);\n\n                return {\n                  text: label,\n                  fillStyle: style.backgroundColor,\n                  strokeStyle: style.borderColor,\n                  fontColor: color,\n                  lineWidth: style.borderWidth,\n                  pointStyle: pointStyle,\n                  hidden: !chart.getDataVisibility(i),\n\n                  // Extra data used for toggling the correct item\n                  index: i\n                };\n              });\n            }\n            return [];\n          }\n        },\n\n        onClick(e, legendItem, legend) {\n          legend.chart.toggleDataVisibility(legendItem.index);\n          legend.chart.update();\n        }\n      }\n    },\n\n    scales: {\n      r: {\n        type: 'radialLinear',\n        angleLines: {\n          display: false\n        },\n        beginAtZero: true,\n        grid: {\n          circular: true\n        },\n        pointLabels: {\n          display: false\n        },\n        startAngle: 0\n      }\n    }\n  };\n\n  constructor(chart, datasetIndex) {\n    super(chart, datasetIndex);\n\n    this.innerRadius = undefined;\n    this.outerRadius = undefined;\n  }\n\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const chart = this.chart;\n    const labels = chart.data.labels || [];\n    const value = formatNumber(meta._parsed[index].r, chart.options.locale);\n\n    return {\n      label: labels[index] || '',\n      value,\n    };\n  }\n\n  parseObjectData(meta, data, start, count) {\n    return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n  }\n\n  update(mode) {\n    const arcs = this._cachedMeta.data;\n\n    this._updateRadius();\n    this.updateElements(arcs, 0, arcs.length, mode);\n  }\n\n  /**\n   * @protected\n   */\n  getMinMax() {\n    const meta = this._cachedMeta;\n    const range = {min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY};\n\n    meta.data.forEach((element, index) => {\n      const parsed = this.getParsed(index).r;\n\n      if (!isNaN(parsed) && this.chart.getDataVisibility(index)) {\n        if (parsed < range.min) {\n          range.min = parsed;\n        }\n\n        if (parsed > range.max) {\n          range.max = parsed;\n        }\n      }\n    });\n\n    return range;\n  }\n\n  /**\n\t * @private\n\t */\n  _updateRadius() {\n    const chart = this.chart;\n    const chartArea = chart.chartArea;\n    const opts = chart.options;\n    const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);\n\n    const outerRadius = Math.max(minSize / 2, 0);\n    const innerRadius = Math.max(opts.cutoutPercentage ? (outerRadius / 100) * (opts.cutoutPercentage) : 1, 0);\n    const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();\n\n    this.outerRadius = outerRadius - (radiusLength * this.index);\n    this.innerRadius = this.outerRadius - radiusLength;\n  }\n\n  updateElements(arcs, start, count, mode) {\n    const reset = mode === 'reset';\n    const chart = this.chart;\n    const opts = chart.options;\n    const animationOpts = opts.animation;\n    const scale = this._cachedMeta.rScale;\n    const centerX = scale.xCenter;\n    const centerY = scale.yCenter;\n    const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;\n    let angle = datasetStartAngle;\n    let i;\n\n    const defaultAngle = 360 / this.countVisibleElements();\n\n    for (i = 0; i < start; ++i) {\n      angle += this._computeAngle(i, mode, defaultAngle);\n    }\n    for (i = start; i < start + count; i++) {\n      const arc = arcs[i];\n      let startAngle = angle;\n      let endAngle = angle + this._computeAngle(i, mode, defaultAngle);\n      let outerRadius = chart.getDataVisibility(i) ? scale.getDistanceFromCenterForValue(this.getParsed(i).r) : 0;\n      angle = endAngle;\n\n      if (reset) {\n        if (animationOpts.animateScale) {\n          outerRadius = 0;\n        }\n        if (animationOpts.animateRotate) {\n          startAngle = endAngle = datasetStartAngle;\n        }\n      }\n\n      const properties = {\n        x: centerX,\n        y: centerY,\n        innerRadius: 0,\n        outerRadius,\n        startAngle,\n        endAngle,\n        options: this.resolveDataElementOptions(i, arc.active ? 'active' : mode)\n      };\n\n      this.updateElement(arc, i, properties, mode);\n    }\n  }\n\n  countVisibleElements() {\n    const meta = this._cachedMeta;\n    let count = 0;\n\n    meta.data.forEach((element, index) => {\n      if (!isNaN(this.getParsed(index).r) && this.chart.getDataVisibility(index)) {\n        count++;\n      }\n    });\n\n    return count;\n  }\n\n  /**\n\t * @private\n\t */\n  _computeAngle(index, mode, defaultAngle) {\n    return this.chart.getDataVisibility(index)\n      ? toRadians(this.resolveDataElementOptions(index, mode).angle || defaultAngle)\n      : 0;\n  }\n}\n", "import DoughnutController from './controller.doughnut.js';\n\n// Pie charts are Doughnut chart with different defaults\nexport default class PieController extends DoughnutController {\n\n  static id = 'pie';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    // The percentage of the chart that we cut out of the middle.\n    cutout: 0,\n\n    // The rotation of the chart, where the first data arc begins.\n    rotation: 0,\n\n    // The total circumference of the chart.\n    circumference: 360,\n\n    // The outer radius of the chart\n    radius: '100%'\n  };\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {_parseObjectDataRadialScale} from '../helpers/index.js';\n\nexport default class RadarController extends DatasetController {\n\n  static id = 'radar';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    datasetElementType: 'line',\n    dataElementType: 'point',\n    indexAxis: 'r',\n    showLine: true,\n    elements: {\n      line: {\n        fill: 'start'\n      }\n    },\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n    aspectRatio: 1,\n\n    scales: {\n      r: {\n        type: 'radialLinear',\n      }\n    }\n  };\n\n  /**\n\t * @protected\n\t */\n  getLabelAndValue(index) {\n    const vScale = this._cachedMeta.vScale;\n    const parsed = this.getParsed(index);\n\n    return {\n      label: vScale.getLabels()[index],\n      value: '' + vScale.getLabelForValue(parsed[vScale.axis])\n    };\n  }\n\n  parseObjectData(meta, data, start, count) {\n    return _parseObjectDataRadialScale.bind(this)(meta, data, start, count);\n  }\n\n  update(mode) {\n    const meta = this._cachedMeta;\n    const line = meta.dataset;\n    const points = meta.data || [];\n    const labels = meta.iScale.getLabels();\n\n    // Update Line\n    line.points = points;\n    // In resize mode only point locations change, so no need to set the points or options.\n    if (mode !== 'resize') {\n      const options = this.resolveDatasetElementOptions(mode);\n      if (!this.options.showLine) {\n        options.borderWidth = 0;\n      }\n\n      const properties = {\n        _loop: true,\n        _fullLoop: labels.length === points.length,\n        options\n      };\n\n      this.updateElement(line, undefined, properties, mode);\n    }\n\n    // Update Points\n    this.updateElements(points, 0, points.length, mode);\n  }\n\n  updateElements(points, start, count, mode) {\n    const scale = this._cachedMeta.rScale;\n    const reset = mode === 'reset';\n\n    for (let i = start; i < start + count; i++) {\n      const point = points[i];\n      const options = this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n      const pointPosition = scale.getPointPositionForValue(i, this.getParsed(i).r);\n\n      const x = reset ? scale.xCenter : pointPosition.x;\n      const y = reset ? scale.yCenter : pointPosition.y;\n\n      const properties = {\n        x,\n        y,\n        angle: pointPosition.angle,\n        skip: isNaN(x) || isNaN(y),\n        options\n      };\n\n      this.updateElement(point, i, properties, mode);\n    }\n  }\n}\n", "import DatasetController from '../core/core.datasetController.js';\nimport {isNullOrUndef} from '../helpers/index.js';\nimport {isNumber} from '../helpers/helpers.math.js';\nimport {_getStartAndCountOfVisiblePoints, _scaleRangesChanged} from '../helpers/helpers.extras.js';\n\nexport default class ScatterController extends DatasetController {\n\n  static id = 'scatter';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    datasetElementType: false,\n    dataElementType: 'point',\n    showLine: false,\n    fill: false\n  };\n\n  /**\n   * @type {any}\n   */\n  static overrides = {\n\n    interaction: {\n      mode: 'point'\n    },\n\n    scales: {\n      x: {\n        type: 'linear'\n      },\n      y: {\n        type: 'linear'\n      }\n    }\n  };\n\n  /**\n\t * @protected\n\t */\n  getLabelAndValue(index) {\n    const meta = this._cachedMeta;\n    const labels = this.chart.data.labels || [];\n    const {xScale, yScale} = meta;\n    const parsed = this.getParsed(index);\n    const x = xScale.getLabelForValue(parsed.x);\n    const y = yScale.getLabelForValue(parsed.y);\n\n    return {\n      label: labels[index] || '',\n      value: '(' + x + ', ' + y + ')'\n    };\n  }\n\n  update(mode) {\n    const meta = this._cachedMeta;\n    const {data: points = []} = meta;\n    // @ts-ignore\n    const animationsDisabled = this.chart._animationsDisabled;\n    let {start, count} = _getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);\n\n    this._drawStart = start;\n    this._drawCount = count;\n\n    if (_scaleRangesChanged(meta)) {\n      start = 0;\n      count = points.length;\n    }\n\n    if (this.options.showLine) {\n\n      // https://github.com/chartjs/Chart.js/issues/11333\n      if (!this.datasetElementType) {\n        this.addElements();\n      }\n      const {dataset: line, _dataset} = meta;\n\n      // Update Line\n      line._chart = this.chart;\n      line._datasetIndex = this.index;\n      line._decimated = !!_dataset._decimated;\n      line.points = points;\n\n      const options = this.resolveDatasetElementOptions(mode);\n      options.segment = this.options.segment;\n      this.updateElement(line, undefined, {\n        animated: !animationsDisabled,\n        options\n      }, mode);\n    } else if (this.datasetElementType) {\n      // https://github.com/chartjs/Chart.js/issues/11333\n      delete meta.dataset;\n      this.datasetElementType = false;\n    }\n\n    // Update Points\n    this.updateElements(points, start, count, mode);\n  }\n\n  addElements() {\n    const {showLine} = this.options;\n\n    if (!this.datasetElementType && showLine) {\n      this.datasetElementType = this.chart.registry.getElement('line');\n    }\n\n    super.addElements();\n  }\n\n  updateElements(points, start, count, mode) {\n    const reset = mode === 'reset';\n    const {iScale, vScale, _stacked, _dataset} = this._cachedMeta;\n    const firstOpts = this.resolveDataElementOptions(start, mode);\n    const sharedOptions = this.getSharedOptions(firstOpts);\n    const includeOptions = this.includeOptions(mode, sharedOptions);\n    const iAxis = iScale.axis;\n    const vAxis = vScale.axis;\n    const {spanGaps, segment} = this.options;\n    const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;\n    const directUpdate = this.chart._animationsDisabled || reset || mode === 'none';\n    let prevParsed = start > 0 && this.getParsed(start - 1);\n\n    for (let i = start; i < start + count; ++i) {\n      const point = points[i];\n      const parsed = this.getParsed(i);\n      const properties = directUpdate ? point : {};\n      const nullData = isNullOrUndef(parsed[vAxis]);\n      const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i);\n      const vPixel = properties[vAxis] = reset || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i);\n\n      properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;\n      properties.stop = i > 0 && (Math.abs(parsed[iAxis] - prevParsed[iAxis])) > maxGapLength;\n      if (segment) {\n        properties.parsed = parsed;\n        properties.raw = _dataset.data[i];\n      }\n\n      if (includeOptions) {\n        properties.options = sharedOptions || this.resolveDataElementOptions(i, point.active ? 'active' : mode);\n      }\n\n      if (!directUpdate) {\n        this.updateElement(point, i, properties, mode);\n      }\n\n      prevParsed = parsed;\n    }\n\n    this.updateSharedOptions(sharedOptions, mode, firstOpts);\n  }\n\n  /**\n\t * @protected\n\t */\n  getMaxOverflow() {\n    const meta = this._cachedMeta;\n    const data = meta.data || [];\n\n    if (!this.options.showLine) {\n      let max = 0;\n      for (let i = data.length - 1; i >= 0; --i) {\n        max = Math.max(max, data[i].size(this.resolveDataElementOptions(i)) / 2);\n      }\n      return max > 0 && max;\n    }\n\n    const dataset = meta.dataset;\n    const border = dataset.options && dataset.options.borderWidth || 0;\n\n    if (!data.length) {\n      return border;\n    }\n\n    const firstPoint = data[0].size(this.resolveDataElementOptions(0));\n    const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));\n    return Math.max(border, firstPoint, lastPoint) / 2;\n  }\n}\n", "/**\n * @namespace Chart._adapters\n * @since 2.8.0\n * @private\n */\n\nimport type {AnyObject} from '../types/basic.js';\nimport type {ChartOptions} from '../types/index.js';\n\nexport type TimeUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';\n\nexport interface DateAdapter<T extends AnyObject = AnyObject> {\n  readonly options: T;\n  /**\n   * Will called with chart options after adapter creation.\n   */\n  init(this: DateAdapter<T>, chartOptions: ChartOptions): void;\n  /**\n   * Returns a map of time formats for the supported formatting units defined\n   * in Unit as well as 'datetime' representing a detailed date/time string.\n   */\n  formats(this: DateAdapter<T>): Record<string, string>;\n  /**\n   * Parses the given `value` and return the associated timestamp.\n   * @param value - the value to parse (usually comes from the data)\n   * @param [format] - the expected data format\n   */\n  parse(this: DateAdapter<T>, value: unknown, format?: TimeUnit): number | null;\n  /**\n   * Returns the formatted date in the specified `format` for a given `timestamp`.\n   * @param timestamp - the timestamp to format\n   * @param format - the date/time token\n   */\n  format(this: DateAdapter<T>, timestamp: number, format: TimeUnit): string;\n  /**\n   * Adds the specified `amount` of `unit` to the given `timestamp`.\n   * @param timestamp - the input timestamp\n   * @param amount - the amount to add\n   * @param unit - the unit as string\n   */\n  add(this: DateAdapter<T>, timestamp: number, amount: number, unit: TimeUnit): number;\n  /**\n   * Returns the number of `unit` between the given timestamps.\n   * @param a - the input timestamp (reference)\n   * @param b - the timestamp to subtract\n   * @param unit - the unit as string\n   */\n  diff(this: DateAdapter<T>, a: number, b: number, unit: TimeUnit): number;\n  /**\n   * Returns start of `unit` for the given `timestamp`.\n   * @param timestamp - the input timestamp\n   * @param unit - the unit as string\n   * @param [weekday] - the ISO day of the week with 1 being Monday\n   * and 7 being Sunday (only needed if param *unit* is `isoWeek`).\n   */\n  startOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek', weekday?: number): number;\n  /**\n   * Returns end of `unit` for the given `timestamp`.\n   * @param timestamp - the input timestamp\n   * @param unit - the unit as string\n   */\n  endOf(this: DateAdapter<T>, timestamp: number, unit: TimeUnit | 'isoWeek'): number;\n}\n\nfunction abstract<T = void>(): T {\n  throw new Error('This method is not implemented: Check that a complete date adapter is provided.');\n}\n\n/**\n * Date adapter (current used by the time scale)\n * @namespace Chart._adapters._date\n * @memberof Chart._adapters\n * @private\n */\nclass DateAdapterBase implements DateAdapter {\n\n  /**\n   * Override default date adapter methods.\n   * Accepts type parameter to define options type.\n   * @example\n   * Chart._adapters._date.override<{myAdapterOption: string}>({\n   *   init() {\n   *     console.log(this.options.myAdapterOption);\n   *   }\n   * })\n   */\n  static override<T extends AnyObject = AnyObject>(\n    members: Partial<Omit<DateAdapter<T>, 'options'>>\n  ) {\n    Object.assign(DateAdapterBase.prototype, members);\n  }\n\n  readonly options: AnyObject;\n\n  constructor(options: AnyObject) {\n    this.options = options || {};\n  }\n\n  // eslint-disable-next-line @typescript-eslint/no-empty-function\n  init() {}\n\n  formats(): Record<string, string> {\n    return abstract();\n  }\n\n  parse(): number | null {\n    return abstract();\n  }\n\n  format(): string {\n    return abstract();\n  }\n\n  add(): number {\n    return abstract();\n  }\n\n  diff(): number {\n    return abstract();\n  }\n\n  startOf(): number {\n    return abstract();\n  }\n\n  endOf(): number {\n    return abstract();\n  }\n}\n\nexport default {\n  _date: DateAdapterBase\n};\n", "import {_lookupByKey, _rlookupByKey} from '../helpers/helpers.collection.js';\nimport {getRelativePosition} from '../helpers/helpers.dom.js';\nimport {_angleBetween, getAngleFromPoint} from '../helpers/helpers.math.js';\nimport {_isPointInArea} from '../helpers/index.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef {{axis?: string, intersect?: boolean, includeInvisible?: boolean}} InteractionOptions\n * @typedef {{datasetIndex: number, index: number, element: import('./core.element.js').default}} InteractionItem\n * @typedef { import('../types/index.js').Point } Point\n */\n\n/**\n * Helper function to do binary search when possible\n * @param {object} metaset - the dataset meta\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {number} value - the value to find\n * @param {boolean} [intersect] - should the element intersect\n * @returns {{lo:number, hi:number}} indices to search data array between\n */\nfunction binarySearch(metaset, axis, value, intersect) {\n  const {controller, data, _sorted} = metaset;\n  const iScale = controller._cachedMeta.iScale;\n  if (iScale && axis === iScale.axis && axis !== 'r' && _sorted && data.length) {\n    const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;\n    if (!intersect) {\n      return lookupMethod(data, axis, value);\n    } else if (controller._sharedOptions) {\n      // _sharedOptions indicates that each element has equal options -> equal proportions\n      // So we can do a ranged binary search based on the range of first element and\n      // be confident to get the full range of indices that can intersect with the value.\n      const el = data[0];\n      const range = typeof el.getRange === 'function' && el.getRange(axis);\n      if (range) {\n        const start = lookupMethod(data, axis, value - range);\n        const end = lookupMethod(data, axis, value + range);\n        return {lo: start.lo, hi: end.hi};\n      }\n    }\n  }\n  // Default to all elements, when binary search can not be used.\n  return {lo: 0, hi: data.length - 1};\n}\n\n/**\n * Helper function to select candidate elements for interaction\n * @param {Chart} chart - the chart\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {function} handler - the callback to execute for each visible item\n * @param {boolean} [intersect] - consider intersecting items\n */\nfunction evaluateInteractionItems(chart, axis, position, handler, intersect) {\n  const metasets = chart.getSortedVisibleDatasetMetas();\n  const value = position[axis];\n  for (let i = 0, ilen = metasets.length; i < ilen; ++i) {\n    const {index, data} = metasets[i];\n    const {lo, hi} = binarySearch(metasets[i], axis, value, intersect);\n    for (let j = lo; j <= hi; ++j) {\n      const element = data[j];\n      if (!element.skip) {\n        handler(element, index, j);\n      }\n    }\n  }\n}\n\n/**\n * Get a distance metric function for two points based on the\n * axis mode setting\n * @param {string} axis - the axis mode. x|y|xy|r\n */\nfunction getDistanceMetricForAxis(axis) {\n  const useX = axis.indexOf('x') !== -1;\n  const useY = axis.indexOf('y') !== -1;\n\n  return function(pt1, pt2) {\n    const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;\n    const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;\n    return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));\n  };\n}\n\n/**\n * Helper function to get the items that intersect the event position\n * @param {Chart} chart - the chart\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis mode. x|y|xy|r\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {\n  const items = [];\n\n  if (!includeInvisible && !chart.isPointInArea(position)) {\n    return items;\n  }\n\n  const evaluationFunc = function(element, datasetIndex, index) {\n    if (!includeInvisible && !_isPointInArea(element, chart.chartArea, 0)) {\n      return;\n    }\n    if (element.inRange(position.x, position.y, useFinalPosition)) {\n      items.push({element, datasetIndex, index});\n    }\n  };\n\n  evaluateInteractionItems(chart, axis, position, evaluationFunc, true);\n  return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a radial chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestRadialItems(chart, position, axis, useFinalPosition) {\n  let items = [];\n\n  function evaluationFunc(element, datasetIndex, index) {\n    const {startAngle, endAngle} = element.getProps(['startAngle', 'endAngle'], useFinalPosition);\n    const {angle} = getAngleFromPoint(element, {x: position.x, y: position.y});\n\n    if (_angleBetween(angle, startAngle, endAngle)) {\n      items.push({element, datasetIndex, index});\n    }\n  }\n\n  evaluateInteractionItems(chart, axis, position, evaluationFunc);\n  return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position for a cartesian chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n  let items = [];\n  const distanceMetric = getDistanceMetricForAxis(axis);\n  let minDistance = Number.POSITIVE_INFINITY;\n\n  function evaluationFunc(element, datasetIndex, index) {\n    const inRange = element.inRange(position.x, position.y, useFinalPosition);\n    if (intersect && !inRange) {\n      return;\n    }\n\n    const center = element.getCenterPoint(useFinalPosition);\n    const pointInArea = !!includeInvisible || chart.isPointInArea(center);\n    if (!pointInArea && !inRange) {\n      return;\n    }\n\n    const distance = distanceMetric(position, center);\n    if (distance < minDistance) {\n      items = [{element, datasetIndex, index}];\n      minDistance = distance;\n    } else if (distance === minDistance) {\n      // Can have multiple items at the same distance in which case we sort by size\n      items.push({element, datasetIndex, index});\n    }\n  }\n\n  evaluateInteractionItems(chart, axis, position, evaluationFunc);\n  return items;\n}\n\n/**\n * Helper function to get the items nearest to the event position considering all visible items in the chart\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axes along which to measure distance\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @param {boolean} [includeInvisible] - include invisible points that are outside of the chart area\n * @return {InteractionItem[]} the nearest items\n */\nfunction getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {\n  if (!includeInvisible && !chart.isPointInArea(position)) {\n    return [];\n  }\n\n  return axis === 'r' && !intersect\n    ? getNearestRadialItems(chart, position, axis, useFinalPosition)\n    : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible);\n}\n\n/**\n * Helper function to get the items matching along the given X or Y axis\n * @param {Chart} chart - the chart to look at elements from\n * @param {Point} position - the point to be nearest to, in relative coordinates\n * @param {string} axis - the axis to match\n * @param {boolean} [intersect] - if true, only consider items that intersect the position\n * @param {boolean} [useFinalPosition] - use the element's animation target instead of current position\n * @return {InteractionItem[]} the nearest items\n */\nfunction getAxisItems(chart, position, axis, intersect, useFinalPosition) {\n  const items = [];\n  const rangeMethod = axis === 'x' ? 'inXRange' : 'inYRange';\n  let intersectsItem = false;\n\n  evaluateInteractionItems(chart, axis, position, (element, datasetIndex, index) => {\n    if (element[rangeMethod](position[axis], useFinalPosition)) {\n      items.push({element, datasetIndex, index});\n      intersectsItem = intersectsItem || element.inRange(position.x, position.y, useFinalPosition);\n    }\n  });\n\n  // If we want to trigger on an intersect and we don't have any items\n  // that intersect the position, return nothing\n  if (intersect && !intersectsItem) {\n    return [];\n  }\n  return items;\n}\n\n/**\n * Contains interaction related functions\n * @namespace Chart.Interaction\n */\nexport default {\n  // Part of the public API to facilitate developers creating their own modes\n  evaluateInteractionItems,\n\n  // Helper function for different modes\n  modes: {\n    /**\n\t\t * Returns items at the same index. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect mode is false, we find the nearest item and return the items at the same index as that item\n\t\t * @function Chart.Interaction.modes.index\n\t\t * @since v2.4.0\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n    index(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      // Default axis for index mode is 'x' to match old behaviour\n      const axis = options.axis || 'x';\n      const includeInvisible = options.includeInvisible || false;\n      const items = options.intersect\n        ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible)\n        : getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n      const elements = [];\n\n      if (!items.length) {\n        return [];\n      }\n\n      chart.getSortedVisibleDatasetMetas().forEach((meta) => {\n        const index = items[0].index;\n        const element = meta.data[index];\n\n        // don't count items that are skipped (null data)\n        if (element && !element.skip) {\n          elements.push({element, datasetIndex: meta.index, index});\n        }\n      });\n\n      return elements;\n    },\n\n    /**\n\t\t * Returns items in the same dataset. If the options.intersect parameter is true, we only return items if we intersect something\n\t\t * If the options.intersect is false, we find the nearest item and return the items in that dataset\n\t\t * @function Chart.Interaction.modes.dataset\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n    dataset(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'xy';\n      const includeInvisible = options.includeInvisible || false;\n      let items = options.intersect\n        ? getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) :\n        getNearestItems(chart, position, axis, false, useFinalPosition, includeInvisible);\n\n      if (items.length > 0) {\n        const datasetIndex = items[0].datasetIndex;\n        const data = chart.getDatasetMeta(datasetIndex).data;\n        items = [];\n        for (let i = 0; i < data.length; ++i) {\n          items.push({element: data[i], datasetIndex, index: i});\n        }\n      }\n\n      return items;\n    },\n\n    /**\n\t\t * Point mode returns all elements that hit test based on the event position\n\t\t * of the event\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n    point(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'xy';\n      const includeInvisible = options.includeInvisible || false;\n      return getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible);\n    },\n\n    /**\n\t\t * nearest mode returns the element closest to the point\n\t\t * @function Chart.Interaction.modes.intersect\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n    nearest(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      const axis = options.axis || 'xy';\n      const includeInvisible = options.includeInvisible || false;\n      return getNearestItems(chart, position, axis, options.intersect, useFinalPosition, includeInvisible);\n    },\n\n    /**\n\t\t * x mode returns the elements that hit-test at the current x coordinate\n\t\t * @function Chart.Interaction.modes.x\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n    x(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      return getAxisItems(chart, position, 'x', options.intersect, useFinalPosition);\n    },\n\n    /**\n\t\t * y mode returns the elements that hit-test at the current y coordinate\n\t\t * @function Chart.Interaction.modes.y\n\t\t * @param {Chart} chart - the chart we are returning items from\n\t\t * @param {Event} e - the event we are find things at\n\t\t * @param {InteractionOptions} options - options to use\n\t\t * @param {boolean} [useFinalPosition] - use final element position (animation target)\n\t\t * @return {InteractionItem[]} - items that are found\n\t\t */\n    y(chart, e, options, useFinalPosition) {\n      const position = getRelativePosition(e, chart);\n      return getAxisItems(chart, position, 'y', options.intersect, useFinalPosition);\n    }\n  }\n};\n", "import {defined, each, isObject} from '../helpers/helpers.core.js';\nimport {toPadding} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n */\n\nconst STATIC_POSITIONS = ['left', 'top', 'right', 'bottom'];\n\nfunction filterByPosition(array, position) {\n  return array.filter(v => v.pos === position);\n}\n\nfunction filterDynamicPositionByAxis(array, axis) {\n  return array.filter(v => STATIC_POSITIONS.indexOf(v.pos) === -1 && v.box.axis === axis);\n}\n\nfunction sortByWeight(array, reverse) {\n  return array.sort((a, b) => {\n    const v0 = reverse ? b : a;\n    const v1 = reverse ? a : b;\n    return v0.weight === v1.weight ?\n      v0.index - v1.index :\n      v0.weight - v1.weight;\n  });\n}\n\nfunction wrapBoxes(boxes) {\n  const layoutBoxes = [];\n  let i, ilen, box, pos, stack, stackWeight;\n\n  for (i = 0, ilen = (boxes || []).length; i < ilen; ++i) {\n    box = boxes[i];\n    ({position: pos, options: {stack, stackWeight = 1}} = box);\n    layoutBoxes.push({\n      index: i,\n      box,\n      pos,\n      horizontal: box.isHorizontal(),\n      weight: box.weight,\n      stack: stack && (pos + stack),\n      stackWeight\n    });\n  }\n  return layoutBoxes;\n}\n\nfunction buildStacks(layouts) {\n  const stacks = {};\n  for (const wrap of layouts) {\n    const {stack, pos, stackWeight} = wrap;\n    if (!stack || !STATIC_POSITIONS.includes(pos)) {\n      continue;\n    }\n    const _stack = stacks[stack] || (stacks[stack] = {count: 0, placed: 0, weight: 0, size: 0});\n    _stack.count++;\n    _stack.weight += stackWeight;\n  }\n  return stacks;\n}\n\n/**\n * store dimensions used instead of available chartArea in fitBoxes\n **/\nfunction setLayoutDims(layouts, params) {\n  const stacks = buildStacks(layouts);\n  const {vBoxMaxWidth, hBoxMaxHeight} = params;\n  let i, ilen, layout;\n  for (i = 0, ilen = layouts.length; i < ilen; ++i) {\n    layout = layouts[i];\n    const {fullSize} = layout.box;\n    const stack = stacks[layout.stack];\n    const factor = stack && layout.stackWeight / stack.weight;\n    if (layout.horizontal) {\n      layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;\n      layout.height = hBoxMaxHeight;\n    } else {\n      layout.width = vBoxMaxWidth;\n      layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;\n    }\n  }\n  return stacks;\n}\n\nfunction buildLayoutBoxes(boxes) {\n  const layoutBoxes = wrapBoxes(boxes);\n  const fullSize = sortByWeight(layoutBoxes.filter(wrap => wrap.box.fullSize), true);\n  const left = sortByWeight(filterByPosition(layoutBoxes, 'left'), true);\n  const right = sortByWeight(filterByPosition(layoutBoxes, 'right'));\n  const top = sortByWeight(filterByPosition(layoutBoxes, 'top'), true);\n  const bottom = sortByWeight(filterByPosition(layoutBoxes, 'bottom'));\n  const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, 'x');\n  const centerVertical = filterDynamicPositionByAxis(layoutBoxes, 'y');\n\n  return {\n    fullSize,\n    leftAndTop: left.concat(top),\n    rightAndBottom: right.concat(centerVertical).concat(bottom).concat(centerHorizontal),\n    chartArea: filterByPosition(layoutBoxes, 'chartArea'),\n    vertical: left.concat(right).concat(centerVertical),\n    horizontal: top.concat(bottom).concat(centerHorizontal)\n  };\n}\n\nfunction getCombinedMax(maxPadding, chartArea, a, b) {\n  return Math.max(maxPadding[a], chartArea[a]) + Math.max(maxPadding[b], chartArea[b]);\n}\n\nfunction updateMaxPadding(maxPadding, boxPadding) {\n  maxPadding.top = Math.max(maxPadding.top, boxPadding.top);\n  maxPadding.left = Math.max(maxPadding.left, boxPadding.left);\n  maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);\n  maxPadding.right = Math.max(maxPadding.right, boxPadding.right);\n}\n\nfunction updateDims(chartArea, params, layout, stacks) {\n  const {pos, box} = layout;\n  const maxPadding = chartArea.maxPadding;\n\n  // dynamically placed boxes size is not considered\n  if (!isObject(pos)) {\n    if (layout.size) {\n      // this layout was already counted for, lets first reduce old size\n      chartArea[pos] -= layout.size;\n    }\n    const stack = stacks[layout.stack] || {size: 0, count: 1};\n    stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);\n    layout.size = stack.size / stack.count;\n    chartArea[pos] += layout.size;\n  }\n\n  if (box.getPadding) {\n    updateMaxPadding(maxPadding, box.getPadding());\n  }\n\n  const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, 'left', 'right'));\n  const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, 'top', 'bottom'));\n  const widthChanged = newWidth !== chartArea.w;\n  const heightChanged = newHeight !== chartArea.h;\n  chartArea.w = newWidth;\n  chartArea.h = newHeight;\n\n  // return booleans on the changes per direction\n  return layout.horizontal\n    ? {same: widthChanged, other: heightChanged}\n    : {same: heightChanged, other: widthChanged};\n}\n\nfunction handleMaxPadding(chartArea) {\n  const maxPadding = chartArea.maxPadding;\n\n  function updatePos(pos) {\n    const change = Math.max(maxPadding[pos] - chartArea[pos], 0);\n    chartArea[pos] += change;\n    return change;\n  }\n  chartArea.y += updatePos('top');\n  chartArea.x += updatePos('left');\n  updatePos('right');\n  updatePos('bottom');\n}\n\nfunction getMargins(horizontal, chartArea) {\n  const maxPadding = chartArea.maxPadding;\n\n  function marginForPositions(positions) {\n    const margin = {left: 0, top: 0, right: 0, bottom: 0};\n    positions.forEach((pos) => {\n      margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);\n    });\n    return margin;\n  }\n\n  return horizontal\n    ? marginForPositions(['left', 'right'])\n    : marginForPositions(['top', 'bottom']);\n}\n\nfunction fitBoxes(boxes, chartArea, params, stacks) {\n  const refitBoxes = [];\n  let i, ilen, layout, box, refit, changed;\n\n  for (i = 0, ilen = boxes.length, refit = 0; i < ilen; ++i) {\n    layout = boxes[i];\n    box = layout.box;\n\n    box.update(\n      layout.width || chartArea.w,\n      layout.height || chartArea.h,\n      getMargins(layout.horizontal, chartArea)\n    );\n    const {same, other} = updateDims(chartArea, params, layout, stacks);\n\n    // Dimensions changed and there were non full width boxes before this\n    // -> we have to refit those\n    refit |= same && refitBoxes.length;\n\n    // Chart area changed in the opposite direction\n    changed = changed || other;\n\n    if (!box.fullSize) { // fullSize boxes don't need to be re-fitted in any case\n      refitBoxes.push(layout);\n    }\n  }\n\n  return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;\n}\n\nfunction setBoxDims(box, left, top, width, height) {\n  box.top = top;\n  box.left = left;\n  box.right = left + width;\n  box.bottom = top + height;\n  box.width = width;\n  box.height = height;\n}\n\nfunction placeBoxes(boxes, chartArea, params, stacks) {\n  const userPadding = params.padding;\n  let {x, y} = chartArea;\n\n  for (const layout of boxes) {\n    const box = layout.box;\n    const stack = stacks[layout.stack] || {count: 1, placed: 0, weight: 1};\n    const weight = (layout.stackWeight / stack.weight) || 1;\n    if (layout.horizontal) {\n      const width = chartArea.w * weight;\n      const height = stack.size || box.height;\n      if (defined(stack.start)) {\n        y = stack.start;\n      }\n      if (box.fullSize) {\n        setBoxDims(box, userPadding.left, y, params.outerWidth - userPadding.right - userPadding.left, height);\n      } else {\n        setBoxDims(box, chartArea.left + stack.placed, y, width, height);\n      }\n      stack.start = y;\n      stack.placed += width;\n      y = box.bottom;\n    } else {\n      const height = chartArea.h * weight;\n      const width = stack.size || box.width;\n      if (defined(stack.start)) {\n        x = stack.start;\n      }\n      if (box.fullSize) {\n        setBoxDims(box, x, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);\n      } else {\n        setBoxDims(box, x, chartArea.top + stack.placed, width, height);\n      }\n      stack.start = x;\n      stack.placed += height;\n      x = box.right;\n    }\n  }\n\n  chartArea.x = x;\n  chartArea.y = y;\n}\n\n/**\n * @interface LayoutItem\n * @typedef {object} LayoutItem\n * @prop {string} position - The position of the item in the chart layout. Possible values are\n * 'left', 'top', 'right', 'bottom', and 'chartArea'\n * @prop {number} weight - The weight used to sort the item. Higher weights are further away from the chart area\n * @prop {boolean} fullSize - if true, and the item is horizontal, then push vertical boxes down\n * @prop {function} isHorizontal - returns true if the layout item is horizontal (ie. top or bottom)\n * @prop {function} update - Takes two parameters: width and height. Returns size of item\n * @prop {function} draw - Draws the element\n * @prop {function} [getPadding] -  Returns an object with padding on the edges\n * @prop {number} width - Width of item. Must be valid after update()\n * @prop {number} height - Height of item. Must be valid after update()\n * @prop {number} left - Left edge of the item. Set by layout system and cannot be used in update\n * @prop {number} top - Top edge of the item. Set by layout system and cannot be used in update\n * @prop {number} right - Right edge of the item. Set by layout system and cannot be used in update\n * @prop {number} bottom - Bottom edge of the item. Set by layout system and cannot be used in update\n */\n\n// The layout service is very self explanatory.  It's responsible for the layout within a chart.\n// Scales, Legends and Plugins all rely on the layout service and can easily register to be placed anywhere they need\n// It is this service's responsibility of carrying out that layout.\nexport default {\n\n  /**\n\t * Register a box to a chart.\n\t * A box is simply a reference to an object that requires layout. eg. Scales, Legend, Title.\n\t * @param {Chart} chart - the chart to use\n\t * @param {LayoutItem} item - the item to add to be laid out\n\t */\n  addBox(chart, item) {\n    if (!chart.boxes) {\n      chart.boxes = [];\n    }\n\n    // initialize item with default values\n    item.fullSize = item.fullSize || false;\n    item.position = item.position || 'top';\n    item.weight = item.weight || 0;\n    // @ts-ignore\n    item._layers = item._layers || function() {\n      return [{\n        z: 0,\n        draw(chartArea) {\n          item.draw(chartArea);\n        }\n      }];\n    };\n\n    chart.boxes.push(item);\n  },\n\n  /**\n\t * Remove a layoutItem from a chart\n\t * @param {Chart} chart - the chart to remove the box from\n\t * @param {LayoutItem} layoutItem - the item to remove from the layout\n\t */\n  removeBox(chart, layoutItem) {\n    const index = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;\n    if (index !== -1) {\n      chart.boxes.splice(index, 1);\n    }\n  },\n\n  /**\n\t * Sets (or updates) options on the given `item`.\n\t * @param {Chart} chart - the chart in which the item lives (or will be added to)\n\t * @param {LayoutItem} item - the item to configure with the given options\n\t * @param {object} options - the new item options.\n\t */\n  configure(chart, item, options) {\n    item.fullSize = options.fullSize;\n    item.position = options.position;\n    item.weight = options.weight;\n  },\n\n  /**\n\t * Fits boxes of the given chart into the given size by having each box measure itself\n\t * then running a fitting algorithm\n\t * @param {Chart} chart - the chart\n\t * @param {number} width - the width to fit into\n\t * @param {number} height - the height to fit into\n   * @param {number} minPadding - minimum padding required for each side of chart area\n\t */\n  update(chart, width, height, minPadding) {\n    if (!chart) {\n      return;\n    }\n\n    const padding = toPadding(chart.options.layout.padding);\n    const availableWidth = Math.max(width - padding.width, 0);\n    const availableHeight = Math.max(height - padding.height, 0);\n    const boxes = buildLayoutBoxes(chart.boxes);\n    const verticalBoxes = boxes.vertical;\n    const horizontalBoxes = boxes.horizontal;\n\n    // Before any changes are made, notify boxes that an update is about to being\n    // This is used to clear any cached data (e.g. scale limits)\n    each(chart.boxes, box => {\n      if (typeof box.beforeLayout === 'function') {\n        box.beforeLayout();\n      }\n    });\n\n    // Essentially we now have any number of boxes on each of the 4 sides.\n    // Our canvas looks like the following.\n    // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and\n    // B1 is the bottom axis\n    // There are also 4 quadrant-like locations (left to right instead of clockwise) reserved for chart overlays\n    // These locations are single-box locations only, when trying to register a chartArea location that is already taken,\n    // an error will be thrown.\n    //\n    // |----------------------------------------------------|\n    // |                  T1 (Full Width)                   |\n    // |----------------------------------------------------|\n    // |    |    |                 T2                  |    |\n    // |    |----|-------------------------------------|----|\n    // |    |    | C1 |                           | C2 |    |\n    // |    |    |----|                           |----|    |\n    // |    |    |                                     |    |\n    // | L1 | L2 |           ChartArea (C0)            | R1 |\n    // |    |    |                                     |    |\n    // |    |    |----|                           |----|    |\n    // |    |    | C3 |                           | C4 |    |\n    // |    |----|-------------------------------------|----|\n    // |    |    |                 B1                  |    |\n    // |----------------------------------------------------|\n    // |                  B2 (Full Width)                   |\n    // |----------------------------------------------------|\n    //\n\n    const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap) =>\n      wrap.box.options && wrap.box.options.display === false ? total : total + 1, 0) || 1;\n\n    const params = Object.freeze({\n      outerWidth: width,\n      outerHeight: height,\n      padding,\n      availableWidth,\n      availableHeight,\n      vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,\n      hBoxMaxHeight: availableHeight / 2\n    });\n    const maxPadding = Object.assign({}, padding);\n    updateMaxPadding(maxPadding, toPadding(minPadding));\n    const chartArea = Object.assign({\n      maxPadding,\n      w: availableWidth,\n      h: availableHeight,\n      x: padding.left,\n      y: padding.top\n    }, padding);\n\n    const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);\n\n    // First fit the fullSize boxes, to reduce probability of re-fitting.\n    fitBoxes(boxes.fullSize, chartArea, params, stacks);\n\n    // Then fit vertical boxes\n    fitBoxes(verticalBoxes, chartArea, params, stacks);\n\n    // Then fit horizontal boxes\n    if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {\n      // if the area changed, re-fit vertical boxes\n      fitBoxes(verticalBoxes, chartArea, params, stacks);\n    }\n\n    handleMaxPadding(chartArea);\n\n    // Finally place the boxes to correct coordinates\n    placeBoxes(boxes.leftAndTop, chartArea, params, stacks);\n\n    // Move to opposite side of chart\n    chartArea.x += chartArea.w;\n    chartArea.y += chartArea.h;\n\n    placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);\n\n    chart.chartArea = {\n      left: chartArea.left,\n      top: chartArea.top,\n      right: chartArea.left + chartArea.w,\n      bottom: chartArea.top + chartArea.h,\n      height: chartArea.h,\n      width: chartArea.w,\n    };\n\n    // Finally update boxes in chartArea (radial scale for example)\n    each(boxes.chartArea, (layout) => {\n      const box = layout.box;\n      Object.assign(box, chart.chartArea);\n      box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0});\n    });\n  }\n};\n", "\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\n/**\n * Abstract class that allows abstracting platform dependencies away from the chart.\n */\nexport default class BasePlatform {\n  /**\n\t * Called at chart construction time, returns a context2d instance implementing\n\t * the [W3C Canvas 2D Context API standard]{@link https://www.w3.org/TR/2dcontext/}.\n\t * @param {HTMLCanvasElement} canvas - The canvas from which to acquire context (platform specific)\n\t * @param {number} [aspectRatio] - The chart options\n\t */\n  acquireContext(canvas, aspectRatio) {} // eslint-disable-line no-unused-vars\n\n  /**\n\t * Called at chart destruction time, releases any resources associated to the context\n\t * previously returned by the acquireContext() method.\n\t * @param {CanvasRenderingContext2D} context - The context2d instance\n\t * @returns {boolean} true if the method succeeded, else false\n\t */\n  releaseContext(context) { // eslint-disable-line no-unused-vars\n    return false;\n  }\n\n  /**\n\t * Registers the specified listener on the given chart.\n\t * @param {Chart} chart - Chart from which to listen for event\n\t * @param {string} type - The ({@link ChartEvent}) type to listen for\n\t * @param {function} listener - Receives a notification (an object that implements\n\t * the {@link ChartEvent} interface) when an event of the specified type occurs.\n\t */\n  addEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n  /**\n\t * Removes the specified listener previously registered with addEventListener.\n\t * @param {Chart} chart - Chart from which to remove the listener\n\t * @param {string} type - The ({@link ChartEvent}) type to remove\n\t * @param {function} listener - The listener function to remove from the event target.\n\t */\n  removeEventListener(chart, type, listener) {} // eslint-disable-line no-unused-vars\n\n  /**\n\t * @returns {number} the current devicePixelRatio of the device this platform is connected to.\n\t */\n  getDevicePixelRatio() {\n    return 1;\n  }\n\n  /**\n\t * Returns the maximum size in pixels of given canvas element.\n\t * @param {HTMLCanvasElement} element\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n  getMaximumSize(element, width, height, aspectRatio) {\n    width = Math.max(0, width || element.width);\n    height = height || element.height;\n    return {\n      width,\n      height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)\n    };\n  }\n\n  /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @returns {boolean} true if the canvas is attached to the platform, false if not.\n\t */\n  isAttached(canvas) { // eslint-disable-line no-unused-vars\n    return true;\n  }\n\n  /**\n   * Updates config with platform specific requirements\n   * @param {import('../core/core.config.js').default} config\n   */\n  updateConfig(config) { // eslint-disable-line no-unused-vars\n    // no-op\n  }\n}\n", "/**\n * Platform fallback implementation (minimal).\n * @see https://github.com/chartjs/Chart.js/pull/4591#issuecomment-319575939\n */\n\nimport BasePlatform from './platform.base.js';\n\n/**\n * Platform class for charts without access to the DOM or to many element properties\n * This platform is used by default for any chart passed an OffscreenCanvas.\n * @extends BasePlatform\n */\nexport default class BasicPlatform extends BasePlatform {\n  acquireContext(item) {\n    // To prevent canvas fingerprinting, some add-ons undefine the getContext\n    // method, for example: https://github.com/kkapsner/CanvasBlocker\n    // https://github.com/chartjs/Chart.js/issues/2807\n    return item && item.getContext && item.getContext('2d') || null;\n  }\n  updateConfig(config) {\n    config.options.animation = false;\n  }\n}\n", "/**\n * Chart.Platform implementation for targeting a web browser\n */\n\nimport BasePlatform from './platform.base.js';\nimport {_getParentNode, getRelativePosition, supportsEventListenerOptions, readUsedSize, getMaximumSize} from '../helpers/helpers.dom.js';\nimport {throttled} from '../helpers/helpers.extras.js';\nimport {isNullOrUndef} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../core/core.controller.js').default } Chart\n */\n\nconst EXPANDO_KEY = '$chartjs';\n\n/**\n * DOM event types -> Chart.js event types.\n * Note: only events with different types are mapped.\n * @see https://developer.mozilla.org/en-US/docs/Web/Events\n */\nconst EVENT_TYPES = {\n  touchstart: 'mousedown',\n  touchmove: 'mousemove',\n  touchend: 'mouseup',\n  pointerenter: 'mouseenter',\n  pointerdown: 'mousedown',\n  pointermove: 'mousemove',\n  pointerup: 'mouseup',\n  pointerleave: 'mouseout',\n  pointerout: 'mouseout'\n};\n\nconst isNullOrEmpty = value => value === null || value === '';\n/**\n * Initializes the canvas style and render size without modifying the canvas display size,\n * since responsiveness is handled by the controller.resize() method. The config is used\n * to determine the aspect ratio to apply in case no explicit height has been specified.\n * @param {HTMLCanvasElement} canvas\n * @param {number} [aspectRatio]\n */\nfunction initCanvas(canvas, aspectRatio) {\n  const style = canvas.style;\n\n  // NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it\n  // returns null or '' if no explicit value has been set to the canvas attribute.\n  const renderHeight = canvas.getAttribute('height');\n  const renderWidth = canvas.getAttribute('width');\n\n  // Chart.js modifies some canvas values that we want to restore on destroy\n  canvas[EXPANDO_KEY] = {\n    initial: {\n      height: renderHeight,\n      width: renderWidth,\n      style: {\n        display: style.display,\n        height: style.height,\n        width: style.width\n      }\n    }\n  };\n\n  // Force canvas to display as block to avoid extra space caused by inline\n  // elements, which would interfere with the responsive resize process.\n  // https://github.com/chartjs/Chart.js/issues/2538\n  style.display = style.display || 'block';\n  // Include possible borders in the size\n  style.boxSizing = style.boxSizing || 'border-box';\n\n  if (isNullOrEmpty(renderWidth)) {\n    const displayWidth = readUsedSize(canvas, 'width');\n    if (displayWidth !== undefined) {\n      canvas.width = displayWidth;\n    }\n  }\n\n  if (isNullOrEmpty(renderHeight)) {\n    if (canvas.style.height === '') {\n      // If no explicit render height and style height, let's apply the aspect ratio,\n      // which one can be specified by the user but also by charts as default option\n      // (i.e. options.aspectRatio). If not specified, use canvas aspect ratio of 2.\n      canvas.height = canvas.width / (aspectRatio || 2);\n    } else {\n      const displayHeight = readUsedSize(canvas, 'height');\n      if (displayHeight !== undefined) {\n        canvas.height = displayHeight;\n      }\n    }\n  }\n\n  return canvas;\n}\n\n// Default passive to true as expected by Chrome for 'touchstart' and 'touchend' events.\n// https://github.com/chartjs/Chart.js/issues/4287\nconst eventListenerOptions = supportsEventListenerOptions ? {passive: true} : false;\n\nfunction addListener(node, type, listener) {\n  node.addEventListener(type, listener, eventListenerOptions);\n}\n\nfunction removeListener(chart, type, listener) {\n  chart.canvas.removeEventListener(type, listener, eventListenerOptions);\n}\n\nfunction fromNativeEvent(event, chart) {\n  const type = EVENT_TYPES[event.type] || event.type;\n  const {x, y} = getRelativePosition(event, chart);\n  return {\n    type,\n    chart,\n    native: event,\n    x: x !== undefined ? x : null,\n    y: y !== undefined ? y : null,\n  };\n}\n\nfunction nodeListContains(nodeList, canvas) {\n  for (const node of nodeList) {\n    if (node === canvas || node.contains(canvas)) {\n      return true;\n    }\n  }\n}\n\nfunction createAttachObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const observer = new MutationObserver(entries => {\n    let trigger = false;\n    for (const entry of entries) {\n      trigger = trigger || nodeListContains(entry.addedNodes, canvas);\n      trigger = trigger && !nodeListContains(entry.removedNodes, canvas);\n    }\n    if (trigger) {\n      listener();\n    }\n  });\n  observer.observe(document, {childList: true, subtree: true});\n  return observer;\n}\n\nfunction createDetachObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const observer = new MutationObserver(entries => {\n    let trigger = false;\n    for (const entry of entries) {\n      trigger = trigger || nodeListContains(entry.removedNodes, canvas);\n      trigger = trigger && !nodeListContains(entry.addedNodes, canvas);\n    }\n    if (trigger) {\n      listener();\n    }\n  });\n  observer.observe(document, {childList: true, subtree: true});\n  return observer;\n}\n\nconst drpListeningCharts = new Map();\nlet oldDevicePixelRatio = 0;\n\nfunction onWindowResize() {\n  const dpr = window.devicePixelRatio;\n  if (dpr === oldDevicePixelRatio) {\n    return;\n  }\n  oldDevicePixelRatio = dpr;\n  drpListeningCharts.forEach((resize, chart) => {\n    if (chart.currentDevicePixelRatio !== dpr) {\n      resize();\n    }\n  });\n}\n\nfunction listenDevicePixelRatioChanges(chart, resize) {\n  if (!drpListeningCharts.size) {\n    window.addEventListener('resize', onWindowResize);\n  }\n  drpListeningCharts.set(chart, resize);\n}\n\nfunction unlistenDevicePixelRatioChanges(chart) {\n  drpListeningCharts.delete(chart);\n  if (!drpListeningCharts.size) {\n    window.removeEventListener('resize', onWindowResize);\n  }\n}\n\nfunction createResizeObserver(chart, type, listener) {\n  const canvas = chart.canvas;\n  const container = canvas && _getParentNode(canvas);\n  if (!container) {\n    return;\n  }\n  const resize = throttled((width, height) => {\n    const w = container.clientWidth;\n    listener(width, height);\n    if (w < container.clientWidth) {\n      // If the container size shrank during chart resize, let's assume\n      // scrollbar appeared. So we resize again with the scrollbar visible -\n      // effectively making chart smaller and the scrollbar hidden again.\n      // Because we are inside `throttled`, and currently `ticking`, scroll\n      // events are ignored during this whole 2 resize process.\n      // If we assumed wrong and something else happened, we are resizing\n      // twice in a frame (potential performance issue)\n      listener();\n    }\n  }, window);\n\n  // @ts-ignore until https://github.com/microsoft/TypeScript/issues/37861 implemented\n  const observer = new ResizeObserver(entries => {\n    const entry = entries[0];\n    const width = entry.contentRect.width;\n    const height = entry.contentRect.height;\n    // When its container's display is set to 'none' the callback will be called with a\n    // size of (0, 0), which will cause the chart to lose its original height, so skip\n    // resizing in such case.\n    if (width === 0 && height === 0) {\n      return;\n    }\n    resize(width, height);\n  });\n  observer.observe(container);\n  listenDevicePixelRatioChanges(chart, resize);\n\n  return observer;\n}\n\nfunction releaseObserver(chart, type, observer) {\n  if (observer) {\n    observer.disconnect();\n  }\n  if (type === 'resize') {\n    unlistenDevicePixelRatioChanges(chart);\n  }\n}\n\nfunction createProxyAndListen(chart, type, listener) {\n  const canvas = chart.canvas;\n  const proxy = throttled((event) => {\n    // This case can occur if the chart is destroyed while waiting\n    // for the throttled function to occur. We prevent crashes by checking\n    // for a destroyed chart\n    if (chart.ctx !== null) {\n      listener(fromNativeEvent(event, chart));\n    }\n  }, chart);\n\n  addListener(canvas, type, proxy);\n\n  return proxy;\n}\n\n/**\n * Platform class for charts that can access the DOM and global window/document properties\n * @extends BasePlatform\n */\nexport default class DomPlatform extends BasePlatform {\n\n  /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [aspectRatio]\n\t * @return {CanvasRenderingContext2D|null}\n\t */\n  acquireContext(canvas, aspectRatio) {\n    // To prevent canvas fingerprinting, some add-ons undefine the getContext\n    // method, for example: https://github.com/kkapsner/CanvasBlocker\n    // https://github.com/chartjs/Chart.js/issues/2807\n    const context = canvas && canvas.getContext && canvas.getContext('2d');\n\n    // `instanceof HTMLCanvasElement/CanvasRenderingContext2D` fails when the canvas is\n    // inside an iframe or when running in a protected environment. We could guess the\n    // types from their toString() value but let's keep things flexible and assume it's\n    // a sufficient condition if the canvas has a context2D which has canvas as `canvas`.\n    // https://github.com/chartjs/Chart.js/issues/3887\n    // https://github.com/chartjs/Chart.js/issues/4102\n    // https://github.com/chartjs/Chart.js/issues/4152\n    if (context && context.canvas === canvas) {\n      // Load platform resources on first chart creation, to make it possible to\n      // import the library before setting platform options.\n      initCanvas(canvas, aspectRatio);\n      return context;\n    }\n\n    return null;\n  }\n\n  /**\n\t * @param {CanvasRenderingContext2D} context\n\t */\n  releaseContext(context) {\n    const canvas = context.canvas;\n    if (!canvas[EXPANDO_KEY]) {\n      return false;\n    }\n\n    const initial = canvas[EXPANDO_KEY].initial;\n    ['height', 'width'].forEach((prop) => {\n      const value = initial[prop];\n      if (isNullOrUndef(value)) {\n        canvas.removeAttribute(prop);\n      } else {\n        canvas.setAttribute(prop, value);\n      }\n    });\n\n    const style = initial.style || {};\n    Object.keys(style).forEach((key) => {\n      canvas.style[key] = style[key];\n    });\n\n    // The canvas render size might have been changed (and thus the state stack discarded),\n    // we can't use save() and restore() to restore the initial state. So make sure that at\n    // least the canvas context is reset to the default state by setting the canvas width.\n    // https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html\n    // eslint-disable-next-line no-self-assign\n    canvas.width = canvas.width;\n\n    delete canvas[EXPANDO_KEY];\n    return true;\n  }\n\n  /**\n\t *\n\t * @param {Chart} chart\n\t * @param {string} type\n\t * @param {function} listener\n\t */\n  addEventListener(chart, type, listener) {\n    // Can have only one listener per type, so make sure previous is removed\n    this.removeEventListener(chart, type);\n\n    const proxies = chart.$proxies || (chart.$proxies = {});\n    const handlers = {\n      attach: createAttachObserver,\n      detach: createDetachObserver,\n      resize: createResizeObserver\n    };\n    const handler = handlers[type] || createProxyAndListen;\n    proxies[type] = handler(chart, type, listener);\n  }\n\n\n  /**\n\t * @param {Chart} chart\n\t * @param {string} type\n\t */\n  removeEventListener(chart, type) {\n    const proxies = chart.$proxies || (chart.$proxies = {});\n    const proxy = proxies[type];\n\n    if (!proxy) {\n      return;\n    }\n\n    const handlers = {\n      attach: releaseObserver,\n      detach: releaseObserver,\n      resize: releaseObserver\n    };\n    const handler = handlers[type] || removeListener;\n    handler(chart, type, proxy);\n    proxies[type] = undefined;\n  }\n\n  getDevicePixelRatio() {\n    return window.devicePixelRatio;\n  }\n\n  /**\n\t * @param {HTMLCanvasElement} canvas\n\t * @param {number} [width] - content width of parent element\n\t * @param {number} [height] - content height of parent element\n\t * @param {number} [aspectRatio] - aspect ratio to maintain\n\t */\n  getMaximumSize(canvas, width, height, aspectRatio) {\n    return getMaximumSize(canvas, width, height, aspectRatio);\n  }\n\n  /**\n\t * @param {HTMLCanvasElement} canvas\n\t */\n  isAttached(canvas) {\n    const container = _getParentNode(canvas);\n    return !!(container && container.isConnected);\n  }\n}\n", "import {_isDomSupported} from '../helpers/index.js';\nimport BasePlatform from './platform.base.js';\nimport BasicPlatform from './platform.basic.js';\nimport DomPlatform from './platform.dom.js';\n\nexport function _detectPlatform(canvas) {\n  if (!_isDomSupported() || (typeof OffscreenCanvas !== 'undefined' && canvas instanceof OffscreenCanvas)) {\n    return BasicPlatform;\n  }\n  return DomPlatform;\n}\n\nexport {BasePlatform, BasicPlatform, DomPlatform};\n", "import type {AnyObject} from '../types/basic.js';\nimport type {Point} from '../types/geometric.js';\nimport type {Animation} from '../types/animation.js';\nimport {isNumber} from '../helpers/helpers.math.js';\n\nexport default class Element<T = AnyObject, O = AnyObject> {\n\n  static defaults = {};\n  static defaultRoutes = undefined;\n\n  x: number;\n  y: number;\n  active = false;\n  options: O;\n  $animations: Record<keyof T, Animation>;\n\n  tooltipPosition(useFinalPosition: boolean): Point {\n    const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n    return {x, y} as Point;\n  }\n\n  hasValue() {\n    return isNumber(this.x) && isNumber(this.y);\n  }\n\n  /**\n   * Gets the current or final value of each prop. Can return extra properties (whole object).\n   * @param props - properties to get\n   * @param [final] - get the final value (animation target)\n   */\n  getProps<P extends (keyof T)[]>(props: P, final?: boolean): Pick<T, P[number]>;\n  getProps<P extends string>(props: P[], final?: boolean): Partial<Record<P, unknown>>;\n  getProps(props: string[], final?: boolean): Partial<Record<string, unknown>> {\n    const anims = this.$animations;\n    if (!final || !anims) {\n      // let's not create an object, if not needed\n      return this as Record<string, unknown>;\n    }\n    const ret: Record<string, unknown> = {};\n    props.forEach((prop) => {\n      ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop as string];\n    });\n    return ret;\n  }\n}\n", "import {isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\nimport {_factorize} from '../helpers/helpers.math.js';\n\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a subset of ticks to be plotted to avoid overlapping labels.\n * @param {import('./core.scale.js').default} scale\n * @param {Tick[]} ticks\n * @return {Tick[]}\n * @private\n */\nexport function autoSkip(scale, ticks) {\n  const tickOpts = scale.options.ticks;\n  const determinedMaxTicks = determineMaxTicks(scale);\n  const ticksLimit = Math.min(tickOpts.maxTicksLimit || determinedMaxTicks, determinedMaxTicks);\n  const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];\n  const numMajorIndices = majorIndices.length;\n  const first = majorIndices[0];\n  const last = majorIndices[numMajorIndices - 1];\n  const newTicks = [];\n\n  // If there are too many major ticks to display them all\n  if (numMajorIndices > ticksLimit) {\n    skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);\n    return newTicks;\n  }\n\n  const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);\n\n  if (numMajorIndices > 0) {\n    let i, ilen;\n    const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first) / (numMajorIndices - 1)) : null;\n    skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first - avgMajorSpacing, first);\n    for (i = 0, ilen = numMajorIndices - 1; i < ilen; i++) {\n      skip(ticks, newTicks, spacing, majorIndices[i], majorIndices[i + 1]);\n    }\n    skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);\n    return newTicks;\n  }\n  skip(ticks, newTicks, spacing);\n  return newTicks;\n}\n\nfunction determineMaxTicks(scale) {\n  const offset = scale.options.offset;\n  const tickLength = scale._tickSize();\n  const maxScale = scale._length / tickLength + (offset ? 0 : 1);\n  const maxChart = scale._maxLength / tickLength;\n  return Math.floor(Math.min(maxScale, maxChart));\n}\n\n/**\n * @param {number[]} majorIndices\n * @param {Tick[]} ticks\n * @param {number} ticksLimit\n */\nfunction calculateSpacing(majorIndices, ticks, ticksLimit) {\n  const evenMajorSpacing = getEvenSpacing(majorIndices);\n  const spacing = ticks.length / ticksLimit;\n\n  // If the major ticks are evenly spaced apart, place the minor ticks\n  // so that they divide the major ticks into even chunks\n  if (!evenMajorSpacing) {\n    return Math.max(spacing, 1);\n  }\n\n  const factors = _factorize(evenMajorSpacing);\n  for (let i = 0, ilen = factors.length - 1; i < ilen; i++) {\n    const factor = factors[i];\n    if (factor > spacing) {\n      return factor;\n    }\n  }\n  return Math.max(spacing, 1);\n}\n\n/**\n * @param {Tick[]} ticks\n */\nfunction getMajorIndices(ticks) {\n  const result = [];\n  let i, ilen;\n  for (i = 0, ilen = ticks.length; i < ilen; i++) {\n    if (ticks[i].major) {\n      result.push(i);\n    }\n  }\n  return result;\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number[]} majorIndices\n * @param {number} spacing\n */\nfunction skipMajors(ticks, newTicks, majorIndices, spacing) {\n  let count = 0;\n  let next = majorIndices[0];\n  let i;\n\n  spacing = Math.ceil(spacing);\n  for (i = 0; i < ticks.length; i++) {\n    if (i === next) {\n      newTicks.push(ticks[i]);\n      count++;\n      next = majorIndices[count * spacing];\n    }\n  }\n}\n\n/**\n * @param {Tick[]} ticks\n * @param {Tick[]} newTicks\n * @param {number} spacing\n * @param {number} [majorStart]\n * @param {number} [majorEnd]\n */\nfunction skip(ticks, newTicks, spacing, majorStart, majorEnd) {\n  const start = valueOrDefault(majorStart, 0);\n  const end = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);\n  let count = 0;\n  let length, i, next;\n\n  spacing = Math.ceil(spacing);\n  if (majorEnd) {\n    length = majorEnd - majorStart;\n    spacing = length / Math.floor(length / spacing);\n  }\n\n  next = start;\n\n  while (next < 0) {\n    count++;\n    next = Math.round(start + count * spacing);\n  }\n\n  for (i = Math.max(start, 0); i < end; i++) {\n    if (i === next) {\n      newTicks.push(ticks[i]);\n      count++;\n      next = Math.round(start + count * spacing);\n    }\n  }\n}\n\n\n/**\n * @param {number[]} arr\n */\nfunction getEvenSpacing(arr) {\n  const len = arr.length;\n  let i, diff;\n\n  if (len < 2) {\n    return false;\n  }\n\n  for (diff = arr[0], i = 1; i < len; ++i) {\n    if (arr[i] - arr[i - 1] !== diff) {\n      return false;\n    }\n  }\n  return diff;\n}\n", "import Element from './core.element.js';\nimport {_alignPixel, _measureText, renderText, clipArea, unclipArea} from '../helpers/helpers.canvas.js';\nimport {callback as call, each, finiteOrDefault, isArray, isFinite, isNullOrUndef, isObject, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toDegrees, toRadians, _int16Range, _limitValue, HALF_PI} from '../helpers/helpers.math.js';\nimport {_alignStartEnd, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {createContext, toFont, toPadding, _addGrace} from '../helpers/helpers.options.js';\nimport {autoSkip} from './core.scale.autoskip.js';\n\nconst reverseAlign = (align) => align === 'left' ? 'right' : align === 'right' ? 'left' : align;\nconst offsetFromEdge = (scale, edge, offset) => edge === 'top' || edge === 'left' ? scale[edge] + offset : scale[edge] - offset;\nconst getTicksLimit = (ticksLength, maxTicksLimit) => Math.min(maxTicksLimit || ticksLength, ticksLength);\n\n/**\n * @typedef { import('../types/index.js').Chart } Chart\n * @typedef {{value:number | string, label?:string, major?:boolean, $context?:any}} Tick\n */\n\n/**\n * Returns a new array containing numItems from arr\n * @param {any[]} arr\n * @param {number} numItems\n */\nfunction sample(arr, numItems) {\n  const result = [];\n  const increment = arr.length / numItems;\n  const len = arr.length;\n  let i = 0;\n\n  for (; i < len; i += increment) {\n    result.push(arr[Math.floor(i)]);\n  }\n  return result;\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @param {boolean} offsetGridLines\n */\nfunction getPixelForGridLine(scale, index, offsetGridLines) {\n  const length = scale.ticks.length;\n  const validIndex = Math.min(index, length - 1);\n  const start = scale._startPixel;\n  const end = scale._endPixel;\n  const epsilon = 1e-6; // 1e-6 is margin in pixels for accumulated error.\n  let lineValue = scale.getPixelForTick(validIndex);\n  let offset;\n\n  if (offsetGridLines) {\n    if (length === 1) {\n      offset = Math.max(lineValue - start, end - lineValue);\n    } else if (index === 0) {\n      offset = (scale.getPixelForTick(1) - lineValue) / 2;\n    } else {\n      offset = (lineValue - scale.getPixelForTick(validIndex - 1)) / 2;\n    }\n    lineValue += validIndex < index ? offset : -offset;\n\n    // Return undefined if the pixel is out of the range\n    if (lineValue < start - epsilon || lineValue > end + epsilon) {\n      return;\n    }\n  }\n  return lineValue;\n}\n\n/**\n * @param {object} caches\n * @param {number} length\n */\nfunction garbageCollect(caches, length) {\n  each(caches, (cache) => {\n    const gc = cache.gc;\n    const gcLen = gc.length / 2;\n    let i;\n    if (gcLen > length) {\n      for (i = 0; i < gcLen; ++i) {\n        delete cache.data[gc[i]];\n      }\n      gc.splice(0, gcLen);\n    }\n  });\n}\n\n/**\n * @param {object} options\n */\nfunction getTickMarkLength(options) {\n  return options.drawTicks ? options.tickLength : 0;\n}\n\n/**\n * @param {object} options\n */\nfunction getTitleHeight(options, fallback) {\n  if (!options.display) {\n    return 0;\n  }\n\n  const font = toFont(options.font, fallback);\n  const padding = toPadding(options.padding);\n  const lines = isArray(options.text) ? options.text.length : 1;\n\n  return (lines * font.lineHeight) + padding.height;\n}\n\nfunction createScaleContext(parent, scale) {\n  return createContext(parent, {\n    scale,\n    type: 'scale'\n  });\n}\n\nfunction createTickContext(parent, index, tick) {\n  return createContext(parent, {\n    tick,\n    index,\n    type: 'tick'\n  });\n}\n\nfunction titleAlign(align, position, reverse) {\n  /** @type {CanvasTextAlign} */\n  let ret = _toLeftRightCenter(align);\n  if ((reverse && position !== 'right') || (!reverse && position === 'right')) {\n    ret = reverseAlign(ret);\n  }\n  return ret;\n}\n\nfunction titleArgs(scale, offset, position, align) {\n  const {top, left, bottom, right, chart} = scale;\n  const {chartArea, scales} = chart;\n  let rotation = 0;\n  let maxWidth, titleX, titleY;\n  const height = bottom - top;\n  const width = right - left;\n\n  if (scale.isHorizontal()) {\n    titleX = _alignStartEnd(align, left, right);\n\n    if (isObject(position)) {\n      const positionAxisID = Object.keys(position)[0];\n      const value = position[positionAxisID];\n      titleY = scales[positionAxisID].getPixelForValue(value) + height - offset;\n    } else if (position === 'center') {\n      titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset;\n    } else {\n      titleY = offsetFromEdge(scale, position, offset);\n    }\n    maxWidth = right - left;\n  } else {\n    if (isObject(position)) {\n      const positionAxisID = Object.keys(position)[0];\n      const value = position[positionAxisID];\n      titleX = scales[positionAxisID].getPixelForValue(value) - width + offset;\n    } else if (position === 'center') {\n      titleX = (chartArea.left + chartArea.right) / 2 - width + offset;\n    } else {\n      titleX = offsetFromEdge(scale, position, offset);\n    }\n    titleY = _alignStartEnd(align, bottom, top);\n    rotation = position === 'left' ? -HALF_PI : HALF_PI;\n  }\n  return {titleX, titleY, maxWidth, rotation};\n}\n\nexport default class Scale extends Element {\n\n  // eslint-disable-next-line max-statements\n  constructor(cfg) {\n    super();\n\n    /** @type {string} */\n    this.id = cfg.id;\n    /** @type {string} */\n    this.type = cfg.type;\n    /** @type {any} */\n    this.options = undefined;\n    /** @type {CanvasRenderingContext2D} */\n    this.ctx = cfg.ctx;\n    /** @type {Chart} */\n    this.chart = cfg.chart;\n\n    // implements box\n    /** @type {number} */\n    this.top = undefined;\n    /** @type {number} */\n    this.bottom = undefined;\n    /** @type {number} */\n    this.left = undefined;\n    /** @type {number} */\n    this.right = undefined;\n    /** @type {number} */\n    this.width = undefined;\n    /** @type {number} */\n    this.height = undefined;\n    this._margins = {\n      left: 0,\n      right: 0,\n      top: 0,\n      bottom: 0\n    };\n    /** @type {number} */\n    this.maxWidth = undefined;\n    /** @type {number} */\n    this.maxHeight = undefined;\n    /** @type {number} */\n    this.paddingTop = undefined;\n    /** @type {number} */\n    this.paddingBottom = undefined;\n    /** @type {number} */\n    this.paddingLeft = undefined;\n    /** @type {number} */\n    this.paddingRight = undefined;\n\n    // scale-specific properties\n    /** @type {string=} */\n    this.axis = undefined;\n    /** @type {number=} */\n    this.labelRotation = undefined;\n    this.min = undefined;\n    this.max = undefined;\n    this._range = undefined;\n    /** @type {Tick[]} */\n    this.ticks = [];\n    /** @type {object[]|null} */\n    this._gridLineItems = null;\n    /** @type {object[]|null} */\n    this._labelItems = null;\n    /** @type {object|null} */\n    this._labelSizes = null;\n    this._length = 0;\n    this._maxLength = 0;\n    this._longestTextCache = {};\n    /** @type {number} */\n    this._startPixel = undefined;\n    /** @type {number} */\n    this._endPixel = undefined;\n    this._reversePixels = false;\n    this._userMax = undefined;\n    this._userMin = undefined;\n    this._suggestedMax = undefined;\n    this._suggestedMin = undefined;\n    this._ticksLength = 0;\n    this._borderValue = 0;\n    this._cache = {};\n    this._dataLimitsCached = false;\n    this.$context = undefined;\n  }\n\n  /**\n\t * @param {any} options\n\t * @since 3.0\n\t */\n  init(options) {\n    this.options = options.setContext(this.getContext());\n\n    this.axis = options.axis;\n\n    // parse min/max value, so we can properly determine min/max for other scales\n    this._userMin = this.parse(options.min);\n    this._userMax = this.parse(options.max);\n    this._suggestedMin = this.parse(options.suggestedMin);\n    this._suggestedMax = this.parse(options.suggestedMax);\n  }\n\n  /**\n\t * Parse a supported input value to internal representation.\n\t * @param {*} raw\n\t * @param {number} [index]\n\t * @since 3.0\n\t */\n  parse(raw, index) { // eslint-disable-line no-unused-vars\n    return raw;\n  }\n\n  /**\n\t * @return {{min: number, max: number, minDefined: boolean, maxDefined: boolean}}\n\t * @protected\n\t * @since 3.0\n\t */\n  getUserBounds() {\n    let {_userMin, _userMax, _suggestedMin, _suggestedMax} = this;\n    _userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);\n    _userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);\n    _suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);\n    _suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);\n    return {\n      min: finiteOrDefault(_userMin, _suggestedMin),\n      max: finiteOrDefault(_userMax, _suggestedMax),\n      minDefined: isFinite(_userMin),\n      maxDefined: isFinite(_userMax)\n    };\n  }\n\n  /**\n\t * @param {boolean} canStack\n\t * @return {{min: number, max: number}}\n\t * @protected\n\t * @since 3.0\n\t */\n  getMinMax(canStack) {\n    // eslint-disable-next-line prefer-const\n    let {min, max, minDefined, maxDefined} = this.getUserBounds();\n    let range;\n\n    if (minDefined && maxDefined) {\n      return {min, max};\n    }\n\n    const metas = this.getMatchingVisibleMetas();\n    for (let i = 0, ilen = metas.length; i < ilen; ++i) {\n      range = metas[i].controller.getMinMax(this, canStack);\n      if (!minDefined) {\n        min = Math.min(min, range.min);\n      }\n      if (!maxDefined) {\n        max = Math.max(max, range.max);\n      }\n    }\n\n    // Make sure min <= max when only min or max is defined by user and the data is outside that range\n    min = maxDefined && min > max ? max : min;\n    max = minDefined && min > max ? min : max;\n\n    return {\n      min: finiteOrDefault(min, finiteOrDefault(max, min)),\n      max: finiteOrDefault(max, finiteOrDefault(min, max))\n    };\n  }\n\n  /**\n\t * Get the padding needed for the scale\n\t * @return {{top: number, left: number, bottom: number, right: number}} the necessary padding\n\t * @private\n\t */\n  getPadding() {\n    return {\n      left: this.paddingLeft || 0,\n      top: this.paddingTop || 0,\n      right: this.paddingRight || 0,\n      bottom: this.paddingBottom || 0\n    };\n  }\n\n  /**\n\t * Returns the scale tick objects\n\t * @return {Tick[]}\n\t * @since 2.7\n\t */\n  getTicks() {\n    return this.ticks;\n  }\n\n  /**\n\t * @return {string[]}\n\t */\n  getLabels() {\n    const data = this.chart.data;\n    return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];\n  }\n\n  /**\n   * @return {import('../types.js').LabelItem[]}\n   */\n  getLabelItems(chartArea = this.chart.chartArea) {\n    const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));\n    return items;\n  }\n\n  // When a new layout is created, reset the data limits cache\n  beforeLayout() {\n    this._cache = {};\n    this._dataLimitsCached = false;\n  }\n\n  // These methods are ordered by lifecycle. Utilities then follow.\n  // Any function defined here is inherited by all scale types.\n  // Any function can be extended by the scale type\n\n  beforeUpdate() {\n    call(this.options.beforeUpdate, [this]);\n  }\n\n  /**\n\t * @param {number} maxWidth - the max width in pixels\n\t * @param {number} maxHeight - the max height in pixels\n\t * @param {{top: number, left: number, bottom: number, right: number}} margins - the space between the edge of the other scales and edge of the chart\n\t *   This space comes from two sources:\n\t *     - padding - space that's required to show the labels at the edges of the scale\n\t *     - thickness of scales or legends in another orientation\n\t */\n  update(maxWidth, maxHeight, margins) {\n    const {beginAtZero, grace, ticks: tickOpts} = this.options;\n    const sampleSize = tickOpts.sampleSize;\n\n    // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)\n    this.beforeUpdate();\n\n    // Absorb the master measurements\n    this.maxWidth = maxWidth;\n    this.maxHeight = maxHeight;\n    this._margins = margins = Object.assign({\n      left: 0,\n      right: 0,\n      top: 0,\n      bottom: 0\n    }, margins);\n\n    this.ticks = null;\n    this._labelSizes = null;\n    this._gridLineItems = null;\n    this._labelItems = null;\n\n    // Dimensions\n    this.beforeSetDimensions();\n    this.setDimensions();\n    this.afterSetDimensions();\n\n    this._maxLength = this.isHorizontal()\n      ? this.width + margins.left + margins.right\n      : this.height + margins.top + margins.bottom;\n\n    // Data min/max\n    if (!this._dataLimitsCached) {\n      this.beforeDataLimits();\n      this.determineDataLimits();\n      this.afterDataLimits();\n      this._range = _addGrace(this, grace, beginAtZero);\n      this._dataLimitsCached = true;\n    }\n\n    this.beforeBuildTicks();\n\n    this.ticks = this.buildTicks() || [];\n\n    // Allow modification of ticks in callback.\n    this.afterBuildTicks();\n\n    // Compute tick rotation and fit using a sampled subset of labels\n    // We generally don't need to compute the size of every single label for determining scale size\n    const samplingEnabled = sampleSize < this.ticks.length;\n    this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);\n\n    // configure is called twice, once here, once from core.controller.updateLayout.\n    // Here we haven't been positioned yet, but dimensions are correct.\n    // Variables set in configure are needed for calculateLabelRotation, and\n    // it's ok that coordinates are not correct there, only dimensions matter.\n    this.configure();\n\n    // Tick Rotation\n    this.beforeCalculateLabelRotation();\n    this.calculateLabelRotation(); // Preconditions: number of ticks and sizes of largest labels must be calculated beforehand\n    this.afterCalculateLabelRotation();\n\n    // Auto-skip\n    if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === 'auto')) {\n      this.ticks = autoSkip(this, this.ticks);\n      this._labelSizes = null;\n      this.afterAutoSkip();\n    }\n\n    if (samplingEnabled) {\n      // Generate labels using all non-skipped ticks\n      this._convertTicksToLabels(this.ticks);\n    }\n\n    this.beforeFit();\n    this.fit(); // Preconditions: label rotation and label sizes must be calculated beforehand\n    this.afterFit();\n\n    // IMPORTANT: after this point, we consider that `this.ticks` will NEVER change!\n\n    this.afterUpdate();\n  }\n\n  /**\n\t * @protected\n\t */\n  configure() {\n    let reversePixels = this.options.reverse;\n    let startPixel, endPixel;\n\n    if (this.isHorizontal()) {\n      startPixel = this.left;\n      endPixel = this.right;\n    } else {\n      startPixel = this.top;\n      endPixel = this.bottom;\n      // by default vertical scales are from bottom to top, so pixels are reversed\n      reversePixels = !reversePixels;\n    }\n    this._startPixel = startPixel;\n    this._endPixel = endPixel;\n    this._reversePixels = reversePixels;\n    this._length = endPixel - startPixel;\n    this._alignToPixels = this.options.alignToPixels;\n  }\n\n  afterUpdate() {\n    call(this.options.afterUpdate, [this]);\n  }\n\n  //\n\n  beforeSetDimensions() {\n    call(this.options.beforeSetDimensions, [this]);\n  }\n  setDimensions() {\n    // Set the unconstrained dimension before label rotation\n    if (this.isHorizontal()) {\n      // Reset position before calculating rotation\n      this.width = this.maxWidth;\n      this.left = 0;\n      this.right = this.width;\n    } else {\n      this.height = this.maxHeight;\n\n      // Reset position before calculating rotation\n      this.top = 0;\n      this.bottom = this.height;\n    }\n\n    // Reset padding\n    this.paddingLeft = 0;\n    this.paddingTop = 0;\n    this.paddingRight = 0;\n    this.paddingBottom = 0;\n  }\n  afterSetDimensions() {\n    call(this.options.afterSetDimensions, [this]);\n  }\n\n  _callHooks(name) {\n    this.chart.notifyPlugins(name, this.getContext());\n    call(this.options[name], [this]);\n  }\n\n  // Data limits\n  beforeDataLimits() {\n    this._callHooks('beforeDataLimits');\n  }\n  determineDataLimits() {}\n  afterDataLimits() {\n    this._callHooks('afterDataLimits');\n  }\n\n  //\n  beforeBuildTicks() {\n    this._callHooks('beforeBuildTicks');\n  }\n  /**\n\t * @return {object[]} the ticks\n\t */\n  buildTicks() {\n    return [];\n  }\n  afterBuildTicks() {\n    this._callHooks('afterBuildTicks');\n  }\n\n  beforeTickToLabelConversion() {\n    call(this.options.beforeTickToLabelConversion, [this]);\n  }\n  /**\n\t * Convert ticks to label strings\n\t * @param {Tick[]} ticks\n\t */\n  generateTickLabels(ticks) {\n    const tickOpts = this.options.ticks;\n    let i, ilen, tick;\n    for (i = 0, ilen = ticks.length; i < ilen; i++) {\n      tick = ticks[i];\n      tick.label = call(tickOpts.callback, [tick.value, i, ticks], this);\n    }\n  }\n  afterTickToLabelConversion() {\n    call(this.options.afterTickToLabelConversion, [this]);\n  }\n\n  //\n\n  beforeCalculateLabelRotation() {\n    call(this.options.beforeCalculateLabelRotation, [this]);\n  }\n  calculateLabelRotation() {\n    const options = this.options;\n    const tickOpts = options.ticks;\n    const numTicks = getTicksLimit(this.ticks.length, options.ticks.maxTicksLimit);\n    const minRotation = tickOpts.minRotation || 0;\n    const maxRotation = tickOpts.maxRotation;\n    let labelRotation = minRotation;\n    let tickWidth, maxHeight, maxLabelDiagonal;\n\n    if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {\n      this.labelRotation = minRotation;\n      return;\n    }\n\n    const labelSizes = this._getLabelSizes();\n    const maxLabelWidth = labelSizes.widest.width;\n    const maxLabelHeight = labelSizes.highest.height;\n\n    // Estimate the width of each grid based on the canvas width, the maximum\n    // label width and the number of tick intervals\n    const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);\n    tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);\n\n    // Allow 3 pixels x2 padding either side for label readability\n    if (maxLabelWidth + 6 > tickWidth) {\n      tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));\n      maxHeight = this.maxHeight - getTickMarkLength(options.grid)\n\t\t\t\t- tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);\n      maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);\n      labelRotation = toDegrees(Math.min(\n        Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),\n        Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))\n      ));\n      labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));\n    }\n\n    this.labelRotation = labelRotation;\n  }\n  afterCalculateLabelRotation() {\n    call(this.options.afterCalculateLabelRotation, [this]);\n  }\n  afterAutoSkip() {}\n\n  //\n\n  beforeFit() {\n    call(this.options.beforeFit, [this]);\n  }\n  fit() {\n    // Reset\n    const minSize = {\n      width: 0,\n      height: 0\n    };\n\n    const {chart, options: {ticks: tickOpts, title: titleOpts, grid: gridOpts}} = this;\n    const display = this._isVisible();\n    const isHorizontal = this.isHorizontal();\n\n    if (display) {\n      const titleHeight = getTitleHeight(titleOpts, chart.options.font);\n      if (isHorizontal) {\n        minSize.width = this.maxWidth;\n        minSize.height = getTickMarkLength(gridOpts) + titleHeight;\n      } else {\n        minSize.height = this.maxHeight; // fill all the height\n        minSize.width = getTickMarkLength(gridOpts) + titleHeight;\n      }\n\n      // Don't bother fitting the ticks if we are not showing the labels\n      if (tickOpts.display && this.ticks.length) {\n        const {first, last, widest, highest} = this._getLabelSizes();\n        const tickPadding = tickOpts.padding * 2;\n        const angleRadians = toRadians(this.labelRotation);\n        const cos = Math.cos(angleRadians);\n        const sin = Math.sin(angleRadians);\n\n        if (isHorizontal) {\n        // A horizontal axis is more constrained by the height.\n          const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;\n          minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);\n        } else {\n        // A vertical axis is more constrained by the width. Labels are the\n        // dominant factor here, so get that length first and account for padding\n          const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;\n\n          minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);\n        }\n        this._calculatePadding(first, last, sin, cos);\n      }\n    }\n\n    this._handleMargins();\n\n    if (isHorizontal) {\n      this.width = this._length = chart.width - this._margins.left - this._margins.right;\n      this.height = minSize.height;\n    } else {\n      this.width = minSize.width;\n      this.height = this._length = chart.height - this._margins.top - this._margins.bottom;\n    }\n  }\n\n  _calculatePadding(first, last, sin, cos) {\n    const {ticks: {align, padding}, position} = this.options;\n    const isRotated = this.labelRotation !== 0;\n    const labelsBelowTicks = position !== 'top' && this.axis === 'x';\n\n    if (this.isHorizontal()) {\n      const offsetLeft = this.getPixelForTick(0) - this.left;\n      const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);\n      let paddingLeft = 0;\n      let paddingRight = 0;\n\n      // Ensure that our ticks are always inside the canvas. When rotated, ticks are right aligned\n      // which means that the right padding is dominated by the font height\n      if (isRotated) {\n        if (labelsBelowTicks) {\n          paddingLeft = cos * first.width;\n          paddingRight = sin * last.height;\n        } else {\n          paddingLeft = sin * first.height;\n          paddingRight = cos * last.width;\n        }\n      } else if (align === 'start') {\n        paddingRight = last.width;\n      } else if (align === 'end') {\n        paddingLeft = first.width;\n      } else if (align !== 'inner') {\n        paddingLeft = first.width / 2;\n        paddingRight = last.width / 2;\n      }\n\n      // Adjust padding taking into account changes in offsets\n      this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);\n      this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);\n    } else {\n      let paddingTop = last.height / 2;\n      let paddingBottom = first.height / 2;\n\n      if (align === 'start') {\n        paddingTop = 0;\n        paddingBottom = first.height;\n      } else if (align === 'end') {\n        paddingTop = last.height;\n        paddingBottom = 0;\n      }\n\n      this.paddingTop = paddingTop + padding;\n      this.paddingBottom = paddingBottom + padding;\n    }\n  }\n\n  /**\n\t * Handle margins and padding interactions\n\t * @private\n\t */\n  _handleMargins() {\n    if (this._margins) {\n      this._margins.left = Math.max(this.paddingLeft, this._margins.left);\n      this._margins.top = Math.max(this.paddingTop, this._margins.top);\n      this._margins.right = Math.max(this.paddingRight, this._margins.right);\n      this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);\n    }\n  }\n\n  afterFit() {\n    call(this.options.afterFit, [this]);\n  }\n\n  // Shared Methods\n  /**\n\t * @return {boolean}\n\t */\n  isHorizontal() {\n    const {axis, position} = this.options;\n    return position === 'top' || position === 'bottom' || axis === 'x';\n  }\n  /**\n\t * @return {boolean}\n\t */\n  isFullSize() {\n    return this.options.fullSize;\n  }\n\n  /**\n\t * @param {Tick[]} ticks\n\t * @private\n\t */\n  _convertTicksToLabels(ticks) {\n    this.beforeTickToLabelConversion();\n\n    this.generateTickLabels(ticks);\n\n    // Ticks should be skipped when callback returns null or undef, so lets remove those.\n    let i, ilen;\n    for (i = 0, ilen = ticks.length; i < ilen; i++) {\n      if (isNullOrUndef(ticks[i].label)) {\n        ticks.splice(i, 1);\n        ilen--;\n        i--;\n      }\n    }\n\n    this.afterTickToLabelConversion();\n  }\n\n  /**\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n  _getLabelSizes() {\n    let labelSizes = this._labelSizes;\n\n    if (!labelSizes) {\n      const sampleSize = this.options.ticks.sampleSize;\n      let ticks = this.ticks;\n      if (sampleSize < ticks.length) {\n        ticks = sample(ticks, sampleSize);\n      }\n\n      this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length, this.options.ticks.maxTicksLimit);\n    }\n\n    return labelSizes;\n  }\n\n  /**\n\t * Returns {width, height, offset} objects for the first, last, widest, highest tick\n\t * labels where offset indicates the anchor point offset from the top in pixels.\n\t * @return {{ first: object, last: object, widest: object, highest: object, widths: Array, heights: array }}\n\t * @private\n\t */\n  _computeLabelSizes(ticks, length, maxTicksLimit) {\n    const {ctx, _longestTextCache: caches} = this;\n    const widths = [];\n    const heights = [];\n    const increment = Math.floor(length / getTicksLimit(length, maxTicksLimit));\n    let widestLabelSize = 0;\n    let highestLabelSize = 0;\n    let i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel;\n\n    for (i = 0; i < length; i += increment) {\n      label = ticks[i].label;\n      tickFont = this._resolveTickFontOptions(i);\n      ctx.font = fontString = tickFont.string;\n      cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};\n      lineHeight = tickFont.lineHeight;\n      width = height = 0;\n      // Undefined labels and arrays should not be measured\n      if (!isNullOrUndef(label) && !isArray(label)) {\n        width = _measureText(ctx, cache.data, cache.gc, width, label);\n        height = lineHeight;\n      } else if (isArray(label)) {\n        // if it is an array let's measure each element\n        for (j = 0, jlen = label.length; j < jlen; ++j) {\n          nestedLabel = /** @type {string} */ (label[j]);\n          // Undefined labels and arrays should not be measured\n          if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {\n            width = _measureText(ctx, cache.data, cache.gc, width, nestedLabel);\n            height += lineHeight;\n          }\n        }\n      }\n      widths.push(width);\n      heights.push(height);\n      widestLabelSize = Math.max(width, widestLabelSize);\n      highestLabelSize = Math.max(height, highestLabelSize);\n    }\n    garbageCollect(caches, length);\n\n    const widest = widths.indexOf(widestLabelSize);\n    const highest = heights.indexOf(highestLabelSize);\n\n    const valueAt = (idx) => ({width: widths[idx] || 0, height: heights[idx] || 0});\n\n    return {\n      first: valueAt(0),\n      last: valueAt(length - 1),\n      widest: valueAt(widest),\n      highest: valueAt(highest),\n      widths,\n      heights,\n    };\n  }\n\n  /**\n\t * Used to get the label to display in the tooltip for the given value\n\t * @param {*} value\n\t * @return {string}\n\t */\n  getLabelForValue(value) {\n    return value;\n  }\n\n  /**\n\t * Returns the location of the given data point. Value can either be an index or a numerical value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {*} value\n\t * @param {number} [index]\n\t * @return {number}\n\t */\n  getPixelForValue(value, index) { // eslint-disable-line no-unused-vars\n    return NaN;\n  }\n\n  /**\n\t * Used to get the data value from a given pixel. This is the inverse of getPixelForValue\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} pixel\n\t * @return {*}\n\t */\n  getValueForPixel(pixel) {} // eslint-disable-line no-unused-vars\n\n  /**\n\t * Returns the location of the tick at the given index\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} index\n\t * @return {number}\n\t */\n  getPixelForTick(index) {\n    const ticks = this.ticks;\n    if (index < 0 || index > ticks.length - 1) {\n      return null;\n    }\n    return this.getPixelForValue(ticks[index].value);\n  }\n\n  /**\n\t * Utility for getting the pixel location of a percentage of scale\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @param {number} decimal\n\t * @return {number}\n\t */\n  getPixelForDecimal(decimal) {\n    if (this._reversePixels) {\n      decimal = 1 - decimal;\n    }\n\n    const pixel = this._startPixel + decimal * this._length;\n    return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);\n  }\n\n  /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n  getDecimalForPixel(pixel) {\n    const decimal = (pixel - this._startPixel) / this._length;\n    return this._reversePixels ? 1 - decimal : decimal;\n  }\n\n  /**\n\t * Returns the pixel for the minimum chart value\n\t * The coordinate (0, 0) is at the upper-left corner of the canvas\n\t * @return {number}\n\t */\n  getBasePixel() {\n    return this.getPixelForValue(this.getBaseValue());\n  }\n\n  /**\n\t * @return {number}\n\t */\n  getBaseValue() {\n    const {min, max} = this;\n\n    return min < 0 && max < 0 ? max :\n      min > 0 && max > 0 ? min :\n      0;\n  }\n\n  /**\n\t * @protected\n\t */\n  getContext(index) {\n    const ticks = this.ticks || [];\n\n    if (index >= 0 && index < ticks.length) {\n      const tick = ticks[index];\n      return tick.$context ||\n\t\t\t\t(tick.$context = createTickContext(this.getContext(), index, tick));\n    }\n    return this.$context ||\n\t\t\t(this.$context = createScaleContext(this.chart.getContext(), this));\n  }\n\n  /**\n\t * @return {number}\n\t * @private\n\t */\n  _tickSize() {\n    const optionTicks = this.options.ticks;\n\n    // Calculate space needed by label in axis direction.\n    const rot = toRadians(this.labelRotation);\n    const cos = Math.abs(Math.cos(rot));\n    const sin = Math.abs(Math.sin(rot));\n\n    const labelSizes = this._getLabelSizes();\n    const padding = optionTicks.autoSkipPadding || 0;\n    const w = labelSizes ? labelSizes.widest.width + padding : 0;\n    const h = labelSizes ? labelSizes.highest.height + padding : 0;\n\n    // Calculate space needed for 1 tick in axis direction.\n    return this.isHorizontal()\n      ? h * cos > w * sin ? w / cos : h / sin\n      : h * sin < w * cos ? h / cos : w / sin;\n  }\n\n  /**\n\t * @return {boolean}\n\t * @private\n\t */\n  _isVisible() {\n    const display = this.options.display;\n\n    if (display !== 'auto') {\n      return !!display;\n    }\n\n    return this.getMatchingVisibleMetas().length > 0;\n  }\n\n  /**\n\t * @private\n\t */\n  _computeGridLineItems(chartArea) {\n    const axis = this.axis;\n    const chart = this.chart;\n    const options = this.options;\n    const {grid, position, border} = options;\n    const offset = grid.offset;\n    const isHorizontal = this.isHorizontal();\n    const ticks = this.ticks;\n    const ticksLength = ticks.length + (offset ? 1 : 0);\n    const tl = getTickMarkLength(grid);\n    const items = [];\n\n    const borderOpts = border.setContext(this.getContext());\n    const axisWidth = borderOpts.display ? borderOpts.width : 0;\n    const axisHalfWidth = axisWidth / 2;\n    const alignBorderValue = function(pixel) {\n      return _alignPixel(chart, pixel, axisWidth);\n    };\n    let borderValue, i, lineValue, alignedLineValue;\n    let tx1, ty1, tx2, ty2, x1, y1, x2, y2;\n\n    if (position === 'top') {\n      borderValue = alignBorderValue(this.bottom);\n      ty1 = this.bottom - tl;\n      ty2 = borderValue - axisHalfWidth;\n      y1 = alignBorderValue(chartArea.top) + axisHalfWidth;\n      y2 = chartArea.bottom;\n    } else if (position === 'bottom') {\n      borderValue = alignBorderValue(this.top);\n      y1 = chartArea.top;\n      y2 = alignBorderValue(chartArea.bottom) - axisHalfWidth;\n      ty1 = borderValue + axisHalfWidth;\n      ty2 = this.top + tl;\n    } else if (position === 'left') {\n      borderValue = alignBorderValue(this.right);\n      tx1 = this.right - tl;\n      tx2 = borderValue - axisHalfWidth;\n      x1 = alignBorderValue(chartArea.left) + axisHalfWidth;\n      x2 = chartArea.right;\n    } else if (position === 'right') {\n      borderValue = alignBorderValue(this.left);\n      x1 = chartArea.left;\n      x2 = alignBorderValue(chartArea.right) - axisHalfWidth;\n      tx1 = borderValue + axisHalfWidth;\n      tx2 = this.left + tl;\n    } else if (axis === 'x') {\n      if (position === 'center') {\n        borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n      }\n\n      y1 = chartArea.top;\n      y2 = chartArea.bottom;\n      ty1 = borderValue + axisHalfWidth;\n      ty2 = ty1 + tl;\n    } else if (axis === 'y') {\n      if (position === 'center') {\n        borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));\n      }\n\n      tx1 = borderValue - axisHalfWidth;\n      tx2 = tx1 - tl;\n      x1 = chartArea.left;\n      x2 = chartArea.right;\n    }\n\n    const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);\n    const step = Math.max(1, Math.ceil(ticksLength / limit));\n    for (i = 0; i < ticksLength; i += step) {\n      const context = this.getContext(i);\n      const optsAtIndex = grid.setContext(context);\n      const optsAtIndexBorder = border.setContext(context);\n\n      const lineWidth = optsAtIndex.lineWidth;\n      const lineColor = optsAtIndex.color;\n      const borderDash = optsAtIndexBorder.dash || [];\n      const borderDashOffset = optsAtIndexBorder.dashOffset;\n\n      const tickWidth = optsAtIndex.tickWidth;\n      const tickColor = optsAtIndex.tickColor;\n      const tickBorderDash = optsAtIndex.tickBorderDash || [];\n      const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;\n\n      lineValue = getPixelForGridLine(this, i, offset);\n\n      // Skip if the pixel is out of the range\n      if (lineValue === undefined) {\n        continue;\n      }\n\n      alignedLineValue = _alignPixel(chart, lineValue, lineWidth);\n\n      if (isHorizontal) {\n        tx1 = tx2 = x1 = x2 = alignedLineValue;\n      } else {\n        ty1 = ty2 = y1 = y2 = alignedLineValue;\n      }\n\n      items.push({\n        tx1,\n        ty1,\n        tx2,\n        ty2,\n        x1,\n        y1,\n        x2,\n        y2,\n        width: lineWidth,\n        color: lineColor,\n        borderDash,\n        borderDashOffset,\n        tickWidth,\n        tickColor,\n        tickBorderDash,\n        tickBorderDashOffset,\n      });\n    }\n\n    this._ticksLength = ticksLength;\n    this._borderValue = borderValue;\n\n    return items;\n  }\n\n  /**\n\t * @private\n\t */\n  _computeLabelItems(chartArea) {\n    const axis = this.axis;\n    const options = this.options;\n    const {position, ticks: optionTicks} = options;\n    const isHorizontal = this.isHorizontal();\n    const ticks = this.ticks;\n    const {align, crossAlign, padding, mirror} = optionTicks;\n    const tl = getTickMarkLength(options.grid);\n    const tickAndPadding = tl + padding;\n    const hTickAndPadding = mirror ? -padding : tickAndPadding;\n    const rotation = -toRadians(this.labelRotation);\n    const items = [];\n    let i, ilen, tick, label, x, y, textAlign, pixel, font, lineHeight, lineCount, textOffset;\n    let textBaseline = 'middle';\n\n    if (position === 'top') {\n      y = this.bottom - hTickAndPadding;\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (position === 'bottom') {\n      y = this.top + hTickAndPadding;\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (position === 'left') {\n      const ret = this._getYAxisLabelAlignment(tl);\n      textAlign = ret.textAlign;\n      x = ret.x;\n    } else if (position === 'right') {\n      const ret = this._getYAxisLabelAlignment(tl);\n      textAlign = ret.textAlign;\n      x = ret.x;\n    } else if (axis === 'x') {\n      if (position === 'center') {\n        y = ((chartArea.top + chartArea.bottom) / 2) + tickAndPadding;\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        y = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;\n      }\n      textAlign = this._getXAxisLabelAlignment();\n    } else if (axis === 'y') {\n      if (position === 'center') {\n        x = ((chartArea.left + chartArea.right) / 2) - tickAndPadding;\n      } else if (isObject(position)) {\n        const positionAxisID = Object.keys(position)[0];\n        const value = position[positionAxisID];\n        x = this.chart.scales[positionAxisID].getPixelForValue(value);\n      }\n      textAlign = this._getYAxisLabelAlignment(tl).textAlign;\n    }\n\n    if (axis === 'y') {\n      if (align === 'start') {\n        textBaseline = 'top';\n      } else if (align === 'end') {\n        textBaseline = 'bottom';\n      }\n    }\n\n    const labelSizes = this._getLabelSizes();\n    for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n      tick = ticks[i];\n      label = tick.label;\n\n      const optsAtIndex = optionTicks.setContext(this.getContext(i));\n      pixel = this.getPixelForTick(i) + optionTicks.labelOffset;\n      font = this._resolveTickFontOptions(i);\n      lineHeight = font.lineHeight;\n      lineCount = isArray(label) ? label.length : 1;\n      const halfCount = lineCount / 2;\n      const color = optsAtIndex.color;\n      const strokeColor = optsAtIndex.textStrokeColor;\n      const strokeWidth = optsAtIndex.textStrokeWidth;\n      let tickTextAlign = textAlign;\n\n      if (isHorizontal) {\n        x = pixel;\n\n        if (textAlign === 'inner') {\n          if (i === ilen - 1) {\n            tickTextAlign = !this.options.reverse ? 'right' : 'left';\n          } else if (i === 0) {\n            tickTextAlign = !this.options.reverse ? 'left' : 'right';\n          } else {\n            tickTextAlign = 'center';\n          }\n        }\n\n        if (position === 'top') {\n          if (crossAlign === 'near' || rotation !== 0) {\n            textOffset = -lineCount * lineHeight + lineHeight / 2;\n          } else if (crossAlign === 'center') {\n            textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;\n          } else {\n            textOffset = -labelSizes.highest.height + lineHeight / 2;\n          }\n        } else {\n          // eslint-disable-next-line no-lonely-if\n          if (crossAlign === 'near' || rotation !== 0) {\n            textOffset = lineHeight / 2;\n          } else if (crossAlign === 'center') {\n            textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;\n          } else {\n            textOffset = labelSizes.highest.height - lineCount * lineHeight;\n          }\n        }\n        if (mirror) {\n          textOffset *= -1;\n        }\n        if (rotation !== 0 && !optsAtIndex.showLabelBackdrop) {\n          x += (lineHeight / 2) * Math.sin(rotation);\n        }\n      } else {\n        y = pixel;\n        textOffset = (1 - lineCount) * lineHeight / 2;\n      }\n\n      let backdrop;\n\n      if (optsAtIndex.showLabelBackdrop) {\n        const labelPadding = toPadding(optsAtIndex.backdropPadding);\n        const height = labelSizes.heights[i];\n        const width = labelSizes.widths[i];\n\n        let top = textOffset - labelPadding.top;\n        let left = 0 - labelPadding.left;\n\n        switch (textBaseline) {\n        case 'middle':\n          top -= height / 2;\n          break;\n        case 'bottom':\n          top -= height;\n          break;\n        default:\n          break;\n        }\n\n        switch (textAlign) {\n        case 'center':\n          left -= width / 2;\n          break;\n        case 'right':\n          left -= width;\n          break;\n        default:\n          break;\n        }\n\n        backdrop = {\n          left,\n          top,\n          width: width + labelPadding.width,\n          height: height + labelPadding.height,\n\n          color: optsAtIndex.backdropColor,\n        };\n      }\n\n      items.push({\n        label,\n        font,\n        textOffset,\n        options: {\n          rotation,\n          color,\n          strokeColor,\n          strokeWidth,\n          textAlign: tickTextAlign,\n          textBaseline,\n          translation: [x, y],\n          backdrop,\n        }\n      });\n    }\n\n    return items;\n  }\n\n  _getXAxisLabelAlignment() {\n    const {position, ticks} = this.options;\n    const rotation = -toRadians(this.labelRotation);\n\n    if (rotation) {\n      return position === 'top' ? 'left' : 'right';\n    }\n\n    let align = 'center';\n\n    if (ticks.align === 'start') {\n      align = 'left';\n    } else if (ticks.align === 'end') {\n      align = 'right';\n    } else if (ticks.align === 'inner') {\n      align = 'inner';\n    }\n\n    return align;\n  }\n\n  _getYAxisLabelAlignment(tl) {\n    const {position, ticks: {crossAlign, mirror, padding}} = this.options;\n    const labelSizes = this._getLabelSizes();\n    const tickAndPadding = tl + padding;\n    const widest = labelSizes.widest.width;\n\n    let textAlign;\n    let x;\n\n    if (position === 'left') {\n      if (mirror) {\n        x = this.right + padding;\n\n        if (crossAlign === 'near') {\n          textAlign = 'left';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x += (widest / 2);\n        } else {\n          textAlign = 'right';\n          x += widest;\n        }\n      } else {\n        x = this.right - tickAndPadding;\n\n        if (crossAlign === 'near') {\n          textAlign = 'right';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x -= (widest / 2);\n        } else {\n          textAlign = 'left';\n          x = this.left;\n        }\n      }\n    } else if (position === 'right') {\n      if (mirror) {\n        x = this.left + padding;\n\n        if (crossAlign === 'near') {\n          textAlign = 'right';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x -= (widest / 2);\n        } else {\n          textAlign = 'left';\n          x -= widest;\n        }\n      } else {\n        x = this.left + tickAndPadding;\n\n        if (crossAlign === 'near') {\n          textAlign = 'left';\n        } else if (crossAlign === 'center') {\n          textAlign = 'center';\n          x += widest / 2;\n        } else {\n          textAlign = 'right';\n          x = this.right;\n        }\n      }\n    } else {\n      textAlign = 'right';\n    }\n\n    return {textAlign, x};\n  }\n\n  /**\n\t * @private\n\t */\n  _computeLabelArea() {\n    if (this.options.ticks.mirror) {\n      return;\n    }\n\n    const chart = this.chart;\n    const position = this.options.position;\n\n    if (position === 'left' || position === 'right') {\n      return {top: 0, left: this.left, bottom: chart.height, right: this.right};\n    } if (position === 'top' || position === 'bottom') {\n      return {top: this.top, left: 0, bottom: this.bottom, right: chart.width};\n    }\n  }\n\n  /**\n   * @protected\n   */\n  drawBackground() {\n    const {ctx, options: {backgroundColor}, left, top, width, height} = this;\n    if (backgroundColor) {\n      ctx.save();\n      ctx.fillStyle = backgroundColor;\n      ctx.fillRect(left, top, width, height);\n      ctx.restore();\n    }\n  }\n\n  getLineWidthForValue(value) {\n    const grid = this.options.grid;\n    if (!this._isVisible() || !grid.display) {\n      return 0;\n    }\n    const ticks = this.ticks;\n    const index = ticks.findIndex(t => t.value === value);\n    if (index >= 0) {\n      const opts = grid.setContext(this.getContext(index));\n      return opts.lineWidth;\n    }\n    return 0;\n  }\n\n  /**\n\t * @protected\n\t */\n  drawGrid(chartArea) {\n    const grid = this.options.grid;\n    const ctx = this.ctx;\n    const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));\n    let i, ilen;\n\n    const drawLine = (p1, p2, style) => {\n      if (!style.width || !style.color) {\n        return;\n      }\n      ctx.save();\n      ctx.lineWidth = style.width;\n      ctx.strokeStyle = style.color;\n      ctx.setLineDash(style.borderDash || []);\n      ctx.lineDashOffset = style.borderDashOffset;\n\n      ctx.beginPath();\n      ctx.moveTo(p1.x, p1.y);\n      ctx.lineTo(p2.x, p2.y);\n      ctx.stroke();\n      ctx.restore();\n    };\n\n    if (grid.display) {\n      for (i = 0, ilen = items.length; i < ilen; ++i) {\n        const item = items[i];\n\n        if (grid.drawOnChartArea) {\n          drawLine(\n            {x: item.x1, y: item.y1},\n            {x: item.x2, y: item.y2},\n            item\n          );\n        }\n\n        if (grid.drawTicks) {\n          drawLine(\n            {x: item.tx1, y: item.ty1},\n            {x: item.tx2, y: item.ty2},\n            {\n              color: item.tickColor,\n              width: item.tickWidth,\n              borderDash: item.tickBorderDash,\n              borderDashOffset: item.tickBorderDashOffset\n            }\n          );\n        }\n      }\n    }\n  }\n\n  /**\n\t * @protected\n\t */\n  drawBorder() {\n    const {chart, ctx, options: {border, grid}} = this;\n    const borderOpts = border.setContext(this.getContext());\n    const axisWidth = border.display ? borderOpts.width : 0;\n    if (!axisWidth) {\n      return;\n    }\n    const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;\n    const borderValue = this._borderValue;\n    let x1, x2, y1, y2;\n\n    if (this.isHorizontal()) {\n      x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;\n      x2 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;\n      y1 = y2 = borderValue;\n    } else {\n      y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;\n      y2 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;\n      x1 = x2 = borderValue;\n    }\n    ctx.save();\n    ctx.lineWidth = borderOpts.width;\n    ctx.strokeStyle = borderOpts.color;\n\n    ctx.beginPath();\n    ctx.moveTo(x1, y1);\n    ctx.lineTo(x2, y2);\n    ctx.stroke();\n\n    ctx.restore();\n  }\n\n  /**\n\t * @protected\n\t */\n  drawLabels(chartArea) {\n    const optionTicks = this.options.ticks;\n\n    if (!optionTicks.display) {\n      return;\n    }\n\n    const ctx = this.ctx;\n\n    const area = this._computeLabelArea();\n    if (area) {\n      clipArea(ctx, area);\n    }\n\n    const items = this.getLabelItems(chartArea);\n    for (const item of items) {\n      const renderTextOptions = item.options;\n      const tickFont = item.font;\n      const label = item.label;\n      const y = item.textOffset;\n      renderText(ctx, label, 0, y, tickFont, renderTextOptions);\n    }\n\n    if (area) {\n      unclipArea(ctx);\n    }\n  }\n\n  /**\n\t * @protected\n\t */\n  drawTitle() {\n    const {ctx, options: {position, title, reverse}} = this;\n\n    if (!title.display) {\n      return;\n    }\n\n    const font = toFont(title.font);\n    const padding = toPadding(title.padding);\n    const align = title.align;\n    let offset = font.lineHeight / 2;\n\n    if (position === 'bottom' || position === 'center' || isObject(position)) {\n      offset += padding.bottom;\n      if (isArray(title.text)) {\n        offset += font.lineHeight * (title.text.length - 1);\n      }\n    } else {\n      offset += padding.top;\n    }\n\n    const {titleX, titleY, maxWidth, rotation} = titleArgs(this, offset, position, align);\n\n    renderText(ctx, title.text, 0, 0, font, {\n      color: title.color,\n      maxWidth,\n      rotation,\n      textAlign: titleAlign(align, position, reverse),\n      textBaseline: 'middle',\n      translation: [titleX, titleY],\n    });\n  }\n\n  draw(chartArea) {\n    if (!this._isVisible()) {\n      return;\n    }\n\n    this.drawBackground();\n    this.drawGrid(chartArea);\n    this.drawBorder();\n    this.drawTitle();\n    this.drawLabels(chartArea);\n  }\n\n  /**\n\t * @return {object[]}\n\t * @private\n\t */\n  _layers() {\n    const opts = this.options;\n    const tz = opts.ticks && opts.ticks.z || 0;\n    const gz = valueOrDefault(opts.grid && opts.grid.z, -1);\n    const bz = valueOrDefault(opts.border && opts.border.z, 0);\n\n    if (!this._isVisible() || this.draw !== Scale.prototype.draw) {\n      // backward compatibility: draw has been overridden by custom scale\n      return [{\n        z: tz,\n        draw: (chartArea) => {\n          this.draw(chartArea);\n        }\n      }];\n    }\n\n    return [{\n      z: gz,\n      draw: (chartArea) => {\n        this.drawBackground();\n        this.drawGrid(chartArea);\n        this.drawTitle();\n      }\n    }, {\n      z: bz,\n      draw: () => {\n        this.drawBorder();\n      }\n    }, {\n      z: tz,\n      draw: (chartArea) => {\n        this.drawLabels(chartArea);\n      }\n    }];\n  }\n\n  /**\n\t * Returns visible dataset metas that are attached to this scale\n\t * @param {string} [type] - if specified, also filter by dataset type\n\t * @return {object[]}\n\t */\n  getMatchingVisibleMetas(type) {\n    const metas = this.chart.getSortedVisibleDatasetMetas();\n    const axisID = this.axis + 'AxisID';\n    const result = [];\n    let i, ilen;\n\n    for (i = 0, ilen = metas.length; i < ilen; ++i) {\n      const meta = metas[i];\n      if (meta[axisID] === this.id && (!type || meta.type === type)) {\n        result.push(meta);\n      }\n    }\n    return result;\n  }\n\n  /**\n\t * @param {number} index\n\t * @return {object}\n\t * @protected\n \t */\n  _resolveTickFontOptions(index) {\n    const opts = this.options.ticks.setContext(this.getContext(index));\n    return toFont(opts.font);\n  }\n\n  /**\n   * @protected\n   */\n  _maxDigits() {\n    const fontSize = this._resolveTickFontOptions(0).lineHeight;\n    return (this.isHorizontal() ? this.width : this.height) / fontSize;\n  }\n}\n", "import {merge} from '../helpers/index.js';\nimport defaults, {overrides} from './core.defaults.js';\n\n/**\n * @typedef {{id: string, defaults: any, overrides?: any, defaultRoutes: any}} IChartComponent\n */\n\nexport default class TypedRegistry {\n  constructor(type, scope, override) {\n    this.type = type;\n    this.scope = scope;\n    this.override = override;\n    this.items = Object.create(null);\n  }\n\n  isForType(type) {\n    return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);\n  }\n\n  /**\n\t * @param {IChartComponent} item\n\t * @returns {string} The scope where items defaults were registered to.\n\t */\n  register(item) {\n    const proto = Object.getPrototypeOf(item);\n    let parentScope;\n\n    if (isIChartComponent(proto)) {\n      // Make sure the parent is registered and note the scope where its defaults are.\n      parentScope = this.register(proto);\n    }\n\n    const items = this.items;\n    const id = item.id;\n    const scope = this.scope + '.' + id;\n\n    if (!id) {\n      throw new Error('class does not have id: ' + item);\n    }\n\n    if (id in items) {\n      // already registered\n      return scope;\n    }\n\n    items[id] = item;\n    registerDefaults(item, scope, parentScope);\n    if (this.override) {\n      defaults.override(item.id, item.overrides);\n    }\n\n    return scope;\n  }\n\n  /**\n\t * @param {string} id\n\t * @returns {object?}\n\t */\n  get(id) {\n    return this.items[id];\n  }\n\n  /**\n\t * @param {IChartComponent} item\n\t */\n  unregister(item) {\n    const items = this.items;\n    const id = item.id;\n    const scope = this.scope;\n\n    if (id in items) {\n      delete items[id];\n    }\n\n    if (scope && id in defaults[scope]) {\n      delete defaults[scope][id];\n      if (this.override) {\n        delete overrides[id];\n      }\n    }\n  }\n}\n\nfunction registerDefaults(item, scope, parentScope) {\n  // Inherit the parent's defaults and keep existing defaults\n  const itemDefaults = merge(Object.create(null), [\n    parentScope ? defaults.get(parentScope) : {},\n    defaults.get(scope),\n    item.defaults\n  ]);\n\n  defaults.set(scope, itemDefaults);\n\n  if (item.defaultRoutes) {\n    routeDefaults(scope, item.defaultRoutes);\n  }\n\n  if (item.descriptors) {\n    defaults.describe(scope, item.descriptors);\n  }\n}\n\nfunction routeDefaults(scope, routes) {\n  Object.keys(routes).forEach(property => {\n    const propertyParts = property.split('.');\n    const sourceName = propertyParts.pop();\n    const sourceScope = [scope].concat(propertyParts).join('.');\n    const parts = routes[property].split('.');\n    const targetName = parts.pop();\n    const targetScope = parts.join('.');\n    defaults.route(sourceScope, sourceName, targetScope, targetName);\n  });\n}\n\nfunction isIChartComponent(proto) {\n  return 'id' in proto && 'defaults' in proto;\n}\n", "import DatasetController from './core.datasetController.js';\nimport Element from './core.element.js';\nimport Scale from './core.scale.js';\nimport TypedRegistry from './core.typedRegistry.js';\nimport {each, callback as call, _capitalize} from '../helpers/helpers.core.js';\n\n/**\n * Please use the module's default export which provides a singleton instance\n * Note: class is exported for typedoc\n */\nexport class Registry {\n  constructor() {\n    this.controllers = new TypedRegistry(DatasetController, 'datasets', true);\n    this.elements = new TypedRegistry(Element, 'elements');\n    this.plugins = new TypedRegistry(Object, 'plugins');\n    this.scales = new TypedRegistry(Scale, 'scales');\n    // Order is important, Scale has Element in prototype chain,\n    // so Scales must be before Elements. Plugins are a fallback, so not listed here.\n    this._typedRegistries = [this.controllers, this.scales, this.elements];\n  }\n\n  /**\n\t * @param  {...any} args\n\t */\n  add(...args) {\n    this._each('register', args);\n  }\n\n  remove(...args) {\n    this._each('unregister', args);\n  }\n\n  /**\n\t * @param  {...typeof DatasetController} args\n\t */\n  addControllers(...args) {\n    this._each('register', args, this.controllers);\n  }\n\n  /**\n\t * @param  {...typeof Element} args\n\t */\n  addElements(...args) {\n    this._each('register', args, this.elements);\n  }\n\n  /**\n\t * @param  {...any} args\n\t */\n  addPlugins(...args) {\n    this._each('register', args, this.plugins);\n  }\n\n  /**\n\t * @param  {...typeof Scale} args\n\t */\n  addScales(...args) {\n    this._each('register', args, this.scales);\n  }\n\n  /**\n\t * @param {string} id\n\t * @returns {typeof DatasetController}\n\t */\n  getController(id) {\n    return this._get(id, this.controllers, 'controller');\n  }\n\n  /**\n\t * @param {string} id\n\t * @returns {typeof Element}\n\t */\n  getElement(id) {\n    return this._get(id, this.elements, 'element');\n  }\n\n  /**\n\t * @param {string} id\n\t * @returns {object}\n\t */\n  getPlugin(id) {\n    return this._get(id, this.plugins, 'plugin');\n  }\n\n  /**\n\t * @param {string} id\n\t * @returns {typeof Scale}\n\t */\n  getScale(id) {\n    return this._get(id, this.scales, 'scale');\n  }\n\n  /**\n\t * @param  {...typeof DatasetController} args\n\t */\n  removeControllers(...args) {\n    this._each('unregister', args, this.controllers);\n  }\n\n  /**\n\t * @param  {...typeof Element} args\n\t */\n  removeElements(...args) {\n    this._each('unregister', args, this.elements);\n  }\n\n  /**\n\t * @param  {...any} args\n\t */\n  removePlugins(...args) {\n    this._each('unregister', args, this.plugins);\n  }\n\n  /**\n\t * @param  {...typeof Scale} args\n\t */\n  removeScales(...args) {\n    this._each('unregister', args, this.scales);\n  }\n\n  /**\n\t * @private\n\t */\n  _each(method, args, typedRegistry) {\n    [...args].forEach(arg => {\n      const reg = typedRegistry || this._getRegistryForType(arg);\n      if (typedRegistry || reg.isForType(arg) || (reg === this.plugins && arg.id)) {\n        this._exec(method, reg, arg);\n      } else {\n        // Handle loopable args\n        // Use case:\n        //  import * as plugins from './plugins.js';\n        //  Chart.register(plugins);\n        each(arg, item => {\n          // If there are mixed types in the loopable, make sure those are\n          // registered in correct registry\n          // Use case: (treemap exporting controller, elements etc)\n          //  import * as treemap from 'chartjs-chart-treemap.js';\n          //  Chart.register(treemap);\n\n          const itemReg = typedRegistry || this._getRegistryForType(item);\n          this._exec(method, itemReg, item);\n        });\n      }\n    });\n  }\n\n  /**\n\t * @private\n\t */\n  _exec(method, registry, component) {\n    const camelMethod = _capitalize(method);\n    call(component['before' + camelMethod], [], component); // beforeRegister / beforeUnregister\n    registry[method](component);\n    call(component['after' + camelMethod], [], component); // afterRegister / afterUnregister\n  }\n\n  /**\n\t * @private\n\t */\n  _getRegistryForType(type) {\n    for (let i = 0; i < this._typedRegistries.length; i++) {\n      const reg = this._typedRegistries[i];\n      if (reg.isForType(type)) {\n        return reg;\n      }\n    }\n    // plugins is the fallback registry\n    return this.plugins;\n  }\n\n  /**\n\t * @private\n\t */\n  _get(id, typedRegistry, type) {\n    const item = typedRegistry.get(id);\n    if (item === undefined) {\n      throw new Error('\"' + id + '\" is not a registered ' + type + '.');\n    }\n    return item;\n  }\n\n}\n\n// singleton instance\nexport default /* #__PURE__ */ new Registry();\n", "import registry from './core.registry.js';\nimport {callback as callCallback, isNullOrUndef, valueOrDefault} from '../helpers/helpers.core.js';\n\n/**\n * @typedef { import('./core.controller.js').default } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../plugins/plugin.tooltip.js').default } Tooltip\n */\n\n/**\n * @callback filterCallback\n * @param {{plugin: object, options: object}} value\n * @param {number} [index]\n * @param {array} [array]\n * @param {object} [thisArg]\n * @return {boolean}\n */\n\n\nexport default class PluginService {\n  constructor() {\n    this._init = [];\n  }\n\n  /**\n\t * Calls enabled plugins for `chart` on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {Chart} chart - The chart instance for which plugins should be called.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {object} [args] - Extra arguments to apply to the hook call.\n   * @param {filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n  notify(chart, hook, args, filter) {\n    if (hook === 'beforeInit') {\n      this._init = this._createDescriptors(chart, true);\n      this._notify(this._init, chart, 'install');\n    }\n\n    const descriptors = filter ? this._descriptors(chart).filter(filter) : this._descriptors(chart);\n    const result = this._notify(descriptors, chart, hook, args);\n\n    if (hook === 'afterDestroy') {\n      this._notify(descriptors, chart, 'stop');\n      this._notify(this._init, chart, 'uninstall');\n    }\n    return result;\n  }\n\n  /**\n\t * @private\n\t */\n  _notify(descriptors, chart, hook, args) {\n    args = args || {};\n    for (const descriptor of descriptors) {\n      const plugin = descriptor.plugin;\n      const method = plugin[hook];\n      const params = [chart, args, descriptor.options];\n      if (callCallback(method, params, plugin) === false && args.cancelable) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  invalidate() {\n    // When plugins are registered, there is the possibility of a double\n    // invalidate situation. In this case, we only want to invalidate once.\n    // If we invalidate multiple times, the `_oldCache` is lost and all of the\n    // plugins are restarted without being correctly stopped.\n    // See https://github.com/chartjs/Chart.js/issues/8147\n    if (!isNullOrUndef(this._cache)) {\n      this._oldCache = this._cache;\n      this._cache = undefined;\n    }\n  }\n\n  /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n  _descriptors(chart) {\n    if (this._cache) {\n      return this._cache;\n    }\n\n    const descriptors = this._cache = this._createDescriptors(chart);\n\n    this._notifyStateChanges(chart);\n\n    return descriptors;\n  }\n\n  _createDescriptors(chart, all) {\n    const config = chart && chart.config;\n    const options = valueOrDefault(config.options && config.options.plugins, {});\n    const plugins = allPlugins(config);\n    // options === false => all plugins are disabled\n    return options === false && !all ? [] : createDescriptors(chart, plugins, options, all);\n  }\n\n  /**\n\t * @param {Chart} chart\n\t * @private\n\t */\n  _notifyStateChanges(chart) {\n    const previousDescriptors = this._oldCache || [];\n    const descriptors = this._cache;\n    const diff = (a, b) => a.filter(x => !b.some(y => x.plugin.id === y.plugin.id));\n    this._notify(diff(previousDescriptors, descriptors), chart, 'stop');\n    this._notify(diff(descriptors, previousDescriptors), chart, 'start');\n  }\n}\n\n/**\n * @param {import('./core.config.js').default} config\n */\nfunction allPlugins(config) {\n  const localIds = {};\n  const plugins = [];\n  const keys = Object.keys(registry.plugins.items);\n  for (let i = 0; i < keys.length; i++) {\n    plugins.push(registry.getPlugin(keys[i]));\n  }\n\n  const local = config.plugins || [];\n  for (let i = 0; i < local.length; i++) {\n    const plugin = local[i];\n\n    if (plugins.indexOf(plugin) === -1) {\n      plugins.push(plugin);\n      localIds[plugin.id] = true;\n    }\n  }\n\n  return {plugins, localIds};\n}\n\nfunction getOpts(options, all) {\n  if (!all && options === false) {\n    return null;\n  }\n  if (options === true) {\n    return {};\n  }\n  return options;\n}\n\nfunction createDescriptors(chart, {plugins, localIds}, options, all) {\n  const result = [];\n  const context = chart.getContext();\n\n  for (const plugin of plugins) {\n    const id = plugin.id;\n    const opts = getOpts(options[id], all);\n    if (opts === null) {\n      continue;\n    }\n    result.push({\n      plugin,\n      options: pluginOpts(chart.config, {plugin, local: localIds[id]}, opts, context)\n    });\n  }\n\n  return result;\n}\n\nfunction pluginOpts(config, {plugin, local}, opts, context) {\n  const keys = config.pluginScopeKeys(plugin);\n  const scopes = config.getOptionScopes(opts, keys);\n  if (local && plugin.defaults) {\n    // make sure plugin defaults are in scopes for local (not registered) plugins\n    scopes.push(plugin.defaults);\n  }\n  return config.createResolver(scopes, context, [''], {\n    // These are just defaults that plugins can override\n    scriptable: false,\n    indexable: false,\n    allKeys: true\n  });\n}\n", "import defaults, {overrides, descriptors} from './core.defaults.js';\nimport {mergeIf, resolveObjectKey, isArray, isFunction, valueOrDefault, isObject} from '../helpers/helpers.core.js';\nimport {_attachContext, _createResolver, _descriptors} from '../helpers/helpers.config.js';\n\nexport function getIndexAxis(type, options) {\n  const datasetDefaults = defaults.datasets[type] || {};\n  const datasetOptions = (options.datasets || {})[type] || {};\n  return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || 'x';\n}\n\nfunction getAxisFromDefaultScaleID(id, indexAxis) {\n  let axis = id;\n  if (id === '_index_') {\n    axis = indexAxis;\n  } else if (id === '_value_') {\n    axis = indexAxis === 'x' ? 'y' : 'x';\n  }\n  return axis;\n}\n\nfunction getDefaultScaleIDFromAxis(axis, indexAxis) {\n  return axis === indexAxis ? '_index_' : '_value_';\n}\n\nfunction idMatchesAxis(id) {\n  if (id === 'x' || id === 'y' || id === 'r') {\n    return id;\n  }\n}\n\nfunction axisFromPosition(position) {\n  if (position === 'top' || position === 'bottom') {\n    return 'x';\n  }\n  if (position === 'left' || position === 'right') {\n    return 'y';\n  }\n}\n\nexport function determineAxis(id, ...scaleOptions) {\n  if (idMatchesAxis(id)) {\n    return id;\n  }\n  for (const opts of scaleOptions) {\n    const axis = opts.axis\n      || axisFromPosition(opts.position)\n      || id.length > 1 && idMatchesAxis(id[0].toLowerCase());\n    if (axis) {\n      return axis;\n    }\n  }\n  throw new Error(`Cannot determine type of '${id}' axis. Please provide 'axis' or 'position' option.`);\n}\n\nfunction getAxisFromDataset(id, axis, dataset) {\n  if (dataset[axis + 'AxisID'] === id) {\n    return {axis};\n  }\n}\n\nfunction retrieveAxisFromDatasets(id, config) {\n  if (config.data && config.data.datasets) {\n    const boundDs = config.data.datasets.filter((d) => d.xAxisID === id || d.yAxisID === id);\n    if (boundDs.length) {\n      return getAxisFromDataset(id, 'x', boundDs[0]) || getAxisFromDataset(id, 'y', boundDs[0]);\n    }\n  }\n  return {};\n}\n\nfunction mergeScaleConfig(config, options) {\n  const chartDefaults = overrides[config.type] || {scales: {}};\n  const configScales = options.scales || {};\n  const chartIndexAxis = getIndexAxis(config.type, options);\n  const scales = Object.create(null);\n\n  // First figure out first scale id's per axis.\n  Object.keys(configScales).forEach(id => {\n    const scaleConf = configScales[id];\n    if (!isObject(scaleConf)) {\n      return console.error(`Invalid scale configuration for scale: ${id}`);\n    }\n    if (scaleConf._proxy) {\n      return console.warn(`Ignoring resolver passed as options for scale: ${id}`);\n    }\n    const axis = determineAxis(id, scaleConf, retrieveAxisFromDatasets(id, config), defaults.scales[scaleConf.type]);\n    const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);\n    const defaultScaleOptions = chartDefaults.scales || {};\n    scales[id] = mergeIf(Object.create(null), [{axis}, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);\n  });\n\n  // Then merge dataset defaults to scale configs\n  config.data.datasets.forEach(dataset => {\n    const type = dataset.type || config.type;\n    const indexAxis = dataset.indexAxis || getIndexAxis(type, options);\n    const datasetDefaults = overrides[type] || {};\n    const defaultScaleOptions = datasetDefaults.scales || {};\n    Object.keys(defaultScaleOptions).forEach(defaultID => {\n      const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);\n      const id = dataset[axis + 'AxisID'] || axis;\n      scales[id] = scales[id] || Object.create(null);\n      mergeIf(scales[id], [{axis}, configScales[id], defaultScaleOptions[defaultID]]);\n    });\n  });\n\n  // apply scale defaults, if not overridden by dataset defaults\n  Object.keys(scales).forEach(key => {\n    const scale = scales[key];\n    mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);\n  });\n\n  return scales;\n}\n\nfunction initOptions(config) {\n  const options = config.options || (config.options = {});\n\n  options.plugins = valueOrDefault(options.plugins, {});\n  options.scales = mergeScaleConfig(config, options);\n}\n\nfunction initData(data) {\n  data = data || {};\n  data.datasets = data.datasets || [];\n  data.labels = data.labels || [];\n  return data;\n}\n\nfunction initConfig(config) {\n  config = config || {};\n  config.data = initData(config.data);\n\n  initOptions(config);\n\n  return config;\n}\n\nconst keyCache = new Map();\nconst keysCached = new Set();\n\nfunction cachedKeys(cacheKey, generate) {\n  let keys = keyCache.get(cacheKey);\n  if (!keys) {\n    keys = generate();\n    keyCache.set(cacheKey, keys);\n    keysCached.add(keys);\n  }\n  return keys;\n}\n\nconst addIfFound = (set, obj, key) => {\n  const opts = resolveObjectKey(obj, key);\n  if (opts !== undefined) {\n    set.add(opts);\n  }\n};\n\nexport default class Config {\n  constructor(config) {\n    this._config = initConfig(config);\n    this._scopeCache = new Map();\n    this._resolverCache = new Map();\n  }\n\n  get platform() {\n    return this._config.platform;\n  }\n\n  get type() {\n    return this._config.type;\n  }\n\n  set type(type) {\n    this._config.type = type;\n  }\n\n  get data() {\n    return this._config.data;\n  }\n\n  set data(data) {\n    this._config.data = initData(data);\n  }\n\n  get options() {\n    return this._config.options;\n  }\n\n  set options(options) {\n    this._config.options = options;\n  }\n\n  get plugins() {\n    return this._config.plugins;\n  }\n\n  update() {\n    const config = this._config;\n    this.clearCache();\n    initOptions(config);\n  }\n\n  clearCache() {\n    this._scopeCache.clear();\n    this._resolverCache.clear();\n  }\n\n  /**\n   * Returns the option scope keys for resolving dataset options.\n   * These keys do not include the dataset itself, because it is not under options.\n   * @param {string} datasetType\n   * @return {string[][]}\n   */\n  datasetScopeKeys(datasetType) {\n    return cachedKeys(datasetType,\n      () => [[\n        `datasets.${datasetType}`,\n        ''\n      ]]);\n  }\n\n  /**\n   * Returns the option scope keys for resolving dataset animation options.\n   * These keys do not include the dataset itself, because it is not under options.\n   * @param {string} datasetType\n   * @param {string} transition\n   * @return {string[][]}\n   */\n  datasetAnimationScopeKeys(datasetType, transition) {\n    return cachedKeys(`${datasetType}.transition.${transition}`,\n      () => [\n        [\n          `datasets.${datasetType}.transitions.${transition}`,\n          `transitions.${transition}`,\n        ],\n        // The following are used for looking up the `animations` and `animation` keys\n        [\n          `datasets.${datasetType}`,\n          ''\n        ]\n      ]);\n  }\n\n  /**\n   * Returns the options scope keys for resolving element options that belong\n   * to an dataset. These keys do not include the dataset itself, because it\n   * is not under options.\n   * @param {string} datasetType\n   * @param {string} elementType\n   * @return {string[][]}\n   */\n  datasetElementScopeKeys(datasetType, elementType) {\n    return cachedKeys(`${datasetType}-${elementType}`,\n      () => [[\n        `datasets.${datasetType}.elements.${elementType}`,\n        `datasets.${datasetType}`,\n        `elements.${elementType}`,\n        ''\n      ]]);\n  }\n\n  /**\n   * Returns the options scope keys for resolving plugin options.\n   * @param {{id: string, additionalOptionScopes?: string[]}} plugin\n   * @return {string[][]}\n   */\n  pluginScopeKeys(plugin) {\n    const id = plugin.id;\n    const type = this.type;\n    return cachedKeys(`${type}-plugin-${id}`,\n      () => [[\n        `plugins.${id}`,\n        ...plugin.additionalOptionScopes || [],\n      ]]);\n  }\n\n  /**\n   * @private\n   */\n  _cachedScopes(mainScope, resetCache) {\n    const _scopeCache = this._scopeCache;\n    let cache = _scopeCache.get(mainScope);\n    if (!cache || resetCache) {\n      cache = new Map();\n      _scopeCache.set(mainScope, cache);\n    }\n    return cache;\n  }\n\n  /**\n   * Resolves the objects from options and defaults for option value resolution.\n   * @param {object} mainScope - The main scope object for options\n   * @param {string[][]} keyLists - The arrays of keys in resolution order\n   * @param {boolean} [resetCache] - reset the cache for this mainScope\n   */\n  getOptionScopes(mainScope, keyLists, resetCache) {\n    const {options, type} = this;\n    const cache = this._cachedScopes(mainScope, resetCache);\n    const cached = cache.get(keyLists);\n    if (cached) {\n      return cached;\n    }\n\n    const scopes = new Set();\n\n    keyLists.forEach(keys => {\n      if (mainScope) {\n        scopes.add(mainScope);\n        keys.forEach(key => addIfFound(scopes, mainScope, key));\n      }\n      keys.forEach(key => addIfFound(scopes, options, key));\n      keys.forEach(key => addIfFound(scopes, overrides[type] || {}, key));\n      keys.forEach(key => addIfFound(scopes, defaults, key));\n      keys.forEach(key => addIfFound(scopes, descriptors, key));\n    });\n\n    const array = Array.from(scopes);\n    if (array.length === 0) {\n      array.push(Object.create(null));\n    }\n    if (keysCached.has(keyLists)) {\n      cache.set(keyLists, array);\n    }\n    return array;\n  }\n\n  /**\n   * Returns the option scopes for resolving chart options\n   * @return {object[]}\n   */\n  chartOptionScopes() {\n    const {options, type} = this;\n\n    return [\n      options,\n      overrides[type] || {},\n      defaults.datasets[type] || {}, // https://github.com/chartjs/Chart.js/issues/8531\n      {type},\n      defaults,\n      descriptors\n    ];\n  }\n\n  /**\n   * @param {object[]} scopes\n   * @param {string[]} names\n   * @param {function|object} context\n   * @param {string[]} [prefixes]\n   * @return {object}\n   */\n  resolveNamedOptions(scopes, names, context, prefixes = ['']) {\n    const result = {$shared: true};\n    const {resolver, subPrefixes} = getResolver(this._resolverCache, scopes, prefixes);\n    let options = resolver;\n    if (needContext(resolver, names)) {\n      result.$shared = false;\n      context = isFunction(context) ? context() : context;\n      // subResolver is passed to scriptable options. It should not resolve to hover options.\n      const subResolver = this.createResolver(scopes, context, subPrefixes);\n      options = _attachContext(resolver, context, subResolver);\n    }\n\n    for (const prop of names) {\n      result[prop] = options[prop];\n    }\n    return result;\n  }\n\n  /**\n   * @param {object[]} scopes\n   * @param {object} [context]\n   * @param {string[]} [prefixes]\n   * @param {{scriptable: boolean, indexable: boolean, allKeys?: boolean}} [descriptorDefaults]\n   */\n  createResolver(scopes, context, prefixes = [''], descriptorDefaults) {\n    const {resolver} = getResolver(this._resolverCache, scopes, prefixes);\n    return isObject(context)\n      ? _attachContext(resolver, context, undefined, descriptorDefaults)\n      : resolver;\n  }\n}\n\nfunction getResolver(resolverCache, scopes, prefixes) {\n  let cache = resolverCache.get(scopes);\n  if (!cache) {\n    cache = new Map();\n    resolverCache.set(scopes, cache);\n  }\n  const cacheKey = prefixes.join();\n  let cached = cache.get(cacheKey);\n  if (!cached) {\n    const resolver = _createResolver(scopes, prefixes);\n    cached = {\n      resolver,\n      subPrefixes: prefixes.filter(p => !p.toLowerCase().includes('hover'))\n    };\n    cache.set(cacheKey, cached);\n  }\n  return cached;\n}\n\nconst hasFunction = value => isObject(value)\n  && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);\n\nfunction needContext(proxy, names) {\n  const {isScriptable, isIndexable} = _descriptors(proxy);\n\n  for (const prop of names) {\n    const scriptable = isScriptable(prop);\n    const indexable = isIndexable(prop);\n    const value = (indexable || scriptable) && proxy[prop];\n    if ((scriptable && (isFunction(value) || hasFunction(value)))\n      || (indexable && isArray(value))) {\n      return true;\n    }\n  }\n  return false;\n}\n", "import animator from './core.animator.js';\nimport defaults, {overrides} from './core.defaults.js';\nimport Interaction from './core.interaction.js';\nimport layouts from './core.layouts.js';\nimport {_detectPlatform} from '../platform/index.js';\nimport PluginService from './core.plugins.js';\nimport registry from './core.registry.js';\nimport Config, {determineAxis, getIndexAxis} from './core.config.js';\nimport {retinaScale, _isDomSupported} from '../helpers/helpers.dom.js';\nimport {each, callback as callCallback, uid, valueOrDefault, _elementsEqual, isNullOrUndef, setsEqual, defined, isFunction, _isClickEvent} from '../helpers/helpers.core.js';\nimport {clearCanvas, clipArea, createContext, unclipArea, _isPointInArea} from '../helpers/index.js';\n// @ts-ignore\nimport {version} from '../../package.json';\nimport {debounce} from '../helpers/helpers.extras.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').Point } Point\n */\n\nconst KNOWN_POSITIONS = ['top', 'bottom', 'left', 'right', 'chartArea'];\nfunction positionIsHorizontal(position, axis) {\n  return position === 'top' || position === 'bottom' || (KNOWN_POSITIONS.indexOf(position) === -1 && axis === 'x');\n}\n\nfunction compare2Level(l1, l2) {\n  return function(a, b) {\n    return a[l1] === b[l1]\n      ? a[l2] - b[l2]\n      : a[l1] - b[l1];\n  };\n}\n\nfunction onAnimationsComplete(context) {\n  const chart = context.chart;\n  const animationOptions = chart.options.animation;\n\n  chart.notifyPlugins('afterRender');\n  callCallback(animationOptions && animationOptions.onComplete, [context], chart);\n}\n\nfunction onAnimationProgress(context) {\n  const chart = context.chart;\n  const animationOptions = chart.options.animation;\n  callCallback(animationOptions && animationOptions.onProgress, [context], chart);\n}\n\n/**\n * Chart.js can take a string id of a canvas element, a 2d context, or a canvas element itself.\n * Attempt to unwrap the item passed into the chart constructor so that it is a canvas element (if possible).\n */\nfunction getCanvas(item) {\n  if (_isDomSupported() && typeof item === 'string') {\n    item = document.getElementById(item);\n  } else if (item && item.length) {\n    // Support for array based queries (such as jQuery)\n    item = item[0];\n  }\n\n  if (item && item.canvas) {\n    // Support for any object associated to a canvas (including a context2d)\n    item = item.canvas;\n  }\n  return item;\n}\n\nconst instances = {};\nconst getChart = (key) => {\n  const canvas = getCanvas(key);\n  return Object.values(instances).filter((c) => c.canvas === canvas).pop();\n};\n\nfunction moveNumericKeys(obj, start, move) {\n  const keys = Object.keys(obj);\n  for (const key of keys) {\n    const intKey = +key;\n    if (intKey >= start) {\n      const value = obj[key];\n      delete obj[key];\n      if (move > 0 || intKey > start) {\n        obj[intKey + move] = value;\n      }\n    }\n  }\n}\n\n/**\n * @param {ChartEvent} e\n * @param {ChartEvent|null} lastEvent\n * @param {boolean} inChartArea\n * @param {boolean} isClick\n * @returns {ChartEvent|null}\n */\nfunction determineLastEvent(e, lastEvent, inChartArea, isClick) {\n  if (!inChartArea || e.type === 'mouseout') {\n    return null;\n  }\n  if (isClick) {\n    return lastEvent;\n  }\n  return e;\n}\n\nfunction getSizeForArea(scale, chartArea, field) {\n  return scale.options.clip ? scale[field] : chartArea[field];\n}\n\nfunction getDatasetArea(meta, chartArea) {\n  const {xScale, yScale} = meta;\n  if (xScale && yScale) {\n    return {\n      left: getSizeForArea(xScale, chartArea, 'left'),\n      right: getSizeForArea(xScale, chartArea, 'right'),\n      top: getSizeForArea(yScale, chartArea, 'top'),\n      bottom: getSizeForArea(yScale, chartArea, 'bottom')\n    };\n  }\n  return chartArea;\n}\n\nclass Chart {\n\n  static defaults = defaults;\n  static instances = instances;\n  static overrides = overrides;\n  static registry = registry;\n  static version = version;\n  static getChart = getChart;\n\n  static register(...items) {\n    registry.add(...items);\n    invalidatePlugins();\n  }\n\n  static unregister(...items) {\n    registry.remove(...items);\n    invalidatePlugins();\n  }\n\n  // eslint-disable-next-line max-statements\n  constructor(item, userConfig) {\n    const config = this.config = new Config(userConfig);\n    const initialCanvas = getCanvas(item);\n    const existingChart = getChart(initialCanvas);\n    if (existingChart) {\n      throw new Error(\n        'Canvas is already in use. Chart with ID \\'' + existingChart.id + '\\'' +\n\t\t\t\t' must be destroyed before the canvas with ID \\'' + existingChart.canvas.id + '\\' can be reused.'\n      );\n    }\n\n    const options = config.createResolver(config.chartOptionScopes(), this.getContext());\n\n    this.platform = new (config.platform || _detectPlatform(initialCanvas))();\n    this.platform.updateConfig(config);\n\n    const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);\n    const canvas = context && context.canvas;\n    const height = canvas && canvas.height;\n    const width = canvas && canvas.width;\n\n    this.id = uid();\n    this.ctx = context;\n    this.canvas = canvas;\n    this.width = width;\n    this.height = height;\n    this._options = options;\n    // Store the previously used aspect ratio to determine if a resize\n    // is needed during updates. Do this after _options is set since\n    // aspectRatio uses a getter\n    this._aspectRatio = this.aspectRatio;\n    this._layers = [];\n    this._metasets = [];\n    this._stacks = undefined;\n    this.boxes = [];\n    this.currentDevicePixelRatio = undefined;\n    this.chartArea = undefined;\n    this._active = [];\n    this._lastEvent = undefined;\n    this._listeners = {};\n    /** @type {?{attach?: function, detach?: function, resize?: function}} */\n    this._responsiveListeners = undefined;\n    this._sortedMetasets = [];\n    this.scales = {};\n    this._plugins = new PluginService();\n    this.$proxies = {};\n    this._hiddenIndices = {};\n    this.attached = false;\n    this._animationsDisabled = undefined;\n    this.$context = undefined;\n    this._doResize = debounce(mode => this.update(mode), options.resizeDelay || 0);\n    this._dataChanges = [];\n\n    // Add the chart instance to the global namespace\n    instances[this.id] = this;\n\n    if (!context || !canvas) {\n      // The given item is not a compatible context2d element, let's return before finalizing\n      // the chart initialization but after setting basic chart / controller properties that\n      // can help to figure out that the chart is not valid (e.g chart.canvas !== null);\n      // https://github.com/chartjs/Chart.js/issues/2807\n      console.error(\"Failed to create chart: can't acquire context from the given item\");\n      return;\n    }\n\n    animator.listen(this, 'complete', onAnimationsComplete);\n    animator.listen(this, 'progress', onAnimationProgress);\n\n    this._initialize();\n    if (this.attached) {\n      this.update();\n    }\n  }\n\n  get aspectRatio() {\n    const {options: {aspectRatio, maintainAspectRatio}, width, height, _aspectRatio} = this;\n    if (!isNullOrUndef(aspectRatio)) {\n      // If aspectRatio is defined in options, use that.\n      return aspectRatio;\n    }\n\n    if (maintainAspectRatio && _aspectRatio) {\n      // If maintainAspectRatio is truthly and we had previously determined _aspectRatio, use that\n      return _aspectRatio;\n    }\n\n    // Calculate\n    return height ? width / height : null;\n  }\n\n  get data() {\n    return this.config.data;\n  }\n\n  set data(data) {\n    this.config.data = data;\n  }\n\n  get options() {\n    return this._options;\n  }\n\n  set options(options) {\n    this.config.options = options;\n  }\n\n  get registry() {\n    return registry;\n  }\n\n  /**\n\t * @private\n\t */\n  _initialize() {\n    // Before init plugin notification\n    this.notifyPlugins('beforeInit');\n\n    if (this.options.responsive) {\n      this.resize();\n    } else {\n      retinaScale(this, this.options.devicePixelRatio);\n    }\n\n    this.bindEvents();\n\n    // After init plugin notification\n    this.notifyPlugins('afterInit');\n\n    return this;\n  }\n\n  clear() {\n    clearCanvas(this.canvas, this.ctx);\n    return this;\n  }\n\n  stop() {\n    animator.stop(this);\n    return this;\n  }\n\n  /**\n\t * Resize the chart to its container or to explicit dimensions.\n\t * @param {number} [width]\n\t * @param {number} [height]\n\t */\n  resize(width, height) {\n    if (!animator.running(this)) {\n      this._resize(width, height);\n    } else {\n      this._resizeBeforeDraw = {width, height};\n    }\n  }\n\n  _resize(width, height) {\n    const options = this.options;\n    const canvas = this.canvas;\n    const aspectRatio = options.maintainAspectRatio && this.aspectRatio;\n    const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);\n    const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();\n    const mode = this.width ? 'resize' : 'attach';\n\n    this.width = newSize.width;\n    this.height = newSize.height;\n    this._aspectRatio = this.aspectRatio;\n    if (!retinaScale(this, newRatio, true)) {\n      return;\n    }\n\n    this.notifyPlugins('resize', {size: newSize});\n\n    callCallback(options.onResize, [this, newSize], this);\n\n    if (this.attached) {\n      if (this._doResize(mode)) {\n        // The resize update is delayed, only draw without updating.\n        this.render();\n      }\n    }\n  }\n\n  ensureScalesHaveIDs() {\n    const options = this.options;\n    const scalesOptions = options.scales || {};\n\n    each(scalesOptions, (axisOptions, axisID) => {\n      axisOptions.id = axisID;\n    });\n  }\n\n  /**\n\t * Builds a map of scale ID to scale object for future lookup.\n\t */\n  buildOrUpdateScales() {\n    const options = this.options;\n    const scaleOpts = options.scales;\n    const scales = this.scales;\n    const updated = Object.keys(scales).reduce((obj, id) => {\n      obj[id] = false;\n      return obj;\n    }, {});\n    let items = [];\n\n    if (scaleOpts) {\n      items = items.concat(\n        Object.keys(scaleOpts).map((id) => {\n          const scaleOptions = scaleOpts[id];\n          const axis = determineAxis(id, scaleOptions);\n          const isRadial = axis === 'r';\n          const isHorizontal = axis === 'x';\n          return {\n            options: scaleOptions,\n            dposition: isRadial ? 'chartArea' : isHorizontal ? 'bottom' : 'left',\n            dtype: isRadial ? 'radialLinear' : isHorizontal ? 'category' : 'linear'\n          };\n        })\n      );\n    }\n\n    each(items, (item) => {\n      const scaleOptions = item.options;\n      const id = scaleOptions.id;\n      const axis = determineAxis(id, scaleOptions);\n      const scaleType = valueOrDefault(scaleOptions.type, item.dtype);\n\n      if (scaleOptions.position === undefined || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {\n        scaleOptions.position = item.dposition;\n      }\n\n      updated[id] = true;\n      let scale = null;\n      if (id in scales && scales[id].type === scaleType) {\n        scale = scales[id];\n      } else {\n        const scaleClass = registry.getScale(scaleType);\n        scale = new scaleClass({\n          id,\n          type: scaleType,\n          ctx: this.ctx,\n          chart: this\n        });\n        scales[scale.id] = scale;\n      }\n\n      scale.init(scaleOptions, options);\n    });\n    // clear up discarded scales\n    each(updated, (hasUpdated, id) => {\n      if (!hasUpdated) {\n        delete scales[id];\n      }\n    });\n\n    each(scales, (scale) => {\n      layouts.configure(this, scale, scale.options);\n      layouts.addBox(this, scale);\n    });\n  }\n\n  /**\n\t * @private\n\t */\n  _updateMetasets() {\n    const metasets = this._metasets;\n    const numData = this.data.datasets.length;\n    const numMeta = metasets.length;\n\n    metasets.sort((a, b) => a.index - b.index);\n    if (numMeta > numData) {\n      for (let i = numData; i < numMeta; ++i) {\n        this._destroyDatasetMeta(i);\n      }\n      metasets.splice(numData, numMeta - numData);\n    }\n    this._sortedMetasets = metasets.slice(0).sort(compare2Level('order', 'index'));\n  }\n\n  /**\n\t * @private\n\t */\n  _removeUnreferencedMetasets() {\n    const {_metasets: metasets, data: {datasets}} = this;\n    if (metasets.length > datasets.length) {\n      delete this._stacks;\n    }\n    metasets.forEach((meta, index) => {\n      if (datasets.filter(x => x === meta._dataset).length === 0) {\n        this._destroyDatasetMeta(index);\n      }\n    });\n  }\n\n  buildOrUpdateControllers() {\n    const newControllers = [];\n    const datasets = this.data.datasets;\n    let i, ilen;\n\n    this._removeUnreferencedMetasets();\n\n    for (i = 0, ilen = datasets.length; i < ilen; i++) {\n      const dataset = datasets[i];\n      let meta = this.getDatasetMeta(i);\n      const type = dataset.type || this.config.type;\n\n      if (meta.type && meta.type !== type) {\n        this._destroyDatasetMeta(i);\n        meta = this.getDatasetMeta(i);\n      }\n      meta.type = type;\n      meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);\n      meta.order = dataset.order || 0;\n      meta.index = i;\n      meta.label = '' + dataset.label;\n      meta.visible = this.isDatasetVisible(i);\n\n      if (meta.controller) {\n        meta.controller.updateIndex(i);\n        meta.controller.linkScales();\n      } else {\n        const ControllerClass = registry.getController(type);\n        const {datasetElementType, dataElementType} = defaults.datasets[type];\n        Object.assign(ControllerClass, {\n          dataElementType: registry.getElement(dataElementType),\n          datasetElementType: datasetElementType && registry.getElement(datasetElementType)\n        });\n        meta.controller = new ControllerClass(this, i);\n        newControllers.push(meta.controller);\n      }\n    }\n\n    this._updateMetasets();\n    return newControllers;\n  }\n\n  /**\n\t * Reset the elements of all datasets\n\t * @private\n\t */\n  _resetElements() {\n    each(this.data.datasets, (dataset, datasetIndex) => {\n      this.getDatasetMeta(datasetIndex).controller.reset();\n    }, this);\n  }\n\n  /**\n\t* Resets the chart back to its state before the initial animation\n\t*/\n  reset() {\n    this._resetElements();\n    this.notifyPlugins('reset');\n  }\n\n  update(mode) {\n    const config = this.config;\n\n    config.update();\n    const options = this._options = config.createResolver(config.chartOptionScopes(), this.getContext());\n    const animsDisabled = this._animationsDisabled = !options.animation;\n\n    this._updateScales();\n    this._checkEventBindings();\n    this._updateHiddenIndices();\n\n    // plugins options references might have change, let's invalidate the cache\n    // https://github.com/chartjs/Chart.js/issues/5111#issuecomment-355934167\n    this._plugins.invalidate();\n\n    if (this.notifyPlugins('beforeUpdate', {mode, cancelable: true}) === false) {\n      return;\n    }\n\n    // Make sure dataset controllers are updated and new controllers are reset\n    const newControllers = this.buildOrUpdateControllers();\n\n    this.notifyPlugins('beforeElementsUpdate');\n\n    // Make sure all dataset controllers have correct meta data counts\n    let minPadding = 0;\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; i++) {\n      const {controller} = this.getDatasetMeta(i);\n      const reset = !animsDisabled && newControllers.indexOf(controller) === -1;\n      // New controllers will be reset after the layout pass, so we only want to modify\n      // elements added to new datasets\n      controller.buildOrUpdateElements(reset);\n      minPadding = Math.max(+controller.getMaxOverflow(), minPadding);\n    }\n    minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;\n    this._updateLayout(minPadding);\n\n    // Only reset the controllers if we have animations\n    if (!animsDisabled) {\n      // Can only reset the new controllers after the scales have been updated\n      // Reset is done to get the starting point for the initial animation\n      each(newControllers, (controller) => {\n        controller.reset();\n      });\n    }\n\n    this._updateDatasets(mode);\n\n    // Do this before render so that any plugins that need final scale updates can use it\n    this.notifyPlugins('afterUpdate', {mode});\n\n    this._layers.sort(compare2Level('z', '_idx'));\n\n    // Replay last event from before update, or set hover styles on active elements\n    const {_active, _lastEvent} = this;\n    if (_lastEvent) {\n      this._eventHandler(_lastEvent, true);\n    } else if (_active.length) {\n      this._updateHoverStyles(_active, _active, true);\n    }\n\n    this.render();\n  }\n\n  /**\n   * @private\n   */\n  _updateScales() {\n    each(this.scales, (scale) => {\n      layouts.removeBox(this, scale);\n    });\n\n    this.ensureScalesHaveIDs();\n    this.buildOrUpdateScales();\n  }\n\n  /**\n   * @private\n   */\n  _checkEventBindings() {\n    const options = this.options;\n    const existingEvents = new Set(Object.keys(this._listeners));\n    const newEvents = new Set(options.events);\n\n    if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {\n      // The configured events have changed. Rebind.\n      this.unbindEvents();\n      this.bindEvents();\n    }\n  }\n\n  /**\n   * @private\n   */\n  _updateHiddenIndices() {\n    const {_hiddenIndices} = this;\n    const changes = this._getUniformDataChanges() || [];\n    for (const {method, start, count} of changes) {\n      const move = method === '_removeElements' ? -count : count;\n      moveNumericKeys(_hiddenIndices, start, move);\n    }\n  }\n\n  /**\n   * @private\n   */\n  _getUniformDataChanges() {\n    const _dataChanges = this._dataChanges;\n    if (!_dataChanges || !_dataChanges.length) {\n      return;\n    }\n\n    this._dataChanges = [];\n    const datasetCount = this.data.datasets.length;\n    const makeSet = (idx) => new Set(\n      _dataChanges\n        .filter(c => c[0] === idx)\n        .map((c, i) => i + ',' + c.splice(1).join(','))\n    );\n\n    const changeSet = makeSet(0);\n    for (let i = 1; i < datasetCount; i++) {\n      if (!setsEqual(changeSet, makeSet(i))) {\n        return;\n      }\n    }\n    return Array.from(changeSet)\n      .map(c => c.split(','))\n      .map(a => ({method: a[1], start: +a[2], count: +a[3]}));\n  }\n\n  /**\n\t * Updates the chart layout unless a plugin returns `false` to the `beforeLayout`\n\t * hook, in which case, plugins will not be called on `afterLayout`.\n\t * @private\n\t */\n  _updateLayout(minPadding) {\n    if (this.notifyPlugins('beforeLayout', {cancelable: true}) === false) {\n      return;\n    }\n\n    layouts.update(this, this.width, this.height, minPadding);\n\n    const area = this.chartArea;\n    const noArea = area.width <= 0 || area.height <= 0;\n\n    this._layers = [];\n    each(this.boxes, (box) => {\n      if (noArea && box.position === 'chartArea') {\n        // Skip drawing and configuring chartArea boxes when chartArea is zero or negative\n        return;\n      }\n\n      // configure is called twice, once in core.scale.update and once here.\n      // Here the boxes are fully updated and at their final positions.\n      if (box.configure) {\n        box.configure();\n      }\n      this._layers.push(...box._layers());\n    }, this);\n\n    this._layers.forEach((item, index) => {\n      item._idx = index;\n    });\n\n    this.notifyPlugins('afterLayout');\n  }\n\n  /**\n\t * Updates all datasets unless a plugin returns `false` to the `beforeDatasetsUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetsUpdate`.\n\t * @private\n\t */\n  _updateDatasets(mode) {\n    if (this.notifyPlugins('beforeDatasetsUpdate', {mode, cancelable: true}) === false) {\n      return;\n    }\n\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this.getDatasetMeta(i).controller.configure();\n    }\n\n    for (let i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this._updateDataset(i, isFunction(mode) ? mode({datasetIndex: i}) : mode);\n    }\n\n    this.notifyPlugins('afterDatasetsUpdate', {mode});\n  }\n\n  /**\n\t * Updates dataset at index unless a plugin returns `false` to the `beforeDatasetUpdate`\n\t * hook, in which case, plugins will not be called on `afterDatasetUpdate`.\n\t * @private\n\t */\n  _updateDataset(index, mode) {\n    const meta = this.getDatasetMeta(index);\n    const args = {meta, index, mode, cancelable: true};\n\n    if (this.notifyPlugins('beforeDatasetUpdate', args) === false) {\n      return;\n    }\n\n    meta.controller._update(mode);\n\n    args.cancelable = false;\n    this.notifyPlugins('afterDatasetUpdate', args);\n  }\n\n  render() {\n    if (this.notifyPlugins('beforeRender', {cancelable: true}) === false) {\n      return;\n    }\n\n    if (animator.has(this)) {\n      if (this.attached && !animator.running(this)) {\n        animator.start(this);\n      }\n    } else {\n      this.draw();\n      onAnimationsComplete({chart: this});\n    }\n  }\n\n  draw() {\n    let i;\n    if (this._resizeBeforeDraw) {\n      const {width, height} = this._resizeBeforeDraw;\n      this._resize(width, height);\n      this._resizeBeforeDraw = null;\n    }\n    this.clear();\n\n    if (this.width <= 0 || this.height <= 0) {\n      return;\n    }\n\n    if (this.notifyPlugins('beforeDraw', {cancelable: true}) === false) {\n      return;\n    }\n\n    // Because of plugin hooks (before/afterDatasetsDraw), datasets can't\n    // currently be part of layers. Instead, we draw\n    // layers <= 0 before(default, backward compat), and the rest after\n    const layers = this._layers;\n    for (i = 0; i < layers.length && layers[i].z <= 0; ++i) {\n      layers[i].draw(this.chartArea);\n    }\n\n    this._drawDatasets();\n\n    // Rest of layers\n    for (; i < layers.length; ++i) {\n      layers[i].draw(this.chartArea);\n    }\n\n    this.notifyPlugins('afterDraw');\n  }\n\n  /**\n\t * @private\n\t */\n  _getSortedDatasetMetas(filterVisible) {\n    const metasets = this._sortedMetasets;\n    const result = [];\n    let i, ilen;\n\n    for (i = 0, ilen = metasets.length; i < ilen; ++i) {\n      const meta = metasets[i];\n      if (!filterVisible || meta.visible) {\n        result.push(meta);\n      }\n    }\n\n    return result;\n  }\n\n  /**\n\t * Gets the visible dataset metas in drawing order\n\t * @return {object[]}\n\t */\n  getSortedVisibleDatasetMetas() {\n    return this._getSortedDatasetMetas(true);\n  }\n\n  /**\n\t * Draws all datasets unless a plugin returns `false` to the `beforeDatasetsDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetsDraw`.\n\t * @private\n\t */\n  _drawDatasets() {\n    if (this.notifyPlugins('beforeDatasetsDraw', {cancelable: true}) === false) {\n      return;\n    }\n\n    const metasets = this.getSortedVisibleDatasetMetas();\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      this._drawDataset(metasets[i]);\n    }\n\n    this.notifyPlugins('afterDatasetsDraw');\n  }\n\n  /**\n\t * Draws dataset at index unless a plugin returns `false` to the `beforeDatasetDraw`\n\t * hook, in which case, plugins will not be called on `afterDatasetDraw`.\n\t * @private\n\t */\n  _drawDataset(meta) {\n    const ctx = this.ctx;\n    const clip = meta._clip;\n    const useClip = !clip.disabled;\n    const area = getDatasetArea(meta, this.chartArea);\n    const args = {\n      meta,\n      index: meta.index,\n      cancelable: true\n    };\n\n    if (this.notifyPlugins('beforeDatasetDraw', args) === false) {\n      return;\n    }\n\n    if (useClip) {\n      clipArea(ctx, {\n        left: clip.left === false ? 0 : area.left - clip.left,\n        right: clip.right === false ? this.width : area.right + clip.right,\n        top: clip.top === false ? 0 : area.top - clip.top,\n        bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom\n      });\n    }\n\n    meta.controller.draw();\n\n    if (useClip) {\n      unclipArea(ctx);\n    }\n\n    args.cancelable = false;\n    this.notifyPlugins('afterDatasetDraw', args);\n  }\n\n  /**\n   * Checks whether the given point is in the chart area.\n   * @param {Point} point - in relative coordinates (see, e.g., getRelativePosition)\n   * @returns {boolean}\n   */\n  isPointInArea(point) {\n    return _isPointInArea(point, this.chartArea, this._minPadding);\n  }\n\n  getElementsAtEventForMode(e, mode, options, useFinalPosition) {\n    const method = Interaction.modes[mode];\n    if (typeof method === 'function') {\n      return method(this, e, options, useFinalPosition);\n    }\n\n    return [];\n  }\n\n  getDatasetMeta(datasetIndex) {\n    const dataset = this.data.datasets[datasetIndex];\n    const metasets = this._metasets;\n    let meta = metasets.filter(x => x && x._dataset === dataset).pop();\n\n    if (!meta) {\n      meta = {\n        type: null,\n        data: [],\n        dataset: null,\n        controller: null,\n        hidden: null,\t\t\t// See isDatasetVisible() comment\n        xAxisID: null,\n        yAxisID: null,\n        order: dataset && dataset.order || 0,\n        index: datasetIndex,\n        _dataset: dataset,\n        _parsed: [],\n        _sorted: false\n      };\n      metasets.push(meta);\n    }\n\n    return meta;\n  }\n\n  getContext() {\n    return this.$context || (this.$context = createContext(null, {chart: this, type: 'chart'}));\n  }\n\n  getVisibleDatasetCount() {\n    return this.getSortedVisibleDatasetMetas().length;\n  }\n\n  isDatasetVisible(datasetIndex) {\n    const dataset = this.data.datasets[datasetIndex];\n    if (!dataset) {\n      return false;\n    }\n\n    const meta = this.getDatasetMeta(datasetIndex);\n\n    // meta.hidden is a per chart dataset hidden flag override with 3 states: if true or false,\n    // the dataset.hidden value is ignored, else if null, the dataset hidden state is returned.\n    return typeof meta.hidden === 'boolean' ? !meta.hidden : !dataset.hidden;\n  }\n\n  setDatasetVisibility(datasetIndex, visible) {\n    const meta = this.getDatasetMeta(datasetIndex);\n    meta.hidden = !visible;\n  }\n\n  toggleDataVisibility(index) {\n    this._hiddenIndices[index] = !this._hiddenIndices[index];\n  }\n\n  getDataVisibility(index) {\n    return !this._hiddenIndices[index];\n  }\n\n  /**\n\t * @private\n\t */\n  _updateVisibility(datasetIndex, dataIndex, visible) {\n    const mode = visible ? 'show' : 'hide';\n    const meta = this.getDatasetMeta(datasetIndex);\n    const anims = meta.controller._resolveAnimations(undefined, mode);\n\n    if (defined(dataIndex)) {\n      meta.data[dataIndex].hidden = !visible;\n      this.update();\n    } else {\n      this.setDatasetVisibility(datasetIndex, visible);\n      // Animate visible state, so hide animation can be seen. This could be handled better if update / updateDataset returned a Promise.\n      anims.update(meta, {visible});\n      this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : undefined);\n    }\n  }\n\n  hide(datasetIndex, dataIndex) {\n    this._updateVisibility(datasetIndex, dataIndex, false);\n  }\n\n  show(datasetIndex, dataIndex) {\n    this._updateVisibility(datasetIndex, dataIndex, true);\n  }\n\n  /**\n\t * @private\n\t */\n  _destroyDatasetMeta(datasetIndex) {\n    const meta = this._metasets[datasetIndex];\n    if (meta && meta.controller) {\n      meta.controller._destroy();\n    }\n    delete this._metasets[datasetIndex];\n  }\n\n  _stop() {\n    let i, ilen;\n    this.stop();\n    animator.remove(this);\n\n    for (i = 0, ilen = this.data.datasets.length; i < ilen; ++i) {\n      this._destroyDatasetMeta(i);\n    }\n  }\n\n  destroy() {\n    this.notifyPlugins('beforeDestroy');\n    const {canvas, ctx} = this;\n\n    this._stop();\n    this.config.clearCache();\n\n    if (canvas) {\n      this.unbindEvents();\n      clearCanvas(canvas, ctx);\n      this.platform.releaseContext(ctx);\n      this.canvas = null;\n      this.ctx = null;\n    }\n\n    delete instances[this.id];\n\n    this.notifyPlugins('afterDestroy');\n  }\n\n  toBase64Image(...args) {\n    return this.canvas.toDataURL(...args);\n  }\n\n  /**\n\t * @private\n\t */\n  bindEvents() {\n    this.bindUserEvents();\n    if (this.options.responsive) {\n      this.bindResponsiveEvents();\n    } else {\n      this.attached = true;\n    }\n  }\n\n  /**\n   * @private\n   */\n  bindUserEvents() {\n    const listeners = this._listeners;\n    const platform = this.platform;\n\n    const _add = (type, listener) => {\n      platform.addEventListener(this, type, listener);\n      listeners[type] = listener;\n    };\n\n    const listener = (e, x, y) => {\n      e.offsetX = x;\n      e.offsetY = y;\n      this._eventHandler(e);\n    };\n\n    each(this.options.events, (type) => _add(type, listener));\n  }\n\n  /**\n   * @private\n   */\n  bindResponsiveEvents() {\n    if (!this._responsiveListeners) {\n      this._responsiveListeners = {};\n    }\n    const listeners = this._responsiveListeners;\n    const platform = this.platform;\n\n    const _add = (type, listener) => {\n      platform.addEventListener(this, type, listener);\n      listeners[type] = listener;\n    };\n    const _remove = (type, listener) => {\n      if (listeners[type]) {\n        platform.removeEventListener(this, type, listener);\n        delete listeners[type];\n      }\n    };\n\n    const listener = (width, height) => {\n      if (this.canvas) {\n        this.resize(width, height);\n      }\n    };\n\n    let detached; // eslint-disable-line prefer-const\n    const attached = () => {\n      _remove('attach', attached);\n\n      this.attached = true;\n      this.resize();\n\n      _add('resize', listener);\n      _add('detach', detached);\n    };\n\n    detached = () => {\n      this.attached = false;\n\n      _remove('resize', listener);\n\n      // Stop animating and remove metasets, so when re-attached, the animations start from beginning.\n      this._stop();\n      this._resize(0, 0);\n\n      _add('attach', attached);\n    };\n\n    if (platform.isAttached(this.canvas)) {\n      attached();\n    } else {\n      detached();\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  unbindEvents() {\n    each(this._listeners, (listener, type) => {\n      this.platform.removeEventListener(this, type, listener);\n    });\n    this._listeners = {};\n\n    each(this._responsiveListeners, (listener, type) => {\n      this.platform.removeEventListener(this, type, listener);\n    });\n    this._responsiveListeners = undefined;\n  }\n\n  updateHoverStyle(items, mode, enabled) {\n    const prefix = enabled ? 'set' : 'remove';\n    let meta, item, i, ilen;\n\n    if (mode === 'dataset') {\n      meta = this.getDatasetMeta(items[0].datasetIndex);\n      meta.controller['_' + prefix + 'DatasetHoverStyle']();\n    }\n\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      item = items[i];\n      const controller = item && this.getDatasetMeta(item.datasetIndex).controller;\n      if (controller) {\n        controller[prefix + 'HoverStyle'](item.element, item.datasetIndex, item.index);\n      }\n    }\n  }\n\n  /**\n\t * Get active (hovered) elements\n\t * @returns array\n\t */\n  getActiveElements() {\n    return this._active || [];\n  }\n\n  /**\n\t * Set active (hovered) elements\n\t * @param {array} activeElements New active data points\n\t */\n  setActiveElements(activeElements) {\n    const lastActive = this._active || [];\n    const active = activeElements.map(({datasetIndex, index}) => {\n      const meta = this.getDatasetMeta(datasetIndex);\n      if (!meta) {\n        throw new Error('No dataset found at index ' + datasetIndex);\n      }\n\n      return {\n        datasetIndex,\n        element: meta.data[index],\n        index,\n      };\n    });\n    const changed = !_elementsEqual(active, lastActive);\n\n    if (changed) {\n      this._active = active;\n      // Make sure we don't use the previous mouse event to override the active elements in update.\n      this._lastEvent = null;\n      this._updateHoverStyles(active, lastActive);\n    }\n  }\n\n  /**\n\t * Calls enabled plugins on the specified hook and with the given args.\n\t * This method immediately returns as soon as a plugin explicitly returns false. The\n\t * returned value can be used, for instance, to interrupt the current action.\n\t * @param {string} hook - The name of the plugin method to call (e.g. 'beforeUpdate').\n\t * @param {Object} [args] - Extra arguments to apply to the hook call.\n   * @param {import('./core.plugins.js').filterCallback} [filter] - Filtering function for limiting which plugins are notified\n\t * @returns {boolean} false if any of the plugins return false, else returns true.\n\t */\n  notifyPlugins(hook, args, filter) {\n    return this._plugins.notify(this, hook, args, filter);\n  }\n\n  /**\n   * Check if a plugin with the specific ID is registered and enabled\n   * @param {string} pluginId - The ID of the plugin of which to check if it is enabled\n   * @returns {boolean}\n   */\n  isPluginEnabled(pluginId) {\n    return this._plugins._cache.filter(p => p.plugin.id === pluginId).length === 1;\n  }\n\n  /**\n\t * @private\n\t */\n  _updateHoverStyles(active, lastActive, replay) {\n    const hoverOptions = this.options.hover;\n    const diff = (a, b) => a.filter(x => !b.some(y => x.datasetIndex === y.datasetIndex && x.index === y.index));\n    const deactivated = diff(lastActive, active);\n    const activated = replay ? active : diff(active, lastActive);\n\n    if (deactivated.length) {\n      this.updateHoverStyle(deactivated, hoverOptions.mode, false);\n    }\n\n    if (activated.length && hoverOptions.mode) {\n      this.updateHoverStyle(activated, hoverOptions.mode, true);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _eventHandler(e, replay) {\n    const args = {\n      event: e,\n      replay,\n      cancelable: true,\n      inChartArea: this.isPointInArea(e)\n    };\n    const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e.native.type);\n\n    if (this.notifyPlugins('beforeEvent', args, eventFilter) === false) {\n      return;\n    }\n\n    const changed = this._handleEvent(e, replay, args.inChartArea);\n\n    args.cancelable = false;\n    this.notifyPlugins('afterEvent', args, eventFilter);\n\n    if (changed || args.changed) {\n      this.render();\n    }\n\n    return this;\n  }\n\n  /**\n\t * Handle an event\n\t * @param {ChartEvent} e the event to handle\n\t * @param {boolean} [replay] - true if the event was replayed by `update`\n   * @param {boolean} [inChartArea] - true if the event is inside chartArea\n\t * @return {boolean} true if the chart needs to re-render\n\t * @private\n\t */\n  _handleEvent(e, replay, inChartArea) {\n    const {_active: lastActive = [], options} = this;\n\n    // If the event is replayed from `update`, we should evaluate with the final positions.\n    //\n    // The `replay`:\n    // It's the last event (excluding click) that has occurred before `update`.\n    // So mouse has not moved. It's also over the chart, because there is a `replay`.\n    //\n    // The why:\n    // If animations are active, the elements haven't moved yet compared to state before update.\n    // But if they will, we are activating the elements that would be active, if this check\n    // was done after the animations have completed. => \"final positions\".\n    // If there is no animations, the \"final\" and \"current\" positions are equal.\n    // This is done so we do not have to evaluate the active elements each animation frame\n    // - it would be expensive.\n    const useFinalPosition = replay;\n    const active = this._getActiveElements(e, lastActive, inChartArea, useFinalPosition);\n    const isClick = _isClickEvent(e);\n    const lastEvent = determineLastEvent(e, this._lastEvent, inChartArea, isClick);\n\n    if (inChartArea) {\n      // Set _lastEvent to null while we are processing the event handlers.\n      // This prevents recursion if the handler calls chart.update()\n      this._lastEvent = null;\n\n      // Invoke onHover hook\n      callCallback(options.onHover, [e, active, this], this);\n\n      if (isClick) {\n        callCallback(options.onClick, [e, active, this], this);\n      }\n    }\n\n    const changed = !_elementsEqual(active, lastActive);\n    if (changed || replay) {\n      this._active = active;\n      this._updateHoverStyles(active, lastActive, replay);\n    }\n\n    this._lastEvent = lastEvent;\n\n    return changed;\n  }\n\n  /**\n   * @param {ChartEvent} e - The event\n   * @param {import('../types/index.js').ActiveElement[]} lastActive - Previously active elements\n   * @param {boolean} inChartArea - Is the envent inside chartArea\n   * @param {boolean} useFinalPosition - Should the evaluation be done with current or final (after animation) element positions\n   * @returns {import('../types/index.js').ActiveElement[]} - The active elements\n   * @pravate\n   */\n  _getActiveElements(e, lastActive, inChartArea, useFinalPosition) {\n    if (e.type === 'mouseout') {\n      return [];\n    }\n\n    if (!inChartArea) {\n      // Let user control the active elements outside chartArea. Eg. using Legend.\n      return lastActive;\n    }\n\n    const hoverOptions = this.options.hover;\n    return this.getElementsAtEventForMode(e, hoverOptions.mode, hoverOptions, useFinalPosition);\n  }\n}\n\n// @ts-ignore\nfunction invalidatePlugins() {\n  return each(Chart.instances, (chart) => chart._plugins.invalidate());\n}\n\nexport default Chart;\n", "import Element from '../core/core.element.js';\nimport {_angleBetween, getAngleFromPoint, TAU, HALF_PI, valueOrDefault} from '../helpers/index.js';\nimport {PI, _isBetween, _limitValue} from '../helpers/helpers.math.js';\nimport {_readValueToProps} from '../helpers/helpers.options.js';\nimport type {ArcOptions, Point} from '../types/index.js';\n\n\nfunction clipArc(ctx: CanvasRenderingContext2D, element: ArcElement, endAngle: number) {\n  const {startAngle, pixelMargin, x, y, outerRadius, innerRadius} = element;\n  let angleMargin = pixelMargin / outerRadius;\n\n  // Draw an inner border by clipping the arc and drawing a double-width border\n  // Enlarge the clipping arc by 0.33 pixels to eliminate glitches between borders\n  ctx.beginPath();\n  ctx.arc(x, y, outerRadius, startAngle - angleMargin, endAngle + angleMargin);\n  if (innerRadius > pixelMargin) {\n    angleMargin = pixelMargin / innerRadius;\n    ctx.arc(x, y, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);\n  } else {\n    ctx.arc(x, y, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);\n  }\n  ctx.closePath();\n  ctx.clip();\n}\n\nfunction toRadiusCorners(value) {\n  return _readValueToProps(value, ['outerStart', 'outerEnd', 'innerStart', 'innerEnd']);\n}\n\n/**\n * Parse border radius from the provided options\n */\nfunction parseBorderRadius(arc: ArcElement, innerRadius: number, outerRadius: number, angleDelta: number) {\n  const o = toRadiusCorners(arc.options.borderRadius);\n  const halfThickness = (outerRadius - innerRadius) / 2;\n  const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);\n\n  // Outer limits are complicated. We want to compute the available angular distance at\n  // a radius of outerRadius - borderRadius because for small angular distances, this term limits.\n  // We compute at r = outerRadius - borderRadius because this circle defines the center of the border corners.\n  //\n  // If the borderRadius is large, that value can become negative.\n  // This causes the outer borders to lose their radius entirely, which is rather unexpected. To solve that, if borderRadius > outerRadius\n  // we know that the thickness term will dominate and compute the limits at that point\n  const computeOuterLimit = (val) => {\n    const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;\n    return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));\n  };\n\n  return {\n    outerStart: computeOuterLimit(o.outerStart),\n    outerEnd: computeOuterLimit(o.outerEnd),\n    innerStart: _limitValue(o.innerStart, 0, innerLimit),\n    innerEnd: _limitValue(o.innerEnd, 0, innerLimit),\n  };\n}\n\n/**\n * Convert (r, 𝜃) to (x, y)\n */\nfunction rThetaToXY(r: number, theta: number, x: number, y: number) {\n  return {\n    x: x + r * Math.cos(theta),\n    y: y + r * Math.sin(theta),\n  };\n}\n\n\n/**\n * Path the arc, respecting border radius by separating into left and right halves.\n *\n *   Start      End\n *\n *    1--->a--->2    Outer\n *   /           \\\n *   8           3\n *   |           |\n *   |           |\n *   7           4\n *   \\           /\n *    6<---b<---5    Inner\n */\nfunction pathArc(\n  ctx: CanvasRenderingContext2D,\n  element: ArcElement,\n  offset: number,\n  spacing: number,\n  end: number,\n  circular: boolean,\n) {\n  const {x, y, startAngle: start, pixelMargin, innerRadius: innerR} = element;\n\n  const outerRadius = Math.max(element.outerRadius + spacing + offset - pixelMargin, 0);\n  const innerRadius = innerR > 0 ? innerR + spacing + offset + pixelMargin : 0;\n\n  let spacingOffset = 0;\n  const alpha = end - start;\n\n  if (spacing) {\n    // When spacing is present, it is the same for all items\n    // So we adjust the start and end angle of the arc such that\n    // the distance is the same as it would be without the spacing\n    const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;\n    const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;\n    const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;\n    const adjustedAngle = avNogSpacingRadius !== 0 ? (alpha * avNogSpacingRadius) / (avNogSpacingRadius + spacing) : alpha;\n    spacingOffset = (alpha - adjustedAngle) / 2;\n  }\n\n  const beta = Math.max(0.001, alpha * outerRadius - offset / PI) / outerRadius;\n  const angleOffset = (alpha - beta) / 2;\n  const startAngle = start + angleOffset + spacingOffset;\n  const endAngle = end - angleOffset - spacingOffset;\n  const {outerStart, outerEnd, innerStart, innerEnd} = parseBorderRadius(element, innerRadius, outerRadius, endAngle - startAngle);\n\n  const outerStartAdjustedRadius = outerRadius - outerStart;\n  const outerEndAdjustedRadius = outerRadius - outerEnd;\n  const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;\n  const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;\n\n  const innerStartAdjustedRadius = innerRadius + innerStart;\n  const innerEndAdjustedRadius = innerRadius + innerEnd;\n  const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;\n  const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;\n\n  ctx.beginPath();\n\n  if (circular) {\n    // The first arc segments from point 1 to point a to point 2\n    const outerMidAdjustedAngle = (outerStartAdjustedAngle + outerEndAdjustedAngle) / 2;\n    ctx.arc(x, y, outerRadius, outerStartAdjustedAngle, outerMidAdjustedAngle);\n    ctx.arc(x, y, outerRadius, outerMidAdjustedAngle, outerEndAdjustedAngle);\n\n    // The corner segment from point 2 to point 3\n    if (outerEnd > 0) {\n      const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);\n    }\n\n    // The line from point 3 to point 4\n    const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x, y);\n    ctx.lineTo(p4.x, p4.y);\n\n    // The corner segment from point 4 to point 5\n    if (innerEnd > 0) {\n      const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);\n    }\n\n    // The inner arc from point 5 to point b to point 6\n    const innerMidAdjustedAngle = ((endAngle - (innerEnd / innerRadius)) + (startAngle + (innerStart / innerRadius))) / 2;\n    ctx.arc(x, y, innerRadius, endAngle - (innerEnd / innerRadius), innerMidAdjustedAngle, true);\n    ctx.arc(x, y, innerRadius, innerMidAdjustedAngle, startAngle + (innerStart / innerRadius), true);\n\n    // The corner segment from point 6 to point 7\n    if (innerStart > 0) {\n      const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);\n    }\n\n    // The line from point 7 to point 8\n    const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x, y);\n    ctx.lineTo(p8.x, p8.y);\n\n    // The corner segment from point 8 to point 1\n    if (outerStart > 0) {\n      const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x, y);\n      ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);\n    }\n  } else {\n    ctx.moveTo(x, y);\n\n    const outerStartX = Math.cos(outerStartAdjustedAngle) * outerRadius + x;\n    const outerStartY = Math.sin(outerStartAdjustedAngle) * outerRadius + y;\n    ctx.lineTo(outerStartX, outerStartY);\n\n    const outerEndX = Math.cos(outerEndAdjustedAngle) * outerRadius + x;\n    const outerEndY = Math.sin(outerEndAdjustedAngle) * outerRadius + y;\n    ctx.lineTo(outerEndX, outerEndY);\n  }\n\n  ctx.closePath();\n}\n\nfunction drawArc(\n  ctx: CanvasRenderingContext2D,\n  element: ArcElement,\n  offset: number,\n  spacing: number,\n  circular: boolean,\n) {\n  const {fullCircles, startAngle, circumference} = element;\n  let endAngle = element.endAngle;\n  if (fullCircles) {\n    pathArc(ctx, element, offset, spacing, endAngle, circular);\n    for (let i = 0; i < fullCircles; ++i) {\n      ctx.fill();\n    }\n    if (!isNaN(circumference)) {\n      endAngle = startAngle + (circumference % TAU || TAU);\n    }\n  }\n  pathArc(ctx, element, offset, spacing, endAngle, circular);\n  ctx.fill();\n  return endAngle;\n}\n\nfunction drawBorder(\n  ctx: CanvasRenderingContext2D,\n  element: ArcElement,\n  offset: number,\n  spacing: number,\n  circular: boolean,\n) {\n  const {fullCircles, startAngle, circumference, options} = element;\n  const {borderWidth, borderJoinStyle, borderDash, borderDashOffset} = options;\n  const inner = options.borderAlign === 'inner';\n\n  if (!borderWidth) {\n    return;\n  }\n\n  ctx.setLineDash(borderDash || []);\n  ctx.lineDashOffset = borderDashOffset;\n\n  if (inner) {\n    ctx.lineWidth = borderWidth * 2;\n    ctx.lineJoin = borderJoinStyle || 'round';\n  } else {\n    ctx.lineWidth = borderWidth;\n    ctx.lineJoin = borderJoinStyle || 'bevel';\n  }\n\n  let endAngle = element.endAngle;\n  if (fullCircles) {\n    pathArc(ctx, element, offset, spacing, endAngle, circular);\n    for (let i = 0; i < fullCircles; ++i) {\n      ctx.stroke();\n    }\n    if (!isNaN(circumference)) {\n      endAngle = startAngle + (circumference % TAU || TAU);\n    }\n  }\n\n  if (inner) {\n    clipArc(ctx, element, endAngle);\n  }\n\n  if (!fullCircles) {\n    pathArc(ctx, element, offset, spacing, endAngle, circular);\n    ctx.stroke();\n  }\n}\n\nexport interface ArcProps extends Point {\n  startAngle: number;\n  endAngle: number;\n  innerRadius: number;\n  outerRadius: number;\n  circumference: number;\n}\n\nexport default class ArcElement extends Element<ArcProps, ArcOptions> {\n\n  static id = 'arc';\n\n  static defaults = {\n    borderAlign: 'center',\n    borderColor: '#fff',\n    borderDash: [],\n    borderDashOffset: 0,\n    borderJoinStyle: undefined,\n    borderRadius: 0,\n    borderWidth: 2,\n    offset: 0,\n    spacing: 0,\n    angle: undefined,\n    circular: true,\n  };\n\n  static defaultRoutes = {\n    backgroundColor: 'backgroundColor'\n  };\n\n  static descriptors = {\n    _scriptable: true,\n    _indexable: (name) => name !== 'borderDash'\n  };\n\n  circumference: number;\n  endAngle: number;\n  fullCircles: number;\n  innerRadius: number;\n  outerRadius: number;\n  pixelMargin: number;\n  startAngle: number;\n\n  constructor(cfg) {\n    super();\n\n    this.options = undefined;\n    this.circumference = undefined;\n    this.startAngle = undefined;\n    this.endAngle = undefined;\n    this.innerRadius = undefined;\n    this.outerRadius = undefined;\n    this.pixelMargin = 0;\n    this.fullCircles = 0;\n\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n\n  inRange(chartX: number, chartY: number, useFinalPosition: boolean) {\n    const point = this.getProps(['x', 'y'], useFinalPosition);\n    const {angle, distance} = getAngleFromPoint(point, {x: chartX, y: chartY});\n    const {startAngle, endAngle, innerRadius, outerRadius, circumference} = this.getProps([\n      'startAngle',\n      'endAngle',\n      'innerRadius',\n      'outerRadius',\n      'circumference'\n    ], useFinalPosition);\n    const rAdjust = (this.options.spacing + this.options.borderWidth) / 2;\n    const _circumference = valueOrDefault(circumference, endAngle - startAngle);\n    const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);\n    const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);\n\n    return (betweenAngles && withinRadius);\n  }\n\n  getCenterPoint(useFinalPosition: boolean) {\n    const {x, y, startAngle, endAngle, innerRadius, outerRadius} = this.getProps([\n      'x',\n      'y',\n      'startAngle',\n      'endAngle',\n      'innerRadius',\n      'outerRadius'\n    ], useFinalPosition);\n    const {offset, spacing} = this.options;\n    const halfAngle = (startAngle + endAngle) / 2;\n    const halfRadius = (innerRadius + outerRadius + spacing + offset) / 2;\n    return {\n      x: x + Math.cos(halfAngle) * halfRadius,\n      y: y + Math.sin(halfAngle) * halfRadius\n    };\n  }\n\n  tooltipPosition(useFinalPosition: boolean) {\n    return this.getCenterPoint(useFinalPosition);\n  }\n\n  draw(ctx: CanvasRenderingContext2D) {\n    const {options, circumference} = this;\n    const offset = (options.offset || 0) / 4;\n    const spacing = (options.spacing || 0) / 2;\n    const circular = options.circular;\n    this.pixelMargin = (options.borderAlign === 'inner') ? 0.33 : 0;\n    this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;\n\n    if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {\n      return;\n    }\n\n    ctx.save();\n\n    const halfAngle = (this.startAngle + this.endAngle) / 2;\n    ctx.translate(Math.cos(halfAngle) * offset, Math.sin(halfAngle) * offset);\n    const fix = 1 - Math.sin(Math.min(PI, circumference || 0));\n    const radiusOffset = offset * fix;\n\n    ctx.fillStyle = options.backgroundColor;\n    ctx.strokeStyle = options.borderColor;\n\n    drawArc(ctx, this, radiusOffset, spacing, circular);\n    drawBorder(ctx, this, radiusOffset, spacing, circular);\n\n    ctx.restore();\n  }\n}\n", "import Element from '../core/core.element.js';\nimport {_bezierInterpolation, _pointInLine, _steppedInterpolation} from '../helpers/helpers.interpolation.js';\nimport {_computeSegments, _boundSegments} from '../helpers/helpers.segment.js';\nimport {_steppedLineTo, _bezierCurveTo} from '../helpers/helpers.canvas.js';\nimport {_updateBezierControlPoints} from '../helpers/helpers.curve.js';\nimport {valueOrDefault} from '../helpers/index.js';\n\n/**\n * @typedef { import('./element.point.js').default } PointElement\n */\n\nfunction setStyle(ctx, options, style = options) {\n  ctx.lineCap = valueOrDefault(style.borderCapStyle, options.borderCapStyle);\n  ctx.setLineDash(valueOrDefault(style.borderDash, options.borderDash));\n  ctx.lineDashOffset = valueOrDefault(style.borderDashOffset, options.borderDashOffset);\n  ctx.lineJoin = valueOrDefault(style.borderJoinStyle, options.borderJoinStyle);\n  ctx.lineWidth = valueOrDefault(style.borderWidth, options.borderWidth);\n  ctx.strokeStyle = valueOrDefault(style.borderColor, options.borderColor);\n}\n\nfunction lineTo(ctx, previous, target) {\n  ctx.lineTo(target.x, target.y);\n}\n\n/**\n * @returns {any}\n */\nfunction getLineMethod(options) {\n  if (options.stepped) {\n    return _steppedLineTo;\n  }\n\n  if (options.tension || options.cubicInterpolationMode === 'monotone') {\n    return _bezierCurveTo;\n  }\n\n  return lineTo;\n}\n\nfunction pathVars(points, segment, params = {}) {\n  const count = points.length;\n  const {start: paramsStart = 0, end: paramsEnd = count - 1} = params;\n  const {start: segmentStart, end: segmentEnd} = segment;\n  const start = Math.max(paramsStart, segmentStart);\n  const end = Math.min(paramsEnd, segmentEnd);\n  const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;\n\n  return {\n    count,\n    start,\n    loop: segment.loop,\n    ilen: end < start && !outside ? count + end - start : end - start\n  };\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction pathSegment(ctx, line, segment, params) {\n  const {points, options} = line;\n  const {count, start, loop, ilen} = pathVars(points, segment, params);\n  const lineMethod = getLineMethod(options);\n  // eslint-disable-next-line prefer-const\n  let {move = true, reverse} = params || {};\n  let i, point, prev;\n\n  for (i = 0; i <= ilen; ++i) {\n    point = points[(start + (reverse ? ilen - i : i)) % count];\n\n    if (point.skip) {\n      // If there is a skipped point inside a segment, spanGaps must be true\n      continue;\n    } else if (move) {\n      ctx.moveTo(point.x, point.y);\n      move = false;\n    } else {\n      lineMethod(ctx, prev, point, reverse, options.stepped);\n    }\n\n    prev = point;\n  }\n\n  if (loop) {\n    point = points[(start + (reverse ? ilen : 0)) % count];\n    lineMethod(ctx, prev, point, reverse, options.stepped);\n  }\n\n  return !!loop;\n}\n\n/**\n * Create path from points, grouping by truncated x-coordinate\n * Points need to be in order by x-coordinate for this to work efficiently\n * @param {CanvasRenderingContext2D|Path2D} ctx - Context\n * @param {LineElement} line\n * @param {object} segment\n * @param {number} segment.start - start index of the segment, referring the points array\n * @param {number} segment.end - end index of the segment, referring the points array\n * @param {boolean} segment.loop - indicates that the segment is a loop\n * @param {object} params\n * @param {boolean} params.move - move to starting point (vs line to it)\n * @param {boolean} params.reverse - path the segment from end to start\n * @param {number} params.start - limit segment to points starting from `start` index\n * @param {number} params.end - limit segment to points ending at `start` + `count` index\n */\nfunction fastPathSegment(ctx, line, segment, params) {\n  const points = line.points;\n  const {count, start, ilen} = pathVars(points, segment, params);\n  const {move = true, reverse} = params || {};\n  let avgX = 0;\n  let countX = 0;\n  let i, point, prevX, minY, maxY, lastY;\n\n  const pointIndex = (index) => (start + (reverse ? ilen - index : index)) % count;\n  const drawX = () => {\n    if (minY !== maxY) {\n      // Draw line to maxY and minY, using the average x-coordinate\n      ctx.lineTo(avgX, maxY);\n      ctx.lineTo(avgX, minY);\n      // Line to y-value of last point in group. So the line continues\n      // from correct position. Not using move, to have solid path.\n      ctx.lineTo(avgX, lastY);\n    }\n  };\n\n  if (move) {\n    point = points[pointIndex(0)];\n    ctx.moveTo(point.x, point.y);\n  }\n\n  for (i = 0; i <= ilen; ++i) {\n    point = points[pointIndex(i)];\n\n    if (point.skip) {\n      // If there is a skipped point inside a segment, spanGaps must be true\n      continue;\n    }\n\n    const x = point.x;\n    const y = point.y;\n    const truncX = x | 0; // truncated x-coordinate\n\n    if (truncX === prevX) {\n      // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n      if (y < minY) {\n        minY = y;\n      } else if (y > maxY) {\n        maxY = y;\n      }\n      // For first point in group, countX is `0`, so average will be `x` / 1.\n      avgX = (countX * avgX + x) / ++countX;\n    } else {\n      drawX();\n      // Draw line to next x-position, using the first (or only)\n      // y-value in that group\n      ctx.lineTo(x, y);\n\n      prevX = truncX;\n      countX = 0;\n      minY = maxY = y;\n    }\n    // Keep track of the last y-value in group\n    lastY = y;\n  }\n  drawX();\n}\n\n/**\n * @param {LineElement} line - the line\n * @returns {function}\n * @private\n */\nfunction _getSegmentMethod(line) {\n  const opts = line.options;\n  const borderDash = opts.borderDash && opts.borderDash.length;\n  const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== 'monotone' && !opts.stepped && !borderDash;\n  return useFastPath ? fastPathSegment : pathSegment;\n}\n\n/**\n * @private\n */\nfunction _getInterpolationMethod(options) {\n  if (options.stepped) {\n    return _steppedInterpolation;\n  }\n\n  if (options.tension || options.cubicInterpolationMode === 'monotone') {\n    return _bezierInterpolation;\n  }\n\n  return _pointInLine;\n}\n\nfunction strokePathWithCache(ctx, line, start, count) {\n  let path = line._path;\n  if (!path) {\n    path = line._path = new Path2D();\n    if (line.path(path, start, count)) {\n      path.closePath();\n    }\n  }\n  setStyle(ctx, line.options);\n  ctx.stroke(path);\n}\n\nfunction strokePathDirect(ctx, line, start, count) {\n  const {segments, options} = line;\n  const segmentMethod = _getSegmentMethod(line);\n\n  for (const segment of segments) {\n    setStyle(ctx, options, segment.style);\n    ctx.beginPath();\n    if (segmentMethod(ctx, line, segment, {start, end: start + count - 1})) {\n      ctx.closePath();\n    }\n    ctx.stroke();\n  }\n}\n\nconst usePath2D = typeof Path2D === 'function';\n\nfunction draw(ctx, line, start, count) {\n  if (usePath2D && !line.options.segment) {\n    strokePathWithCache(ctx, line, start, count);\n  } else {\n    strokePathDirect(ctx, line, start, count);\n  }\n}\n\nexport default class LineElement extends Element {\n\n  static id = 'line';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    borderCapStyle: 'butt',\n    borderDash: [],\n    borderDashOffset: 0,\n    borderJoinStyle: 'miter',\n    borderWidth: 3,\n    capBezierPoints: true,\n    cubicInterpolationMode: 'default',\n    fill: false,\n    spanGaps: false,\n    stepped: false,\n    tension: 0,\n  };\n\n  /**\n   * @type {any}\n   */\n  static defaultRoutes = {\n    backgroundColor: 'backgroundColor',\n    borderColor: 'borderColor'\n  };\n\n\n  static descriptors = {\n    _scriptable: true,\n    _indexable: (name) => name !== 'borderDash' && name !== 'fill',\n  };\n\n\n  constructor(cfg) {\n    super();\n\n    this.animated = true;\n    this.options = undefined;\n    this._chart = undefined;\n    this._loop = undefined;\n    this._fullLoop = undefined;\n    this._path = undefined;\n    this._points = undefined;\n    this._segments = undefined;\n    this._decimated = false;\n    this._pointsUpdated = false;\n    this._datasetIndex = undefined;\n\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n\n  updateControlPoints(chartArea, indexAxis) {\n    const options = this.options;\n    if ((options.tension || options.cubicInterpolationMode === 'monotone') && !options.stepped && !this._pointsUpdated) {\n      const loop = options.spanGaps ? this._loop : this._fullLoop;\n      _updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);\n      this._pointsUpdated = true;\n    }\n  }\n\n  set points(points) {\n    this._points = points;\n    delete this._segments;\n    delete this._path;\n    this._pointsUpdated = false;\n  }\n\n  get points() {\n    return this._points;\n  }\n\n  get segments() {\n    return this._segments || (this._segments = _computeSegments(this, this.options.segment));\n  }\n\n  /**\n\t * First non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n  first() {\n    const segments = this.segments;\n    const points = this.points;\n    return segments.length && points[segments[0].start];\n  }\n\n  /**\n\t * Last non-skipped point on this line\n\t * @returns {PointElement|undefined}\n\t */\n  last() {\n    const segments = this.segments;\n    const points = this.points;\n    const count = segments.length;\n    return count && points[segments[count - 1].end];\n  }\n\n  /**\n\t * Interpolate a point in this line at the same value on `property` as\n\t * the reference `point` provided\n\t * @param {PointElement} point - the reference point\n\t * @param {string} property - the property to match on\n\t * @returns {PointElement|undefined}\n\t */\n  interpolate(point, property) {\n    const options = this.options;\n    const value = point[property];\n    const points = this.points;\n    const segments = _boundSegments(this, {property, start: value, end: value});\n\n    if (!segments.length) {\n      return;\n    }\n\n    const result = [];\n    const _interpolate = _getInterpolationMethod(options);\n    let i, ilen;\n    for (i = 0, ilen = segments.length; i < ilen; ++i) {\n      const {start, end} = segments[i];\n      const p1 = points[start];\n      const p2 = points[end];\n      if (p1 === p2) {\n        result.push(p1);\n        continue;\n      }\n      const t = Math.abs((value - p1[property]) / (p2[property] - p1[property]));\n      const interpolated = _interpolate(p1, p2, t, options.stepped);\n      interpolated[property] = point[property];\n      result.push(interpolated);\n    }\n    return result.length === 1 ? result[0] : result;\n  }\n\n  /**\n\t * Append a segment of this line to current path.\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} segment\n\t * @param {number} segment.start - start index of the segment, referring the points array\n \t * @param {number} segment.end - end index of the segment, referring the points array\n \t * @param {boolean} segment.loop - indicates that the segment is a loop\n\t * @param {object} params\n\t * @param {boolean} params.move - move to starting point (vs line to it)\n\t * @param {boolean} params.reverse - path the segment from end to start\n\t * @param {number} params.start - limit segment to points starting from `start` index\n\t * @param {number} params.end - limit segment to points ending at `start` + `count` index\n\t * @returns {undefined|boolean} - true if the segment is a full loop (path should be closed)\n\t */\n  pathSegment(ctx, segment, params) {\n    const segmentMethod = _getSegmentMethod(this);\n    return segmentMethod(ctx, this, segment, params);\n  }\n\n  /**\n\t * Append all segments of this line to current path.\n\t * @param {CanvasRenderingContext2D|Path2D} ctx\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t * @returns {undefined|boolean} - true if line is a full loop (path should be closed)\n\t */\n  path(ctx, start, count) {\n    const segments = this.segments;\n    const segmentMethod = _getSegmentMethod(this);\n    let loop = this._loop;\n\n    start = start || 0;\n    count = count || (this.points.length - start);\n\n    for (const segment of segments) {\n      loop &= segmentMethod(ctx, this, segment, {start, end: start + count - 1});\n    }\n    return !!loop;\n  }\n\n  /**\n\t * Draw\n\t * @param {CanvasRenderingContext2D} ctx\n\t * @param {object} chartArea\n\t * @param {number} [start]\n\t * @param {number} [count]\n\t */\n  draw(ctx, chartArea, start, count) {\n    const options = this.options || {};\n    const points = this.points || [];\n\n    if (points.length && options.borderWidth) {\n      ctx.save();\n\n      draw(ctx, this, start, count);\n\n      ctx.restore();\n    }\n\n    if (this.animated) {\n      // When line is animated, the control points and path are not cached.\n      this._pointsUpdated = false;\n      this._path = undefined;\n    }\n  }\n}\n", "import Element from '../core/core.element.js';\nimport {drawPoint, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport type {\n  CartesianParsedData,\n  ChartArea,\n  Point,\n  PointHoverOptions,\n  PointOptions,\n} from '../types/index.js';\n\nfunction inRange(el: PointElement, pos: number, axis: 'x' | 'y', useFinalPosition?: boolean) {\n  const options = el.options;\n  const {[axis]: value} = el.getProps([axis], useFinalPosition);\n\n  return (Math.abs(pos - value) < options.radius + options.hitRadius);\n}\n\nexport type PointProps = Point\n\nexport default class PointElement extends Element<PointProps, PointOptions & PointHoverOptions> {\n\n  static id = 'point';\n\n  parsed: CartesianParsedData;\n  skip?: boolean;\n  stop?: boolean;\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    borderWidth: 1,\n    hitRadius: 1,\n    hoverBorderWidth: 1,\n    hoverRadius: 4,\n    pointStyle: 'circle',\n    radius: 3,\n    rotation: 0\n  };\n\n  /**\n   * @type {any}\n   */\n  static defaultRoutes = {\n    backgroundColor: 'backgroundColor',\n    borderColor: 'borderColor'\n  };\n\n  constructor(cfg) {\n    super();\n\n    this.options = undefined;\n    this.parsed = undefined;\n    this.skip = undefined;\n    this.stop = undefined;\n\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n\n  inRange(mouseX: number, mouseY: number, useFinalPosition?: boolean) {\n    const options = this.options;\n    const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n    return ((Math.pow(mouseX - x, 2) + Math.pow(mouseY - y, 2)) < Math.pow(options.hitRadius + options.radius, 2));\n  }\n\n  inXRange(mouseX: number, useFinalPosition?: boolean) {\n    return inRange(this, mouseX, 'x', useFinalPosition);\n  }\n\n  inYRange(mouseY: number, useFinalPosition?: boolean) {\n    return inRange(this, mouseY, 'y', useFinalPosition);\n  }\n\n  getCenterPoint(useFinalPosition?: boolean) {\n    const {x, y} = this.getProps(['x', 'y'], useFinalPosition);\n    return {x, y};\n  }\n\n  size(options?: Partial<PointOptions & PointHoverOptions>) {\n    options = options || this.options || {};\n    let radius = options.radius || 0;\n    radius = Math.max(radius, radius && options.hoverRadius || 0);\n    const borderWidth = radius && options.borderWidth || 0;\n    return (radius + borderWidth) * 2;\n  }\n\n  draw(ctx: CanvasRenderingContext2D, area: ChartArea) {\n    const options = this.options;\n\n    if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {\n      return;\n    }\n\n    ctx.strokeStyle = options.borderColor;\n    ctx.lineWidth = options.borderWidth;\n    ctx.fillStyle = options.backgroundColor;\n    drawPoint(ctx, options, this.x, this.y);\n  }\n\n  getRange() {\n    const options = this.options || {};\n    // @ts-expect-error Fallbacks should never be hit in practice\n    return options.radius + options.hitRadius;\n  }\n}\n", "import Element from '../core/core.element.js';\nimport {isObject, _isBetween, _limitValue} from '../helpers/index.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {toTRBL, toTRBLCorners} from '../helpers/helpers.options.js';\n\n/** @typedef {{ x: number, y: number, base: number, horizontal: boolean, width: number, height: number }} BarProps */\n\n/**\n * Helper function to get the bounds of the bar regardless of the orientation\n * @param {BarElement} bar the bar\n * @param {boolean} [useFinalPosition]\n * @return {object} bounds of the bar\n * @private\n */\nfunction getBarBounds(bar, useFinalPosition) {\n  const {x, y, base, width, height} = /** @type {BarProps} */ (bar.getProps(['x', 'y', 'base', 'width', 'height'], useFinalPosition));\n\n  let left, right, top, bottom, half;\n\n  if (bar.horizontal) {\n    half = height / 2;\n    left = Math.min(x, base);\n    right = Math.max(x, base);\n    top = y - half;\n    bottom = y + half;\n  } else {\n    half = width / 2;\n    left = x - half;\n    right = x + half;\n    top = Math.min(y, base);\n    bottom = Math.max(y, base);\n  }\n\n  return {left, top, right, bottom};\n}\n\nfunction skipOrLimit(skip, value, min, max) {\n  return skip ? 0 : _limitValue(value, min, max);\n}\n\nfunction parseBorderWidth(bar, maxW, maxH) {\n  const value = bar.options.borderWidth;\n  const skip = bar.borderSkipped;\n  const o = toTRBL(value);\n\n  return {\n    t: skipOrLimit(skip.top, o.top, 0, maxH),\n    r: skipOrLimit(skip.right, o.right, 0, maxW),\n    b: skipOrLimit(skip.bottom, o.bottom, 0, maxH),\n    l: skipOrLimit(skip.left, o.left, 0, maxW)\n  };\n}\n\nfunction parseBorderRadius(bar, maxW, maxH) {\n  const {enableBorderRadius} = bar.getProps(['enableBorderRadius']);\n  const value = bar.options.borderRadius;\n  const o = toTRBLCorners(value);\n  const maxR = Math.min(maxW, maxH);\n  const skip = bar.borderSkipped;\n\n  // If the value is an object, assume the user knows what they are doing\n  // and apply as directed.\n  const enableBorder = enableBorderRadius || isObject(value);\n\n  return {\n    topLeft: skipOrLimit(!enableBorder || skip.top || skip.left, o.topLeft, 0, maxR),\n    topRight: skipOrLimit(!enableBorder || skip.top || skip.right, o.topRight, 0, maxR),\n    bottomLeft: skipOrLimit(!enableBorder || skip.bottom || skip.left, o.bottomLeft, 0, maxR),\n    bottomRight: skipOrLimit(!enableBorder || skip.bottom || skip.right, o.bottomRight, 0, maxR)\n  };\n}\n\nfunction boundingRects(bar) {\n  const bounds = getBarBounds(bar);\n  const width = bounds.right - bounds.left;\n  const height = bounds.bottom - bounds.top;\n  const border = parseBorderWidth(bar, width / 2, height / 2);\n  const radius = parseBorderRadius(bar, width / 2, height / 2);\n\n  return {\n    outer: {\n      x: bounds.left,\n      y: bounds.top,\n      w: width,\n      h: height,\n      radius\n    },\n    inner: {\n      x: bounds.left + border.l,\n      y: bounds.top + border.t,\n      w: width - border.l - border.r,\n      h: height - border.t - border.b,\n      radius: {\n        topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),\n        topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),\n        bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),\n        bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r)),\n      }\n    }\n  };\n}\n\nfunction inRange(bar, x, y, useFinalPosition) {\n  const skipX = x === null;\n  const skipY = y === null;\n  const skipBoth = skipX && skipY;\n  const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);\n\n  return bounds\n\t\t&& (skipX || _isBetween(x, bounds.left, bounds.right))\n\t\t&& (skipY || _isBetween(y, bounds.top, bounds.bottom));\n}\n\nfunction hasRadius(radius) {\n  return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;\n}\n\n/**\n * Add a path of a rectangle to the current sub-path\n * @param {CanvasRenderingContext2D} ctx Context\n * @param {*} rect Bounding rect\n */\nfunction addNormalRectPath(ctx, rect) {\n  ctx.rect(rect.x, rect.y, rect.w, rect.h);\n}\n\nfunction inflateRect(rect, amount, refRect = {}) {\n  const x = rect.x !== refRect.x ? -amount : 0;\n  const y = rect.y !== refRect.y ? -amount : 0;\n  const w = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x;\n  const h = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y;\n  return {\n    x: rect.x + x,\n    y: rect.y + y,\n    w: rect.w + w,\n    h: rect.h + h,\n    radius: rect.radius\n  };\n}\n\nexport default class BarElement extends Element {\n\n  static id = 'bar';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    borderSkipped: 'start',\n    borderWidth: 0,\n    borderRadius: 0,\n    inflateAmount: 'auto',\n    pointStyle: undefined\n  };\n\n  /**\n   * @type {any}\n   */\n  static defaultRoutes = {\n    backgroundColor: 'backgroundColor',\n    borderColor: 'borderColor'\n  };\n\n  constructor(cfg) {\n    super();\n\n    this.options = undefined;\n    this.horizontal = undefined;\n    this.base = undefined;\n    this.width = undefined;\n    this.height = undefined;\n    this.inflateAmount = undefined;\n\n    if (cfg) {\n      Object.assign(this, cfg);\n    }\n  }\n\n  draw(ctx) {\n    const {inflateAmount, options: {borderColor, backgroundColor}} = this;\n    const {inner, outer} = boundingRects(this);\n    const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;\n\n    ctx.save();\n\n    if (outer.w !== inner.w || outer.h !== inner.h) {\n      ctx.beginPath();\n      addRectPath(ctx, inflateRect(outer, inflateAmount, inner));\n      ctx.clip();\n      addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));\n      ctx.fillStyle = borderColor;\n      ctx.fill('evenodd');\n    }\n\n    ctx.beginPath();\n    addRectPath(ctx, inflateRect(inner, inflateAmount));\n    ctx.fillStyle = backgroundColor;\n    ctx.fill();\n\n    ctx.restore();\n  }\n\n  inRange(mouseX, mouseY, useFinalPosition) {\n    return inRange(this, mouseX, mouseY, useFinalPosition);\n  }\n\n  inXRange(mouseX, useFinalPosition) {\n    return inRange(this, mouseX, null, useFinalPosition);\n  }\n\n  inYRange(mouseY, useFinalPosition) {\n    return inRange(this, null, mouseY, useFinalPosition);\n  }\n\n  getCenterPoint(useFinalPosition) {\n    const {x, y, base, horizontal} = /** @type {BarProps} */ (this.getProps(['x', 'y', 'base', 'horizontal'], useFinalPosition));\n    return {\n      x: horizontal ? (x + base) / 2 : x,\n      y: horizontal ? y : (y + base) / 2\n    };\n  }\n\n  getRange(axis) {\n    return axis === 'x' ? this.width / 2 : this.height / 2;\n  }\n}\n", "import {DoughnutController, PolarAreaController} from '../index.js';\nimport type {Chart, ChartDataset} from '../types.js';\n\nexport interface ColorsPluginOptions {\n  enabled?: boolean;\n  forceOverride?: boolean;\n}\n\ninterface ColorsDescriptor {\n  backgroundColor?: unknown;\n  borderColor?: unknown;\n}\n\nconst BORDER_COLORS = [\n  'rgb(54, 162, 235)', // blue\n  'rgb(255, 99, 132)', // red\n  'rgb(255, 159, 64)', // orange\n  'rgb(255, 205, 86)', // yellow\n  'rgb(75, 192, 192)', // green\n  'rgb(153, 102, 255)', // purple\n  'rgb(201, 203, 207)' // grey\n];\n\n// Border colors with 50% transparency\nconst BACKGROUND_COLORS = /* #__PURE__ */ BORDER_COLORS.map(color => color.replace('rgb(', 'rgba(').replace(')', ', 0.5)'));\n\nfunction getBorderColor(i: number) {\n  return BORDER_COLORS[i % BORDER_COLORS.length];\n}\n\nfunction getBackgroundColor(i: number) {\n  return BACKGROUND_COLORS[i % BACKGROUND_COLORS.length];\n}\n\nfunction colorizeDefaultDataset(dataset: ChartDataset, i: number) {\n  dataset.borderColor = getBorderColor(i);\n  dataset.backgroundColor = getBackgroundColor(i);\n\n  return ++i;\n}\n\nfunction colorizeDoughnutDataset(dataset: ChartDataset, i: number) {\n  dataset.backgroundColor = dataset.data.map(() => getBorderColor(i++));\n\n  return i;\n}\n\nfunction colorizePolarAreaDataset(dataset: ChartDataset, i: number) {\n  dataset.backgroundColor = dataset.data.map(() => getBackgroundColor(i++));\n\n  return i;\n}\n\nfunction getColorizer(chart: Chart) {\n  let i = 0;\n\n  return (dataset: ChartDataset, datasetIndex: number) => {\n    const controller = chart.getDatasetMeta(datasetIndex).controller;\n\n    if (controller instanceof DoughnutController) {\n      i = colorizeDoughnutDataset(dataset, i);\n    } else if (controller instanceof PolarAreaController) {\n      i = colorizePolarAreaDataset(dataset, i);\n    } else if (controller) {\n      i = colorizeDefaultDataset(dataset, i);\n    }\n  };\n}\n\nfunction containsColorsDefinitions(\n  descriptors: ColorsDescriptor[] | Record<string, ColorsDescriptor>\n) {\n  let k: number | string;\n\n  for (k in descriptors) {\n    if (descriptors[k].borderColor || descriptors[k].backgroundColor) {\n      return true;\n    }\n  }\n\n  return false;\n}\n\nfunction containsColorsDefinition(\n  descriptor: ColorsDescriptor\n) {\n  return descriptor && (descriptor.borderColor || descriptor.backgroundColor);\n}\n\nexport default {\n  id: 'colors',\n\n  defaults: {\n    enabled: true,\n    forceOverride: false\n  } as ColorsPluginOptions,\n\n  beforeLayout(chart: Chart, _args, options: ColorsPluginOptions) {\n    if (!options.enabled) {\n      return;\n    }\n\n    const {\n      data: {datasets},\n      options: chartOptions\n    } = chart.config;\n    const {elements} = chartOptions;\n\n    if (!options.forceOverride && (containsColorsDefinitions(datasets) || containsColorsDefinition(chartOptions) || (elements && containsColorsDefinitions(elements)))) {\n      return;\n    }\n\n    const colorizer = getColorizer(chart);\n\n    datasets.forEach(colorizer);\n  }\n};\n", "import {_limitValue, _lookupByKey, isNullOrUndef, resolve} from '../helpers/index.js';\n\nfunction lttbDecimation(data, start, count, availableWidth, options) {\n  /**\n   * Implementation of the Largest Triangle Three Buckets algorithm.\n   *\n   * This implementation is based on the original implementation by Sveinn Steinarsson\n   * in https://github.com/sveinn-steinarsson/flot-downsample/blob/master/jquery.flot.downsample.js\n   *\n   * The original implementation is MIT licensed.\n   */\n  const samples = options.samples || availableWidth;\n  // There are less points than the threshold, returning the whole array\n  if (samples >= count) {\n    return data.slice(start, start + count);\n  }\n\n  const decimated = [];\n\n  const bucketWidth = (count - 2) / (samples - 2);\n  let sampledIndex = 0;\n  const endIndex = start + count - 1;\n  // Starting from offset\n  let a = start;\n  let i, maxAreaPoint, maxArea, area, nextA;\n\n  decimated[sampledIndex++] = data[a];\n\n  for (i = 0; i < samples - 2; i++) {\n    let avgX = 0;\n    let avgY = 0;\n    let j;\n\n    // Adding offset\n    const avgRangeStart = Math.floor((i + 1) * bucketWidth) + 1 + start;\n    const avgRangeEnd = Math.min(Math.floor((i + 2) * bucketWidth) + 1, count) + start;\n    const avgRangeLength = avgRangeEnd - avgRangeStart;\n\n    for (j = avgRangeStart; j < avgRangeEnd; j++) {\n      avgX += data[j].x;\n      avgY += data[j].y;\n    }\n\n    avgX /= avgRangeLength;\n    avgY /= avgRangeLength;\n\n    // Adding offset\n    const rangeOffs = Math.floor(i * bucketWidth) + 1 + start;\n    const rangeTo = Math.min(Math.floor((i + 1) * bucketWidth) + 1, count) + start;\n    const {x: pointAx, y: pointAy} = data[a];\n\n    // Note that this is changed from the original algorithm which initializes these\n    // values to 1. The reason for this change is that if the area is small, nextA\n    // would never be set and thus a crash would occur in the next loop as `a` would become\n    // `undefined`. Since the area is always positive, but could be 0 in the case of a flat trace,\n    // initializing with a negative number is the correct solution.\n    maxArea = area = -1;\n\n    for (j = rangeOffs; j < rangeTo; j++) {\n      area = 0.5 * Math.abs(\n        (pointAx - avgX) * (data[j].y - pointAy) -\n        (pointAx - data[j].x) * (avgY - pointAy)\n      );\n\n      if (area > maxArea) {\n        maxArea = area;\n        maxAreaPoint = data[j];\n        nextA = j;\n      }\n    }\n\n    decimated[sampledIndex++] = maxAreaPoint;\n    a = nextA;\n  }\n\n  // Include the last point\n  decimated[sampledIndex++] = data[endIndex];\n\n  return decimated;\n}\n\nfunction minMaxDecimation(data, start, count, availableWidth) {\n  let avgX = 0;\n  let countX = 0;\n  let i, point, x, y, prevX, minIndex, maxIndex, startIndex, minY, maxY;\n  const decimated = [];\n  const endIndex = start + count - 1;\n\n  const xMin = data[start].x;\n  const xMax = data[endIndex].x;\n  const dx = xMax - xMin;\n\n  for (i = start; i < start + count; ++i) {\n    point = data[i];\n    x = (point.x - xMin) / dx * availableWidth;\n    y = point.y;\n    const truncX = x | 0;\n\n    if (truncX === prevX) {\n      // Determine `minY` / `maxY` and `avgX` while we stay within same x-position\n      if (y < minY) {\n        minY = y;\n        minIndex = i;\n      } else if (y > maxY) {\n        maxY = y;\n        maxIndex = i;\n      }\n      // For first point in group, countX is `0`, so average will be `x` / 1.\n      // Use point.x here because we're computing the average data `x` value\n      avgX = (countX * avgX + point.x) / ++countX;\n    } else {\n      // Push up to 4 points, 3 for the last interval and the first point for this interval\n      const lastIndex = i - 1;\n\n      if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {\n        // The interval is defined by 4 points: start, min, max, end.\n        // The starting point is already considered at this point, so we need to determine which\n        // of the other points to add. We need to sort these points to ensure the decimated data\n        // is still sorted and then ensure there are no duplicates.\n        const intermediateIndex1 = Math.min(minIndex, maxIndex);\n        const intermediateIndex2 = Math.max(minIndex, maxIndex);\n\n        if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {\n          decimated.push({\n            ...data[intermediateIndex1],\n            x: avgX,\n          });\n        }\n        if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {\n          decimated.push({\n            ...data[intermediateIndex2],\n            x: avgX\n          });\n        }\n      }\n\n      // lastIndex === startIndex will occur when a range has only 1 point which could\n      // happen with very uneven data\n      if (i > 0 && lastIndex !== startIndex) {\n        // Last point in the previous interval\n        decimated.push(data[lastIndex]);\n      }\n\n      // Start of the new interval\n      decimated.push(point);\n      prevX = truncX;\n      countX = 0;\n      minY = maxY = y;\n      minIndex = maxIndex = startIndex = i;\n    }\n  }\n\n  return decimated;\n}\n\nfunction cleanDecimatedDataset(dataset) {\n  if (dataset._decimated) {\n    const data = dataset._data;\n    delete dataset._decimated;\n    delete dataset._data;\n    Object.defineProperty(dataset, 'data', {\n      configurable: true,\n      enumerable: true,\n      writable: true,\n      value: data,\n    });\n  }\n}\n\nfunction cleanDecimatedData(chart) {\n  chart.data.datasets.forEach((dataset) => {\n    cleanDecimatedDataset(dataset);\n  });\n}\n\nfunction getStartAndCountOfVisiblePointsSimplified(meta, points) {\n  const pointCount = points.length;\n\n  let start = 0;\n  let count;\n\n  const {iScale} = meta;\n  const {min, max, minDefined, maxDefined} = iScale.getUserBounds();\n\n  if (minDefined) {\n    start = _limitValue(_lookupByKey(points, iScale.axis, min).lo, 0, pointCount - 1);\n  }\n  if (maxDefined) {\n    count = _limitValue(_lookupByKey(points, iScale.axis, max).hi + 1, start, pointCount) - start;\n  } else {\n    count = pointCount - start;\n  }\n\n  return {start, count};\n}\n\nexport default {\n  id: 'decimation',\n\n  defaults: {\n    algorithm: 'min-max',\n    enabled: false,\n  },\n\n  beforeElementsUpdate: (chart, args, options) => {\n    if (!options.enabled) {\n      // The decimation plugin may have been previously enabled. Need to remove old `dataset._data` handlers\n      cleanDecimatedData(chart);\n      return;\n    }\n\n    // Assume the entire chart is available to show a few more points than needed\n    const availableWidth = chart.width;\n\n    chart.data.datasets.forEach((dataset, datasetIndex) => {\n      const {_data, indexAxis} = dataset;\n      const meta = chart.getDatasetMeta(datasetIndex);\n      const data = _data || dataset.data;\n\n      if (resolve([indexAxis, chart.options.indexAxis]) === 'y') {\n        // Decimation is only supported for lines that have an X indexAxis\n        return;\n      }\n\n      if (!meta.controller.supportsDecimation) {\n        // Only line datasets are supported\n        return;\n      }\n\n      const xAxis = chart.scales[meta.xAxisID];\n      if (xAxis.type !== 'linear' && xAxis.type !== 'time') {\n        // Only linear interpolation is supported\n        return;\n      }\n\n      if (chart.options.parsing) {\n        // Plugin only supports data that does not need parsing\n        return;\n      }\n\n      let {start, count} = getStartAndCountOfVisiblePointsSimplified(meta, data);\n      const threshold = options.threshold || 4 * availableWidth;\n      if (count <= threshold) {\n        // No decimation is required until we are above this threshold\n        cleanDecimatedDataset(dataset);\n        return;\n      }\n\n      if (isNullOrUndef(_data)) {\n        // First time we are seeing this dataset\n        // We override the 'data' property with a setter that stores the\n        // raw data in _data, but reads the decimated data from _decimated\n        dataset._data = data;\n        delete dataset.data;\n        Object.defineProperty(dataset, 'data', {\n          configurable: true,\n          enumerable: true,\n          get: function() {\n            return this._decimated;\n          },\n          set: function(d) {\n            this._data = d;\n          }\n        });\n      }\n\n      // Point the chart to the decimated data\n      let decimated;\n      switch (options.algorithm) {\n      case 'lttb':\n        decimated = lttbDecimation(data, start, count, availableWidth, options);\n        break;\n      case 'min-max':\n        decimated = minMaxDecimation(data, start, count, availableWidth);\n        break;\n      default:\n        throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);\n      }\n\n      dataset._decimated = decimated;\n    });\n  },\n\n  destroy(chart) {\n    cleanDecimatedData(chart);\n  }\n};\n", "import {_boundSegment, _boundSegments, _normalizeAngle} from '../../helpers/index.js';\n\nexport function _segments(line, target, property) {\n  const segments = line.segments;\n  const points = line.points;\n  const tpoints = target.points;\n  const parts = [];\n\n  for (const segment of segments) {\n    let {start, end} = segment;\n    end = _findSegmentEnd(start, end, points);\n\n    const bounds = _getBounds(property, points[start], points[end], segment.loop);\n\n    if (!target.segments) {\n      // Special case for boundary not supporting `segments` (simpleArc)\n      // Bounds are provided as `target` for partial circle, or undefined for full circle\n      parts.push({\n        source: segment,\n        target: bounds,\n        start: points[start],\n        end: points[end]\n      });\n      continue;\n    }\n\n    // Get all segments from `target` that intersect the bounds of current segment of `line`\n    const targetSegments = _boundSegments(target, bounds);\n\n    for (const tgt of targetSegments) {\n      const subBounds = _getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);\n      const fillSources = _boundSegment(segment, points, subBounds);\n\n      for (const fillSource of fillSources) {\n        parts.push({\n          source: fillSource,\n          target: tgt,\n          start: {\n            [property]: _getEdge(bounds, subBounds, 'start', Math.max)\n          },\n          end: {\n            [property]: _getEdge(bounds, subBounds, 'end', Math.min)\n          }\n        });\n      }\n    }\n  }\n  return parts;\n}\n\nexport function _getBounds(property, first, last, loop) {\n  if (loop) {\n    return;\n  }\n  let start = first[property];\n  let end = last[property];\n\n  if (property === 'angle') {\n    start = _normalizeAngle(start);\n    end = _normalizeAngle(end);\n  }\n  return {property, start, end};\n}\n\nexport function _pointsFromSegments(boundary, line) {\n  const {x = null, y = null} = boundary || {};\n  const linePoints = line.points;\n  const points = [];\n  line.segments.forEach(({start, end}) => {\n    end = _findSegmentEnd(start, end, linePoints);\n    const first = linePoints[start];\n    const last = linePoints[end];\n    if (y !== null) {\n      points.push({x: first.x, y});\n      points.push({x: last.x, y});\n    } else if (x !== null) {\n      points.push({x, y: first.y});\n      points.push({x, y: last.y});\n    }\n  });\n  return points;\n}\n\nexport function _findSegmentEnd(start, end, points) {\n  for (;end > start; end--) {\n    const point = points[end];\n    if (!isNaN(point.x) && !isNaN(point.y)) {\n      break;\n    }\n  }\n  return end;\n}\n\nfunction _getEdge(a, b, prop, fn) {\n  if (a && b) {\n    return fn(a[prop], b[prop]);\n  }\n  return a ? a[prop] : b ? b[prop] : 0;\n}\n", "/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {isArray} from '../../helpers/index.js';\nimport {_pointsFromSegments} from './filler.segment.js';\n\n/**\n * @param {PointElement[] | { x: number; y: number; }} boundary\n * @param {LineElement} line\n * @return {LineElement?}\n */\nexport function _createBoundaryLine(boundary, line) {\n  let points = [];\n  let _loop = false;\n\n  if (isArray(boundary)) {\n    _loop = true;\n    // @ts-ignore\n    points = boundary;\n  } else {\n    points = _pointsFromSegments(boundary, line);\n  }\n\n  return points.length ? new LineElement({\n    points,\n    options: {tension: 0},\n    _loop,\n    _fullLoop: _loop\n  }) : null;\n}\n\nexport function _shouldApplyFill(source) {\n  return source && source.fill !== false;\n}\n", "import {isObject, isFinite, valueOrDefault} from '../../helpers/helpers.core.js';\n\n/**\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.line.js').default } LineElement\n * @typedef { import('../../types/index.js').FillTarget } FillTarget\n * @typedef { import('../../types/index.js').ComplexFillTarget } ComplexFillTarget\n */\n\nexport function _resolveTarget(sources, index, propagate) {\n  const source = sources[index];\n  let fill = source.fill;\n  const visited = [index];\n  let target;\n\n  if (!propagate) {\n    return fill;\n  }\n\n  while (fill !== false && visited.indexOf(fill) === -1) {\n    if (!isFinite(fill)) {\n      return fill;\n    }\n\n    target = sources[fill];\n    if (!target) {\n      return false;\n    }\n\n    if (target.visible) {\n      return fill;\n    }\n\n    visited.push(fill);\n    fill = target.fill;\n  }\n\n  return false;\n}\n\n/**\n * @param {LineElement} line\n * @param {number} index\n * @param {number} count\n */\nexport function _decodeFill(line, index, count) {\n  /** @type {string | {value: number}} */\n  const fill = parseFillOption(line);\n\n  if (isObject(fill)) {\n    return isNaN(fill.value) ? false : fill;\n  }\n\n  let target = parseFloat(fill);\n\n  if (isFinite(target) && Math.floor(target) === target) {\n    return decodeTargetIndex(fill[0], index, target, count);\n  }\n\n  return ['origin', 'start', 'end', 'stack', 'shape'].indexOf(fill) >= 0 && fill;\n}\n\nfunction decodeTargetIndex(firstCh, index, target, count) {\n  if (firstCh === '-' || firstCh === '+') {\n    target = index + target;\n  }\n\n  if (target === index || target < 0 || target >= count) {\n    return false;\n  }\n\n  return target;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @returns {number | null}\n */\nexport function _getTargetPixel(fill, scale) {\n  let pixel = null;\n  if (fill === 'start') {\n    pixel = scale.bottom;\n  } else if (fill === 'end') {\n    pixel = scale.top;\n  } else if (isObject(fill)) {\n    // @ts-ignore\n    pixel = scale.getPixelForValue(fill.value);\n  } else if (scale.getBasePixel) {\n    pixel = scale.getBasePixel();\n  }\n  return pixel;\n}\n\n/**\n * @param {FillTarget | ComplexFillTarget} fill\n * @param {Scale} scale\n * @param {number} startValue\n * @returns {number | undefined}\n */\nexport function _getTargetValue(fill, scale, startValue) {\n  let value;\n\n  if (fill === 'start') {\n    value = startValue;\n  } else if (fill === 'end') {\n    value = scale.options.reverse ? scale.min : scale.max;\n  } else if (isObject(fill)) {\n    // @ts-ignore\n    value = fill.value;\n  } else {\n    value = scale.getBaseValue();\n  }\n  return value;\n}\n\n/**\n * @param {LineElement} line\n */\nfunction parseFillOption(line) {\n  const options = line.options;\n  const fillOption = options.fill;\n  let fill = valueOrDefault(fillOption && fillOption.target, fillOption);\n\n  if (fill === undefined) {\n    fill = !!options.backgroundColor;\n  }\n\n  if (fill === false || fill === null) {\n    return false;\n  }\n\n  if (fill === true) {\n    return 'origin';\n  }\n  return fill;\n}\n", "/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nimport {LineElement} from '../../elements/index.js';\nimport {_isBetween} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\n\n/**\n * @param {{ chart: Chart; scale: Scale; index: number; line: LineElement; }} source\n * @return {LineElement}\n */\nexport function _buildStackLine(source) {\n  const {scale, index, line} = source;\n  const points = [];\n  const segments = line.segments;\n  const sourcePoints = line.points;\n  const linesBelow = getLinesBelow(scale, index);\n  linesBelow.push(_createBoundaryLine({x: null, y: scale.bottom}, line));\n\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n    for (let j = segment.start; j <= segment.end; j++) {\n      addPointsBelow(points, sourcePoints[j], linesBelow);\n    }\n  }\n  return new LineElement({points, options: {}});\n}\n\n/**\n * @param {Scale} scale\n * @param {number} index\n * @return {LineElement[]}\n */\nfunction getLinesBelow(scale, index) {\n  const below = [];\n  const metas = scale.getMatchingVisibleMetas('line');\n\n  for (let i = 0; i < metas.length; i++) {\n    const meta = metas[i];\n    if (meta.index === index) {\n      break;\n    }\n    if (!meta.hidden) {\n      below.unshift(meta.dataset);\n    }\n  }\n  return below;\n}\n\n/**\n * @param {PointElement[]} points\n * @param {PointElement} sourcePoint\n * @param {LineElement[]} linesBelow\n */\nfunction addPointsBelow(points, sourcePoint, linesBelow) {\n  const postponed = [];\n  for (let j = 0; j < linesBelow.length; j++) {\n    const line = linesBelow[j];\n    const {first, last, point} = findPoint(line, sourcePoint, 'x');\n\n    if (!point || (first && last)) {\n      continue;\n    }\n    if (first) {\n      // First point of an segment -> need to add another point before this,\n      // from next line below.\n      postponed.unshift(point);\n    } else {\n      points.push(point);\n      if (!last) {\n        // In the middle of an segment, no need to add more points.\n        break;\n      }\n    }\n  }\n  points.push(...postponed);\n}\n\n/**\n * @param {LineElement} line\n * @param {PointElement} sourcePoint\n * @param {string} property\n * @returns {{point?: PointElement, first?: boolean, last?: boolean}}\n */\nfunction findPoint(line, sourcePoint, property) {\n  const point = line.interpolate(sourcePoint, property);\n  if (!point) {\n    return {};\n  }\n\n  const pointValue = point[property];\n  const segments = line.segments;\n  const linePoints = line.points;\n  let first = false;\n  let last = false;\n  for (let i = 0; i < segments.length; i++) {\n    const segment = segments[i];\n    const firstValue = linePoints[segment.start][property];\n    const lastValue = linePoints[segment.end][property];\n    if (_isBetween(pointValue, firstValue, lastValue)) {\n      first = pointValue === firstValue;\n      last = pointValue === lastValue;\n      break;\n    }\n  }\n  return {first, last, point};\n}\n", "import {TAU} from '../../helpers/index.js';\n\n// TODO: use elements.ArcElement instead\nexport class simpleArc {\n  constructor(opts) {\n    this.x = opts.x;\n    this.y = opts.y;\n    this.radius = opts.radius;\n  }\n\n  pathSegment(ctx, bounds, opts) {\n    const {x, y, radius} = this;\n    bounds = bounds || {start: 0, end: TAU};\n    ctx.arc(x, y, radius, bounds.end, bounds.start, true);\n    return !opts.bounds;\n  }\n\n  interpolate(point) {\n    const {x, y, radius} = this;\n    const angle = point.angle;\n    return {\n      x: x + Math.cos(angle) * radius,\n      y: y + Math.sin(angle) * radius,\n      angle\n    };\n  }\n}\n", "import {isFinite} from '../../helpers/index.js';\nimport {_createBoundaryLine} from './filler.helper.js';\nimport {_getTargetPixel, _getTargetValue} from './filler.options.js';\nimport {_buildStackLine} from './filler.target.stack.js';\nimport {simpleArc} from './simpleArc.js';\n\n/**\n * @typedef { import('../../core/core.controller.js').default } Chart\n * @typedef { import('../../core/core.scale.js').default } Scale\n * @typedef { import('../../elements/element.point.js').default } PointElement\n */\n\nexport function _getTarget(source) {\n  const {chart, fill, line} = source;\n\n  if (isFinite(fill)) {\n    return getLineByIndex(chart, fill);\n  }\n\n  if (fill === 'stack') {\n    return _buildStackLine(source);\n  }\n\n  if (fill === 'shape') {\n    return true;\n  }\n\n  const boundary = computeBoundary(source);\n\n  if (boundary instanceof simpleArc) {\n    return boundary;\n  }\n\n  return _createBoundaryLine(boundary, line);\n}\n\n/**\n * @param {Chart} chart\n * @param {number} index\n */\nfunction getLineByIndex(chart, index) {\n  const meta = chart.getDatasetMeta(index);\n  const visible = meta && chart.isDatasetVisible(index);\n  return visible ? meta.dataset : null;\n}\n\nfunction computeBoundary(source) {\n  const scale = source.scale || {};\n\n  if (scale.getPointPositionForValue) {\n    return computeCircularBoundary(source);\n  }\n  return computeLinearBoundary(source);\n}\n\n\nfunction computeLinearBoundary(source) {\n  const {scale = {}, fill} = source;\n  const pixel = _getTargetPixel(fill, scale);\n\n  if (isFinite(pixel)) {\n    const horizontal = scale.isHorizontal();\n\n    return {\n      x: horizontal ? pixel : null,\n      y: horizontal ? null : pixel\n    };\n  }\n\n  return null;\n}\n\nfunction computeCircularBoundary(source) {\n  const {scale, fill} = source;\n  const options = scale.options;\n  const length = scale.getLabels().length;\n  const start = options.reverse ? scale.max : scale.min;\n  const value = _getTargetValue(fill, scale, start);\n  const target = [];\n\n  if (options.grid.circular) {\n    const center = scale.getPointPositionForValue(0, start);\n    return new simpleArc({\n      x: center.x,\n      y: center.y,\n      radius: scale.getDistanceFromCenterForValue(value)\n    });\n  }\n\n  for (let i = 0; i < length; ++i) {\n    target.push(scale.getPointPositionForValue(i, value));\n  }\n  return target;\n}\n\n", "import {clipArea, unclipArea} from '../../helpers/index.js';\nimport {_findSegmentEnd, _getBounds, _segments} from './filler.segment.js';\nimport {_getTarget} from './filler.target.js';\n\nexport function _drawfill(ctx, source, area) {\n  const target = _getTarget(source);\n  const {line, scale, axis} = source;\n  const lineOpts = line.options;\n  const fillOption = lineOpts.fill;\n  const color = lineOpts.backgroundColor;\n  const {above = color, below = color} = fillOption || {};\n  if (target && line.points.length) {\n    clipArea(ctx, area);\n    doFill(ctx, {line, target, above, below, area, scale, axis});\n    unclipArea(ctx);\n  }\n}\n\nfunction doFill(ctx, cfg) {\n  const {line, target, above, below, area, scale} = cfg;\n  const property = line._loop ? 'angle' : cfg.axis;\n\n  ctx.save();\n\n  if (property === 'x' && below !== above) {\n    clipVertical(ctx, target, area.top);\n    fill(ctx, {line, target, color: above, scale, property});\n    ctx.restore();\n    ctx.save();\n    clipVertical(ctx, target, area.bottom);\n  }\n  fill(ctx, {line, target, color: below, scale, property});\n\n  ctx.restore();\n}\n\nfunction clipVertical(ctx, target, clipY) {\n  const {segments, points} = target;\n  let first = true;\n  let lineLoop = false;\n\n  ctx.beginPath();\n  for (const segment of segments) {\n    const {start, end} = segment;\n    const firstPoint = points[start];\n    const lastPoint = points[_findSegmentEnd(start, end, points)];\n    if (first) {\n      ctx.moveTo(firstPoint.x, firstPoint.y);\n      first = false;\n    } else {\n      ctx.lineTo(firstPoint.x, clipY);\n      ctx.lineTo(firstPoint.x, firstPoint.y);\n    }\n    lineLoop = !!target.pathSegment(ctx, segment, {move: lineLoop});\n    if (lineLoop) {\n      ctx.closePath();\n    } else {\n      ctx.lineTo(lastPoint.x, clipY);\n    }\n  }\n\n  ctx.lineTo(target.first().x, clipY);\n  ctx.closePath();\n  ctx.clip();\n}\n\nfunction fill(ctx, cfg) {\n  const {line, target, property, color, scale} = cfg;\n  const segments = _segments(line, target, property);\n\n  for (const {source: src, target: tgt, start, end} of segments) {\n    const {style: {backgroundColor = color} = {}} = src;\n    const notShape = target !== true;\n\n    ctx.save();\n    ctx.fillStyle = backgroundColor;\n\n    clipBounds(ctx, scale, notShape && _getBounds(property, start, end));\n\n    ctx.beginPath();\n\n    const lineLoop = !!line.pathSegment(ctx, src);\n\n    let loop;\n    if (notShape) {\n      if (lineLoop) {\n        ctx.closePath();\n      } else {\n        interpolatedLineTo(ctx, target, end, property);\n      }\n\n      const targetLoop = !!target.pathSegment(ctx, tgt, {move: lineLoop, reverse: true});\n      loop = lineLoop && targetLoop;\n      if (!loop) {\n        interpolatedLineTo(ctx, target, start, property);\n      }\n    }\n\n    ctx.closePath();\n    ctx.fill(loop ? 'evenodd' : 'nonzero');\n\n    ctx.restore();\n  }\n}\n\nfunction clipBounds(ctx, scale, bounds) {\n  const {top, bottom} = scale.chart.chartArea;\n  const {property, start, end} = bounds || {};\n  if (property === 'x') {\n    ctx.beginPath();\n    ctx.rect(start, top, end - start, bottom - top);\n    ctx.clip();\n  }\n}\n\nfunction interpolatedLineTo(ctx, target, point, property) {\n  const interpolatedPoint = target.interpolate(point, property);\n  if (interpolatedPoint) {\n    ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);\n  }\n}\n\n", "/**\n * Plugin based on discussion from the following Chart.js issues:\n * @see https://github.com/chartjs/Chart.js/issues/2380#issuecomment-279961569\n * @see https://github.com/chartjs/Chart.js/issues/2440#issuecomment-256461897\n */\n\nimport LineElement from '../../elements/element.line.js';\nimport {_drawfill} from './filler.drawing.js';\nimport {_shouldApplyFill} from './filler.helper.js';\nimport {_decodeFill, _resolveTarget} from './filler.options.js';\n\nexport default {\n  id: 'filler',\n\n  afterDatasetsUpdate(chart, _args, options) {\n    const count = (chart.data.datasets || []).length;\n    const sources = [];\n    let meta, i, line, source;\n\n    for (i = 0; i < count; ++i) {\n      meta = chart.getDatasetMeta(i);\n      line = meta.dataset;\n      source = null;\n\n      if (line && line.options && line instanceof LineElement) {\n        source = {\n          visible: chart.isDatasetVisible(i),\n          index: i,\n          fill: _decodeFill(line, i, count),\n          chart,\n          axis: meta.controller.options.indexAxis,\n          scale: meta.vScale,\n          line,\n        };\n      }\n\n      meta.$filler = source;\n      sources.push(source);\n    }\n\n    for (i = 0; i < count; ++i) {\n      source = sources[i];\n      if (!source || source.fill === false) {\n        continue;\n      }\n\n      source.fill = _resolveTarget(sources, i, options.propagate);\n    }\n  },\n\n  beforeDraw(chart, _args, options) {\n    const draw = options.drawTime === 'beforeDraw';\n    const metasets = chart.getSortedVisibleDatasetMetas();\n    const area = chart.chartArea;\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      const source = metasets[i].$filler;\n      if (!source) {\n        continue;\n      }\n\n      source.line.updateControlPoints(area, source.axis);\n      if (draw && source.fill) {\n        _drawfill(chart.ctx, source, area);\n      }\n    }\n  },\n\n  beforeDatasetsDraw(chart, _args, options) {\n    if (options.drawTime !== 'beforeDatasetsDraw') {\n      return;\n    }\n\n    const metasets = chart.getSortedVisibleDatasetMetas();\n    for (let i = metasets.length - 1; i >= 0; --i) {\n      const source = metasets[i].$filler;\n\n      if (_shouldApplyFill(source)) {\n        _drawfill(chart.ctx, source, chart.chartArea);\n      }\n    }\n  },\n\n  beforeDatasetDraw(chart, args, options) {\n    const source = args.meta.$filler;\n\n    if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {\n      return;\n    }\n\n    _drawfill(chart.ctx, source, chart.chartArea);\n  },\n\n  defaults: {\n    propagate: true,\n    drawTime: 'beforeDatasetDraw'\n  }\n};\n", "import defaults from '../core/core.defaults.js';\nimport Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helpers.canvas.js';\nimport {\n  _isBetween,\n  callback as call,\n  clipArea,\n  getRtlAdapter,\n  overrideTextDirection,\n  restoreTextDirection,\n  toFont,\n  toPadding,\n  unclipArea,\n  valueOrDefault,\n} from '../helpers/index.js';\nimport {_alignStartEnd, _textX, _toLeftRightCenter} from '../helpers/helpers.extras.js';\nimport {toTRBLCorners} from '../helpers/helpers.options.js';\n\n/**\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n */\n\nconst getBoxSize = (labelOpts, fontSize) => {\n  let {boxHeight = fontSize, boxWidth = fontSize} = labelOpts;\n\n  if (labelOpts.usePointStyle) {\n    boxHeight = Math.min(boxHeight, fontSize);\n    boxWidth = labelOpts.pointStyleWidth || Math.min(boxWidth, fontSize);\n  }\n\n  return {\n    boxWidth,\n    boxHeight,\n    itemHeight: Math.max(fontSize, boxHeight)\n  };\n};\n\nconst itemsEqual = (a, b) => a !== null && b !== null && a.datasetIndex === b.datasetIndex && a.index === b.index;\n\nexport class Legend extends Element {\n\n  /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n  constructor(config) {\n    super();\n\n    this._added = false;\n\n    // Contains hit boxes for each dataset (in dataset order)\n    this.legendHitBoxes = [];\n\n    /**\n \t\t * @private\n \t\t */\n    this._hoveredItem = null;\n\n    // Are we in doughnut mode which has a different data type\n    this.doughnutMode = false;\n\n    this.chart = config.chart;\n    this.options = config.options;\n    this.ctx = config.ctx;\n    this.legendItems = undefined;\n    this.columnSizes = undefined;\n    this.lineWidths = undefined;\n    this.maxHeight = undefined;\n    this.maxWidth = undefined;\n    this.top = undefined;\n    this.bottom = undefined;\n    this.left = undefined;\n    this.right = undefined;\n    this.height = undefined;\n    this.width = undefined;\n    this._margins = undefined;\n    this.position = undefined;\n    this.weight = undefined;\n    this.fullSize = undefined;\n  }\n\n  update(maxWidth, maxHeight, margins) {\n    this.maxWidth = maxWidth;\n    this.maxHeight = maxHeight;\n    this._margins = margins;\n\n    this.setDimensions();\n    this.buildLabels();\n    this.fit();\n  }\n\n  setDimensions() {\n    if (this.isHorizontal()) {\n      this.width = this.maxWidth;\n      this.left = this._margins.left;\n      this.right = this.width;\n    } else {\n      this.height = this.maxHeight;\n      this.top = this._margins.top;\n      this.bottom = this.height;\n    }\n  }\n\n  buildLabels() {\n    const labelOpts = this.options.labels || {};\n    let legendItems = call(labelOpts.generateLabels, [this.chart], this) || [];\n\n    if (labelOpts.filter) {\n      legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));\n    }\n\n    if (labelOpts.sort) {\n      legendItems = legendItems.sort((a, b) => labelOpts.sort(a, b, this.chart.data));\n    }\n\n    if (this.options.reverse) {\n      legendItems.reverse();\n    }\n\n    this.legendItems = legendItems;\n  }\n\n  fit() {\n    const {options, ctx} = this;\n\n    // The legend may not be displayed for a variety of reasons including\n    // the fact that the defaults got set to `false`.\n    // When the legend is not displayed, there are no guarantees that the options\n    // are correctly formatted so we need to bail out as early as possible.\n    if (!options.display) {\n      this.width = this.height = 0;\n      return;\n    }\n\n    const labelOpts = options.labels;\n    const labelFont = toFont(labelOpts.font);\n    const fontSize = labelFont.size;\n    const titleHeight = this._computeTitleHeight();\n    const {boxWidth, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n    let width, height;\n\n    ctx.font = labelFont.string;\n\n    if (this.isHorizontal()) {\n      width = this.maxWidth; // fill all the width\n      height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;\n    } else {\n      height = this.maxHeight; // fill all the height\n      width = this._fitCols(titleHeight, labelFont, boxWidth, itemHeight) + 10;\n    }\n\n    this.width = Math.min(width, options.maxWidth || this.maxWidth);\n    this.height = Math.min(height, options.maxHeight || this.maxHeight);\n  }\n\n  /**\n\t * @private\n\t */\n  _fitRows(titleHeight, fontSize, boxWidth, itemHeight) {\n    const {ctx, maxWidth, options: {labels: {padding}}} = this;\n    const hitboxes = this.legendHitBoxes = [];\n    // Width of each line of legend boxes. Labels wrap onto multiple lines when there are too many to fit on one\n    const lineWidths = this.lineWidths = [0];\n    const lineHeight = itemHeight + padding;\n    let totalHeight = titleHeight;\n\n    ctx.textAlign = 'left';\n    ctx.textBaseline = 'middle';\n\n    let row = -1;\n    let top = -lineHeight;\n    this.legendItems.forEach((legendItem, i) => {\n      const itemWidth = boxWidth + (fontSize / 2) + ctx.measureText(legendItem.text).width;\n\n      if (i === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {\n        totalHeight += lineHeight;\n        lineWidths[lineWidths.length - (i > 0 ? 0 : 1)] = 0;\n        top += lineHeight;\n        row++;\n      }\n\n      hitboxes[i] = {left: 0, top, row, width: itemWidth, height: itemHeight};\n\n      lineWidths[lineWidths.length - 1] += itemWidth + padding;\n    });\n\n    return totalHeight;\n  }\n\n  _fitCols(titleHeight, labelFont, boxWidth, _itemHeight) {\n    const {ctx, maxHeight, options: {labels: {padding}}} = this;\n    const hitboxes = this.legendHitBoxes = [];\n    const columnSizes = this.columnSizes = [];\n    const heightLimit = maxHeight - titleHeight;\n\n    let totalWidth = padding;\n    let currentColWidth = 0;\n    let currentColHeight = 0;\n\n    let left = 0;\n    let col = 0;\n\n    this.legendItems.forEach((legendItem, i) => {\n      const {itemWidth, itemHeight} = calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight);\n\n      // If too tall, go to new column\n      if (i > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {\n        totalWidth += currentColWidth + padding;\n        columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n        left += currentColWidth + padding;\n        col++;\n        currentColWidth = currentColHeight = 0;\n      }\n\n      // Store the hitbox width and height here. Final position will be updated in `draw`\n      hitboxes[i] = {left, top: currentColHeight, col, width: itemWidth, height: itemHeight};\n\n      // Get max width\n      currentColWidth = Math.max(currentColWidth, itemWidth);\n      currentColHeight += itemHeight + padding;\n    });\n\n    totalWidth += currentColWidth;\n    columnSizes.push({width: currentColWidth, height: currentColHeight}); // previous column size\n\n    return totalWidth;\n  }\n\n  adjustHitBoxes() {\n    if (!this.options.display) {\n      return;\n    }\n    const titleHeight = this._computeTitleHeight();\n    const {legendHitBoxes: hitboxes, options: {align, labels: {padding}, rtl}} = this;\n    const rtlHelper = getRtlAdapter(rtl, this.left, this.width);\n    if (this.isHorizontal()) {\n      let row = 0;\n      let left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n      for (const hitbox of hitboxes) {\n        if (row !== hitbox.row) {\n          row = hitbox.row;\n          left = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);\n        }\n        hitbox.top += this.top + titleHeight + padding;\n        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left), hitbox.width);\n        left += hitbox.width + padding;\n      }\n    } else {\n      let col = 0;\n      let top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n      for (const hitbox of hitboxes) {\n        if (hitbox.col !== col) {\n          col = hitbox.col;\n          top = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);\n        }\n        hitbox.top = top;\n        hitbox.left += this.left + padding;\n        hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);\n        top += hitbox.height + padding;\n      }\n    }\n  }\n\n  isHorizontal() {\n    return this.options.position === 'top' || this.options.position === 'bottom';\n  }\n\n  draw() {\n    if (this.options.display) {\n      const ctx = this.ctx;\n      clipArea(ctx, this);\n\n      this._draw();\n\n      unclipArea(ctx);\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _draw() {\n    const {options: opts, columnSizes, lineWidths, ctx} = this;\n    const {align, labels: labelOpts} = opts;\n    const defaultColor = defaults.color;\n    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n    const labelFont = toFont(labelOpts.font);\n    const {padding} = labelOpts;\n    const fontSize = labelFont.size;\n    const halfFontSize = fontSize / 2;\n    let cursor;\n\n    this.drawTitle();\n\n    // Canvas setup\n    ctx.textAlign = rtlHelper.textAlign('left');\n    ctx.textBaseline = 'middle';\n    ctx.lineWidth = 0.5;\n    ctx.font = labelFont.string;\n\n    const {boxWidth, boxHeight, itemHeight} = getBoxSize(labelOpts, fontSize);\n\n    // current position\n    const drawLegendBox = function(x, y, legendItem) {\n      if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {\n        return;\n      }\n\n      // Set the ctx for the box\n      ctx.save();\n\n      const lineWidth = valueOrDefault(legendItem.lineWidth, 1);\n      ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);\n      ctx.lineCap = valueOrDefault(legendItem.lineCap, 'butt');\n      ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);\n      ctx.lineJoin = valueOrDefault(legendItem.lineJoin, 'miter');\n      ctx.lineWidth = lineWidth;\n      ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);\n\n      ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));\n\n      if (labelOpts.usePointStyle) {\n        // Recalculate x and y for drawPoint() because its expecting\n        // x and y to be center of figure (instead of top left)\n        const drawOptions = {\n          radius: boxHeight * Math.SQRT2 / 2,\n          pointStyle: legendItem.pointStyle,\n          rotation: legendItem.rotation,\n          borderWidth: lineWidth\n        };\n        const centerX = rtlHelper.xPlus(x, boxWidth / 2);\n        const centerY = y + halfFontSize;\n\n        // Draw pointStyle as legend symbol\n        drawPointLegend(ctx, drawOptions, centerX, centerY, labelOpts.pointStyleWidth && boxWidth);\n      } else {\n        // Draw box as legend symbol\n        // Adjust position when boxHeight < fontSize (want it centered)\n        const yBoxTop = y + Math.max((fontSize - boxHeight) / 2, 0);\n        const xBoxLeft = rtlHelper.leftForLtr(x, boxWidth);\n        const borderRadius = toTRBLCorners(legendItem.borderRadius);\n\n        ctx.beginPath();\n\n        if (Object.values(borderRadius).some(v => v !== 0)) {\n          addRoundedRectPath(ctx, {\n            x: xBoxLeft,\n            y: yBoxTop,\n            w: boxWidth,\n            h: boxHeight,\n            radius: borderRadius,\n          });\n        } else {\n          ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);\n        }\n\n        ctx.fill();\n        if (lineWidth !== 0) {\n          ctx.stroke();\n        }\n      }\n\n      ctx.restore();\n    };\n\n    const fillText = function(x, y, legendItem) {\n      renderText(ctx, legendItem.text, x, y + (itemHeight / 2), labelFont, {\n        strikethrough: legendItem.hidden,\n        textAlign: rtlHelper.textAlign(legendItem.textAlign)\n      });\n    };\n\n    // Horizontal\n    const isHorizontal = this.isHorizontal();\n    const titleHeight = this._computeTitleHeight();\n    if (isHorizontal) {\n      cursor = {\n        x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),\n        y: this.top + padding + titleHeight,\n        line: 0\n      };\n    } else {\n      cursor = {\n        x: this.left + padding,\n        y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),\n        line: 0\n      };\n    }\n\n    overrideTextDirection(this.ctx, opts.textDirection);\n\n    const lineHeight = itemHeight + padding;\n    this.legendItems.forEach((legendItem, i) => {\n      ctx.strokeStyle = legendItem.fontColor; // for strikethrough effect\n      ctx.fillStyle = legendItem.fontColor; // render in correct colour\n\n      const textWidth = ctx.measureText(legendItem.text).width;\n      const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));\n      const width = boxWidth + halfFontSize + textWidth;\n      let x = cursor.x;\n      let y = cursor.y;\n\n      rtlHelper.setWidth(this.width);\n\n      if (isHorizontal) {\n        if (i > 0 && x + width + padding > this.right) {\n          y = cursor.y += lineHeight;\n          cursor.line++;\n          x = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);\n        }\n      } else if (i > 0 && y + lineHeight > this.bottom) {\n        x = cursor.x = x + columnSizes[cursor.line].width + padding;\n        cursor.line++;\n        y = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);\n      }\n\n      const realX = rtlHelper.x(x);\n\n      drawLegendBox(realX, y, legendItem);\n\n      x = _textX(textAlign, x + boxWidth + halfFontSize, isHorizontal ? x + width : this.right, opts.rtl);\n\n      // Fill the actual label\n      fillText(rtlHelper.x(x), y, legendItem);\n\n      if (isHorizontal) {\n        cursor.x += width + padding;\n      } else if (typeof legendItem.text !== 'string') {\n        const fontLineHeight = labelFont.lineHeight;\n        cursor.y += calculateLegendItemHeight(legendItem, fontLineHeight) + padding;\n      } else {\n        cursor.y += lineHeight;\n      }\n    });\n\n    restoreTextDirection(this.ctx, opts.textDirection);\n  }\n\n  /**\n\t * @protected\n\t */\n  drawTitle() {\n    const opts = this.options;\n    const titleOpts = opts.title;\n    const titleFont = toFont(titleOpts.font);\n    const titlePadding = toPadding(titleOpts.padding);\n\n    if (!titleOpts.display) {\n      return;\n    }\n\n    const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);\n    const ctx = this.ctx;\n    const position = titleOpts.position;\n    const halfFontSize = titleFont.size / 2;\n    const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;\n    let y;\n\n    // These defaults are used when the legend is vertical.\n    // When horizontal, they are computed below.\n    let left = this.left;\n    let maxWidth = this.width;\n\n    if (this.isHorizontal()) {\n      // Move left / right so that the title is above the legend lines\n      maxWidth = Math.max(...this.lineWidths);\n      y = this.top + topPaddingPlusHalfFontSize;\n      left = _alignStartEnd(opts.align, left, this.right - maxWidth);\n    } else {\n      // Move down so that the title is above the legend stack in every alignment\n      const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);\n      y = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());\n    }\n\n    // Now that we know the left edge of the inner legend box, compute the correct\n    // X coordinate from the title alignment\n    const x = _alignStartEnd(position, left, left + maxWidth);\n\n    // Canvas setup\n    ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));\n    ctx.textBaseline = 'middle';\n    ctx.strokeStyle = titleOpts.color;\n    ctx.fillStyle = titleOpts.color;\n    ctx.font = titleFont.string;\n\n    renderText(ctx, titleOpts.text, x, y, titleFont);\n  }\n\n  /**\n\t * @private\n\t */\n  _computeTitleHeight() {\n    const titleOpts = this.options.title;\n    const titleFont = toFont(titleOpts.font);\n    const titlePadding = toPadding(titleOpts.padding);\n    return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;\n  }\n\n  /**\n\t * @private\n\t */\n  _getLegendItemAt(x, y) {\n    let i, hitBox, lh;\n\n    if (_isBetween(x, this.left, this.right)\n      && _isBetween(y, this.top, this.bottom)) {\n      // See if we are touching one of the dataset boxes\n      lh = this.legendHitBoxes;\n      for (i = 0; i < lh.length; ++i) {\n        hitBox = lh[i];\n\n        if (_isBetween(x, hitBox.left, hitBox.left + hitBox.width)\n          && _isBetween(y, hitBox.top, hitBox.top + hitBox.height)) {\n          // Touching an element\n          return this.legendItems[i];\n        }\n      }\n    }\n\n    return null;\n  }\n\n  /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t */\n  handleEvent(e) {\n    const opts = this.options;\n    if (!isListened(e.type, opts)) {\n      return;\n    }\n\n    // Chart event already has relative position in it\n    const hoveredItem = this._getLegendItemAt(e.x, e.y);\n\n    if (e.type === 'mousemove' || e.type === 'mouseout') {\n      const previous = this._hoveredItem;\n      const sameItem = itemsEqual(previous, hoveredItem);\n      if (previous && !sameItem) {\n        call(opts.onLeave, [e, previous, this], this);\n      }\n\n      this._hoveredItem = hoveredItem;\n\n      if (hoveredItem && !sameItem) {\n        call(opts.onHover, [e, hoveredItem, this], this);\n      }\n    } else if (hoveredItem) {\n      call(opts.onClick, [e, hoveredItem, this], this);\n    }\n  }\n}\n\nfunction calculateItemSize(boxWidth, labelFont, ctx, legendItem, _itemHeight) {\n  const itemWidth = calculateItemWidth(legendItem, boxWidth, labelFont, ctx);\n  const itemHeight = calculateItemHeight(_itemHeight, legendItem, labelFont.lineHeight);\n  return {itemWidth, itemHeight};\n}\n\nfunction calculateItemWidth(legendItem, boxWidth, labelFont, ctx) {\n  let legendItemText = legendItem.text;\n  if (legendItemText && typeof legendItemText !== 'string') {\n    legendItemText = legendItemText.reduce((a, b) => a.length > b.length ? a : b);\n  }\n  return boxWidth + (labelFont.size / 2) + ctx.measureText(legendItemText).width;\n}\n\nfunction calculateItemHeight(_itemHeight, legendItem, fontLineHeight) {\n  let itemHeight = _itemHeight;\n  if (typeof legendItem.text !== 'string') {\n    itemHeight = calculateLegendItemHeight(legendItem, fontLineHeight);\n  }\n  return itemHeight;\n}\n\nfunction calculateLegendItemHeight(legendItem, fontLineHeight) {\n  const labelHeight = legendItem.text ? legendItem.text.length : 0;\n  return fontLineHeight * labelHeight;\n}\n\nfunction isListened(type, opts) {\n  if ((type === 'mousemove' || type === 'mouseout') && (opts.onHover || opts.onLeave)) {\n    return true;\n  }\n  if (opts.onClick && (type === 'click' || type === 'mouseup')) {\n    return true;\n  }\n  return false;\n}\n\nexport default {\n  id: 'legend',\n\n  /**\n\t * For tests\n\t * @private\n\t */\n  _element: Legend,\n\n  start(chart, _args, options) {\n    const legend = chart.legend = new Legend({ctx: chart.ctx, options, chart});\n    layouts.configure(chart, legend, options);\n    layouts.addBox(chart, legend);\n  },\n\n  stop(chart) {\n    layouts.removeBox(chart, chart.legend);\n    delete chart.legend;\n  },\n\n  // During the beforeUpdate step, the layout configuration needs to run\n  // This ensures that if the legend position changes (via an option update)\n  // the layout system respects the change. See https://github.com/chartjs/Chart.js/issues/7527\n  beforeUpdate(chart, _args, options) {\n    const legend = chart.legend;\n    layouts.configure(chart, legend, options);\n    legend.options = options;\n  },\n\n  // The labels need to be built after datasets are updated to ensure that colors\n  // and other styling are correct. See https://github.com/chartjs/Chart.js/issues/6968\n  afterUpdate(chart) {\n    const legend = chart.legend;\n    legend.buildLabels();\n    legend.adjustHitBoxes();\n  },\n\n\n  afterEvent(chart, args) {\n    if (!args.replay) {\n      chart.legend.handleEvent(args.event);\n    }\n  },\n\n  defaults: {\n    display: true,\n    position: 'top',\n    align: 'center',\n    fullSize: true,\n    reverse: false,\n    weight: 1000,\n\n    // a callback that will handle\n    onClick(e, legendItem, legend) {\n      const index = legendItem.datasetIndex;\n      const ci = legend.chart;\n      if (ci.isDatasetVisible(index)) {\n        ci.hide(index);\n        legendItem.hidden = true;\n      } else {\n        ci.show(index);\n        legendItem.hidden = false;\n      }\n    },\n\n    onHover: null,\n    onLeave: null,\n\n    labels: {\n      color: (ctx) => ctx.chart.options.color,\n      boxWidth: 40,\n      padding: 10,\n      // Generates labels shown in the legend\n      // Valid properties to return:\n      // text : text to display\n      // fillStyle : fill of coloured box\n      // strokeStyle: stroke of coloured box\n      // hidden : if this legend item refers to a hidden item\n      // lineCap : cap style for line\n      // lineDash\n      // lineDashOffset :\n      // lineJoin :\n      // lineWidth :\n      generateLabels(chart) {\n        const datasets = chart.data.datasets;\n        const {labels: {usePointStyle, pointStyle, textAlign, color, useBorderRadius, borderRadius}} = chart.legend.options;\n\n        return chart._getSortedDatasetMetas().map((meta) => {\n          const style = meta.controller.getStyle(usePointStyle ? 0 : undefined);\n          const borderWidth = toPadding(style.borderWidth);\n\n          return {\n            text: datasets[meta.index].label,\n            fillStyle: style.backgroundColor,\n            fontColor: color,\n            hidden: !meta.visible,\n            lineCap: style.borderCapStyle,\n            lineDash: style.borderDash,\n            lineDashOffset: style.borderDashOffset,\n            lineJoin: style.borderJoinStyle,\n            lineWidth: (borderWidth.width + borderWidth.height) / 4,\n            strokeStyle: style.borderColor,\n            pointStyle: pointStyle || style.pointStyle,\n            rotation: style.rotation,\n            textAlign: textAlign || style.textAlign,\n            borderRadius: useBorderRadius && (borderRadius || style.borderRadius),\n\n            // Below is extra data used for toggling the datasets\n            datasetIndex: meta.index\n          };\n        }, this);\n      }\n    },\n\n    title: {\n      color: (ctx) => ctx.chart.options.color,\n      display: false,\n      position: 'center',\n      text: '',\n    }\n  },\n\n  descriptors: {\n    _scriptable: (name) => !name.startsWith('on'),\n    labels: {\n      _scriptable: (name) => !['generateLabels', 'filter', 'sort'].includes(name),\n    }\n  },\n};\n", "import Element from '../core/core.element.js';\nimport layouts from '../core/core.layouts.js';\nimport {PI, isArray, toPadding, toFont} from '../helpers/index.js';\nimport {_toLeftRightCenter, _alignStartEnd} from '../helpers/helpers.extras.js';\nimport {renderText} from '../helpers/helpers.canvas.js';\n\nexport class Title extends Element {\n  /**\n\t * @param {{ ctx: any; options: any; chart: any; }} config\n\t */\n  constructor(config) {\n    super();\n\n    this.chart = config.chart;\n    this.options = config.options;\n    this.ctx = config.ctx;\n    this._padding = undefined;\n    this.top = undefined;\n    this.bottom = undefined;\n    this.left = undefined;\n    this.right = undefined;\n    this.width = undefined;\n    this.height = undefined;\n    this.position = undefined;\n    this.weight = undefined;\n    this.fullSize = undefined;\n  }\n\n  update(maxWidth, maxHeight) {\n    const opts = this.options;\n\n    this.left = 0;\n    this.top = 0;\n\n    if (!opts.display) {\n      this.width = this.height = this.right = this.bottom = 0;\n      return;\n    }\n\n    this.width = this.right = maxWidth;\n    this.height = this.bottom = maxHeight;\n\n    const lineCount = isArray(opts.text) ? opts.text.length : 1;\n    this._padding = toPadding(opts.padding);\n    const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;\n\n    if (this.isHorizontal()) {\n      this.height = textSize;\n    } else {\n      this.width = textSize;\n    }\n  }\n\n  isHorizontal() {\n    const pos = this.options.position;\n    return pos === 'top' || pos === 'bottom';\n  }\n\n  _drawArgs(offset) {\n    const {top, left, bottom, right, options} = this;\n    const align = options.align;\n    let rotation = 0;\n    let maxWidth, titleX, titleY;\n\n    if (this.isHorizontal()) {\n      titleX = _alignStartEnd(align, left, right);\n      titleY = top + offset;\n      maxWidth = right - left;\n    } else {\n      if (options.position === 'left') {\n        titleX = left + offset;\n        titleY = _alignStartEnd(align, bottom, top);\n        rotation = PI * -0.5;\n      } else {\n        titleX = right - offset;\n        titleY = _alignStartEnd(align, top, bottom);\n        rotation = PI * 0.5;\n      }\n      maxWidth = bottom - top;\n    }\n    return {titleX, titleY, maxWidth, rotation};\n  }\n\n  draw() {\n    const ctx = this.ctx;\n    const opts = this.options;\n\n    if (!opts.display) {\n      return;\n    }\n\n    const fontOpts = toFont(opts.font);\n    const lineHeight = fontOpts.lineHeight;\n    const offset = lineHeight / 2 + this._padding.top;\n    const {titleX, titleY, maxWidth, rotation} = this._drawArgs(offset);\n\n    renderText(ctx, opts.text, 0, 0, fontOpts, {\n      color: opts.color,\n      maxWidth,\n      rotation,\n      textAlign: _toLeftRightCenter(opts.align),\n      textBaseline: 'middle',\n      translation: [titleX, titleY],\n    });\n  }\n}\n\nfunction createTitle(chart, titleOpts) {\n  const title = new Title({\n    ctx: chart.ctx,\n    options: titleOpts,\n    chart\n  });\n\n  layouts.configure(chart, title, titleOpts);\n  layouts.addBox(chart, title);\n  chart.titleBlock = title;\n}\n\nexport default {\n  id: 'title',\n\n  /**\n\t * For tests\n\t * @private\n\t */\n  _element: Title,\n\n  start(chart, _args, options) {\n    createTitle(chart, options);\n  },\n\n  stop(chart) {\n    const titleBlock = chart.titleBlock;\n    layouts.removeBox(chart, titleBlock);\n    delete chart.titleBlock;\n  },\n\n  beforeUpdate(chart, _args, options) {\n    const title = chart.titleBlock;\n    layouts.configure(chart, title, options);\n    title.options = options;\n  },\n\n  defaults: {\n    align: 'center',\n    display: false,\n    font: {\n      weight: 'bold',\n    },\n    fullSize: true,\n    padding: 10,\n    position: 'top',\n    text: '',\n    weight: 2000         // by default greater than legend (1000) to be above\n  },\n\n  defaultRoutes: {\n    color: 'color'\n  },\n\n  descriptors: {\n    _scriptable: true,\n    _indexable: false,\n  },\n};\n", "import {Title} from './plugin.title.js';\nimport layouts from '../core/core.layouts.js';\n\nconst map = new WeakMap();\n\nexport default {\n  id: 'subtitle',\n\n  start(chart, _args, options) {\n    const title = new Title({\n      ctx: chart.ctx,\n      options,\n      chart\n    });\n\n    layouts.configure(chart, title, options);\n    layouts.addBox(chart, title);\n    map.set(chart, title);\n  },\n\n  stop(chart) {\n    layouts.removeBox(chart, map.get(chart));\n    map.delete(chart);\n  },\n\n  beforeUpdate(chart, _args, options) {\n    const title = map.get(chart);\n    layouts.configure(chart, title, options);\n    title.options = options;\n  },\n\n  defaults: {\n    align: 'center',\n    display: false,\n    font: {\n      weight: 'normal',\n    },\n    fullSize: true,\n    padding: 0,\n    position: 'top',\n    text: '',\n    weight: 1500         // by default greater than legend (1000) and smaller than title (2000)\n  },\n\n  defaultRoutes: {\n    color: 'color'\n  },\n\n  descriptors: {\n    _scriptable: true,\n    _indexable: false,\n  },\n};\n", "import Animations from '../core/core.animations.js';\nimport Element from '../core/core.element.js';\nimport {addRoundedRectPath} from '../helpers/helpers.canvas.js';\nimport {each, noop, isNullOrUndef, isArray, _elementsEqual, isObject} from '../helpers/helpers.core.js';\nimport {toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\nimport {getRtlAdapter, overrideTextDirection, restoreTextDirection} from '../helpers/helpers.rtl.js';\nimport {distanceBetweenPoints, _limitValue} from '../helpers/helpers.math.js';\nimport {createContext, drawPoint} from '../helpers/index.js';\n\n/**\n * @typedef { import('../platform/platform.base.js').Chart } Chart\n * @typedef { import('../types/index.js').ChartEvent } ChartEvent\n * @typedef { import('../types/index.js').ActiveElement } ActiveElement\n * @typedef { import('../core/core.interaction.js').InteractionItem } InteractionItem\n */\n\nconst positioners = {\n  /**\n\t * Average mode places the tooltip at the average position of the elements shown\n\t */\n  average(items) {\n    if (!items.length) {\n      return false;\n    }\n\n    let i, len;\n    let x = 0;\n    let y = 0;\n    let count = 0;\n\n    for (i = 0, len = items.length; i < len; ++i) {\n      const el = items[i].element;\n      if (el && el.hasValue()) {\n        const pos = el.tooltipPosition();\n        x += pos.x;\n        y += pos.y;\n        ++count;\n      }\n    }\n\n    return {\n      x: x / count,\n      y: y / count\n    };\n  },\n\n  /**\n\t * Gets the tooltip position nearest of the item nearest to the event position\n\t */\n  nearest(items, eventPosition) {\n    if (!items.length) {\n      return false;\n    }\n\n    let x = eventPosition.x;\n    let y = eventPosition.y;\n    let minDistance = Number.POSITIVE_INFINITY;\n    let i, len, nearestElement;\n\n    for (i = 0, len = items.length; i < len; ++i) {\n      const el = items[i].element;\n      if (el && el.hasValue()) {\n        const center = el.getCenterPoint();\n        const d = distanceBetweenPoints(eventPosition, center);\n\n        if (d < minDistance) {\n          minDistance = d;\n          nearestElement = el;\n        }\n      }\n    }\n\n    if (nearestElement) {\n      const tp = nearestElement.tooltipPosition();\n      x = tp.x;\n      y = tp.y;\n    }\n\n    return {\n      x,\n      y\n    };\n  }\n};\n\n// Helper to push or concat based on if the 2nd parameter is an array or not\nfunction pushOrConcat(base, toPush) {\n  if (toPush) {\n    if (isArray(toPush)) {\n      // base = base.concat(toPush);\n      Array.prototype.push.apply(base, toPush);\n    } else {\n      base.push(toPush);\n    }\n  }\n\n  return base;\n}\n\n/**\n * Returns array of strings split by newline\n * @param {*} str - The value to split by newline.\n * @returns {string|string[]} value if newline present - Returned from String split() method\n * @function\n */\nfunction splitNewlines(str) {\n  if ((typeof str === 'string' || str instanceof String) && str.indexOf('\\n') > -1) {\n    return str.split('\\n');\n  }\n  return str;\n}\n\n\n/**\n * Private helper to create a tooltip item model\n * @param {Chart} chart\n * @param {ActiveElement} item - {element, index, datasetIndex} to create the tooltip item for\n * @return new tooltip item\n */\nfunction createTooltipItem(chart, item) {\n  const {element, datasetIndex, index} = item;\n  const controller = chart.getDatasetMeta(datasetIndex).controller;\n  const {label, value} = controller.getLabelAndValue(index);\n\n  return {\n    chart,\n    label,\n    parsed: controller.getParsed(index),\n    raw: chart.data.datasets[datasetIndex].data[index],\n    formattedValue: value,\n    dataset: controller.getDataset(),\n    dataIndex: index,\n    datasetIndex,\n    element\n  };\n}\n\n/**\n * Get the size of the tooltip\n */\nfunction getTooltipSize(tooltip, options) {\n  const ctx = tooltip.chart.ctx;\n  const {body, footer, title} = tooltip;\n  const {boxWidth, boxHeight} = options;\n  const bodyFont = toFont(options.bodyFont);\n  const titleFont = toFont(options.titleFont);\n  const footerFont = toFont(options.footerFont);\n  const titleLineCount = title.length;\n  const footerLineCount = footer.length;\n  const bodyLineItemCount = body.length;\n\n  const padding = toPadding(options.padding);\n  let height = padding.height;\n  let width = 0;\n\n  // Count of all lines in the body\n  let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);\n  combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;\n\n  if (titleLineCount) {\n    height += titleLineCount * titleFont.lineHeight\n\t\t\t+ (titleLineCount - 1) * options.titleSpacing\n\t\t\t+ options.titleMarginBottom;\n  }\n  if (combinedBodyLength) {\n    // Body lines may include some extra height depending on boxHeight\n    const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;\n    height += bodyLineItemCount * bodyLineHeight\n\t\t\t+ (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight\n\t\t\t+ (combinedBodyLength - 1) * options.bodySpacing;\n  }\n  if (footerLineCount) {\n    height += options.footerMarginTop\n\t\t\t+ footerLineCount * footerFont.lineHeight\n\t\t\t+ (footerLineCount - 1) * options.footerSpacing;\n  }\n\n  // Title width\n  let widthPadding = 0;\n  const maxLineWidth = function(line) {\n    width = Math.max(width, ctx.measureText(line).width + widthPadding);\n  };\n\n  ctx.save();\n\n  ctx.font = titleFont.string;\n  each(tooltip.title, maxLineWidth);\n\n  // Body width\n  ctx.font = bodyFont.string;\n  each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);\n\n  // Body lines may include some extra width due to the color box\n  widthPadding = options.displayColors ? (boxWidth + 2 + options.boxPadding) : 0;\n  each(body, (bodyItem) => {\n    each(bodyItem.before, maxLineWidth);\n    each(bodyItem.lines, maxLineWidth);\n    each(bodyItem.after, maxLineWidth);\n  });\n\n  // Reset back to 0\n  widthPadding = 0;\n\n  // Footer width\n  ctx.font = footerFont.string;\n  each(tooltip.footer, maxLineWidth);\n\n  ctx.restore();\n\n  // Add padding\n  width += padding.width;\n\n  return {width, height};\n}\n\nfunction determineYAlign(chart, size) {\n  const {y, height} = size;\n\n  if (y < height / 2) {\n    return 'top';\n  } else if (y > (chart.height - height / 2)) {\n    return 'bottom';\n  }\n  return 'center';\n}\n\nfunction doesNotFitWithAlign(xAlign, chart, options, size) {\n  const {x, width} = size;\n  const caret = options.caretSize + options.caretPadding;\n  if (xAlign === 'left' && x + width + caret > chart.width) {\n    return true;\n  }\n\n  if (xAlign === 'right' && x - width - caret < 0) {\n    return true;\n  }\n}\n\nfunction determineXAlign(chart, options, size, yAlign) {\n  const {x, width} = size;\n  const {width: chartWidth, chartArea: {left, right}} = chart;\n  let xAlign = 'center';\n\n  if (yAlign === 'center') {\n    xAlign = x <= (left + right) / 2 ? 'left' : 'right';\n  } else if (x <= width / 2) {\n    xAlign = 'left';\n  } else if (x >= chartWidth - width / 2) {\n    xAlign = 'right';\n  }\n\n  if (doesNotFitWithAlign(xAlign, chart, options, size)) {\n    xAlign = 'center';\n  }\n\n  return xAlign;\n}\n\n/**\n * Helper to get the alignment of a tooltip given the size\n */\nfunction determineAlignment(chart, options, size) {\n  const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);\n\n  return {\n    xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),\n    yAlign\n  };\n}\n\nfunction alignX(size, xAlign) {\n  let {x, width} = size;\n  if (xAlign === 'right') {\n    x -= width;\n  } else if (xAlign === 'center') {\n    x -= (width / 2);\n  }\n  return x;\n}\n\nfunction alignY(size, yAlign, paddingAndSize) {\n  // eslint-disable-next-line prefer-const\n  let {y, height} = size;\n  if (yAlign === 'top') {\n    y += paddingAndSize;\n  } else if (yAlign === 'bottom') {\n    y -= height + paddingAndSize;\n  } else {\n    y -= (height / 2);\n  }\n  return y;\n}\n\n/**\n * Helper to get the location a tooltip needs to be placed at given the initial position (via the vm) and the size and alignment\n */\nfunction getBackgroundPoint(options, size, alignment, chart) {\n  const {caretSize, caretPadding, cornerRadius} = options;\n  const {xAlign, yAlign} = alignment;\n  const paddingAndSize = caretSize + caretPadding;\n  const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n\n  let x = alignX(size, xAlign);\n  const y = alignY(size, yAlign, paddingAndSize);\n\n  if (yAlign === 'center') {\n    if (xAlign === 'left') {\n      x += paddingAndSize;\n    } else if (xAlign === 'right') {\n      x -= paddingAndSize;\n    }\n  } else if (xAlign === 'left') {\n    x -= Math.max(topLeft, bottomLeft) + caretSize;\n  } else if (xAlign === 'right') {\n    x += Math.max(topRight, bottomRight) + caretSize;\n  }\n\n  return {\n    x: _limitValue(x, 0, chart.width - size.width),\n    y: _limitValue(y, 0, chart.height - size.height)\n  };\n}\n\nfunction getAlignedX(tooltip, align, options) {\n  const padding = toPadding(options.padding);\n\n  return align === 'center'\n    ? tooltip.x + tooltip.width / 2\n    : align === 'right'\n      ? tooltip.x + tooltip.width - padding.right\n      : tooltip.x + padding.left;\n}\n\n/**\n * Helper to build before and after body lines\n */\nfunction getBeforeAfterBodyLines(callback) {\n  return pushOrConcat([], splitNewlines(callback));\n}\n\nfunction createTooltipContext(parent, tooltip, tooltipItems) {\n  return createContext(parent, {\n    tooltip,\n    tooltipItems,\n    type: 'tooltip'\n  });\n}\n\nfunction overrideCallbacks(callbacks, context) {\n  const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;\n  return override ? callbacks.override(override) : callbacks;\n}\n\nconst defaultCallbacks = {\n  // Args are: (tooltipItems, data)\n  beforeTitle: noop,\n  title(tooltipItems) {\n    if (tooltipItems.length > 0) {\n      const item = tooltipItems[0];\n      const labels = item.chart.data.labels;\n      const labelCount = labels ? labels.length : 0;\n\n      if (this && this.options && this.options.mode === 'dataset') {\n        return item.dataset.label || '';\n      } else if (item.label) {\n        return item.label;\n      } else if (labelCount > 0 && item.dataIndex < labelCount) {\n        return labels[item.dataIndex];\n      }\n    }\n\n    return '';\n  },\n  afterTitle: noop,\n\n  // Args are: (tooltipItems, data)\n  beforeBody: noop,\n\n  // Args are: (tooltipItem, data)\n  beforeLabel: noop,\n  label(tooltipItem) {\n    if (this && this.options && this.options.mode === 'dataset') {\n      return tooltipItem.label + ': ' + tooltipItem.formattedValue || tooltipItem.formattedValue;\n    }\n\n    let label = tooltipItem.dataset.label || '';\n\n    if (label) {\n      label += ': ';\n    }\n    const value = tooltipItem.formattedValue;\n    if (!isNullOrUndef(value)) {\n      label += value;\n    }\n    return label;\n  },\n  labelColor(tooltipItem) {\n    const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n    const options = meta.controller.getStyle(tooltipItem.dataIndex);\n    return {\n      borderColor: options.borderColor,\n      backgroundColor: options.backgroundColor,\n      borderWidth: options.borderWidth,\n      borderDash: options.borderDash,\n      borderDashOffset: options.borderDashOffset,\n      borderRadius: 0,\n    };\n  },\n  labelTextColor() {\n    return this.options.bodyColor;\n  },\n  labelPointStyle(tooltipItem) {\n    const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);\n    const options = meta.controller.getStyle(tooltipItem.dataIndex);\n    return {\n      pointStyle: options.pointStyle,\n      rotation: options.rotation,\n    };\n  },\n  afterLabel: noop,\n\n  // Args are: (tooltipItems, data)\n  afterBody: noop,\n\n  // Args are: (tooltipItems, data)\n  beforeFooter: noop,\n  footer: noop,\n  afterFooter: noop\n};\n\n/**\n * Invoke callback from object with context and arguments.\n * If callback returns `undefined`, then will be invoked default callback.\n * @param {Record<keyof typeof defaultCallbacks, Function>} callbacks\n * @param {keyof typeof defaultCallbacks} name\n * @param {*} ctx\n * @param {*} arg\n * @returns {any}\n */\nfunction invokeCallbackWithFallback(callbacks, name, ctx, arg) {\n  const result = callbacks[name].call(ctx, arg);\n\n  if (typeof result === 'undefined') {\n    return defaultCallbacks[name].call(ctx, arg);\n  }\n\n  return result;\n}\n\nexport class Tooltip extends Element {\n\n  /**\n   * @namespace Chart.Tooltip.positioners\n   */\n  static positioners = positioners;\n\n  constructor(config) {\n    super();\n\n    this.opacity = 0;\n    this._active = [];\n    this._eventPosition = undefined;\n    this._size = undefined;\n    this._cachedAnimations = undefined;\n    this._tooltipItems = [];\n    this.$animations = undefined;\n    this.$context = undefined;\n    this.chart = config.chart;\n    this.options = config.options;\n    this.dataPoints = undefined;\n    this.title = undefined;\n    this.beforeBody = undefined;\n    this.body = undefined;\n    this.afterBody = undefined;\n    this.footer = undefined;\n    this.xAlign = undefined;\n    this.yAlign = undefined;\n    this.x = undefined;\n    this.y = undefined;\n    this.height = undefined;\n    this.width = undefined;\n    this.caretX = undefined;\n    this.caretY = undefined;\n    // TODO: V4, make this private, rename to `_labelStyles`, and combine with `labelPointStyles`\n    // and `labelTextColors` to create a single variable\n    this.labelColors = undefined;\n    this.labelPointStyles = undefined;\n    this.labelTextColors = undefined;\n  }\n\n  initialize(options) {\n    this.options = options;\n    this._cachedAnimations = undefined;\n    this.$context = undefined;\n  }\n\n  /**\n\t * @private\n\t */\n  _resolveAnimations() {\n    const cached = this._cachedAnimations;\n\n    if (cached) {\n      return cached;\n    }\n\n    const chart = this.chart;\n    const options = this.options.setContext(this.getContext());\n    const opts = options.enabled && chart.options.animation && options.animations;\n    const animations = new Animations(this.chart, opts);\n    if (opts._cacheable) {\n      this._cachedAnimations = Object.freeze(animations);\n    }\n\n    return animations;\n  }\n\n  /**\n\t * @protected\n\t */\n  getContext() {\n    return this.$context ||\n\t\t\t(this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));\n  }\n\n  getTitle(context, options) {\n    const {callbacks} = options;\n\n    const beforeTitle = invokeCallbackWithFallback(callbacks, 'beforeTitle', this, context);\n    const title = invokeCallbackWithFallback(callbacks, 'title', this, context);\n    const afterTitle = invokeCallbackWithFallback(callbacks, 'afterTitle', this, context);\n\n    let lines = [];\n    lines = pushOrConcat(lines, splitNewlines(beforeTitle));\n    lines = pushOrConcat(lines, splitNewlines(title));\n    lines = pushOrConcat(lines, splitNewlines(afterTitle));\n\n    return lines;\n  }\n\n  getBeforeBody(tooltipItems, options) {\n    return getBeforeAfterBodyLines(\n      invokeCallbackWithFallback(options.callbacks, 'beforeBody', this, tooltipItems)\n    );\n  }\n\n  getBody(tooltipItems, options) {\n    const {callbacks} = options;\n    const bodyItems = [];\n\n    each(tooltipItems, (context) => {\n      const bodyItem = {\n        before: [],\n        lines: [],\n        after: []\n      };\n      const scoped = overrideCallbacks(callbacks, context);\n      pushOrConcat(bodyItem.before, splitNewlines(invokeCallbackWithFallback(scoped, 'beforeLabel', this, context)));\n      pushOrConcat(bodyItem.lines, invokeCallbackWithFallback(scoped, 'label', this, context));\n      pushOrConcat(bodyItem.after, splitNewlines(invokeCallbackWithFallback(scoped, 'afterLabel', this, context)));\n\n      bodyItems.push(bodyItem);\n    });\n\n    return bodyItems;\n  }\n\n  getAfterBody(tooltipItems, options) {\n    return getBeforeAfterBodyLines(\n      invokeCallbackWithFallback(options.callbacks, 'afterBody', this, tooltipItems)\n    );\n  }\n\n  // Get the footer and beforeFooter and afterFooter lines\n  getFooter(tooltipItems, options) {\n    const {callbacks} = options;\n\n    const beforeFooter = invokeCallbackWithFallback(callbacks, 'beforeFooter', this, tooltipItems);\n    const footer = invokeCallbackWithFallback(callbacks, 'footer', this, tooltipItems);\n    const afterFooter = invokeCallbackWithFallback(callbacks, 'afterFooter', this, tooltipItems);\n\n    let lines = [];\n    lines = pushOrConcat(lines, splitNewlines(beforeFooter));\n    lines = pushOrConcat(lines, splitNewlines(footer));\n    lines = pushOrConcat(lines, splitNewlines(afterFooter));\n\n    return lines;\n  }\n\n  /**\n\t * @private\n\t */\n  _createItems(options) {\n    const active = this._active;\n    const data = this.chart.data;\n    const labelColors = [];\n    const labelPointStyles = [];\n    const labelTextColors = [];\n    let tooltipItems = [];\n    let i, len;\n\n    for (i = 0, len = active.length; i < len; ++i) {\n      tooltipItems.push(createTooltipItem(this.chart, active[i]));\n    }\n\n    // If the user provided a filter function, use it to modify the tooltip items\n    if (options.filter) {\n      tooltipItems = tooltipItems.filter((element, index, array) => options.filter(element, index, array, data));\n    }\n\n    // If the user provided a sorting function, use it to modify the tooltip items\n    if (options.itemSort) {\n      tooltipItems = tooltipItems.sort((a, b) => options.itemSort(a, b, data));\n    }\n\n    // Determine colors for boxes\n    each(tooltipItems, (context) => {\n      const scoped = overrideCallbacks(options.callbacks, context);\n      labelColors.push(invokeCallbackWithFallback(scoped, 'labelColor', this, context));\n      labelPointStyles.push(invokeCallbackWithFallback(scoped, 'labelPointStyle', this, context));\n      labelTextColors.push(invokeCallbackWithFallback(scoped, 'labelTextColor', this, context));\n    });\n\n    this.labelColors = labelColors;\n    this.labelPointStyles = labelPointStyles;\n    this.labelTextColors = labelTextColors;\n    this.dataPoints = tooltipItems;\n    return tooltipItems;\n  }\n\n  update(changed, replay) {\n    const options = this.options.setContext(this.getContext());\n    const active = this._active;\n    let properties;\n    let tooltipItems = [];\n\n    if (!active.length) {\n      if (this.opacity !== 0) {\n        properties = {\n          opacity: 0\n        };\n      }\n    } else {\n      const position = positioners[options.position].call(this, active, this._eventPosition);\n      tooltipItems = this._createItems(options);\n\n      this.title = this.getTitle(tooltipItems, options);\n      this.beforeBody = this.getBeforeBody(tooltipItems, options);\n      this.body = this.getBody(tooltipItems, options);\n      this.afterBody = this.getAfterBody(tooltipItems, options);\n      this.footer = this.getFooter(tooltipItems, options);\n\n      const size = this._size = getTooltipSize(this, options);\n      const positionAndSize = Object.assign({}, position, size);\n      const alignment = determineAlignment(this.chart, options, positionAndSize);\n      const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);\n\n      this.xAlign = alignment.xAlign;\n      this.yAlign = alignment.yAlign;\n\n      properties = {\n        opacity: 1,\n        x: backgroundPoint.x,\n        y: backgroundPoint.y,\n        width: size.width,\n        height: size.height,\n        caretX: position.x,\n        caretY: position.y\n      };\n    }\n\n    this._tooltipItems = tooltipItems;\n    this.$context = undefined;\n\n    if (properties) {\n      this._resolveAnimations().update(this, properties);\n    }\n\n    if (changed && options.external) {\n      options.external.call(this, {chart: this.chart, tooltip: this, replay});\n    }\n  }\n\n  drawCaret(tooltipPoint, ctx, size, options) {\n    const caretPosition = this.getCaretPosition(tooltipPoint, size, options);\n\n    ctx.lineTo(caretPosition.x1, caretPosition.y1);\n    ctx.lineTo(caretPosition.x2, caretPosition.y2);\n    ctx.lineTo(caretPosition.x3, caretPosition.y3);\n  }\n\n  getCaretPosition(tooltipPoint, size, options) {\n    const {xAlign, yAlign} = this;\n    const {caretSize, cornerRadius} = options;\n    const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(cornerRadius);\n    const {x: ptX, y: ptY} = tooltipPoint;\n    const {width, height} = size;\n    let x1, x2, x3, y1, y2, y3;\n\n    if (yAlign === 'center') {\n      y2 = ptY + (height / 2);\n\n      if (xAlign === 'left') {\n        x1 = ptX;\n        x2 = x1 - caretSize;\n\n        // Left draws bottom -> top, this y1 is on the bottom\n        y1 = y2 + caretSize;\n        y3 = y2 - caretSize;\n      } else {\n        x1 = ptX + width;\n        x2 = x1 + caretSize;\n\n        // Right draws top -> bottom, thus y1 is on the top\n        y1 = y2 - caretSize;\n        y3 = y2 + caretSize;\n      }\n\n      x3 = x1;\n    } else {\n      if (xAlign === 'left') {\n        x2 = ptX + Math.max(topLeft, bottomLeft) + (caretSize);\n      } else if (xAlign === 'right') {\n        x2 = ptX + width - Math.max(topRight, bottomRight) - caretSize;\n      } else {\n        x2 = this.caretX;\n      }\n\n      if (yAlign === 'top') {\n        y1 = ptY;\n        y2 = y1 - caretSize;\n\n        // Top draws left -> right, thus x1 is on the left\n        x1 = x2 - caretSize;\n        x3 = x2 + caretSize;\n      } else {\n        y1 = ptY + height;\n        y2 = y1 + caretSize;\n\n        // Bottom draws right -> left, thus x1 is on the right\n        x1 = x2 + caretSize;\n        x3 = x2 - caretSize;\n      }\n      y3 = y1;\n    }\n    return {x1, x2, x3, y1, y2, y3};\n  }\n\n  drawTitle(pt, ctx, options) {\n    const title = this.title;\n    const length = title.length;\n    let titleFont, titleSpacing, i;\n\n    if (length) {\n      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n      pt.x = getAlignedX(this, options.titleAlign, options);\n\n      ctx.textAlign = rtlHelper.textAlign(options.titleAlign);\n      ctx.textBaseline = 'middle';\n\n      titleFont = toFont(options.titleFont);\n      titleSpacing = options.titleSpacing;\n\n      ctx.fillStyle = options.titleColor;\n      ctx.font = titleFont.string;\n\n      for (i = 0; i < length; ++i) {\n        ctx.fillText(title[i], rtlHelper.x(pt.x), pt.y + titleFont.lineHeight / 2);\n        pt.y += titleFont.lineHeight + titleSpacing; // Line Height and spacing\n\n        if (i + 1 === length) {\n          pt.y += options.titleMarginBottom - titleSpacing; // If Last, add margin, remove spacing\n        }\n      }\n    }\n  }\n\n  /**\n\t * @private\n\t */\n  _drawColorBox(ctx, pt, i, rtlHelper, options) {\n    const labelColor = this.labelColors[i];\n    const labelPointStyle = this.labelPointStyles[i];\n    const {boxHeight, boxWidth} = options;\n    const bodyFont = toFont(options.bodyFont);\n    const colorX = getAlignedX(this, 'left', options);\n    const rtlColorX = rtlHelper.x(colorX);\n    const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;\n    const colorY = pt.y + yOffSet;\n\n    if (options.usePointStyle) {\n      const drawOptions = {\n        radius: Math.min(boxWidth, boxHeight) / 2, // fit the circle in the box\n        pointStyle: labelPointStyle.pointStyle,\n        rotation: labelPointStyle.rotation,\n        borderWidth: 1\n      };\n      // Recalculate x and y for drawPoint() because its expecting\n      // x and y to be center of figure (instead of top left)\n      const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;\n      const centerY = colorY + boxHeight / 2;\n\n      // Fill the point with white so that colours merge nicely if the opacity is < 1\n      ctx.strokeStyle = options.multiKeyBackground;\n      ctx.fillStyle = options.multiKeyBackground;\n      drawPoint(ctx, drawOptions, centerX, centerY);\n\n      // Draw the point\n      ctx.strokeStyle = labelColor.borderColor;\n      ctx.fillStyle = labelColor.backgroundColor;\n      drawPoint(ctx, drawOptions, centerX, centerY);\n    } else {\n      // Border\n      ctx.lineWidth = isObject(labelColor.borderWidth) ? Math.max(...Object.values(labelColor.borderWidth)) : (labelColor.borderWidth || 1); // TODO, v4 remove fallback\n      ctx.strokeStyle = labelColor.borderColor;\n      ctx.setLineDash(labelColor.borderDash || []);\n      ctx.lineDashOffset = labelColor.borderDashOffset || 0;\n\n      // Fill a white rect so that colours merge nicely if the opacity is < 1\n      const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth);\n      const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - 2);\n      const borderRadius = toTRBLCorners(labelColor.borderRadius);\n\n      if (Object.values(borderRadius).some(v => v !== 0)) {\n        ctx.beginPath();\n        ctx.fillStyle = options.multiKeyBackground;\n        addRoundedRectPath(ctx, {\n          x: outerX,\n          y: colorY,\n          w: boxWidth,\n          h: boxHeight,\n          radius: borderRadius,\n        });\n        ctx.fill();\n        ctx.stroke();\n\n        // Inner square\n        ctx.fillStyle = labelColor.backgroundColor;\n        ctx.beginPath();\n        addRoundedRectPath(ctx, {\n          x: innerX,\n          y: colorY + 1,\n          w: boxWidth - 2,\n          h: boxHeight - 2,\n          radius: borderRadius,\n        });\n        ctx.fill();\n      } else {\n        // Normal rect\n        ctx.fillStyle = options.multiKeyBackground;\n        ctx.fillRect(outerX, colorY, boxWidth, boxHeight);\n        ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);\n        // Inner square\n        ctx.fillStyle = labelColor.backgroundColor;\n        ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);\n      }\n    }\n\n    // restore fillStyle\n    ctx.fillStyle = this.labelTextColors[i];\n  }\n\n  drawBody(pt, ctx, options) {\n    const {body} = this;\n    const {bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding} = options;\n    const bodyFont = toFont(options.bodyFont);\n    let bodyLineHeight = bodyFont.lineHeight;\n    let xLinePadding = 0;\n\n    const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n    const fillLineOfText = function(line) {\n      ctx.fillText(line, rtlHelper.x(pt.x + xLinePadding), pt.y + bodyLineHeight / 2);\n      pt.y += bodyLineHeight + bodySpacing;\n    };\n\n    const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);\n    let bodyItem, textColor, lines, i, j, ilen, jlen;\n\n    ctx.textAlign = bodyAlign;\n    ctx.textBaseline = 'middle';\n    ctx.font = bodyFont.string;\n\n    pt.x = getAlignedX(this, bodyAlignForCalculation, options);\n\n    // Before body lines\n    ctx.fillStyle = options.bodyColor;\n    each(this.beforeBody, fillLineOfText);\n\n    xLinePadding = displayColors && bodyAlignForCalculation !== 'right'\n      ? bodyAlign === 'center' ? (boxWidth / 2 + boxPadding) : (boxWidth + 2 + boxPadding)\n      : 0;\n\n    // Draw body lines now\n    for (i = 0, ilen = body.length; i < ilen; ++i) {\n      bodyItem = body[i];\n      textColor = this.labelTextColors[i];\n\n      ctx.fillStyle = textColor;\n      each(bodyItem.before, fillLineOfText);\n\n      lines = bodyItem.lines;\n      // Draw Legend-like boxes if needed\n      if (displayColors && lines.length) {\n        this._drawColorBox(ctx, pt, i, rtlHelper, options);\n        bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);\n      }\n\n      for (j = 0, jlen = lines.length; j < jlen; ++j) {\n        fillLineOfText(lines[j]);\n        // Reset for any lines that don't include colorbox\n        bodyLineHeight = bodyFont.lineHeight;\n      }\n\n      each(bodyItem.after, fillLineOfText);\n    }\n\n    // Reset back to 0 for after body\n    xLinePadding = 0;\n    bodyLineHeight = bodyFont.lineHeight;\n\n    // After body lines\n    each(this.afterBody, fillLineOfText);\n    pt.y -= bodySpacing; // Remove last body spacing\n  }\n\n  drawFooter(pt, ctx, options) {\n    const footer = this.footer;\n    const length = footer.length;\n    let footerFont, i;\n\n    if (length) {\n      const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);\n\n      pt.x = getAlignedX(this, options.footerAlign, options);\n      pt.y += options.footerMarginTop;\n\n      ctx.textAlign = rtlHelper.textAlign(options.footerAlign);\n      ctx.textBaseline = 'middle';\n\n      footerFont = toFont(options.footerFont);\n\n      ctx.fillStyle = options.footerColor;\n      ctx.font = footerFont.string;\n\n      for (i = 0; i < length; ++i) {\n        ctx.fillText(footer[i], rtlHelper.x(pt.x), pt.y + footerFont.lineHeight / 2);\n        pt.y += footerFont.lineHeight + options.footerSpacing;\n      }\n    }\n  }\n\n  drawBackground(pt, ctx, tooltipSize, options) {\n    const {xAlign, yAlign} = this;\n    const {x, y} = pt;\n    const {width, height} = tooltipSize;\n    const {topLeft, topRight, bottomLeft, bottomRight} = toTRBLCorners(options.cornerRadius);\n\n    ctx.fillStyle = options.backgroundColor;\n    ctx.strokeStyle = options.borderColor;\n    ctx.lineWidth = options.borderWidth;\n\n    ctx.beginPath();\n    ctx.moveTo(x + topLeft, y);\n    if (yAlign === 'top') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + width - topRight, y);\n    ctx.quadraticCurveTo(x + width, y, x + width, y + topRight);\n    if (yAlign === 'center' && xAlign === 'right') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + width, y + height - bottomRight);\n    ctx.quadraticCurveTo(x + width, y + height, x + width - bottomRight, y + height);\n    if (yAlign === 'bottom') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x + bottomLeft, y + height);\n    ctx.quadraticCurveTo(x, y + height, x, y + height - bottomLeft);\n    if (yAlign === 'center' && xAlign === 'left') {\n      this.drawCaret(pt, ctx, tooltipSize, options);\n    }\n    ctx.lineTo(x, y + topLeft);\n    ctx.quadraticCurveTo(x, y, x + topLeft, y);\n    ctx.closePath();\n\n    ctx.fill();\n\n    if (options.borderWidth > 0) {\n      ctx.stroke();\n    }\n  }\n\n  /**\n\t * Update x/y animation targets when _active elements are animating too\n\t * @private\n\t */\n  _updateAnimationTarget(options) {\n    const chart = this.chart;\n    const anims = this.$animations;\n    const animX = anims && anims.x;\n    const animY = anims && anims.y;\n    if (animX || animY) {\n      const position = positioners[options.position].call(this, this._active, this._eventPosition);\n      if (!position) {\n        return;\n      }\n      const size = this._size = getTooltipSize(this, options);\n      const positionAndSize = Object.assign({}, position, this._size);\n      const alignment = determineAlignment(chart, options, positionAndSize);\n      const point = getBackgroundPoint(options, positionAndSize, alignment, chart);\n      if (animX._to !== point.x || animY._to !== point.y) {\n        this.xAlign = alignment.xAlign;\n        this.yAlign = alignment.yAlign;\n        this.width = size.width;\n        this.height = size.height;\n        this.caretX = position.x;\n        this.caretY = position.y;\n        this._resolveAnimations().update(this, point);\n      }\n    }\n  }\n\n  /**\n   * Determine if the tooltip will draw anything\n   * @returns {boolean} True if the tooltip will render\n   */\n  _willRender() {\n    return !!this.opacity;\n  }\n\n  draw(ctx) {\n    const options = this.options.setContext(this.getContext());\n    let opacity = this.opacity;\n\n    if (!opacity) {\n      return;\n    }\n\n    this._updateAnimationTarget(options);\n\n    const tooltipSize = {\n      width: this.width,\n      height: this.height\n    };\n    const pt = {\n      x: this.x,\n      y: this.y\n    };\n\n    // IE11/Edge does not like very small opacities, so snap to 0\n    opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;\n\n    const padding = toPadding(options.padding);\n\n    // Truthy/falsey value for empty tooltip\n    const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;\n\n    if (options.enabled && hasTooltipContent) {\n      ctx.save();\n      ctx.globalAlpha = opacity;\n\n      // Draw Background\n      this.drawBackground(pt, ctx, tooltipSize, options);\n\n      overrideTextDirection(ctx, options.textDirection);\n\n      pt.y += padding.top;\n\n      // Titles\n      this.drawTitle(pt, ctx, options);\n\n      // Body\n      this.drawBody(pt, ctx, options);\n\n      // Footer\n      this.drawFooter(pt, ctx, options);\n\n      restoreTextDirection(ctx, options.textDirection);\n\n      ctx.restore();\n    }\n  }\n\n  /**\n\t * Get active elements in the tooltip\n\t * @returns {Array} Array of elements that are active in the tooltip\n\t */\n  getActiveElements() {\n    return this._active || [];\n  }\n\n  /**\n\t * Set active elements in the tooltip\n\t * @param {array} activeElements Array of active datasetIndex/index pairs.\n\t * @param {object} eventPosition Synthetic event position used in positioning\n\t */\n  setActiveElements(activeElements, eventPosition) {\n    const lastActive = this._active;\n    const active = activeElements.map(({datasetIndex, index}) => {\n      const meta = this.chart.getDatasetMeta(datasetIndex);\n\n      if (!meta) {\n        throw new Error('Cannot find a dataset at index ' + datasetIndex);\n      }\n\n      return {\n        datasetIndex,\n        element: meta.data[index],\n        index,\n      };\n    });\n    const changed = !_elementsEqual(lastActive, active);\n    const positionChanged = this._positionChanged(active, eventPosition);\n\n    if (changed || positionChanged) {\n      this._active = active;\n      this._eventPosition = eventPosition;\n      this._ignoreReplayEvents = true;\n      this.update(true);\n    }\n  }\n\n  /**\n\t * Handle an event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {boolean} true if the tooltip changed\n\t */\n  handleEvent(e, replay, inChartArea = true) {\n    if (replay && this._ignoreReplayEvents) {\n      return false;\n    }\n    this._ignoreReplayEvents = false;\n\n    const options = this.options;\n    const lastActive = this._active || [];\n    const active = this._getActiveElements(e, lastActive, replay, inChartArea);\n\n    // When there are multiple items shown, but the tooltip position is nearest mode\n    // an update may need to be made because our position may have changed even though\n    // the items are the same as before.\n    const positionChanged = this._positionChanged(active, e);\n\n    // Remember Last Actives\n    const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;\n\n    // Only handle target event on tooltip change\n    if (changed) {\n      this._active = active;\n\n      if (options.enabled || options.external) {\n        this._eventPosition = {\n          x: e.x,\n          y: e.y\n        };\n\n        this.update(true, replay);\n      }\n    }\n\n    return changed;\n  }\n\n  /**\n\t * Helper for determining the active elements for event\n\t * @param {ChartEvent} e - The event to handle\n\t * @param {InteractionItem[]} lastActive - Previously active elements\n\t * @param {boolean} [replay] - This is a replayed event (from update)\n\t * @param {boolean} [inChartArea] - The event is inside chartArea\n\t * @returns {InteractionItem[]} - Active elements\n\t * @private\n\t */\n  _getActiveElements(e, lastActive, replay, inChartArea) {\n    const options = this.options;\n\n    if (e.type === 'mouseout') {\n      return [];\n    }\n\n    if (!inChartArea) {\n      // Let user control the active elements outside chartArea. Eg. using Legend.\n      return lastActive;\n    }\n\n    // Find Active Elements for tooltips\n    const active = this.chart.getElementsAtEventForMode(e, options.mode, options, replay);\n\n    if (options.reverse) {\n      active.reverse();\n    }\n\n    return active;\n  }\n\n  /**\n\t * Determine if the active elements + event combination changes the\n\t * tooltip position\n\t * @param {array} active - Active elements\n\t * @param {ChartEvent} e - Event that triggered the position change\n\t * @returns {boolean} True if the position has changed\n\t */\n  _positionChanged(active, e) {\n    const {caretX, caretY, options} = this;\n    const position = positioners[options.position].call(this, active, e);\n    return position !== false && (caretX !== position.x || caretY !== position.y);\n  }\n}\n\nexport default {\n  id: 'tooltip',\n  _element: Tooltip,\n  positioners,\n\n  afterInit(chart, _args, options) {\n    if (options) {\n      chart.tooltip = new Tooltip({chart, options});\n    }\n  },\n\n  beforeUpdate(chart, _args, options) {\n    if (chart.tooltip) {\n      chart.tooltip.initialize(options);\n    }\n  },\n\n  reset(chart, _args, options) {\n    if (chart.tooltip) {\n      chart.tooltip.initialize(options);\n    }\n  },\n\n  afterDraw(chart) {\n    const tooltip = chart.tooltip;\n\n    if (tooltip && tooltip._willRender()) {\n      const args = {\n        tooltip\n      };\n\n      if (chart.notifyPlugins('beforeTooltipDraw', {...args, cancelable: true}) === false) {\n        return;\n      }\n\n      tooltip.draw(chart.ctx);\n\n      chart.notifyPlugins('afterTooltipDraw', args);\n    }\n  },\n\n  afterEvent(chart, args) {\n    if (chart.tooltip) {\n      // If the event is replayed from `update`, we should evaluate with the final positions.\n      const useFinalPosition = args.replay;\n      if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {\n        // notify chart about the change, so it will render\n        args.changed = true;\n      }\n    }\n  },\n\n  defaults: {\n    enabled: true,\n    external: null,\n    position: 'average',\n    backgroundColor: 'rgba(0,0,0,0.8)',\n    titleColor: '#fff',\n    titleFont: {\n      weight: 'bold',\n    },\n    titleSpacing: 2,\n    titleMarginBottom: 6,\n    titleAlign: 'left',\n    bodyColor: '#fff',\n    bodySpacing: 2,\n    bodyFont: {\n    },\n    bodyAlign: 'left',\n    footerColor: '#fff',\n    footerSpacing: 2,\n    footerMarginTop: 6,\n    footerFont: {\n      weight: 'bold',\n    },\n    footerAlign: 'left',\n    padding: 6,\n    caretPadding: 2,\n    caretSize: 5,\n    cornerRadius: 6,\n    boxHeight: (ctx, opts) => opts.bodyFont.size,\n    boxWidth: (ctx, opts) => opts.bodyFont.size,\n    multiKeyBackground: '#fff',\n    displayColors: true,\n    boxPadding: 0,\n    borderColor: 'rgba(0,0,0,0)',\n    borderWidth: 0,\n    animation: {\n      duration: 400,\n      easing: 'easeOutQuart',\n    },\n    animations: {\n      numbers: {\n        type: 'number',\n        properties: ['x', 'y', 'width', 'height', 'caretX', 'caretY'],\n      },\n      opacity: {\n        easing: 'linear',\n        duration: 200\n      }\n    },\n    callbacks: defaultCallbacks\n  },\n\n  defaultRoutes: {\n    bodyFont: 'font',\n    footerFont: 'font',\n    titleFont: 'font'\n  },\n\n  descriptors: {\n    _scriptable: (name) => name !== 'filter' && name !== 'itemSort' && name !== 'external',\n    _indexable: false,\n    callbacks: {\n      _scriptable: false,\n      _indexable: false,\n    },\n    animation: {\n      _fallback: false\n    },\n    animations: {\n      _fallback: 'animation'\n    }\n  },\n\n  // Resolve additionally from `interaction` options and defaults.\n  additionalOptionScopes: ['interaction']\n};\n", "import Scale from '../core/core.scale.js';\nimport {isNullOrUndef, valueOrDefault, _limitValue} from '../helpers/index.js';\n\nconst addIfString = (labels, raw, index, addedLabels) => {\n  if (typeof raw === 'string') {\n    index = labels.push(raw) - 1;\n    addedLabels.unshift({index, label: raw});\n  } else if (isNaN(raw)) {\n    index = null;\n  }\n  return index;\n};\n\nfunction findOrAddLabel(labels, raw, index, addedLabels) {\n  const first = labels.indexOf(raw);\n  if (first === -1) {\n    return addIfString(labels, raw, index, addedLabels);\n  }\n  const last = labels.lastIndexOf(raw);\n  return first !== last ? index : first;\n}\n\nconst validIndex = (index, max) => index === null ? null : _limitValue(Math.round(index), 0, max);\n\nfunction _getLabelForValue(value) {\n  const labels = this.getLabels();\n\n  if (value >= 0 && value < labels.length) {\n    return labels[value];\n  }\n  return value;\n}\n\nexport default class CategoryScale extends Scale {\n\n  static id = 'category';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    ticks: {\n      callback: _getLabelForValue\n    }\n  };\n\n  constructor(cfg) {\n    super(cfg);\n\n    /** @type {number} */\n    this._startValue = undefined;\n    this._valueRange = 0;\n    this._addedLabels = [];\n  }\n\n  init(scaleOptions) {\n    const added = this._addedLabels;\n    if (added.length) {\n      const labels = this.getLabels();\n      for (const {index, label} of added) {\n        if (labels[index] === label) {\n          labels.splice(index, 1);\n        }\n      }\n      this._addedLabels = [];\n    }\n    super.init(scaleOptions);\n  }\n\n  parse(raw, index) {\n    if (isNullOrUndef(raw)) {\n      return null;\n    }\n    const labels = this.getLabels();\n    index = isFinite(index) && labels[index] === raw ? index\n      : findOrAddLabel(labels, raw, valueOrDefault(index, raw), this._addedLabels);\n    return validIndex(index, labels.length - 1);\n  }\n\n  determineDataLimits() {\n    const {minDefined, maxDefined} = this.getUserBounds();\n    let {min, max} = this.getMinMax(true);\n\n    if (this.options.bounds === 'ticks') {\n      if (!minDefined) {\n        min = 0;\n      }\n      if (!maxDefined) {\n        max = this.getLabels().length - 1;\n      }\n    }\n\n    this.min = min;\n    this.max = max;\n  }\n\n  buildTicks() {\n    const min = this.min;\n    const max = this.max;\n    const offset = this.options.offset;\n    const ticks = [];\n    let labels = this.getLabels();\n\n    // If we are viewing some subset of labels, slice the original array\n    labels = (min === 0 && max === labels.length - 1) ? labels : labels.slice(min, max + 1);\n\n    this._valueRange = Math.max(labels.length - (offset ? 0 : 1), 1);\n    this._startValue = this.min - (offset ? 0.5 : 0);\n\n    for (let value = min; value <= max; value++) {\n      ticks.push({value});\n    }\n    return ticks;\n  }\n\n  getLabelForValue(value) {\n    return _getLabelForValue.call(this, value);\n  }\n\n  /**\n\t * @protected\n\t */\n  configure() {\n    super.configure();\n\n    if (!this.isHorizontal()) {\n      // For backward compatibility, vertical category scale reverse is inverted.\n      this._reversePixels = !this._reversePixels;\n    }\n  }\n\n  // Used to get data value locations. Value can either be an index or a numerical value\n  getPixelForValue(value) {\n    if (typeof value !== 'number') {\n      value = this.parse(value);\n    }\n\n    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n  }\n\n  // Must override base implementation because it calls getPixelForValue\n  // and category scale can have duplicate values\n  getPixelForTick(index) {\n    const ticks = this.ticks;\n    if (index < 0 || index > ticks.length - 1) {\n      return null;\n    }\n    return this.getPixelForValue(ticks[index].value);\n  }\n\n  getValueForPixel(pixel) {\n    return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);\n  }\n\n  getBasePixel() {\n    return this.bottom;\n  }\n}\n", "import {isNullOrUndef} from '../helpers/helpers.core.js';\nimport {almostEquals, almostWhole, niceNum, _decimalPlaces, _setMinAndMaxByKey, sign, toRadians} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\n\n/**\n * Generate a set of linear ticks for an axis\n * 1. If generationOptions.min, generationOptions.max, and generationOptions.step are defined:\n *    if (max - min) / step is an integer, ticks are generated as [min, min + step, ..., max]\n *    Note that the generationOptions.maxCount setting is respected in this scenario\n *\n * 2. If generationOptions.min, generationOptions.max, and generationOptions.count is defined\n *    spacing = (max - min) / count\n *    Ticks are generated as [min, min + spacing, ..., max]\n *\n * 3. If generationOptions.count is defined\n *    spacing = (niceMax - niceMin) / count\n *\n * 4. Compute optimal spacing of ticks using niceNum algorithm\n *\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, dataRange) {\n  const ticks = [];\n  // To get a \"nice\" value for the tick spacing, we will use the appropriately named\n  // \"nice number\" algorithm. See https://stackoverflow.com/questions/8506881/nice-label-algorithm-for-charts-with-minimum-ticks\n  // for details.\n\n  const MIN_SPACING = 1e-14;\n  const {bounds, step, min, max, precision, count, maxTicks, maxDigits, includeBounds} = generationOptions;\n  const unit = step || 1;\n  const maxSpaces = maxTicks - 1;\n  const {min: rmin, max: rmax} = dataRange;\n  const minDefined = !isNullOrUndef(min);\n  const maxDefined = !isNullOrUndef(max);\n  const countDefined = !isNullOrUndef(count);\n  const minSpacing = (rmax - rmin) / (maxDigits + 1);\n  let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;\n  let factor, niceMin, niceMax, numSpaces;\n\n  // Beyond MIN_SPACING floating point numbers being to lose precision\n  // such that we can't do the math necessary to generate ticks\n  if (spacing < MIN_SPACING && !minDefined && !maxDefined) {\n    return [{value: rmin}, {value: rmax}];\n  }\n\n  numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);\n  if (numSpaces > maxSpaces) {\n    // If the calculated num of spaces exceeds maxNumSpaces, recalculate it\n    spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;\n  }\n\n  if (!isNullOrUndef(precision)) {\n    // If the user specified a precision, round to that number of decimal places\n    factor = Math.pow(10, precision);\n    spacing = Math.ceil(spacing * factor) / factor;\n  }\n\n  if (bounds === 'ticks') {\n    niceMin = Math.floor(rmin / spacing) * spacing;\n    niceMax = Math.ceil(rmax / spacing) * spacing;\n  } else {\n    niceMin = rmin;\n    niceMax = rmax;\n  }\n\n  if (minDefined && maxDefined && step && almostWhole((max - min) / step, spacing / 1000)) {\n    // Case 1: If min, max and stepSize are set and they make an evenly spaced scale use it.\n    // spacing = step;\n    // numSpaces = (max - min) / spacing;\n    // Note that we round here to handle the case where almostWhole translated an FP error\n    numSpaces = Math.round(Math.min((max - min) / spacing, maxTicks));\n    spacing = (max - min) / numSpaces;\n    niceMin = min;\n    niceMax = max;\n  } else if (countDefined) {\n    // Cases 2 & 3, we have a count specified. Handle optional user defined edges to the range.\n    // Sometimes these are no-ops, but it makes the code a lot clearer\n    // and when a user defined range is specified, we want the correct ticks\n    niceMin = minDefined ? min : niceMin;\n    niceMax = maxDefined ? max : niceMax;\n    numSpaces = count - 1;\n    spacing = (niceMax - niceMin) / numSpaces;\n  } else {\n    // Case 4\n    numSpaces = (niceMax - niceMin) / spacing;\n\n    // If very close to our rounded value, use it.\n    if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1000)) {\n      numSpaces = Math.round(numSpaces);\n    } else {\n      numSpaces = Math.ceil(numSpaces);\n    }\n  }\n\n  // The spacing will have changed in cases 1, 2, and 3 so the factor cannot be computed\n  // until this point\n  const decimalPlaces = Math.max(\n    _decimalPlaces(spacing),\n    _decimalPlaces(niceMin)\n  );\n  factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);\n  niceMin = Math.round(niceMin * factor) / factor;\n  niceMax = Math.round(niceMax * factor) / factor;\n\n  let j = 0;\n  if (minDefined) {\n    if (includeBounds && niceMin !== min) {\n      ticks.push({value: min});\n\n      if (niceMin < min) {\n        j++; // Skip niceMin\n      }\n      // If the next nice tick is close to min, skip it\n      if (almostEquals(Math.round((niceMin + j * spacing) * factor) / factor, min, relativeLabelSize(min, minSpacing, generationOptions))) {\n        j++;\n      }\n    } else if (niceMin < min) {\n      j++;\n    }\n  }\n\n  for (; j < numSpaces; ++j) {\n    const tickValue = Math.round((niceMin + j * spacing) * factor) / factor;\n    if (maxDefined && tickValue > max) {\n      break;\n    }\n    ticks.push({value: tickValue});\n  }\n\n  if (maxDefined && includeBounds && niceMax !== max) {\n    // If the previous tick is too close to max, replace it with max, else add max\n    if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max, relativeLabelSize(max, minSpacing, generationOptions))) {\n      ticks[ticks.length - 1].value = max;\n    } else {\n      ticks.push({value: max});\n    }\n  } else if (!maxDefined || niceMax === max) {\n    ticks.push({value: niceMax});\n  }\n\n  return ticks;\n}\n\nfunction relativeLabelSize(value, minSpacing, {horizontal, minRotation}) {\n  const rad = toRadians(minRotation);\n  const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 0.001;\n  const length = 0.75 * minSpacing * ('' + value).length;\n  return Math.min(minSpacing / ratio, length);\n}\n\nexport default class LinearScaleBase extends Scale {\n\n  constructor(cfg) {\n    super(cfg);\n\n    /** @type {number} */\n    this.start = undefined;\n    /** @type {number} */\n    this.end = undefined;\n    /** @type {number} */\n    this._startValue = undefined;\n    /** @type {number} */\n    this._endValue = undefined;\n    this._valueRange = 0;\n  }\n\n  parse(raw, index) { // eslint-disable-line no-unused-vars\n    if (isNullOrUndef(raw)) {\n      return null;\n    }\n    if ((typeof raw === 'number' || raw instanceof Number) && !isFinite(+raw)) {\n      return null;\n    }\n\n    return +raw;\n  }\n\n  handleTickRangeOptions() {\n    const {beginAtZero} = this.options;\n    const {minDefined, maxDefined} = this.getUserBounds();\n    let {min, max} = this;\n\n    const setMin = v => (min = minDefined ? min : v);\n    const setMax = v => (max = maxDefined ? max : v);\n\n    if (beginAtZero) {\n      const minSign = sign(min);\n      const maxSign = sign(max);\n\n      if (minSign < 0 && maxSign < 0) {\n        setMax(0);\n      } else if (minSign > 0 && maxSign > 0) {\n        setMin(0);\n      }\n    }\n\n    if (min === max) {\n      let offset = max === 0 ? 1 : Math.abs(max * 0.05);\n\n      setMax(max + offset);\n\n      if (!beginAtZero) {\n        setMin(min - offset);\n      }\n    }\n    this.min = min;\n    this.max = max;\n  }\n\n  getTickLimit() {\n    const tickOpts = this.options.ticks;\n    // eslint-disable-next-line prefer-const\n    let {maxTicksLimit, stepSize} = tickOpts;\n    let maxTicks;\n\n    if (stepSize) {\n      maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;\n      if (maxTicks > 1000) {\n        console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);\n        maxTicks = 1000;\n      }\n    } else {\n      maxTicks = this.computeTickLimit();\n      maxTicksLimit = maxTicksLimit || 11;\n    }\n\n    if (maxTicksLimit) {\n      maxTicks = Math.min(maxTicksLimit, maxTicks);\n    }\n\n    return maxTicks;\n  }\n\n  /**\n\t * @protected\n\t */\n  computeTickLimit() {\n    return Number.POSITIVE_INFINITY;\n  }\n\n  buildTicks() {\n    const opts = this.options;\n    const tickOpts = opts.ticks;\n\n    // Figure out what the max number of ticks we can support it is based on the size of\n    // the axis area. For now, we say that the minimum tick spacing in pixels must be 40\n    // We also limit the maximum number of ticks to 11 which gives a nice 10 squares on\n    // the graph. Make sure we always have at least 2 ticks\n    let maxTicks = this.getTickLimit();\n    maxTicks = Math.max(2, maxTicks);\n\n    const numericGeneratorOptions = {\n      maxTicks,\n      bounds: opts.bounds,\n      min: opts.min,\n      max: opts.max,\n      precision: tickOpts.precision,\n      step: tickOpts.stepSize,\n      count: tickOpts.count,\n      maxDigits: this._maxDigits(),\n      horizontal: this.isHorizontal(),\n      minRotation: tickOpts.minRotation || 0,\n      includeBounds: tickOpts.includeBounds !== false\n    };\n    const dataRange = this._range || this;\n    const ticks = generateTicks(numericGeneratorOptions, dataRange);\n\n    // At this point, we need to update our max and min given the tick values,\n    // since we probably have expanded the range of the scale\n    if (opts.bounds === 'ticks') {\n      _setMinAndMaxByKey(ticks, this, 'value');\n    }\n\n    if (opts.reverse) {\n      ticks.reverse();\n\n      this.start = this.max;\n      this.end = this.min;\n    } else {\n      this.start = this.min;\n      this.end = this.max;\n    }\n\n    return ticks;\n  }\n\n  /**\n\t * @protected\n\t */\n  configure() {\n    const ticks = this.ticks;\n    let start = this.min;\n    let end = this.max;\n\n    super.configure();\n\n    if (this.options.offset && ticks.length) {\n      const offset = (end - start) / Math.max(ticks.length - 1, 1) / 2;\n      start -= offset;\n      end += offset;\n    }\n    this._startValue = start;\n    this._endValue = end;\n    this._valueRange = end - start;\n  }\n\n  getLabelForValue(value) {\n    return formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n  }\n}\n", "import {isFinite} from '../helpers/helpers.core.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {toRadians} from '../helpers/index.js';\n\nexport default class LinearScale extends LinearScaleBase {\n\n  static id = 'linear';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    ticks: {\n      callback: Ticks.formatters.numeric\n    }\n  };\n\n\n  determineDataLimits() {\n    const {min, max} = this.getMinMax(true);\n\n    this.min = isFinite(min) ? min : 0;\n    this.max = isFinite(max) ? max : 1;\n\n    // Common base implementation to handle min, max, beginAtZero\n    this.handleTickRangeOptions();\n  }\n\n  /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n \t */\n  computeTickLimit() {\n    const horizontal = this.isHorizontal();\n    const length = horizontal ? this.width : this.height;\n    const minRotation = toRadians(this.options.ticks.minRotation);\n    const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 0.001;\n    const tickFont = this._resolveTickFontOptions(0);\n    return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));\n  }\n\n  // Utils\n  getPixelForValue(value) {\n    return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);\n  }\n\n  getValueForPixel(pixel) {\n    return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;\n  }\n}\n", "import {finiteOrDefault, isFinite} from '../helpers/helpers.core.js';\nimport {formatNumber} from '../helpers/helpers.intl.js';\nimport {_setMinAndMaxByKey, log10} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\n\nconst log10Floor = v => Math.floor(log10(v));\nconst changeExponent = (v, m) => Math.pow(10, log10Floor(v) + m);\n\nfunction isMajor(tickVal) {\n  const remain = tickVal / (Math.pow(10, log10Floor(tickVal)));\n  return remain === 1;\n}\n\nfunction steps(min, max, rangeExp) {\n  const rangeStep = Math.pow(10, rangeExp);\n  const start = Math.floor(min / rangeStep);\n  const end = Math.ceil(max / rangeStep);\n  return end - start;\n}\n\nfunction startExp(min, max) {\n  const range = max - min;\n  let rangeExp = log10Floor(range);\n  while (steps(min, max, rangeExp) > 10) {\n    rangeExp++;\n  }\n  while (steps(min, max, rangeExp) < 10) {\n    rangeExp--;\n  }\n  return Math.min(rangeExp, log10Floor(min));\n}\n\n\n/**\n * Generate a set of logarithmic ticks\n * @param generationOptions the options used to generate the ticks\n * @param dataRange the range of the data\n * @returns {object[]} array of tick objects\n */\nfunction generateTicks(generationOptions, {min, max}) {\n  min = finiteOrDefault(generationOptions.min, min);\n  const ticks = [];\n  const minExp = log10Floor(min);\n  let exp = startExp(min, max);\n  let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;\n  const stepSize = Math.pow(10, exp);\n  const base = minExp > exp ? Math.pow(10, minExp) : 0;\n  const start = Math.round((min - base) * precision) / precision;\n  const offset = Math.floor((min - base) / stepSize / 10) * stepSize * 10;\n  let significand = Math.floor((start - offset) / Math.pow(10, exp));\n  let value = finiteOrDefault(generationOptions.min, Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision);\n  while (value < max) {\n    ticks.push({value, major: isMajor(value), significand});\n    if (significand >= 10) {\n      significand = significand < 15 ? 15 : 20;\n    } else {\n      significand++;\n    }\n    if (significand >= 20) {\n      exp++;\n      significand = 2;\n      precision = exp >= 0 ? 1 : precision;\n    }\n    value = Math.round((base + offset + significand * Math.pow(10, exp)) * precision) / precision;\n  }\n  const lastTick = finiteOrDefault(generationOptions.max, value);\n  ticks.push({value: lastTick, major: isMajor(lastTick), significand});\n\n  return ticks;\n}\n\nexport default class LogarithmicScale extends Scale {\n\n  static id = 'logarithmic';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    ticks: {\n      callback: Ticks.formatters.logarithmic,\n      major: {\n        enabled: true\n      }\n    }\n  };\n\n\n  constructor(cfg) {\n    super(cfg);\n\n    /** @type {number} */\n    this.start = undefined;\n    /** @type {number} */\n    this.end = undefined;\n    /** @type {number} */\n    this._startValue = undefined;\n    this._valueRange = 0;\n  }\n\n  parse(raw, index) {\n    const value = LinearScaleBase.prototype.parse.apply(this, [raw, index]);\n    if (value === 0) {\n      this._zero = true;\n      return undefined;\n    }\n    return isFinite(value) && value > 0 ? value : null;\n  }\n\n  determineDataLimits() {\n    const {min, max} = this.getMinMax(true);\n\n    this.min = isFinite(min) ? Math.max(0, min) : null;\n    this.max = isFinite(max) ? Math.max(0, max) : null;\n\n    if (this.options.beginAtZero) {\n      this._zero = true;\n    }\n\n    // if data has `0` in it or `beginAtZero` is true, min (non zero) value is at bottom\n    // of scale, and it does not equal suggestedMin, lower the min bound by one exp.\n    if (this._zero && this.min !== this._suggestedMin && !isFinite(this._userMin)) {\n      this.min = min === changeExponent(this.min, 0) ? changeExponent(this.min, -1) : changeExponent(this.min, 0);\n    }\n\n    this.handleTickRangeOptions();\n  }\n\n  handleTickRangeOptions() {\n    const {minDefined, maxDefined} = this.getUserBounds();\n    let min = this.min;\n    let max = this.max;\n\n    const setMin = v => (min = minDefined ? min : v);\n    const setMax = v => (max = maxDefined ? max : v);\n\n    if (min === max) {\n      if (min <= 0) { // includes null\n        setMin(1);\n        setMax(10);\n      } else {\n        setMin(changeExponent(min, -1));\n        setMax(changeExponent(max, +1));\n      }\n    }\n    if (min <= 0) {\n      setMin(changeExponent(max, -1));\n    }\n    if (max <= 0) {\n\n      setMax(changeExponent(min, +1));\n    }\n\n    this.min = min;\n    this.max = max;\n  }\n\n  buildTicks() {\n    const opts = this.options;\n\n    const generationOptions = {\n      min: this._userMin,\n      max: this._userMax\n    };\n    const ticks = generateTicks(generationOptions, this);\n\n    // At this point, we need to update our max and min given the tick values,\n    // since we probably have expanded the range of the scale\n    if (opts.bounds === 'ticks') {\n      _setMinAndMaxByKey(ticks, this, 'value');\n    }\n\n    if (opts.reverse) {\n      ticks.reverse();\n\n      this.start = this.max;\n      this.end = this.min;\n    } else {\n      this.start = this.min;\n      this.end = this.max;\n    }\n\n    return ticks;\n  }\n\n  /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n  getLabelForValue(value) {\n    return value === undefined\n      ? '0'\n      : formatNumber(value, this.chart.options.locale, this.options.ticks.format);\n  }\n\n  /**\n\t * @protected\n\t */\n  configure() {\n    const start = this.min;\n\n    super.configure();\n\n    this._startValue = log10(start);\n    this._valueRange = log10(this.max) - log10(start);\n  }\n\n  getPixelForValue(value) {\n    if (value === undefined || value === 0) {\n      value = this.min;\n    }\n    if (value === null || isNaN(value)) {\n      return NaN;\n    }\n    return this.getPixelForDecimal(value === this.min\n      ? 0\n      : (log10(value) - this._startValue) / this._valueRange);\n  }\n\n  getValueForPixel(pixel) {\n    const decimal = this.getDecimalForPixel(pixel);\n    return Math.pow(10, this._startValue + decimal * this._valueRange);\n  }\n}\n", "import defaults from '../core/core.defaults.js';\nimport {_longestText, addRoundedRectPath, renderText, _isPointInArea} from '../helpers/helpers.canvas.js';\nimport {HALF_PI, TAU, toDegrees, toRadians, _normalizeAngle, PI} from '../helpers/helpers.math.js';\nimport LinearScaleBase from './scale.linearbase.js';\nimport Ticks from '../core/core.ticks.js';\nimport {valueOrDefault, isArray, isFinite, callback as callCallback, isNullOrUndef} from '../helpers/helpers.core.js';\nimport {createContext, toFont, toPadding, toTRBLCorners} from '../helpers/helpers.options.js';\n\nfunction getTickBackdropHeight(opts) {\n  const tickOpts = opts.ticks;\n\n  if (tickOpts.display && opts.display) {\n    const padding = toPadding(tickOpts.backdropPadding);\n    return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;\n  }\n  return 0;\n}\n\nfunction measureLabelSize(ctx, font, label) {\n  label = isArray(label) ? label : [label];\n  return {\n    w: _longestText(ctx, font.string, label),\n    h: label.length * font.lineHeight\n  };\n}\n\nfunction determineLimits(angle, pos, size, min, max) {\n  if (angle === min || angle === max) {\n    return {\n      start: pos - (size / 2),\n      end: pos + (size / 2)\n    };\n  } else if (angle < min || angle > max) {\n    return {\n      start: pos - size,\n      end: pos\n    };\n  }\n\n  return {\n    start: pos,\n    end: pos + size\n  };\n}\n\n/**\n * Helper function to fit a radial linear scale with point labels\n */\nfunction fitWithPointLabels(scale) {\n\n  // Right, this is really confusing and there is a lot of maths going on here\n  // The gist of the problem is here: https://gist.github.com/nnnick/696cc9c55f4b0beb8fe9\n  //\n  // Reaction: https://dl.dropboxusercontent.com/u/34601363/toomuchscience.gif\n  //\n  // Solution:\n  //\n  // We assume the radius of the polygon is half the size of the canvas at first\n  // at each index we check if the text overlaps.\n  //\n  // Where it does, we store that angle and that index.\n  //\n  // After finding the largest index and angle we calculate how much we need to remove\n  // from the shape radius to move the point inwards by that x.\n  //\n  // We average the left and right distances to get the maximum shape radius that can fit in the box\n  // along with labels.\n  //\n  // Once we have that, we can find the centre point for the chart, by taking the x text protrusion\n  // on each side, removing that from the size, halving it and adding the left x protrusion width.\n  //\n  // This will mean we have a shape fitted to the canvas, as large as it can be with the labels\n  // and position it in the most space efficient manner\n  //\n  // https://dl.dropboxusercontent.com/u/34601363/yeahscience.gif\n\n  // Get maximum radius of the polygon. Either half the height (minus the text width) or half the width.\n  // Use this to calculate the offset + change. - Make sure L/R protrusion is at least 0 to stop issues with centre points\n  const orig = {\n    l: scale.left + scale._padding.left,\n    r: scale.right - scale._padding.right,\n    t: scale.top + scale._padding.top,\n    b: scale.bottom - scale._padding.bottom\n  };\n  const limits = Object.assign({}, orig);\n  const labelSizes = [];\n  const padding = [];\n  const valueCount = scale._pointLabels.length;\n  const pointLabelOpts = scale.options.pointLabels;\n  const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;\n\n  for (let i = 0; i < valueCount; i++) {\n    const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i));\n    padding[i] = opts.padding;\n    const pointPosition = scale.getPointPosition(i, scale.drawingArea + padding[i], additionalAngle);\n    const plFont = toFont(opts.font);\n    const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i]);\n    labelSizes[i] = textSize;\n\n    const angleRadians = _normalizeAngle(scale.getIndexAngle(i) + additionalAngle);\n    const angle = Math.round(toDegrees(angleRadians));\n    const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);\n    const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);\n    updateLimits(limits, orig, angleRadians, hLimits, vLimits);\n  }\n\n  scale.setCenterPoint(\n    orig.l - limits.l,\n    limits.r - orig.r,\n    orig.t - limits.t,\n    limits.b - orig.b\n  );\n\n  // Now that text size is determined, compute the full positions\n  scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);\n}\n\nfunction updateLimits(limits, orig, angle, hLimits, vLimits) {\n  const sin = Math.abs(Math.sin(angle));\n  const cos = Math.abs(Math.cos(angle));\n  let x = 0;\n  let y = 0;\n  if (hLimits.start < orig.l) {\n    x = (orig.l - hLimits.start) / sin;\n    limits.l = Math.min(limits.l, orig.l - x);\n  } else if (hLimits.end > orig.r) {\n    x = (hLimits.end - orig.r) / sin;\n    limits.r = Math.max(limits.r, orig.r + x);\n  }\n  if (vLimits.start < orig.t) {\n    y = (orig.t - vLimits.start) / cos;\n    limits.t = Math.min(limits.t, orig.t - y);\n  } else if (vLimits.end > orig.b) {\n    y = (vLimits.end - orig.b) / cos;\n    limits.b = Math.max(limits.b, orig.b + y);\n  }\n}\n\nfunction createPointLabelItem(scale, index, itemOpts) {\n  const outerDistance = scale.drawingArea;\n  const {extra, additionalAngle, padding, size} = itemOpts;\n  const pointLabelPosition = scale.getPointPosition(index, outerDistance + extra + padding, additionalAngle);\n  const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));\n  const y = yForAngle(pointLabelPosition.y, size.h, angle);\n  const textAlign = getTextAlignForAngle(angle);\n  const left = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);\n  return {\n    // if to draw or overlapped\n    visible: true,\n\n    // Text position\n    x: pointLabelPosition.x,\n    y,\n\n    // Text rendering data\n    textAlign,\n\n    // Bounding box\n    left,\n    top: y,\n    right: left + size.w,\n    bottom: y + size.h\n  };\n}\n\nfunction isNotOverlapped(item, area) {\n  if (!area) {\n    return true;\n  }\n  const {left, top, right, bottom} = item;\n  const apexesInArea = _isPointInArea({x: left, y: top}, area) || _isPointInArea({x: left, y: bottom}, area) ||\n    _isPointInArea({x: right, y: top}, area) || _isPointInArea({x: right, y: bottom}, area);\n  return !apexesInArea;\n}\n\nfunction buildPointLabelItems(scale, labelSizes, padding) {\n  const items = [];\n  const valueCount = scale._pointLabels.length;\n  const opts = scale.options;\n  const {centerPointLabels, display} = opts.pointLabels;\n  const itemOpts = {\n    extra: getTickBackdropHeight(opts) / 2,\n    additionalAngle: centerPointLabels ? PI / valueCount : 0\n  };\n  let area;\n\n  for (let i = 0; i < valueCount; i++) {\n    itemOpts.padding = padding[i];\n    itemOpts.size = labelSizes[i];\n\n    const item = createPointLabelItem(scale, i, itemOpts);\n    items.push(item);\n    if (display === 'auto') {\n      item.visible = isNotOverlapped(item, area);\n      if (item.visible) {\n        area = item;\n      }\n    }\n  }\n  return items;\n}\n\nfunction getTextAlignForAngle(angle) {\n  if (angle === 0 || angle === 180) {\n    return 'center';\n  } else if (angle < 180) {\n    return 'left';\n  }\n\n  return 'right';\n}\n\nfunction leftForTextAlign(x, w, align) {\n  if (align === 'right') {\n    x -= w;\n  } else if (align === 'center') {\n    x -= (w / 2);\n  }\n  return x;\n}\n\nfunction yForAngle(y, h, angle) {\n  if (angle === 90 || angle === 270) {\n    y -= (h / 2);\n  } else if (angle > 270 || angle < 90) {\n    y -= h;\n  }\n  return y;\n}\n\nfunction drawPointLabelBox(ctx, opts, item) {\n  const {left, top, right, bottom} = item;\n  const {backdropColor} = opts;\n\n  if (!isNullOrUndef(backdropColor)) {\n    const borderRadius = toTRBLCorners(opts.borderRadius);\n    const padding = toPadding(opts.backdropPadding);\n    ctx.fillStyle = backdropColor;\n\n    const backdropLeft = left - padding.left;\n    const backdropTop = top - padding.top;\n    const backdropWidth = right - left + padding.width;\n    const backdropHeight = bottom - top + padding.height;\n\n    if (Object.values(borderRadius).some(v => v !== 0)) {\n      ctx.beginPath();\n      addRoundedRectPath(ctx, {\n        x: backdropLeft,\n        y: backdropTop,\n        w: backdropWidth,\n        h: backdropHeight,\n        radius: borderRadius,\n      });\n      ctx.fill();\n    } else {\n      ctx.fillRect(backdropLeft, backdropTop, backdropWidth, backdropHeight);\n    }\n  }\n}\n\nfunction drawPointLabels(scale, labelCount) {\n  const {ctx, options: {pointLabels}} = scale;\n\n  for (let i = labelCount - 1; i >= 0; i--) {\n    const item = scale._pointLabelItems[i];\n    if (!item.visible) {\n      // overlapping\n      continue;\n    }\n    const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i));\n    drawPointLabelBox(ctx, optsAtIndex, item);\n    const plFont = toFont(optsAtIndex.font);\n    const {x, y, textAlign} = item;\n\n    renderText(\n      ctx,\n      scale._pointLabels[i],\n      x,\n      y + (plFont.lineHeight / 2),\n      plFont,\n      {\n        color: optsAtIndex.color,\n        textAlign: textAlign,\n        textBaseline: 'middle'\n      }\n    );\n  }\n}\n\nfunction pathRadiusLine(scale, radius, circular, labelCount) {\n  const {ctx} = scale;\n  if (circular) {\n    // Draw circular arcs between the points\n    ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);\n  } else {\n    // Draw straight lines connecting each index\n    let pointPosition = scale.getPointPosition(0, radius);\n    ctx.moveTo(pointPosition.x, pointPosition.y);\n\n    for (let i = 1; i < labelCount; i++) {\n      pointPosition = scale.getPointPosition(i, radius);\n      ctx.lineTo(pointPosition.x, pointPosition.y);\n    }\n  }\n}\n\nfunction drawRadiusLine(scale, gridLineOpts, radius, labelCount, borderOpts) {\n  const ctx = scale.ctx;\n  const circular = gridLineOpts.circular;\n\n  const {color, lineWidth} = gridLineOpts;\n\n  if ((!circular && !labelCount) || !color || !lineWidth || radius < 0) {\n    return;\n  }\n\n  ctx.save();\n  ctx.strokeStyle = color;\n  ctx.lineWidth = lineWidth;\n  ctx.setLineDash(borderOpts.dash);\n  ctx.lineDashOffset = borderOpts.dashOffset;\n\n  ctx.beginPath();\n  pathRadiusLine(scale, radius, circular, labelCount);\n  ctx.closePath();\n  ctx.stroke();\n  ctx.restore();\n}\n\nfunction createPointLabelContext(parent, index, label) {\n  return createContext(parent, {\n    label,\n    index,\n    type: 'pointLabel'\n  });\n}\n\nexport default class RadialLinearScale extends LinearScaleBase {\n\n  static id = 'radialLinear';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    display: true,\n\n    // Boolean - Whether to animate scaling the chart from the centre\n    animate: true,\n    position: 'chartArea',\n\n    angleLines: {\n      display: true,\n      lineWidth: 1,\n      borderDash: [],\n      borderDashOffset: 0.0\n    },\n\n    grid: {\n      circular: false\n    },\n\n    startAngle: 0,\n\n    // label settings\n    ticks: {\n      // Boolean - Show a backdrop to the scale label\n      showLabelBackdrop: true,\n\n      callback: Ticks.formatters.numeric\n    },\n\n    pointLabels: {\n      backdropColor: undefined,\n\n      // Number - The backdrop padding above & below the label in pixels\n      backdropPadding: 2,\n\n      // Boolean - if true, show point labels\n      display: true,\n\n      // Number - Point label font size in pixels\n      font: {\n        size: 10\n      },\n\n      // Function - Used to convert point labels\n      callback(label) {\n        return label;\n      },\n\n      // Number - Additionl padding between scale and pointLabel\n      padding: 5,\n\n      // Boolean - if true, center point labels to slices in polar chart\n      centerPointLabels: false\n    }\n  };\n\n  static defaultRoutes = {\n    'angleLines.color': 'borderColor',\n    'pointLabels.color': 'color',\n    'ticks.color': 'color'\n  };\n\n  static descriptors = {\n    angleLines: {\n      _fallback: 'grid'\n    }\n  };\n\n  constructor(cfg) {\n    super(cfg);\n\n    /** @type {number} */\n    this.xCenter = undefined;\n    /** @type {number} */\n    this.yCenter = undefined;\n    /** @type {number} */\n    this.drawingArea = undefined;\n    /** @type {string[]} */\n    this._pointLabels = [];\n    this._pointLabelItems = [];\n  }\n\n  setDimensions() {\n    // Set the unconstrained dimension before label rotation\n    const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);\n    const w = this.width = this.maxWidth - padding.width;\n    const h = this.height = this.maxHeight - padding.height;\n    this.xCenter = Math.floor(this.left + w / 2 + padding.left);\n    this.yCenter = Math.floor(this.top + h / 2 + padding.top);\n    this.drawingArea = Math.floor(Math.min(w, h) / 2);\n  }\n\n  determineDataLimits() {\n    const {min, max} = this.getMinMax(false);\n\n    this.min = isFinite(min) && !isNaN(min) ? min : 0;\n    this.max = isFinite(max) && !isNaN(max) ? max : 0;\n\n    // Common base implementation to handle min, max, beginAtZero\n    this.handleTickRangeOptions();\n  }\n\n  /**\n\t * Returns the maximum number of ticks based on the scale dimension\n\t * @protected\n\t */\n  computeTickLimit() {\n    return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));\n  }\n\n  generateTickLabels(ticks) {\n    LinearScaleBase.prototype.generateTickLabels.call(this, ticks);\n\n    // Point labels\n    this._pointLabels = this.getLabels()\n      .map((value, index) => {\n        const label = callCallback(this.options.pointLabels.callback, [value, index], this);\n        return label || label === 0 ? label : '';\n      })\n      .filter((v, i) => this.chart.getDataVisibility(i));\n  }\n\n  fit() {\n    const opts = this.options;\n\n    if (opts.display && opts.pointLabels.display) {\n      fitWithPointLabels(this);\n    } else {\n      this.setCenterPoint(0, 0, 0, 0);\n    }\n  }\n\n  setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {\n    this.xCenter += Math.floor((leftMovement - rightMovement) / 2);\n    this.yCenter += Math.floor((topMovement - bottomMovement) / 2);\n    this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));\n  }\n\n  getIndexAngle(index) {\n    const angleMultiplier = TAU / (this._pointLabels.length || 1);\n    const startAngle = this.options.startAngle || 0;\n\n    return _normalizeAngle(index * angleMultiplier + toRadians(startAngle));\n  }\n\n  getDistanceFromCenterForValue(value) {\n    if (isNullOrUndef(value)) {\n      return NaN;\n    }\n\n    // Take into account half font size + the yPadding of the top value\n    const scalingFactor = this.drawingArea / (this.max - this.min);\n    if (this.options.reverse) {\n      return (this.max - value) * scalingFactor;\n    }\n    return (value - this.min) * scalingFactor;\n  }\n\n  getValueForDistanceFromCenter(distance) {\n    if (isNullOrUndef(distance)) {\n      return NaN;\n    }\n\n    const scaledDistance = distance / (this.drawingArea / (this.max - this.min));\n    return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;\n  }\n\n  getPointLabelContext(index) {\n    const pointLabels = this._pointLabels || [];\n\n    if (index >= 0 && index < pointLabels.length) {\n      const pointLabel = pointLabels[index];\n      return createPointLabelContext(this.getContext(), index, pointLabel);\n    }\n  }\n\n  getPointPosition(index, distanceFromCenter, additionalAngle = 0) {\n    const angle = this.getIndexAngle(index) - HALF_PI + additionalAngle;\n    return {\n      x: Math.cos(angle) * distanceFromCenter + this.xCenter,\n      y: Math.sin(angle) * distanceFromCenter + this.yCenter,\n      angle\n    };\n  }\n\n  getPointPositionForValue(index, value) {\n    return this.getPointPosition(index, this.getDistanceFromCenterForValue(value));\n  }\n\n  getBasePosition(index) {\n    return this.getPointPositionForValue(index || 0, this.getBaseValue());\n  }\n\n  getPointLabelPosition(index) {\n    const {left, top, right, bottom} = this._pointLabelItems[index];\n    return {\n      left,\n      top,\n      right,\n      bottom,\n    };\n  }\n\n  /**\n\t * @protected\n\t */\n  drawBackground() {\n    const {backgroundColor, grid: {circular}} = this.options;\n    if (backgroundColor) {\n      const ctx = this.ctx;\n      ctx.save();\n      ctx.beginPath();\n      pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);\n      ctx.closePath();\n      ctx.fillStyle = backgroundColor;\n      ctx.fill();\n      ctx.restore();\n    }\n  }\n\n  /**\n\t * @protected\n\t */\n  drawGrid() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    const {angleLines, grid, border} = opts;\n    const labelCount = this._pointLabels.length;\n\n    let i, offset, position;\n\n    if (opts.pointLabels.display) {\n      drawPointLabels(this, labelCount);\n    }\n\n    if (grid.display) {\n      this.ticks.forEach((tick, index) => {\n        if (index !== 0) {\n          offset = this.getDistanceFromCenterForValue(tick.value);\n          const context = this.getContext(index);\n          const optsAtIndex = grid.setContext(context);\n          const optsAtIndexBorder = border.setContext(context);\n\n          drawRadiusLine(this, optsAtIndex, offset, labelCount, optsAtIndexBorder);\n        }\n      });\n    }\n\n    if (angleLines.display) {\n      ctx.save();\n\n      for (i = labelCount - 1; i >= 0; i--) {\n        const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i));\n        const {color, lineWidth} = optsAtIndex;\n\n        if (!lineWidth || !color) {\n          continue;\n        }\n\n        ctx.lineWidth = lineWidth;\n        ctx.strokeStyle = color;\n\n        ctx.setLineDash(optsAtIndex.borderDash);\n        ctx.lineDashOffset = optsAtIndex.borderDashOffset;\n\n        offset = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);\n        position = this.getPointPosition(i, offset);\n        ctx.beginPath();\n        ctx.moveTo(this.xCenter, this.yCenter);\n        ctx.lineTo(position.x, position.y);\n        ctx.stroke();\n      }\n\n      ctx.restore();\n    }\n  }\n\n  /**\n\t * @protected\n\t */\n  drawBorder() {}\n\n  /**\n\t * @protected\n\t */\n  drawLabels() {\n    const ctx = this.ctx;\n    const opts = this.options;\n    const tickOpts = opts.ticks;\n\n    if (!tickOpts.display) {\n      return;\n    }\n\n    const startAngle = this.getIndexAngle(0);\n    let offset, width;\n\n    ctx.save();\n    ctx.translate(this.xCenter, this.yCenter);\n    ctx.rotate(startAngle);\n    ctx.textAlign = 'center';\n    ctx.textBaseline = 'middle';\n\n    this.ticks.forEach((tick, index) => {\n      if (index === 0 && !opts.reverse) {\n        return;\n      }\n\n      const optsAtIndex = tickOpts.setContext(this.getContext(index));\n      const tickFont = toFont(optsAtIndex.font);\n      offset = this.getDistanceFromCenterForValue(this.ticks[index].value);\n\n      if (optsAtIndex.showLabelBackdrop) {\n        ctx.font = tickFont.string;\n        width = ctx.measureText(tick.label).width;\n        ctx.fillStyle = optsAtIndex.backdropColor;\n\n        const padding = toPadding(optsAtIndex.backdropPadding);\n        ctx.fillRect(\n          -width / 2 - padding.left,\n          -offset - tickFont.size / 2 - padding.top,\n          width + padding.width,\n          tickFont.size + padding.height\n        );\n      }\n\n      renderText(ctx, tick.label, 0, -offset, tickFont, {\n        color: optsAtIndex.color,\n        strokeColor: optsAtIndex.textStrokeColor,\n        strokeWidth: optsAtIndex.textStrokeWidth,\n      });\n    });\n\n    ctx.restore();\n  }\n\n  /**\n\t * @protected\n\t */\n  drawTitle() {}\n}\n", "import adapters from '../core/core.adapters.js';\nimport {callback as call, isFinite, isNullOrUndef, mergeIf, valueOrDefault} from '../helpers/helpers.core.js';\nimport {toRadians, isNumber, _limitValue} from '../helpers/helpers.math.js';\nimport Scale from '../core/core.scale.js';\nimport {_arrayUnique, _filterBetween, _lookup} from '../helpers/helpers.collection.js';\n\n/**\n * @typedef { import('../core/core.adapters.js').TimeUnit } Unit\n * @typedef {{common: boolean, size: number, steps?: number}} Interval\n * @typedef { import('../core/core.adapters.js').DateAdapter } DateAdapter\n */\n\n/**\n * @type {Object<Unit, Interval>}\n */\nconst INTERVALS = {\n  millisecond: {common: true, size: 1, steps: 1000},\n  second: {common: true, size: 1000, steps: 60},\n  minute: {common: true, size: 60000, steps: 60},\n  hour: {common: true, size: 3600000, steps: 24},\n  day: {common: true, size: 86400000, steps: 30},\n  week: {common: false, size: 604800000, steps: 4},\n  month: {common: true, size: 2.628e9, steps: 12},\n  quarter: {common: false, size: 7.884e9, steps: 4},\n  year: {common: true, size: 3.154e10}\n};\n\n/**\n * @type {Unit[]}\n */\nconst UNITS = /** @type Unit[] */ /* #__PURE__ */ (Object.keys(INTERVALS));\n\n/**\n * @param {number} a\n * @param {number} b\n */\nfunction sorter(a, b) {\n  return a - b;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {*} input\n * @return {number}\n */\nfunction parse(scale, input) {\n  if (isNullOrUndef(input)) {\n    return null;\n  }\n\n  const adapter = scale._adapter;\n  const {parser, round, isoWeekday} = scale._parseOpts;\n  let value = input;\n\n  if (typeof parser === 'function') {\n    value = parser(value);\n  }\n\n  // Only parse if it's not a timestamp already\n  if (!isFinite(value)) {\n    value = typeof parser === 'string'\n      ? adapter.parse(value, /** @type {Unit} */ (parser))\n      : adapter.parse(value);\n  }\n\n  if (value === null) {\n    return null;\n  }\n\n  if (round) {\n    value = round === 'week' && (isNumber(isoWeekday) || isoWeekday === true)\n      ? adapter.startOf(value, 'isoWeek', isoWeekday)\n      : adapter.startOf(value, round);\n  }\n\n  return +value;\n}\n\n/**\n * Figures out what unit results in an appropriate number of auto-generated ticks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @param {number} capacity\n * @return {object}\n */\nfunction determineUnitForAutoTicks(minUnit, min, max, capacity) {\n  const ilen = UNITS.length;\n\n  for (let i = UNITS.indexOf(minUnit); i < ilen - 1; ++i) {\n    const interval = INTERVALS[UNITS[i]];\n    const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;\n\n    if (interval.common && Math.ceil((max - min) / (factor * interval.size)) <= capacity) {\n      return UNITS[i];\n    }\n  }\n\n  return UNITS[ilen - 1];\n}\n\n/**\n * Figures out what unit to format a set of ticks with\n * @param {TimeScale} scale\n * @param {number} numTicks\n * @param {Unit} minUnit\n * @param {number} min\n * @param {number} max\n * @return {Unit}\n */\nfunction determineUnitForFormatting(scale, numTicks, minUnit, min, max) {\n  for (let i = UNITS.length - 1; i >= UNITS.indexOf(minUnit); i--) {\n    const unit = UNITS[i];\n    if (INTERVALS[unit].common && scale._adapter.diff(max, min, unit) >= numTicks - 1) {\n      return unit;\n    }\n  }\n\n  return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];\n}\n\n/**\n * @param {Unit} unit\n * @return {object}\n */\nfunction determineMajorUnit(unit) {\n  for (let i = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i < ilen; ++i) {\n    if (INTERVALS[UNITS[i]].common) {\n      return UNITS[i];\n    }\n  }\n}\n\n/**\n * @param {object} ticks\n * @param {number} time\n * @param {number[]} [timestamps] - if defined, snap to these timestamps\n */\nfunction addTick(ticks, time, timestamps) {\n  if (!timestamps) {\n    ticks[time] = true;\n  } else if (timestamps.length) {\n    const {lo, hi} = _lookup(timestamps, time);\n    const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi];\n    ticks[timestamp] = true;\n  }\n}\n\n/**\n * @param {TimeScale} scale\n * @param {object[]} ticks\n * @param {object} map\n * @param {Unit} majorUnit\n * @return {object[]}\n */\nfunction setMajorTicks(scale, ticks, map, majorUnit) {\n  const adapter = scale._adapter;\n  const first = +adapter.startOf(ticks[0].value, majorUnit);\n  const last = ticks[ticks.length - 1].value;\n  let major, index;\n\n  for (major = first; major <= last; major = +adapter.add(major, 1, majorUnit)) {\n    index = map[major];\n    if (index >= 0) {\n      ticks[index].major = true;\n    }\n  }\n  return ticks;\n}\n\n/**\n * @param {TimeScale} scale\n * @param {number[]} values\n * @param {Unit|undefined} [majorUnit]\n * @return {object[]}\n */\nfunction ticksFromTimestamps(scale, values, majorUnit) {\n  const ticks = [];\n  /** @type {Object<number,object>} */\n  const map = {};\n  const ilen = values.length;\n  let i, value;\n\n  for (i = 0; i < ilen; ++i) {\n    value = values[i];\n    map[value] = i;\n\n    ticks.push({\n      value,\n      major: false\n    });\n  }\n\n  // We set the major ticks separately from the above loop because calling startOf for every tick\n  // is expensive when there is a large number of ticks\n  return (ilen === 0 || !majorUnit) ? ticks : setMajorTicks(scale, ticks, map, majorUnit);\n}\n\nexport default class TimeScale extends Scale {\n\n  static id = 'time';\n\n  /**\n   * @type {any}\n   */\n  static defaults = {\n    /**\n     * Scale boundary strategy (bypassed by min/max time options)\n     * - `data`: make sure data are fully visible, ticks outside are removed\n     * - `ticks`: make sure ticks are fully visible, data outside are truncated\n     * @see https://github.com/chartjs/Chart.js/pull/4556\n     * @since 2.7.0\n     */\n    bounds: 'data',\n\n    adapters: {},\n    time: {\n      parser: false, // false == a pattern string from or a custom callback that converts its argument to a timestamp\n      unit: false, // false == automatic or override with week, month, year, etc.\n      round: false, // none, or override with week, month, year, etc.\n      isoWeekday: false, // override week start day\n      minUnit: 'millisecond',\n      displayFormats: {}\n    },\n    ticks: {\n      /**\n       * Ticks generation input values:\n       * - 'auto': generates \"optimal\" ticks based on scale size and time options.\n       * - 'data': generates ticks from data (including labels from data {t|x|y} objects).\n       * - 'labels': generates ticks from user given `data.labels` values ONLY.\n       * @see https://github.com/chartjs/Chart.js/pull/4507\n       * @since 2.7.0\n       */\n      source: 'auto',\n\n      callback: false,\n\n      major: {\n        enabled: false\n      }\n    }\n  };\n\n  /**\n\t * @param {object} props\n\t */\n  constructor(props) {\n    super(props);\n\n    /** @type {{data: number[], labels: number[], all: number[]}} */\n    this._cache = {\n      data: [],\n      labels: [],\n      all: []\n    };\n\n    /** @type {Unit} */\n    this._unit = 'day';\n    /** @type {Unit=} */\n    this._majorUnit = undefined;\n    this._offsets = {};\n    this._normalized = false;\n    this._parseOpts = undefined;\n  }\n\n  init(scaleOpts, opts = {}) {\n    const time = scaleOpts.time || (scaleOpts.time = {});\n    /** @type {DateAdapter} */\n    const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);\n\n    adapter.init(opts);\n\n    // Backward compatibility: before introducing adapter, `displayFormats` was\n    // supposed to contain *all* unit/string pairs but this can't be resolved\n    // when loading the scale (adapters are loaded afterward), so let's populate\n    // missing formats on update\n    mergeIf(time.displayFormats, adapter.formats());\n\n    this._parseOpts = {\n      parser: time.parser,\n      round: time.round,\n      isoWeekday: time.isoWeekday\n    };\n\n    super.init(scaleOpts);\n\n    this._normalized = opts.normalized;\n  }\n\n  /**\n\t * @param {*} raw\n\t * @param {number?} [index]\n\t * @return {number}\n\t */\n  parse(raw, index) { // eslint-disable-line no-unused-vars\n    if (raw === undefined) {\n      return null;\n    }\n    return parse(this, raw);\n  }\n\n  beforeLayout() {\n    super.beforeLayout();\n    this._cache = {\n      data: [],\n      labels: [],\n      all: []\n    };\n  }\n\n  determineDataLimits() {\n    const options = this.options;\n    const adapter = this._adapter;\n    const unit = options.time.unit || 'day';\n    // eslint-disable-next-line prefer-const\n    let {min, max, minDefined, maxDefined} = this.getUserBounds();\n\n    /**\n\t\t * @param {object} bounds\n\t\t */\n    function _applyBounds(bounds) {\n      if (!minDefined && !isNaN(bounds.min)) {\n        min = Math.min(min, bounds.min);\n      }\n      if (!maxDefined && !isNaN(bounds.max)) {\n        max = Math.max(max, bounds.max);\n      }\n    }\n\n    // If we have user provided `min` and `max` labels / data bounds can be ignored\n    if (!minDefined || !maxDefined) {\n      // Labels are always considered, when user did not force bounds\n      _applyBounds(this._getLabelBounds());\n\n      // If `bounds` is `'ticks'` and `ticks.source` is `'labels'`,\n      // data bounds are ignored (and don't need to be determined)\n      if (options.bounds !== 'ticks' || options.ticks.source !== 'labels') {\n        _applyBounds(this.getMinMax(false));\n      }\n    }\n\n    min = isFinite(min) && !isNaN(min) ? min : +adapter.startOf(Date.now(), unit);\n    max = isFinite(max) && !isNaN(max) ? max : +adapter.endOf(Date.now(), unit) + 1;\n\n    // Make sure that max is strictly higher than min (required by the timeseries lookup table)\n    this.min = Math.min(min, max - 1);\n    this.max = Math.max(min + 1, max);\n  }\n\n  /**\n\t * @private\n\t */\n  _getLabelBounds() {\n    const arr = this.getLabelTimestamps();\n    let min = Number.POSITIVE_INFINITY;\n    let max = Number.NEGATIVE_INFINITY;\n\n    if (arr.length) {\n      min = arr[0];\n      max = arr[arr.length - 1];\n    }\n    return {min, max};\n  }\n\n  /**\n\t * @return {object[]}\n\t */\n  buildTicks() {\n    const options = this.options;\n    const timeOpts = options.time;\n    const tickOpts = options.ticks;\n    const timestamps = tickOpts.source === 'labels' ? this.getLabelTimestamps() : this._generate();\n\n    if (options.bounds === 'ticks' && timestamps.length) {\n      this.min = this._userMin || timestamps[0];\n      this.max = this._userMax || timestamps[timestamps.length - 1];\n    }\n\n    const min = this.min;\n    const max = this.max;\n\n    const ticks = _filterBetween(timestamps, min, max);\n\n    // PRIVATE\n    // determineUnitForFormatting relies on the number of ticks so we don't use it when\n    // autoSkip is enabled because we don't yet know what the final number of ticks will be\n    this._unit = timeOpts.unit || (tickOpts.autoSkip\n      ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min))\n      : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));\n    this._majorUnit = !tickOpts.major.enabled || this._unit === 'year' ? undefined\n      : determineMajorUnit(this._unit);\n    this.initOffsets(timestamps);\n\n    if (options.reverse) {\n      ticks.reverse();\n    }\n\n    return ticksFromTimestamps(this, ticks, this._majorUnit);\n  }\n\n  afterAutoSkip() {\n    // Offsets for bar charts need to be handled with the auto skipped\n    // ticks. Once ticks have been skipped, we re-compute the offsets.\n    if (this.options.offsetAfterAutoskip) {\n      this.initOffsets(this.ticks.map(tick => +tick.value));\n    }\n  }\n\n  /**\n\t * Returns the start and end offsets from edges in the form of {start, end}\n\t * where each value is a relative width to the scale and ranges between 0 and 1.\n\t * They add extra margins on the both sides by scaling down the original scale.\n\t * Offsets are added when the `offset` option is true.\n\t * @param {number[]} timestamps\n\t * @protected\n\t */\n  initOffsets(timestamps = []) {\n    let start = 0;\n    let end = 0;\n    let first, last;\n\n    if (this.options.offset && timestamps.length) {\n      first = this.getDecimalForValue(timestamps[0]);\n      if (timestamps.length === 1) {\n        start = 1 - first;\n      } else {\n        start = (this.getDecimalForValue(timestamps[1]) - first) / 2;\n      }\n      last = this.getDecimalForValue(timestamps[timestamps.length - 1]);\n      if (timestamps.length === 1) {\n        end = last;\n      } else {\n        end = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;\n      }\n    }\n    const limit = timestamps.length < 3 ? 0.5 : 0.25;\n    start = _limitValue(start, 0, limit);\n    end = _limitValue(end, 0, limit);\n\n    this._offsets = {start, end, factor: 1 / (start + 1 + end)};\n  }\n\n  /**\n\t * Generates a maximum of `capacity` timestamps between min and max, rounded to the\n\t * `minor` unit using the given scale time `options`.\n\t * Important: this method can return ticks outside the min and max range, it's the\n\t * responsibility of the calling code to clamp values if needed.\n\t * @protected\n\t */\n  _generate() {\n    const adapter = this._adapter;\n    const min = this.min;\n    const max = this.max;\n    const options = this.options;\n    const timeOpts = options.time;\n    // @ts-ignore\n    const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min, max, this._getLabelCapacity(min));\n    const stepSize = valueOrDefault(options.ticks.stepSize, 1);\n    const weekday = minor === 'week' ? timeOpts.isoWeekday : false;\n    const hasWeekday = isNumber(weekday) || weekday === true;\n    const ticks = {};\n    let first = min;\n    let time, count;\n\n    // For 'week' unit, handle the first day of week option\n    if (hasWeekday) {\n      first = +adapter.startOf(first, 'isoWeek', weekday);\n    }\n\n    // Align first ticks on unit\n    first = +adapter.startOf(first, hasWeekday ? 'day' : minor);\n\n    // Prevent browser from freezing in case user options request millions of milliseconds\n    if (adapter.diff(max, min, minor) > 100000 * stepSize) {\n      throw new Error(min + ' and ' + max + ' are too far apart with stepSize of ' + stepSize + ' ' + minor);\n    }\n\n    const timestamps = options.ticks.source === 'data' && this.getDataTimestamps();\n    for (time = first, count = 0; time < max; time = +adapter.add(time, stepSize, minor), count++) {\n      addTick(ticks, time, timestamps);\n    }\n\n    if (time === max || options.bounds === 'ticks' || count === 1) {\n      addTick(ticks, time, timestamps);\n    }\n\n    // @ts-ignore\n    return Object.keys(ticks).sort(sorter).map(x => +x);\n  }\n\n  /**\n\t * @param {number} value\n\t * @return {string}\n\t */\n  getLabelForValue(value) {\n    const adapter = this._adapter;\n    const timeOpts = this.options.time;\n\n    if (timeOpts.tooltipFormat) {\n      return adapter.format(value, timeOpts.tooltipFormat);\n    }\n    return adapter.format(value, timeOpts.displayFormats.datetime);\n  }\n\n  /**\n\t * @param {number} value\n\t * @param {string|undefined} format\n\t * @return {string}\n\t */\n  format(value, format) {\n    const options = this.options;\n    const formats = options.time.displayFormats;\n    const unit = this._unit;\n    const fmt = format || formats[unit];\n    return this._adapter.format(value, fmt);\n  }\n\n  /**\n\t * Function to format an individual tick mark\n\t * @param {number} time\n\t * @param {number} index\n\t * @param {object[]} ticks\n\t * @param {string|undefined} [format]\n\t * @return {string}\n\t * @private\n\t */\n  _tickFormatFunction(time, index, ticks, format) {\n    const options = this.options;\n    const formatter = options.ticks.callback;\n\n    if (formatter) {\n      return call(formatter, [time, index, ticks], this);\n    }\n\n    const formats = options.time.displayFormats;\n    const unit = this._unit;\n    const majorUnit = this._majorUnit;\n    const minorFormat = unit && formats[unit];\n    const majorFormat = majorUnit && formats[majorUnit];\n    const tick = ticks[index];\n    const major = majorUnit && majorFormat && tick && tick.major;\n\n    return this._adapter.format(time, format || (major ? majorFormat : minorFormat));\n  }\n\n  /**\n\t * @param {object[]} ticks\n\t */\n  generateTickLabels(ticks) {\n    let i, ilen, tick;\n\n    for (i = 0, ilen = ticks.length; i < ilen; ++i) {\n      tick = ticks[i];\n      tick.label = this._tickFormatFunction(tick.value, i, ticks);\n    }\n  }\n\n  /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n  getDecimalForValue(value) {\n    return value === null ? NaN : (value - this.min) / (this.max - this.min);\n  }\n\n  /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n  getPixelForValue(value) {\n    const offsets = this._offsets;\n    const pos = this.getDecimalForValue(value);\n    return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);\n  }\n\n  /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n  getValueForPixel(pixel) {\n    const offsets = this._offsets;\n    const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n    return this.min + pos * (this.max - this.min);\n  }\n\n  /**\n\t * @param {string} label\n\t * @return {{w:number, h:number}}\n\t * @private\n\t */\n  _getLabelSize(label) {\n    const ticksOpts = this.options.ticks;\n    const tickLabelWidth = this.ctx.measureText(label).width;\n    const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);\n    const cosRotation = Math.cos(angle);\n    const sinRotation = Math.sin(angle);\n    const tickFontSize = this._resolveTickFontOptions(0).size;\n\n    return {\n      w: (tickLabelWidth * cosRotation) + (tickFontSize * sinRotation),\n      h: (tickLabelWidth * sinRotation) + (tickFontSize * cosRotation)\n    };\n  }\n\n  /**\n\t * @param {number} exampleTime\n\t * @return {number}\n\t * @private\n\t */\n  _getLabelCapacity(exampleTime) {\n    const timeOpts = this.options.time;\n    const displayFormats = timeOpts.displayFormats;\n\n    // pick the longest format (milliseconds) for guesstimation\n    const format = displayFormats[timeOpts.unit] || displayFormats.millisecond;\n    const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format);\n    const size = this._getLabelSize(exampleLabel);\n    // subtract 1 - if offset then there's one less label than tick\n    // if not offset then one half label padding is added to each end leaving room for one less label\n    const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;\n    return capacity > 0 ? capacity : 1;\n  }\n\n  /**\n\t * @protected\n\t */\n  getDataTimestamps() {\n    let timestamps = this._cache.data || [];\n    let i, ilen;\n\n    if (timestamps.length) {\n      return timestamps;\n    }\n\n    const metas = this.getMatchingVisibleMetas();\n\n    if (this._normalized && metas.length) {\n      return (this._cache.data = metas[0].controller.getAllParsedValues(this));\n    }\n\n    for (i = 0, ilen = metas.length; i < ilen; ++i) {\n      timestamps = timestamps.concat(metas[i].controller.getAllParsedValues(this));\n    }\n\n    return (this._cache.data = this.normalize(timestamps));\n  }\n\n  /**\n\t * @protected\n\t */\n  getLabelTimestamps() {\n    const timestamps = this._cache.labels || [];\n    let i, ilen;\n\n    if (timestamps.length) {\n      return timestamps;\n    }\n\n    const labels = this.getLabels();\n    for (i = 0, ilen = labels.length; i < ilen; ++i) {\n      timestamps.push(parse(this, labels[i]));\n    }\n\n    return (this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps));\n  }\n\n  /**\n\t * @param {number[]} values\n\t * @protected\n\t */\n  normalize(values) {\n    // It seems to be somewhat faster to do sorting first\n    return _arrayUnique(values.sort(sorter));\n  }\n}\n", "import TimeScale from './scale.time.js';\nimport {_lookupByKey} from '../helpers/helpers.collection.js';\n\n/**\n * Linearly interpolates the given source `val` using the table. If value is out of bounds, values\n * at edges are used for the interpolation.\n * @param {object} table\n * @param {number} val\n * @param {boolean} [reverse] lookup time based on position instead of vice versa\n * @return {object}\n */\nfunction interpolate(table, val, reverse) {\n  let lo = 0;\n  let hi = table.length - 1;\n  let prevSource, nextSource, prevTarget, nextTarget;\n  if (reverse) {\n    if (val >= table[lo].pos && val <= table[hi].pos) {\n      ({lo, hi} = _lookupByKey(table, 'pos', val));\n    }\n    ({pos: prevSource, time: prevTarget} = table[lo]);\n    ({pos: nextSource, time: nextTarget} = table[hi]);\n  } else {\n    if (val >= table[lo].time && val <= table[hi].time) {\n      ({lo, hi} = _lookupByKey(table, 'time', val));\n    }\n    ({time: prevSource, pos: prevTarget} = table[lo]);\n    ({time: nextSource, pos: nextTarget} = table[hi]);\n  }\n\n  const span = nextSource - prevSource;\n  return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;\n}\n\nclass TimeSeriesScale extends TimeScale {\n\n  static id = 'timeseries';\n\n  /**\n   * @type {any}\n   */\n  static defaults = TimeScale.defaults;\n\n  /**\n\t * @param {object} props\n\t */\n  constructor(props) {\n    super(props);\n\n    /** @type {object[]} */\n    this._table = [];\n    /** @type {number} */\n    this._minPos = undefined;\n    /** @type {number} */\n    this._tableRange = undefined;\n  }\n\n  /**\n\t * @protected\n\t */\n  initOffsets() {\n    const timestamps = this._getTimestampsForTable();\n    const table = this._table = this.buildLookupTable(timestamps);\n    this._minPos = interpolate(table, this.min);\n    this._tableRange = interpolate(table, this.max) - this._minPos;\n    super.initOffsets(timestamps);\n  }\n\n  /**\n\t * Returns an array of {time, pos} objects used to interpolate a specific `time` or position\n\t * (`pos`) on the scale, by searching entries before and after the requested value. `pos` is\n\t * a decimal between 0 and 1: 0 being the start of the scale (left or top) and 1 the other\n\t * extremity (left + width or top + height). Note that it would be more optimized to directly\n\t * store pre-computed pixels, but the scale dimensions are not guaranteed at the time we need\n\t * to create the lookup table. The table ALWAYS contains at least two items: min and max.\n\t * @param {number[]} timestamps\n\t * @return {object[]}\n\t * @protected\n\t */\n  buildLookupTable(timestamps) {\n    const {min, max} = this;\n    const items = [];\n    const table = [];\n    let i, ilen, prev, curr, next;\n\n    for (i = 0, ilen = timestamps.length; i < ilen; ++i) {\n      curr = timestamps[i];\n      if (curr >= min && curr <= max) {\n        items.push(curr);\n      }\n    }\n\n    if (items.length < 2) {\n      // In case there is less that 2 timestamps between min and max, the scale is defined by min and max\n      return [\n        {time: min, pos: 0},\n        {time: max, pos: 1}\n      ];\n    }\n\n    for (i = 0, ilen = items.length; i < ilen; ++i) {\n      next = items[i + 1];\n      prev = items[i - 1];\n      curr = items[i];\n\n      // only add points that breaks the scale linearity\n      if (Math.round((next + prev) / 2) !== curr) {\n        table.push({time: curr, pos: i / (ilen - 1)});\n      }\n    }\n    return table;\n  }\n\n  /**\n    * Generates all timestamps defined in the data.\n    * Important: this method can return ticks outside the min and max range, it's the\n    * responsibility of the calling code to clamp values if needed.\n    * @protected\n    */\n  _generate() {\n    const min = this.min;\n    const max = this.max;\n    let timestamps = super.getDataTimestamps();\n    if (!timestamps.includes(min) || !timestamps.length) {\n      timestamps.splice(0, 0, min);\n    }\n    if (!timestamps.includes(max) || timestamps.length === 1) {\n      timestamps.push(max);\n    }\n    return timestamps.sort((a, b) => a - b);\n  }\n\n  /**\n\t * Returns all timestamps\n\t * @return {number[]}\n\t * @private\n\t */\n  _getTimestampsForTable() {\n    let timestamps = this._cache.all || [];\n\n    if (timestamps.length) {\n      return timestamps;\n    }\n\n    const data = this.getDataTimestamps();\n    const label = this.getLabelTimestamps();\n    if (data.length && label.length) {\n      // If combining labels and data (data might not contain all labels),\n      // we need to recheck uniqueness and sort\n      timestamps = this.normalize(data.concat(label));\n    } else {\n      timestamps = data.length ? data : label;\n    }\n    timestamps = this._cache.all = timestamps;\n\n    return timestamps;\n  }\n\n  /**\n\t * @param {number} value - Milliseconds since epoch (1 January 1970 00:00:00 UTC)\n\t * @return {number}\n\t */\n  getDecimalForValue(value) {\n    return (interpolate(this._table, value) - this._minPos) / this._tableRange;\n  }\n\n  /**\n\t * @param {number} pixel\n\t * @return {number}\n\t */\n  getValueForPixel(pixel) {\n    const offsets = this._offsets;\n    const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;\n    return interpolate(this._table, decimal * this._tableRange + this._minPos, true);\n  }\n}\n\nexport default TimeSeriesScale;\n", "export * from './controllers/index.js';\nexport * from './core/index.js';\nexport * from './elements/index.js';\nexport * from './platform/index.js';\nexport * from './plugins/index.js';\nexport * from './scales/index.js';\n\nimport * as controllers from './controllers/index.js';\nimport * as elements from './elements/index.js';\nimport * as plugins from './plugins/index.js';\nimport * as scales from './scales/index.js';\n\nexport {\n  controllers,\n  elements,\n  plugins,\n  scales,\n};\n\nexport const registerables = [\n  controllers,\n  elements,\n  plugins,\n  scales,\n];\n", "import {Chart, registerables} from '../dist/chart.js';\n\nChart.register(...registerables);\n\nexport * from '../dist/chart.js';\nexport default Chart;\n", "/*!\n * chartjs-plugin-datalabels v2.2.0\n * https://chartjs-plugin-datalabels.netlify.app\n * (c) 2017-2022 chartjs-plugin-datalabels contributors\n * Released under the MIT license\n */\nimport { isNullOrUndef, merge, toFont, resolve, toPadding, valueOrDefault, callback, isObject, each } from 'chart.js/helpers';\nimport { defaults as defaults$1, ArcElement, PointElement, BarElement } from 'chart.js';\n\nvar devicePixelRatio = (function() {\n  if (typeof window !== 'undefined') {\n    if (window.devicePixelRatio) {\n      return window.devicePixelRatio;\n    }\n\n    // devicePixelRatio is undefined on IE10\n    // https://stackoverflow.com/a/20204180/8837887\n    // https://github.com/chartjs/chartjs-plugin-datalabels/issues/85\n    var screen = window.screen;\n    if (screen) {\n      return (screen.deviceXDPI || 1) / (screen.logicalXDPI || 1);\n    }\n  }\n\n  return 1;\n}());\n\nvar utils = {\n  // @todo move this in Chart.helpers.toTextLines\n  toTextLines: function(inputs) {\n    var lines = [];\n    var input;\n\n    inputs = [].concat(inputs);\n    while (inputs.length) {\n      input = inputs.pop();\n      if (typeof input === 'string') {\n        lines.unshift.apply(lines, input.split('\\n'));\n      } else if (Array.isArray(input)) {\n        inputs.push.apply(inputs, input);\n      } else if (!isNullOrUndef(inputs)) {\n        lines.unshift('' + input);\n      }\n    }\n\n    return lines;\n  },\n\n  // @todo move this in Chart.helpers.canvas.textSize\n  // @todo cache calls of measureText if font doesn't change?!\n  textSize: function(ctx, lines, font) {\n    var items = [].concat(lines);\n    var ilen = items.length;\n    var prev = ctx.font;\n    var width = 0;\n    var i;\n\n    ctx.font = font.string;\n\n    for (i = 0; i < ilen; ++i) {\n      width = Math.max(ctx.measureText(items[i]).width, width);\n    }\n\n    ctx.font = prev;\n\n    return {\n      height: ilen * font.lineHeight,\n      width: width\n    };\n  },\n\n  /**\n   * Returns value bounded by min and max. This is equivalent to max(min, min(value, max)).\n   * @todo move this method in Chart.helpers.bound\n   * https://doc.qt.io/qt-5/qtglobal.html#qBound\n   */\n  bound: function(min, value, max) {\n    return Math.max(min, Math.min(value, max));\n  },\n\n  /**\n   * Returns an array of pair [value, state] where state is:\n   * * -1: value is only in a0 (removed)\n   * *  1: value is only in a1 (added)\n   */\n  arrayDiff: function(a0, a1) {\n    var prev = a0.slice();\n    var updates = [];\n    var i, j, ilen, v;\n\n    for (i = 0, ilen = a1.length; i < ilen; ++i) {\n      v = a1[i];\n      j = prev.indexOf(v);\n\n      if (j === -1) {\n        updates.push([v, 1]);\n      } else {\n        prev.splice(j, 1);\n      }\n    }\n\n    for (i = 0, ilen = prev.length; i < ilen; ++i) {\n      updates.push([prev[i], -1]);\n    }\n\n    return updates;\n  },\n\n  /**\n   * https://github.com/chartjs/chartjs-plugin-datalabels/issues/70\n   */\n  rasterize: function(v) {\n    return Math.round(v * devicePixelRatio) / devicePixelRatio;\n  }\n};\n\nfunction orient(point, origin) {\n  var x0 = origin.x;\n  var y0 = origin.y;\n\n  if (x0 === null) {\n    return {x: 0, y: -1};\n  }\n  if (y0 === null) {\n    return {x: 1, y: 0};\n  }\n\n  var dx = point.x - x0;\n  var dy = point.y - y0;\n  var ln = Math.sqrt(dx * dx + dy * dy);\n\n  return {\n    x: ln ? dx / ln : 0,\n    y: ln ? dy / ln : -1\n  };\n}\n\nfunction aligned(x, y, vx, vy, align) {\n  switch (align) {\n  case 'center':\n    vx = vy = 0;\n    break;\n  case 'bottom':\n    vx = 0;\n    vy = 1;\n    break;\n  case 'right':\n    vx = 1;\n    vy = 0;\n    break;\n  case 'left':\n    vx = -1;\n    vy = 0;\n    break;\n  case 'top':\n    vx = 0;\n    vy = -1;\n    break;\n  case 'start':\n    vx = -vx;\n    vy = -vy;\n    break;\n  case 'end':\n    // keep natural orientation\n    break;\n  default:\n    // clockwise rotation (in degree)\n    align *= (Math.PI / 180);\n    vx = Math.cos(align);\n    vy = Math.sin(align);\n    break;\n  }\n\n  return {\n    x: x,\n    y: y,\n    vx: vx,\n    vy: vy\n  };\n}\n\n// Line clipping (Cohen\u2013Sutherland algorithm)\n// https://en.wikipedia.org/wiki/Cohen\u2013Sutherland_algorithm\n\nvar R_INSIDE = 0;\nvar R_LEFT = 1;\nvar R_RIGHT = 2;\nvar R_BOTTOM = 4;\nvar R_TOP = 8;\n\nfunction region(x, y, rect) {\n  var res = R_INSIDE;\n\n  if (x < rect.left) {\n    res |= R_LEFT;\n  } else if (x > rect.right) {\n    res |= R_RIGHT;\n  }\n  if (y < rect.top) {\n    res |= R_TOP;\n  } else if (y > rect.bottom) {\n    res |= R_BOTTOM;\n  }\n\n  return res;\n}\n\nfunction clipped(segment, area) {\n  var x0 = segment.x0;\n  var y0 = segment.y0;\n  var x1 = segment.x1;\n  var y1 = segment.y1;\n  var r0 = region(x0, y0, area);\n  var r1 = region(x1, y1, area);\n  var r, x, y;\n\n  // eslint-disable-next-line no-constant-condition\n  while (true) {\n    if (!(r0 | r1) || (r0 & r1)) {\n      // both points inside or on the same side: no clipping\n      break;\n    }\n\n    // at least one point is outside\n    r = r0 || r1;\n\n    if (r & R_TOP) {\n      x = x0 + (x1 - x0) * (area.top - y0) / (y1 - y0);\n      y = area.top;\n    } else if (r & R_BOTTOM) {\n      x = x0 + (x1 - x0) * (area.bottom - y0) / (y1 - y0);\n      y = area.bottom;\n    } else if (r & R_RIGHT) {\n      y = y0 + (y1 - y0) * (area.right - x0) / (x1 - x0);\n      x = area.right;\n    } else if (r & R_LEFT) {\n      y = y0 + (y1 - y0) * (area.left - x0) / (x1 - x0);\n      x = area.left;\n    }\n\n    if (r === r0) {\n      x0 = x;\n      y0 = y;\n      r0 = region(x0, y0, area);\n    } else {\n      x1 = x;\n      y1 = y;\n      r1 = region(x1, y1, area);\n    }\n  }\n\n  return {\n    x0: x0,\n    x1: x1,\n    y0: y0,\n    y1: y1\n  };\n}\n\nfunction compute$1(range, config) {\n  var anchor = config.anchor;\n  var segment = range;\n  var x, y;\n\n  if (config.clamp) {\n    segment = clipped(segment, config.area);\n  }\n\n  if (anchor === 'start') {\n    x = segment.x0;\n    y = segment.y0;\n  } else if (anchor === 'end') {\n    x = segment.x1;\n    y = segment.y1;\n  } else {\n    x = (segment.x0 + segment.x1) / 2;\n    y = (segment.y0 + segment.y1) / 2;\n  }\n\n  return aligned(x, y, range.vx, range.vy, config.align);\n}\n\nvar positioners = {\n  arc: function(el, config) {\n    var angle = (el.startAngle + el.endAngle) / 2;\n    var vx = Math.cos(angle);\n    var vy = Math.sin(angle);\n    var r0 = el.innerRadius;\n    var r1 = el.outerRadius;\n\n    return compute$1({\n      x0: el.x + vx * r0,\n      y0: el.y + vy * r0,\n      x1: el.x + vx * r1,\n      y1: el.y + vy * r1,\n      vx: vx,\n      vy: vy\n    }, config);\n  },\n\n  point: function(el, config) {\n    var v = orient(el, config.origin);\n    var rx = v.x * el.options.radius;\n    var ry = v.y * el.options.radius;\n\n    return compute$1({\n      x0: el.x - rx,\n      y0: el.y - ry,\n      x1: el.x + rx,\n      y1: el.y + ry,\n      vx: v.x,\n      vy: v.y\n    }, config);\n  },\n\n  bar: function(el, config) {\n    var v = orient(el, config.origin);\n    var x = el.x;\n    var y = el.y;\n    var sx = 0;\n    var sy = 0;\n\n    if (el.horizontal) {\n      x = Math.min(el.x, el.base);\n      sx = Math.abs(el.base - el.x);\n    } else {\n      y = Math.min(el.y, el.base);\n      sy = Math.abs(el.base - el.y);\n    }\n\n    return compute$1({\n      x0: x,\n      y0: y + sy,\n      x1: x + sx,\n      y1: y,\n      vx: v.x,\n      vy: v.y\n    }, config);\n  },\n\n  fallback: function(el, config) {\n    var v = orient(el, config.origin);\n\n    return compute$1({\n      x0: el.x,\n      y0: el.y,\n      x1: el.x + (el.width || 0),\n      y1: el.y + (el.height || 0),\n      vx: v.x,\n      vy: v.y\n    }, config);\n  }\n};\n\nvar rasterize = utils.rasterize;\n\nfunction boundingRects(model) {\n  var borderWidth = model.borderWidth || 0;\n  var padding = model.padding;\n  var th = model.size.height;\n  var tw = model.size.width;\n  var tx = -tw / 2;\n  var ty = -th / 2;\n\n  return {\n    frame: {\n      x: tx - padding.left - borderWidth,\n      y: ty - padding.top - borderWidth,\n      w: tw + padding.width + borderWidth * 2,\n      h: th + padding.height + borderWidth * 2\n    },\n    text: {\n      x: tx,\n      y: ty,\n      w: tw,\n      h: th\n    }\n  };\n}\n\nfunction getScaleOrigin(el, context) {\n  var scale = context.chart.getDatasetMeta(context.datasetIndex).vScale;\n\n  if (!scale) {\n    return null;\n  }\n\n  if (scale.xCenter !== undefined && scale.yCenter !== undefined) {\n    return {x: scale.xCenter, y: scale.yCenter};\n  }\n\n  var pixel = scale.getBasePixel();\n  return el.horizontal ?\n    {x: pixel, y: null} :\n    {x: null, y: pixel};\n}\n\nfunction getPositioner(el) {\n  if (el instanceof ArcElement) {\n    return positioners.arc;\n  }\n  if (el instanceof PointElement) {\n    return positioners.point;\n  }\n  if (el instanceof BarElement) {\n    return positioners.bar;\n  }\n  return positioners.fallback;\n}\n\nfunction drawRoundedRect(ctx, x, y, w, h, radius) {\n  var HALF_PI = Math.PI / 2;\n\n  if (radius) {\n    var r = Math.min(radius, h / 2, w / 2);\n    var left = x + r;\n    var top = y + r;\n    var right = x + w - r;\n    var bottom = y + h - r;\n\n    ctx.moveTo(x, top);\n    if (left < right && top < bottom) {\n      ctx.arc(left, top, r, -Math.PI, -HALF_PI);\n      ctx.arc(right, top, r, -HALF_PI, 0);\n      ctx.arc(right, bottom, r, 0, HALF_PI);\n      ctx.arc(left, bottom, r, HALF_PI, Math.PI);\n    } else if (left < right) {\n      ctx.moveTo(left, y);\n      ctx.arc(right, top, r, -HALF_PI, HALF_PI);\n      ctx.arc(left, top, r, HALF_PI, Math.PI + HALF_PI);\n    } else if (top < bottom) {\n      ctx.arc(left, top, r, -Math.PI, 0);\n      ctx.arc(left, bottom, r, 0, Math.PI);\n    } else {\n      ctx.arc(left, top, r, -Math.PI, Math.PI);\n    }\n    ctx.closePath();\n    ctx.moveTo(x, y);\n  } else {\n    ctx.rect(x, y, w, h);\n  }\n}\n\nfunction drawFrame(ctx, rect, model) {\n  var bgColor = model.backgroundColor;\n  var borderColor = model.borderColor;\n  var borderWidth = model.borderWidth;\n\n  if (!bgColor && (!borderColor || !borderWidth)) {\n    return;\n  }\n\n  ctx.beginPath();\n\n  drawRoundedRect(\n    ctx,\n    rasterize(rect.x) + borderWidth / 2,\n    rasterize(rect.y) + borderWidth / 2,\n    rasterize(rect.w) - borderWidth,\n    rasterize(rect.h) - borderWidth,\n    model.borderRadius);\n\n  ctx.closePath();\n\n  if (bgColor) {\n    ctx.fillStyle = bgColor;\n    ctx.fill();\n  }\n\n  if (borderColor && borderWidth) {\n    ctx.strokeStyle = borderColor;\n    ctx.lineWidth = borderWidth;\n    ctx.lineJoin = 'miter';\n    ctx.stroke();\n  }\n}\n\nfunction textGeometry(rect, align, font) {\n  var h = font.lineHeight;\n  var w = rect.w;\n  var x = rect.x;\n  var y = rect.y + h / 2;\n\n  if (align === 'center') {\n    x += w / 2;\n  } else if (align === 'end' || align === 'right') {\n    x += w;\n  }\n\n  return {\n    h: h,\n    w: w,\n    x: x,\n    y: y\n  };\n}\n\nfunction drawTextLine(ctx, text, cfg) {\n  var shadow = ctx.shadowBlur;\n  var stroked = cfg.stroked;\n  var x = rasterize(cfg.x);\n  var y = rasterize(cfg.y);\n  var w = rasterize(cfg.w);\n\n  if (stroked) {\n    ctx.strokeText(text, x, y, w);\n  }\n\n  if (cfg.filled) {\n    if (shadow && stroked) {\n      // Prevent drawing shadow on both the text stroke and fill, so\n      // if the text is stroked, remove the shadow for the text fill.\n      ctx.shadowBlur = 0;\n    }\n\n    ctx.fillText(text, x, y, w);\n\n    if (shadow && stroked) {\n      ctx.shadowBlur = shadow;\n    }\n  }\n}\n\nfunction drawText(ctx, lines, rect, model) {\n  var align = model.textAlign;\n  var color = model.color;\n  var filled = !!color;\n  var font = model.font;\n  var ilen = lines.length;\n  var strokeColor = model.textStrokeColor;\n  var strokeWidth = model.textStrokeWidth;\n  var stroked = strokeColor && strokeWidth;\n  var i;\n\n  if (!ilen || (!filled && !stroked)) {\n    return;\n  }\n\n  // Adjust coordinates based on text alignment and line height\n  rect = textGeometry(rect, align, font);\n\n  ctx.font = font.string;\n  ctx.textAlign = align;\n  ctx.textBaseline = 'middle';\n  ctx.shadowBlur = model.textShadowBlur;\n  ctx.shadowColor = model.textShadowColor;\n\n  if (filled) {\n    ctx.fillStyle = color;\n  }\n  if (stroked) {\n    ctx.lineJoin = 'round';\n    ctx.lineWidth = strokeWidth;\n    ctx.strokeStyle = strokeColor;\n  }\n\n  for (i = 0, ilen = lines.length; i < ilen; ++i) {\n    drawTextLine(ctx, lines[i], {\n      stroked: stroked,\n      filled: filled,\n      w: rect.w,\n      x: rect.x,\n      y: rect.y + rect.h * i\n    });\n  }\n}\n\nvar Label = function(config, ctx, el, index) {\n  var me = this;\n\n  me._config = config;\n  me._index = index;\n  me._model = null;\n  me._rects = null;\n  me._ctx = ctx;\n  me._el = el;\n};\n\nmerge(Label.prototype, {\n  /**\n   * @private\n   */\n  _modelize: function(display, lines, config, context) {\n    var me = this;\n    var index = me._index;\n    var font = toFont(resolve([config.font, {}], context, index));\n    var color = resolve([config.color, defaults$1.color], context, index);\n\n    return {\n      align: resolve([config.align, 'center'], context, index),\n      anchor: resolve([config.anchor, 'center'], context, index),\n      area: context.chart.chartArea,\n      backgroundColor: resolve([config.backgroundColor, null], context, index),\n      borderColor: resolve([config.borderColor, null], context, index),\n      borderRadius: resolve([config.borderRadius, 0], context, index),\n      borderWidth: resolve([config.borderWidth, 0], context, index),\n      clamp: resolve([config.clamp, false], context, index),\n      clip: resolve([config.clip, false], context, index),\n      color: color,\n      display: display,\n      font: font,\n      lines: lines,\n      offset: resolve([config.offset, 4], context, index),\n      opacity: resolve([config.opacity, 1], context, index),\n      origin: getScaleOrigin(me._el, context),\n      padding: toPadding(resolve([config.padding, 4], context, index)),\n      positioner: getPositioner(me._el),\n      rotation: resolve([config.rotation, 0], context, index) * (Math.PI / 180),\n      size: utils.textSize(me._ctx, lines, font),\n      textAlign: resolve([config.textAlign, 'start'], context, index),\n      textShadowBlur: resolve([config.textShadowBlur, 0], context, index),\n      textShadowColor: resolve([config.textShadowColor, color], context, index),\n      textStrokeColor: resolve([config.textStrokeColor, color], context, index),\n      textStrokeWidth: resolve([config.textStrokeWidth, 0], context, index)\n    };\n  },\n\n  update: function(context) {\n    var me = this;\n    var model = null;\n    var rects = null;\n    var index = me._index;\n    var config = me._config;\n    var value, label, lines;\n\n    // We first resolve the display option (separately) to avoid computing\n    // other options in case the label is hidden (i.e. display: false).\n    var display = resolve([config.display, true], context, index);\n\n    if (display) {\n      value = context.dataset.data[index];\n      label = valueOrDefault(callback(config.formatter, [value, context]), value);\n      lines = isNullOrUndef(label) ? [] : utils.toTextLines(label);\n\n      if (lines.length) {\n        model = me._modelize(display, lines, config, context);\n        rects = boundingRects(model);\n      }\n    }\n\n    me._model = model;\n    me._rects = rects;\n  },\n\n  geometry: function() {\n    return this._rects ? this._rects.frame : {};\n  },\n\n  rotation: function() {\n    return this._model ? this._model.rotation : 0;\n  },\n\n  visible: function() {\n    return this._model && this._model.opacity;\n  },\n\n  model: function() {\n    return this._model;\n  },\n\n  draw: function(chart, center) {\n    var me = this;\n    var ctx = chart.ctx;\n    var model = me._model;\n    var rects = me._rects;\n    var area;\n\n    if (!this.visible()) {\n      return;\n    }\n\n    ctx.save();\n\n    if (model.clip) {\n      area = model.area;\n      ctx.beginPath();\n      ctx.rect(\n        area.left,\n        area.top,\n        area.right - area.left,\n        area.bottom - area.top);\n      ctx.clip();\n    }\n\n    ctx.globalAlpha = utils.bound(0, model.opacity, 1);\n    ctx.translate(rasterize(center.x), rasterize(center.y));\n    ctx.rotate(model.rotation);\n\n    drawFrame(ctx, rects.frame, model);\n    drawText(ctx, model.lines, rects.text, model);\n\n    ctx.restore();\n  }\n});\n\nvar MIN_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991; // eslint-disable-line es/no-number-minsafeinteger\nvar MAX_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;  // eslint-disable-line es/no-number-maxsafeinteger\n\nfunction rotated(point, center, angle) {\n  var cos = Math.cos(angle);\n  var sin = Math.sin(angle);\n  var cx = center.x;\n  var cy = center.y;\n\n  return {\n    x: cx + cos * (point.x - cx) - sin * (point.y - cy),\n    y: cy + sin * (point.x - cx) + cos * (point.y - cy)\n  };\n}\n\nfunction projected(points, axis) {\n  var min = MAX_INTEGER;\n  var max = MIN_INTEGER;\n  var origin = axis.origin;\n  var i, pt, vx, vy, dp;\n\n  for (i = 0; i < points.length; ++i) {\n    pt = points[i];\n    vx = pt.x - origin.x;\n    vy = pt.y - origin.y;\n    dp = axis.vx * vx + axis.vy * vy;\n    min = Math.min(min, dp);\n    max = Math.max(max, dp);\n  }\n\n  return {\n    min: min,\n    max: max\n  };\n}\n\nfunction toAxis(p0, p1) {\n  var vx = p1.x - p0.x;\n  var vy = p1.y - p0.y;\n  var ln = Math.sqrt(vx * vx + vy * vy);\n\n  return {\n    vx: (p1.x - p0.x) / ln,\n    vy: (p1.y - p0.y) / ln,\n    origin: p0,\n    ln: ln\n  };\n}\n\nvar HitBox = function() {\n  this._rotation = 0;\n  this._rect = {\n    x: 0,\n    y: 0,\n    w: 0,\n    h: 0\n  };\n};\n\nmerge(HitBox.prototype, {\n  center: function() {\n    var r = this._rect;\n    return {\n      x: r.x + r.w / 2,\n      y: r.y + r.h / 2\n    };\n  },\n\n  update: function(center, rect, rotation) {\n    this._rotation = rotation;\n    this._rect = {\n      x: rect.x + center.x,\n      y: rect.y + center.y,\n      w: rect.w,\n      h: rect.h\n    };\n  },\n\n  contains: function(point) {\n    var me = this;\n    var margin = 1;\n    var rect = me._rect;\n\n    point = rotated(point, me.center(), -me._rotation);\n\n    return !(point.x < rect.x - margin\n      || point.y < rect.y - margin\n      || point.x > rect.x + rect.w + margin * 2\n      || point.y > rect.y + rect.h + margin * 2);\n  },\n\n  // Separating Axis Theorem\n  // https://gamedevelopment.tutsplus.com/tutorials/collision-detection-using-the-separating-axis-theorem--gamedev-169\n  intersects: function(other) {\n    var r0 = this._points();\n    var r1 = other._points();\n    var axes = [\n      toAxis(r0[0], r0[1]),\n      toAxis(r0[0], r0[3])\n    ];\n    var i, pr0, pr1;\n\n    if (this._rotation !== other._rotation) {\n      // Only separate with r1 axis if the rotation is different,\n      // else it's enough to separate r0 and r1 with r0 axis only!\n      axes.push(\n        toAxis(r1[0], r1[1]),\n        toAxis(r1[0], r1[3])\n      );\n    }\n\n    for (i = 0; i < axes.length; ++i) {\n      pr0 = projected(r0, axes[i]);\n      pr1 = projected(r1, axes[i]);\n\n      if (pr0.max < pr1.min || pr1.max < pr0.min) {\n        return false;\n      }\n    }\n\n    return true;\n  },\n\n  /**\n   * @private\n   */\n  _points: function() {\n    var me = this;\n    var rect = me._rect;\n    var angle = me._rotation;\n    var center = me.center();\n\n    return [\n      rotated({x: rect.x, y: rect.y}, center, angle),\n      rotated({x: rect.x + rect.w, y: rect.y}, center, angle),\n      rotated({x: rect.x + rect.w, y: rect.y + rect.h}, center, angle),\n      rotated({x: rect.x, y: rect.y + rect.h}, center, angle)\n    ];\n  }\n});\n\nfunction coordinates(el, model, geometry) {\n  var point = model.positioner(el, model);\n  var vx = point.vx;\n  var vy = point.vy;\n\n  if (!vx && !vy) {\n    // if aligned center, we don't want to offset the center point\n    return {x: point.x, y: point.y};\n  }\n\n  var w = geometry.w;\n  var h = geometry.h;\n\n  // take in account the label rotation\n  var rotation = model.rotation;\n  var dx = Math.abs(w / 2 * Math.cos(rotation)) + Math.abs(h / 2 * Math.sin(rotation));\n  var dy = Math.abs(w / 2 * Math.sin(rotation)) + Math.abs(h / 2 * Math.cos(rotation));\n\n  // scale the unit vector (vx, vy) to get at least dx or dy equal to\n  // w or h respectively (else we would calculate the distance to the\n  // ellipse inscribed in the bounding rect)\n  var vs = 1 / Math.max(Math.abs(vx), Math.abs(vy));\n  dx *= vx * vs;\n  dy *= vy * vs;\n\n  // finally, include the explicit offset\n  dx += model.offset * vx;\n  dy += model.offset * vy;\n\n  return {\n    x: point.x + dx,\n    y: point.y + dy\n  };\n}\n\nfunction collide(labels, collider) {\n  var i, j, s0, s1;\n\n  // IMPORTANT Iterate in the reverse order since items at the end of the\n  // list have an higher weight/priority and thus should be less impacted\n  // by the overlapping strategy.\n\n  for (i = labels.length - 1; i >= 0; --i) {\n    s0 = labels[i].$layout;\n\n    for (j = i - 1; j >= 0 && s0._visible; --j) {\n      s1 = labels[j].$layout;\n\n      if (s1._visible && s0._box.intersects(s1._box)) {\n        collider(s0, s1);\n      }\n    }\n  }\n\n  return labels;\n}\n\nfunction compute(labels) {\n  var i, ilen, label, state, geometry, center, proxy;\n\n  // Initialize labels for overlap detection\n  for (i = 0, ilen = labels.length; i < ilen; ++i) {\n    label = labels[i];\n    state = label.$layout;\n\n    if (state._visible) {\n      // Chart.js 3 removed el._model in favor of getProps(), making harder to\n      // abstract reading values in positioners. Also, using string arrays to\n      // read values (i.e. var {a,b,c} = el.getProps([\"a\",\"b\",\"c\"])) would make\n      // positioners inefficient in the normal case (i.e. not the final values)\n      // and the code a bit ugly, so let's use a Proxy instead.\n      proxy = new Proxy(label._el, {get: (el, p) => el.getProps([p], true)[p]});\n\n      geometry = label.geometry();\n      center = coordinates(proxy, label.model(), geometry);\n      state._box.update(center, geometry, label.rotation());\n    }\n  }\n\n  // Auto hide overlapping labels\n  return collide(labels, function(s0, s1) {\n    var h0 = s0._hidable;\n    var h1 = s1._hidable;\n\n    if ((h0 && h1) || h1) {\n      s1._visible = false;\n    } else if (h0) {\n      s0._visible = false;\n    }\n  });\n}\n\nvar layout = {\n  prepare: function(datasets) {\n    var labels = [];\n    var i, j, ilen, jlen, label;\n\n    for (i = 0, ilen = datasets.length; i < ilen; ++i) {\n      for (j = 0, jlen = datasets[i].length; j < jlen; ++j) {\n        label = datasets[i][j];\n        labels.push(label);\n        label.$layout = {\n          _box: new HitBox(),\n          _hidable: false,\n          _visible: true,\n          _set: i,\n          _idx: label._index\n        };\n      }\n    }\n\n    // TODO New `z` option: labels with a higher z-index are drawn\n    // of top of the ones with a lower index. Lowest z-index labels\n    // are also discarded first when hiding overlapping labels.\n    labels.sort(function(a, b) {\n      var sa = a.$layout;\n      var sb = b.$layout;\n\n      return sa._idx === sb._idx\n        ? sb._set - sa._set\n        : sb._idx - sa._idx;\n    });\n\n    this.update(labels);\n\n    return labels;\n  },\n\n  update: function(labels) {\n    var dirty = false;\n    var i, ilen, label, model, state;\n\n    for (i = 0, ilen = labels.length; i < ilen; ++i) {\n      label = labels[i];\n      model = label.model();\n      state = label.$layout;\n      state._hidable = model && model.display === 'auto';\n      state._visible = label.visible();\n      dirty |= state._hidable;\n    }\n\n    if (dirty) {\n      compute(labels);\n    }\n  },\n\n  lookup: function(labels, point) {\n    var i, state;\n\n    // IMPORTANT Iterate in the reverse order since items at the end of\n    // the list have an higher z-index, thus should be picked first.\n\n    for (i = labels.length - 1; i >= 0; --i) {\n      state = labels[i].$layout;\n\n      if (state && state._visible && state._box.contains(point)) {\n        return labels[i];\n      }\n    }\n\n    return null;\n  },\n\n  draw: function(chart, labels) {\n    var i, ilen, label, state, geometry, center;\n\n    for (i = 0, ilen = labels.length; i < ilen; ++i) {\n      label = labels[i];\n      state = label.$layout;\n\n      if (state._visible) {\n        geometry = label.geometry();\n        center = coordinates(label._el, label.model(), geometry);\n        state._box.update(center, geometry, label.rotation());\n        label.draw(chart, center);\n      }\n    }\n  }\n};\n\nvar formatter = function(value) {\n  if (isNullOrUndef(value)) {\n    return null;\n  }\n\n  var label = value;\n  var keys, klen, k;\n  if (isObject(value)) {\n    if (!isNullOrUndef(value.label)) {\n      label = value.label;\n    } else if (!isNullOrUndef(value.r)) {\n      label = value.r;\n    } else {\n      label = '';\n      keys = Object.keys(value);\n      for (k = 0, klen = keys.length; k < klen; ++k) {\n        label += (k !== 0 ? ', ' : '') + keys[k] + ': ' + value[keys[k]];\n      }\n    }\n  }\n\n  return '' + label;\n};\n\n/**\n * IMPORTANT: make sure to also update tests and TypeScript definition\n * files (`/test/specs/defaults.spec.js` and `/types/options.d.ts`)\n */\n\nvar defaults = {\n  align: 'center',\n  anchor: 'center',\n  backgroundColor: null,\n  borderColor: null,\n  borderRadius: 0,\n  borderWidth: 0,\n  clamp: false,\n  clip: false,\n  color: undefined,\n  display: true,\n  font: {\n    family: undefined,\n    lineHeight: 1.2,\n    size: undefined,\n    style: undefined,\n    weight: null\n  },\n  formatter: formatter,\n  labels: undefined,\n  listeners: {},\n  offset: 4,\n  opacity: 1,\n  padding: {\n    top: 4,\n    right: 4,\n    bottom: 4,\n    left: 4\n  },\n  rotation: 0,\n  textAlign: 'start',\n  textStrokeColor: undefined,\n  textStrokeWidth: 0,\n  textShadowBlur: 0,\n  textShadowColor: undefined\n};\n\n/**\n * @see https://github.com/chartjs/Chart.js/issues/4176\n */\n\nvar EXPANDO_KEY = '$datalabels';\nvar DEFAULT_KEY = '$default';\n\nfunction configure(dataset, options) {\n  var override = dataset.datalabels;\n  var listeners = {};\n  var configs = [];\n  var labels, keys;\n\n  if (override === false) {\n    return null;\n  }\n  if (override === true) {\n    override = {};\n  }\n\n  options = merge({}, [options, override]);\n  labels = options.labels || {};\n  keys = Object.keys(labels);\n  delete options.labels;\n\n  if (keys.length) {\n    keys.forEach(function(key) {\n      if (labels[key]) {\n        configs.push(merge({}, [\n          options,\n          labels[key],\n          {_key: key}\n        ]));\n      }\n    });\n  } else {\n    // Default label if no \"named\" label defined.\n    configs.push(options);\n  }\n\n  // listeners: {<event-type>: {<label-key>: <fn>}}\n  listeners = configs.reduce(function(target, config) {\n    each(config.listeners || {}, function(fn, event) {\n      target[event] = target[event] || {};\n      target[event][config._key || DEFAULT_KEY] = fn;\n    });\n\n    delete config.listeners;\n    return target;\n  }, {});\n\n  return {\n    labels: configs,\n    listeners: listeners\n  };\n}\n\nfunction dispatchEvent(chart, listeners, label, event) {\n  if (!listeners) {\n    return;\n  }\n\n  var context = label.$context;\n  var groups = label.$groups;\n  var callback$1;\n\n  if (!listeners[groups._set]) {\n    return;\n  }\n\n  callback$1 = listeners[groups._set][groups._key];\n  if (!callback$1) {\n    return;\n  }\n\n  if (callback(callback$1, [context, event]) === true) {\n    // Users are allowed to tweak the given context by injecting values that can be\n    // used in scriptable options to display labels differently based on the current\n    // event (e.g. highlight an hovered label). That's why we update the label with\n    // the output context and schedule a new chart render by setting it dirty.\n    chart[EXPANDO_KEY]._dirty = true;\n    label.update(context);\n  }\n}\n\nfunction dispatchMoveEvents(chart, listeners, previous, label, event) {\n  var enter, leave;\n\n  if (!previous && !label) {\n    return;\n  }\n\n  if (!previous) {\n    enter = true;\n  } else if (!label) {\n    leave = true;\n  } else if (previous !== label) {\n    leave = enter = true;\n  }\n\n  if (leave) {\n    dispatchEvent(chart, listeners.leave, previous, event);\n  }\n  if (enter) {\n    dispatchEvent(chart, listeners.enter, label, event);\n  }\n}\n\nfunction handleMoveEvents(chart, event) {\n  var expando = chart[EXPANDO_KEY];\n  var listeners = expando._listeners;\n  var previous, label;\n\n  if (!listeners.enter && !listeners.leave) {\n    return;\n  }\n\n  if (event.type === 'mousemove') {\n    label = layout.lookup(expando._labels, event);\n  } else if (event.type !== 'mouseout') {\n    return;\n  }\n\n  previous = expando._hovered;\n  expando._hovered = label;\n  dispatchMoveEvents(chart, listeners, previous, label, event);\n}\n\nfunction handleClickEvents(chart, event) {\n  var expando = chart[EXPANDO_KEY];\n  var handlers = expando._listeners.click;\n  var label = handlers && layout.lookup(expando._labels, event);\n  if (label) {\n    dispatchEvent(chart, handlers, label, event);\n  }\n}\n\nvar plugin = {\n  id: 'datalabels',\n\n  defaults: defaults,\n\n  beforeInit: function(chart) {\n    chart[EXPANDO_KEY] = {\n      _actives: []\n    };\n  },\n\n  beforeUpdate: function(chart) {\n    var expando = chart[EXPANDO_KEY];\n    expando._listened = false;\n    expando._listeners = {};     // {<event-type>: {<dataset-index>: {<label-key>: <fn>}}}\n    expando._datasets = [];      // per dataset labels: [Label[]]\n    expando._labels = [];        // layouted labels: Label[]\n  },\n\n  afterDatasetUpdate: function(chart, args, options) {\n    var datasetIndex = args.index;\n    var expando = chart[EXPANDO_KEY];\n    var labels = expando._datasets[datasetIndex] = [];\n    var visible = chart.isDatasetVisible(datasetIndex);\n    var dataset = chart.data.datasets[datasetIndex];\n    var config = configure(dataset, options);\n    var elements = args.meta.data || [];\n    var ctx = chart.ctx;\n    var i, j, ilen, jlen, cfg, key, el, label;\n\n    ctx.save();\n\n    for (i = 0, ilen = elements.length; i < ilen; ++i) {\n      el = elements[i];\n      el[EXPANDO_KEY] = [];\n\n      if (visible && el && chart.getDataVisibility(i) && !el.skip) {\n        for (j = 0, jlen = config.labels.length; j < jlen; ++j) {\n          cfg = config.labels[j];\n          key = cfg._key;\n\n          label = new Label(cfg, ctx, el, i);\n          label.$groups = {\n            _set: datasetIndex,\n            _key: key || DEFAULT_KEY\n          };\n          label.$context = {\n            active: false,\n            chart: chart,\n            dataIndex: i,\n            dataset: dataset,\n            datasetIndex: datasetIndex\n          };\n\n          label.update(label.$context);\n          el[EXPANDO_KEY].push(label);\n          labels.push(label);\n        }\n      }\n    }\n\n    ctx.restore();\n\n    // Store listeners at the chart level and per event type to optimize\n    // cases where no listeners are registered for a specific event.\n    merge(expando._listeners, config.listeners, {\n      merger: function(event, target, source) {\n        target[event] = target[event] || {};\n        target[event][args.index] = source[event];\n        expando._listened = true;\n      }\n    });\n  },\n\n  afterUpdate: function(chart) {\n    chart[EXPANDO_KEY]._labels = layout.prepare(chart[EXPANDO_KEY]._datasets);\n  },\n\n  // Draw labels on top of all dataset elements\n  // https://github.com/chartjs/chartjs-plugin-datalabels/issues/29\n  // https://github.com/chartjs/chartjs-plugin-datalabels/issues/32\n  afterDatasetsDraw: function(chart) {\n    layout.draw(chart, chart[EXPANDO_KEY]._labels);\n  },\n\n  beforeEvent: function(chart, args) {\n    // If there is no listener registered for this chart, `listened` will be false,\n    // meaning we can immediately ignore the incoming event and avoid useless extra\n    // computation for users who don't implement label interactions.\n    if (chart[EXPANDO_KEY]._listened) {\n      var event = args.event;\n      switch (event.type) {\n      case 'mousemove':\n      case 'mouseout':\n        handleMoveEvents(chart, event);\n        break;\n      case 'click':\n        handleClickEvents(chart, event);\n        break;\n      }\n    }\n  },\n\n  afterEvent: function(chart) {\n    var expando = chart[EXPANDO_KEY];\n    var previous = expando._actives;\n    var actives = expando._actives = chart.getActiveElements();\n    var updates = utils.arrayDiff(previous, actives);\n    var i, ilen, j, jlen, update, label, labels;\n\n    for (i = 0, ilen = updates.length; i < ilen; ++i) {\n      update = updates[i];\n      if (update[1]) {\n        labels = update[0].element[EXPANDO_KEY] || [];\n        for (j = 0, jlen = labels.length; j < jlen; ++j) {\n          label = labels[j];\n          label.$context.active = (update[1] === 1);\n          label.update(label.$context);\n        }\n      }\n    }\n\n    if (expando._dirty || updates.length) {\n      layout.update(expando._labels);\n      chart.render();\n    }\n\n    delete expando._dirty;\n  }\n};\n\nexport { plugin as default };\n", "const getOrCreateLegendList = (chart, id) => {\n    const legendContainer = document.getElementById(id);\n    let listContainer = legendContainer.querySelector('ul');\n\n    if (!listContainer) {\n        listContainer = document.createElement('ul');\n        listContainer.style.display = 'grid';\n        listContainer.style.gap = '13px';\n        listContainer.style.gridTemplateColumns = '1fr 1fr';\n        listContainer.style.marginLeft = 0;\n        listContainer.style.marginTop = '20px';\n        listContainer.style.padding = 0;\n\n        legendContainer.appendChild(listContainer);\n    }\n\n    return listContainer;\n};\n\nconst htmlLegendPlugin = {\n    id: 'htmlLegend',\n    afterUpdate(chart, args, options) {\n        if (!options.containerID) {\n            return;\n        }\n        const ul = getOrCreateLegendList(chart, options.containerID);\n\n        // Remove old legend items\n        while (ul.firstChild) {\n            ul.firstChild.remove();\n        }\n\n        // Reuse the built-in legendItems generator\n        const items = chart.options.plugins.legend.labels.generateLabels(chart);\n\n        items.forEach(item => {\n            const li = document.createElement('li');\n            li.style.alignItems = 'center';\n            li.style.cursor = 'pointer';\n            li.style.display = 'flex';\n            li.style.flexDirection = 'row';\n            li.style.marginLeft = '0';\n\n            li.onclick = () => {\n                const { type } = chart.config;\n                if (type === 'pie' || type === 'doughnut') {\n                    // Pie and doughnut charts only have a single dataset and visibility is per item\n                    chart.toggleDataVisibility(item.index);\n                } else {\n                    chart.setDatasetVisibility(item.datasetIndex, !chart.isDatasetVisible(item.datasetIndex));\n                }\n                chart.update();\n            };\n\n            // Color box\n            const boxSpan = document.createElement('span');\n            boxSpan.style.background = item.fillStyle;\n            boxSpan.style.borderColor = item.strokeStyle;\n            boxSpan.style.borderWidth = item.lineWidth + 'px';\n            boxSpan.style.borderRadius = \"50%\";\n            boxSpan.style.display = 'inline-block';\n            boxSpan.style.flexShrink = 0;\n            boxSpan.style.height = '20px';\n            boxSpan.style.marginRight = '10px';\n            boxSpan.style.width = '20px';\n\n            // Text\n            const textContainer = document.createElement('p');\n            textContainer.style.color = item.fontColor;\n            textContainer.style.margin = 0;\n            textContainer.style.padding = 0;\n            textContainer.style.textDecoration = item.hidden ? 'line-through' : '';\n\n            const text = document.createTextNode(item.text);\n            textContainer.appendChild(text);\n\n            li.appendChild(boxSpan);\n            li.appendChild(textContainer);\n            ul.appendChild(li);\n        });\n    }\n};\n\n\nexport default htmlLegendPlugin;", "/*!\n* chartjs-plugin-annotation v3.1.0\n* https://www.chartjs.org/chartjs-plugin-annotation/index\n * (c) 2024 chartjs-plugin-annotation Contributors\n * Released under the MIT License\n */\nimport { Element, DoughnutController, defaults, Animations, Chart } from 'chart.js';\nimport { distanceBetweenPoints, toRadians, isObject, valueOrDefault, defined, isFunction, callback, isArray, toFont, addRoundedRectPath, toTRBLCorners, QUARTER_PI, PI, HALF_PI, TWO_THIRDS_PI, TAU, isNumber, RAD_PER_DEG, toPadding, isFinite, getAngleFromPoint, toDegrees, clipArea, unclipArea } from 'chart.js/helpers';\n\n/**\n * @typedef { import(\"chart.js\").ChartEvent } ChartEvent\n * @typedef { import('../../types/element').AnnotationElement } AnnotationElement\n */\n\nconst interaction = {\n  modes: {\n    /**\n     * Point mode returns all elements that hit test based on the event position\n     * @param {AnnotationElement[]} visibleElements - annotation elements which are visible\n     * @param {ChartEvent} event - the event we are find things at\n     * @return {AnnotationElement[]} - elements that are found\n     */\n    point(visibleElements, event) {\n      return filterElements(visibleElements, event, {intersect: true});\n    },\n\n    /**\n     * Nearest mode returns the element closest to the event position\n     * @param {AnnotationElement[]} visibleElements - annotation elements which are visible\n     * @param {ChartEvent} event - the event we are find things at\n     * @param {Object} options - interaction options to use\n     * @return {AnnotationElement[]} - elements that are found (only 1 element)\n     */\n    nearest(visibleElements, event, options) {\n      return getNearestItem(visibleElements, event, options);\n    },\n    /**\n     * x mode returns the elements that hit-test at the current x coordinate\n     * @param {AnnotationElement[]} visibleElements - annotation elements which are visible\n     * @param {ChartEvent} event - the event we are find things at\n     * @param {Object} options - interaction options to use\n     * @return {AnnotationElement[]} - elements that are found\n     */\n    x(visibleElements, event, options) {\n      return filterElements(visibleElements, event, {intersect: options.intersect, axis: 'x'});\n    },\n\n    /**\n     * y mode returns the elements that hit-test at the current y coordinate\n     * @param {AnnotationElement[]} visibleElements - annotation elements which are visible\n     * @param {ChartEvent} event - the event we are find things at\n     * @param {Object} options - interaction options to use\n     * @return {AnnotationElement[]} - elements that are found\n     */\n    y(visibleElements, event, options) {\n      return filterElements(visibleElements, event, {intersect: options.intersect, axis: 'y'});\n    }\n  }\n};\n\n/**\n * Returns all elements that hit test based on the event position\n * @param {AnnotationElement[]} visibleElements - annotation elements which are visible\n * @param {ChartEvent} event - the event we are find things at\n * @param {Object} options - interaction options to use\n * @return {AnnotationElement[]} - elements that are found\n */\nfunction getElements(visibleElements, event, options) {\n  const mode = interaction.modes[options.mode] || interaction.modes.nearest;\n  return mode(visibleElements, event, options);\n}\n\nfunction inRangeByAxis(element, event, axis) {\n  if (axis !== 'x' && axis !== 'y') {\n    return element.inRange(event.x, event.y, 'x', true) || element.inRange(event.x, event.y, 'y', true);\n  }\n  return element.inRange(event.x, event.y, axis, true);\n}\n\nfunction getPointByAxis(event, center, axis) {\n  if (axis === 'x') {\n    return {x: event.x, y: center.y};\n  } else if (axis === 'y') {\n    return {x: center.x, y: event.y};\n  }\n  return center;\n}\n\nfunction filterElements(visibleElements, event, options) {\n  return visibleElements.filter((element) => options.intersect ? element.inRange(event.x, event.y) : inRangeByAxis(element, event, options.axis));\n}\n\nfunction getNearestItem(visibleElements, event, options) {\n  let minDistance = Number.POSITIVE_INFINITY;\n\n  return filterElements(visibleElements, event, options)\n    .reduce((nearestItems, element) => {\n      const center = element.getCenterPoint();\n      const evenPoint = getPointByAxis(event, center, options.axis);\n      const distance = distanceBetweenPoints(event, evenPoint);\n      if (distance < minDistance) {\n        nearestItems = [element];\n        minDistance = distance;\n      } else if (distance === minDistance) {\n        // Can have multiple items at the same distance in which case we sort by size\n        nearestItems.push(element);\n      }\n\n      return nearestItems;\n    }, [])\n    .sort((a, b) => a._index - b._index)\n    .slice(0, 1); // return only the top item;\n}\n\n/**\n * @typedef {import('chart.js').Point} Point\n */\n\n/**\n * Rotate a `point` relative to `center` point by `angle`\n * @param {Point} point - the point to rotate\n * @param {Point} center - center point for rotation\n * @param {number} angle - angle for rotation, in radians\n * @returns {Point} rotated point\n */\nfunction rotated(point, center, angle) {\n  const cos = Math.cos(angle);\n  const sin = Math.sin(angle);\n  const cx = center.x;\n  const cy = center.y;\n\n  return {\n    x: cx + cos * (point.x - cx) - sin * (point.y - cy),\n    y: cy + sin * (point.x - cx) + cos * (point.y - cy)\n  };\n}\n\nconst isOlderPart = (act, req) => req > act || (act.length > req.length && act.slice(0, req.length) === req);\n\n/**\n * @typedef { import('chart.js').Point } Point\n * @typedef { import('chart.js').InteractionAxis } InteractionAxis\n * @typedef { import('../../types/element').AnnotationElement } AnnotationElement\n */\n\nconst EPSILON = 0.001;\nconst clamp = (x, from, to) => Math.min(to, Math.max(from, x));\n\n/**\n * @param {{value: number, start: number, end: number}} limit\n * @param {number} hitSize\n * @returns {boolean}\n */\nconst inLimit = (limit, hitSize) => limit.value >= limit.start - hitSize && limit.value <= limit.end + hitSize;\n\n/**\n * @param {Object} obj\n * @param {number} from\n * @param {number} to\n * @returns {Object}\n */\nfunction clampAll(obj, from, to) {\n  for (const key of Object.keys(obj)) {\n    obj[key] = clamp(obj[key], from, to);\n  }\n  return obj;\n}\n\n/**\n * @param {Point} point\n * @param {Point} center\n * @param {number} radius\n * @param {number} hitSize\n * @returns {boolean}\n */\nfunction inPointRange(point, center, radius, hitSize) {\n  if (!point || !center || radius <= 0) {\n    return false;\n  }\n  return (Math.pow(point.x - center.x, 2) + Math.pow(point.y - center.y, 2)) <= Math.pow(radius + hitSize, 2);\n}\n\n/**\n * @param {Point} point\n * @param {{x: number, y: number, x2: number, y2: number}} rect\n * @param {InteractionAxis} axis\n * @param {{borderWidth: number, hitTolerance: number}} hitsize\n * @returns {boolean}\n */\nfunction inBoxRange(point, {x, y, x2, y2}, axis, {borderWidth, hitTolerance}) {\n  const hitSize = (borderWidth + hitTolerance) / 2;\n  const inRangeX = point.x >= x - hitSize - EPSILON && point.x <= x2 + hitSize + EPSILON;\n  const inRangeY = point.y >= y - hitSize - EPSILON && point.y <= y2 + hitSize + EPSILON;\n  if (axis === 'x') {\n    return inRangeX;\n  } else if (axis === 'y') {\n    return inRangeY;\n  }\n  return inRangeX && inRangeY;\n}\n\n/**\n * @param {Point} point\n * @param {rect: {x: number, y: number, x2: number, y2: number}, center: {x: number, y: number}} element\n * @param {InteractionAxis} axis\n * @param {{rotation: number, borderWidth: number, hitTolerance: number}}\n * @returns {boolean}\n */\nfunction inLabelRange(point, {rect, center}, axis, {rotation, borderWidth, hitTolerance}) {\n  const rotPoint = rotated(point, center, toRadians(-rotation));\n  return inBoxRange(rotPoint, rect, axis, {borderWidth, hitTolerance});\n}\n\n/**\n * @param {AnnotationElement} element\n * @param {boolean} useFinalPosition\n * @returns {Point}\n */\nfunction getElementCenterPoint(element, useFinalPosition) {\n  const {centerX, centerY} = element.getProps(['centerX', 'centerY'], useFinalPosition);\n  return {x: centerX, y: centerY};\n}\n\n/**\n * @param {string} pkg\n * @param {string} min\n * @param {string} ver\n * @param {boolean} [strict=true]\n * @returns {boolean}\n */\nfunction requireVersion(pkg, min, ver, strict = true) {\n  const parts = ver.split('.');\n  let i = 0;\n  for (const req of min.split('.')) {\n    const act = parts[i++];\n    if (parseInt(req, 10) < parseInt(act, 10)) {\n      break;\n    }\n    if (isOlderPart(act, req)) {\n      if (strict) {\n        throw new Error(`${pkg} v${ver} is not supported. v${min} or newer is required.`);\n      } else {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\nconst isPercentString = (s) => typeof s === 'string' && s.endsWith('%');\nconst toPercent = (s) => parseFloat(s) / 100;\nconst toPositivePercent = (s) => clamp(toPercent(s), 0, 1);\n\nconst boxAppering = (x, y) => ({x, y, x2: x, y2: y, width: 0, height: 0});\nconst defaultInitAnimation = {\n  box: (properties) => boxAppering(properties.centerX, properties.centerY),\n  doughnutLabel: (properties) => boxAppering(properties.centerX, properties.centerY),\n  ellipse: (properties) => ({centerX: properties.centerX, centerY: properties.centerX, radius: 0, width: 0, height: 0}),\n  label: (properties) => boxAppering(properties.centerX, properties.centerY),\n  line: (properties) => boxAppering(properties.x, properties.y),\n  point: (properties) => ({centerX: properties.centerX, centerY: properties.centerY, radius: 0, width: 0, height: 0}),\n  polygon: (properties) => boxAppering(properties.centerX, properties.centerY)\n};\n\n/**\n * @typedef { import('chart.js').FontSpec } FontSpec\n * @typedef { import('chart.js').Point } Point\n * @typedef { import('chart.js').Padding } Padding\n * @typedef { import('../../types/element').AnnotationBoxModel } AnnotationBoxModel\n * @typedef { import('../../types/element').AnnotationElement } AnnotationElement\n * @typedef { import('../../types/options').AnnotationPointCoordinates } AnnotationPointCoordinates\n * @typedef { import('../../types/label').CoreLabelOptions } CoreLabelOptions\n * @typedef { import('../../types/label').LabelPositionObject } LabelPositionObject\n */\n\n/**\n * @param {number} size\n * @param {number|string} position\n * @returns {number}\n */\nfunction getRelativePosition(size, position) {\n  if (position === 'start') {\n    return 0;\n  }\n  if (position === 'end') {\n    return size;\n  }\n  if (isPercentString(position)) {\n    return toPositivePercent(position) * size;\n  }\n  return size / 2;\n}\n\n/**\n * @param {number} size\n * @param {number|string} value\n * @param {boolean} [positivePercent=true]\n * @returns {number}\n */\nfunction getSize(size, value, positivePercent = true) {\n  if (typeof value === 'number') {\n    return value;\n  } else if (isPercentString(value)) {\n    return (positivePercent ? toPositivePercent(value) : toPercent(value)) * size;\n  }\n  return size;\n}\n\n/**\n * @param {{x: number, width: number}} size\n * @param {CoreLabelOptions} options\n * @returns {number}\n */\nfunction calculateTextAlignment(size, options) {\n  const {x, width} = size;\n  const textAlign = options.textAlign;\n  if (textAlign === 'center') {\n    return x + width / 2;\n  } else if (textAlign === 'end' || textAlign === 'right') {\n    return x + width;\n  }\n  return x;\n}\n\n/**\n * @param {Point} point\n * @param {{height: number, width: number}} labelSize\n * @param {{borderWidth: number, position: {LabelPositionObject|string}, xAdjust: number, yAdjust: number}} options\n * @param {Padding|undefined} padding\n * @returns {{x: number, y: number, x2: number, y2: number, height: number, width: number, centerX: number, centerY: number}}\n */\nfunction measureLabelRectangle(point, labelSize, {borderWidth, position, xAdjust, yAdjust}, padding) {\n  const hasPadding = isObject(padding);\n  const width = labelSize.width + (hasPadding ? padding.width : 0) + borderWidth;\n  const height = labelSize.height + (hasPadding ? padding.height : 0) + borderWidth;\n  const positionObj = toPosition(position);\n  const x = calculateLabelPosition$1(point.x, width, xAdjust, positionObj.x);\n  const y = calculateLabelPosition$1(point.y, height, yAdjust, positionObj.y);\n\n  return {\n    x,\n    y,\n    x2: x + width,\n    y2: y + height,\n    width,\n    height,\n    centerX: x + width / 2,\n    centerY: y + height / 2\n  };\n}\n\n/**\n * @param {LabelPositionObject|string} value\n * @param {string|number} defaultValue\n * @returns {LabelPositionObject}\n */\nfunction toPosition(value, defaultValue = 'center') {\n  if (isObject(value)) {\n    return {\n      x: valueOrDefault(value.x, defaultValue),\n      y: valueOrDefault(value.y, defaultValue),\n    };\n  }\n  value = valueOrDefault(value, defaultValue);\n  return {\n    x: value,\n    y: value\n  };\n}\n\n/**\n * @param {CoreLabelOptions} options\n * @param {number} fitRatio\n * @returns {boolean}\n */\nconst shouldFit = (options, fitRatio) => options && options.autoFit && fitRatio < 1;\n\n/**\n * @param {CoreLabelOptions} options\n * @param {number} fitRatio\n * @returns {FontSpec[]}\n */\nfunction toFonts(options, fitRatio) {\n  const optFont = options.font;\n  const fonts = isArray(optFont) ? optFont : [optFont];\n  if (shouldFit(options, fitRatio)) {\n    return fonts.map(function(f) {\n      const font = toFont(f);\n      font.size = Math.floor(f.size * fitRatio);\n      font.lineHeight = f.lineHeight;\n      return toFont(font);\n    });\n  }\n  return fonts.map(f => toFont(f));\n}\n\n/**\n * @param {AnnotationPointCoordinates} options\n * @returns {boolean}\n */\nfunction isBoundToPoint(options) {\n  return options && (defined(options.xValue) || defined(options.yValue));\n}\n\nfunction calculateLabelPosition$1(start, size, adjust = 0, position) {\n  return start - getRelativePosition(size, position) + adjust;\n}\n\n/**\n * @param {Chart} chart\n * @param {AnnotationBoxModel} properties\n * @param {CoreAnnotationOptions} options\n * @returns {AnnotationElement}\n */\nfunction initAnimationProperties(chart, properties, options) {\n  const initAnim = options.init;\n  if (!initAnim) {\n    return;\n  } else if (initAnim === true) {\n    return applyDefault(properties, options);\n  }\n  return execCallback(chart, properties, options);\n}\n\n/**\n * @param {Object} options\n * @param {Array} hooks\n * @param {Object} hooksContainer\n * @returns {boolean}\n */\nfunction loadHooks(options, hooks, hooksContainer) {\n  let activated = false;\n  hooks.forEach(hook => {\n    if (isFunction(options[hook])) {\n      activated = true;\n      hooksContainer[hook] = options[hook];\n    } else if (defined(hooksContainer[hook])) {\n      delete hooksContainer[hook];\n    }\n  });\n  return activated;\n}\n\nfunction applyDefault(properties, options) {\n  const type = options.type || 'line';\n  return defaultInitAnimation[type](properties);\n}\n\nfunction execCallback(chart, properties, options) {\n  const result = callback(options.init, [{chart, properties, options}]);\n  if (result === true) {\n    return applyDefault(properties, options);\n  } else if (isObject(result)) {\n    return result;\n  }\n}\n\nconst widthCache = new Map();\nconst notRadius = (radius) => isNaN(radius) || radius <= 0;\nconst fontsKey = (fonts) => fonts.reduce(function(prev, item) {\n  prev += item.string;\n  return prev;\n}, '');\n\n/**\n * @typedef { import('chart.js').Point } Point\n * @typedef { import('../../types/label').CoreLabelOptions } CoreLabelOptions\n * @typedef { import('../../types/options').PointAnnotationOptions } PointAnnotationOptions\n */\n\n/**\n * Determine if content is an image or a canvas.\n * @param {*} content\n * @returns boolean|undefined\n * @todo move this function to chart.js helpers\n */\nfunction isImageOrCanvas(content) {\n  if (content && typeof content === 'object') {\n    const type = content.toString();\n    return (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]');\n  }\n}\n\n/**\n * Set the translation on the canvas if the rotation must be applied.\n * @param {CanvasRenderingContext2D} ctx - chart canvas context\n * @param {Point} point - the point of translation\n * @param {number} rotation - rotation (in degrees) to apply\n */\nfunction translate(ctx, {x, y}, rotation) {\n  if (rotation) {\n    ctx.translate(x, y);\n    ctx.rotate(toRadians(rotation));\n    ctx.translate(-x, -y);\n  }\n}\n\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} options\n * @returns {boolean|undefined}\n */\nfunction setBorderStyle(ctx, options) {\n  if (options && options.borderWidth) {\n    ctx.lineCap = options.borderCapStyle || 'butt';\n    ctx.setLineDash(options.borderDash);\n    ctx.lineDashOffset = options.borderDashOffset;\n    ctx.lineJoin = options.borderJoinStyle || 'miter';\n    ctx.lineWidth = options.borderWidth;\n    ctx.strokeStyle = options.borderColor;\n    return true;\n  }\n}\n\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {Object} options\n */\nfunction setShadowStyle(ctx, options) {\n  ctx.shadowColor = options.backgroundShadowColor;\n  ctx.shadowBlur = options.shadowBlur;\n  ctx.shadowOffsetX = options.shadowOffsetX;\n  ctx.shadowOffsetY = options.shadowOffsetY;\n}\n\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {CoreLabelOptions} options\n * @returns {{width: number, height: number}}\n */\nfunction measureLabelSize(ctx, options) {\n  const content = options.content;\n  if (isImageOrCanvas(content)) {\n    const size = {\n      width: getSize(content.width, options.width),\n      height: getSize(content.height, options.height)\n    };\n    return size;\n  }\n  const fonts = toFonts(options);\n  const strokeWidth = options.textStrokeWidth;\n  const lines = isArray(content) ? content : [content];\n  const mapKey = lines.join() + fontsKey(fonts) + strokeWidth + (ctx._measureText ? '-spriting' : '');\n  if (!widthCache.has(mapKey)) {\n    widthCache.set(mapKey, calculateLabelSize(ctx, lines, fonts, strokeWidth));\n  }\n  return widthCache.get(mapKey);\n}\n\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {{x: number, y: number, width: number, height: number}} rect\n * @param {Object} options\n */\nfunction drawBox(ctx, rect, options) {\n  const {x, y, width, height} = rect;\n  ctx.save();\n  setShadowStyle(ctx, options);\n  const stroke = setBorderStyle(ctx, options);\n  ctx.fillStyle = options.backgroundColor;\n  ctx.beginPath();\n  addRoundedRectPath(ctx, {\n    x, y, w: width, h: height,\n    radius: clampAll(toTRBLCorners(options.borderRadius), 0, Math.min(width, height) / 2)\n  });\n  ctx.closePath();\n  ctx.fill();\n  if (stroke) {\n    ctx.shadowColor = options.borderShadowColor;\n    ctx.stroke();\n  }\n  ctx.restore();\n}\n\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {{x: number, y: number, width: number, height: number}} rect\n * @param {CoreLabelOptions} options\n * @param {number} fitRatio\n */\nfunction drawLabel(ctx, rect, options, fitRatio) {\n  const content = options.content;\n  if (isImageOrCanvas(content)) {\n    ctx.save();\n    ctx.globalAlpha = getOpacity(options.opacity, content.style.opacity);\n    ctx.drawImage(content, rect.x, rect.y, rect.width, rect.height);\n    ctx.restore();\n    return;\n  }\n  const labels = isArray(content) ? content : [content];\n  const fonts = toFonts(options, fitRatio);\n  const optColor = options.color;\n  const colors = isArray(optColor) ? optColor : [optColor];\n  const x = calculateTextAlignment(rect, options);\n  const y = rect.y + options.textStrokeWidth / 2;\n  ctx.save();\n  ctx.textBaseline = 'middle';\n  ctx.textAlign = options.textAlign;\n  if (setTextStrokeStyle(ctx, options)) {\n    applyLabelDecoration(ctx, {x, y}, labels, fonts);\n  }\n  applyLabelContent(ctx, {x, y}, labels, {fonts, colors});\n  ctx.restore();\n}\n\nfunction setTextStrokeStyle(ctx, options) {\n  if (options.textStrokeWidth > 0) {\n    // https://stackoverflow.com/questions/13627111/drawing-text-with-an-outer-stroke-with-html5s-canvas\n    ctx.lineJoin = 'round';\n    ctx.miterLimit = 2;\n    ctx.lineWidth = options.textStrokeWidth;\n    ctx.strokeStyle = options.textStrokeColor;\n    return true;\n  }\n}\n\n/**\n * @param {CanvasRenderingContext2D} ctx\n * @param {{radius: number, options: PointAnnotationOptions}} element\n * @param {number} x\n * @param {number} y\n */\nfunction drawPoint(ctx, element, x, y) {\n  const {radius, options} = element;\n  const style = options.pointStyle;\n  const rotation = options.rotation;\n  let rad = (rotation || 0) * RAD_PER_DEG;\n\n  if (isImageOrCanvas(style)) {\n    ctx.save();\n    ctx.translate(x, y);\n    ctx.rotate(rad);\n    ctx.drawImage(style, -style.width / 2, -style.height / 2, style.width, style.height);\n    ctx.restore();\n    return;\n  }\n  if (notRadius(radius)) {\n    return;\n  }\n  drawPointStyle(ctx, {x, y, radius, rotation, style, rad});\n}\n\nfunction drawPointStyle(ctx, {x, y, radius, rotation, style, rad}) {\n  let xOffset, yOffset, size, cornerRadius;\n  ctx.beginPath();\n\n  switch (style) {\n  // Default includes circle\n  default:\n    ctx.arc(x, y, radius, 0, TAU);\n    ctx.closePath();\n    break;\n  case 'triangle':\n    ctx.moveTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n    rad += TWO_THIRDS_PI;\n    ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n    rad += TWO_THIRDS_PI;\n    ctx.lineTo(x + Math.sin(rad) * radius, y - Math.cos(rad) * radius);\n    ctx.closePath();\n    break;\n  case 'rectRounded':\n    // NOTE: the rounded rect implementation changed to use `arc` instead of\n    // `quadraticCurveTo` since it generates better results when rect is\n    // almost a circle. 0.516 (instead of 0.5) produces results with visually\n    // closer proportion to the previous impl and it is inscribed in the\n    // circle with `radius`. For more details, see the following PRs:\n    // https://github.com/chartjs/Chart.js/issues/5597\n    // https://github.com/chartjs/Chart.js/issues/5858\n    cornerRadius = radius * 0.516;\n    size = radius - cornerRadius;\n    xOffset = Math.cos(rad + QUARTER_PI) * size;\n    yOffset = Math.sin(rad + QUARTER_PI) * size;\n    ctx.arc(x - xOffset, y - yOffset, cornerRadius, rad - PI, rad - HALF_PI);\n    ctx.arc(x + yOffset, y - xOffset, cornerRadius, rad - HALF_PI, rad);\n    ctx.arc(x + xOffset, y + yOffset, cornerRadius, rad, rad + HALF_PI);\n    ctx.arc(x - yOffset, y + xOffset, cornerRadius, rad + HALF_PI, rad + PI);\n    ctx.closePath();\n    break;\n  case 'rect':\n    if (!rotation) {\n      size = Math.SQRT1_2 * radius;\n      ctx.rect(x - size, y - size, 2 * size, 2 * size);\n      break;\n    }\n    rad += QUARTER_PI;\n    /* falls through */\n  case 'rectRot':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    ctx.closePath();\n    break;\n  case 'crossRot':\n    rad += QUARTER_PI;\n    /* falls through */\n  case 'cross':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.moveTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    break;\n  case 'star':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.moveTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    rad += QUARTER_PI;\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    ctx.moveTo(x + yOffset, y - xOffset);\n    ctx.lineTo(x - yOffset, y + xOffset);\n    break;\n  case 'line':\n    xOffset = Math.cos(rad) * radius;\n    yOffset = Math.sin(rad) * radius;\n    ctx.moveTo(x - xOffset, y - yOffset);\n    ctx.lineTo(x + xOffset, y + yOffset);\n    break;\n  case 'dash':\n    ctx.moveTo(x, y);\n    ctx.lineTo(x + Math.cos(rad) * radius, y + Math.sin(rad) * radius);\n    break;\n  }\n\n  ctx.fill();\n}\n\nfunction calculateLabelSize(ctx, lines, fonts, strokeWidth) {\n  ctx.save();\n  const count = lines.length;\n  let width = 0;\n  let height = strokeWidth;\n  for (let i = 0; i < count; i++) {\n    const font = fonts[Math.min(i, fonts.length - 1)];\n    ctx.font = font.string;\n    const text = lines[i];\n    width = Math.max(width, ctx.measureText(text).width + strokeWidth);\n    height += font.lineHeight;\n  }\n  ctx.restore();\n  return {width, height};\n}\n\nfunction applyLabelDecoration(ctx, {x, y}, labels, fonts) {\n  ctx.beginPath();\n  let lhs = 0;\n  labels.forEach(function(l, i) {\n    const f = fonts[Math.min(i, fonts.length - 1)];\n    const lh = f.lineHeight;\n    ctx.font = f.string;\n    ctx.strokeText(l, x, y + lh / 2 + lhs);\n    lhs += lh;\n  });\n  ctx.stroke();\n}\n\nfunction applyLabelContent(ctx, {x, y}, labels, {fonts, colors}) {\n  let lhs = 0;\n  labels.forEach(function(l, i) {\n    const c = colors[Math.min(i, colors.length - 1)];\n    const f = fonts[Math.min(i, fonts.length - 1)];\n    const lh = f.lineHeight;\n    ctx.beginPath();\n    ctx.font = f.string;\n    ctx.fillStyle = c;\n    ctx.fillText(l, x, y + lh / 2 + lhs);\n    lhs += lh;\n    ctx.fill();\n  });\n}\n\nfunction getOpacity(value, elementValue) {\n  const opacity = isNumber(value) ? value : elementValue;\n  return isNumber(opacity) ? clamp(opacity, 0, 1) : 1;\n}\n\nconst positions = ['left', 'bottom', 'top', 'right'];\n\n/**\n * @typedef { import('../../types/element').AnnotationElement } AnnotationElement\n */\n\n/**\n * Drawa the callout component for labels.\n * @param {CanvasRenderingContext2D} ctx - chart canvas context\n * @param {AnnotationElement} element - the label element\n */\nfunction drawCallout(ctx, element) {\n  const {pointX, pointY, options} = element;\n  const callout = options.callout;\n  const calloutPosition = callout && callout.display && resolveCalloutPosition(element, callout);\n  if (!calloutPosition || isPointInRange(element, callout, calloutPosition)) {\n    return;\n  }\n\n  ctx.save();\n  ctx.beginPath();\n  const stroke = setBorderStyle(ctx, callout);\n  if (!stroke) {\n    return ctx.restore();\n  }\n  const {separatorStart, separatorEnd} = getCalloutSeparatorCoord(element, calloutPosition);\n  const {sideStart, sideEnd} = getCalloutSideCoord(element, calloutPosition, separatorStart);\n  if (callout.margin > 0 || options.borderWidth === 0) {\n    ctx.moveTo(separatorStart.x, separatorStart.y);\n    ctx.lineTo(separatorEnd.x, separatorEnd.y);\n  }\n  ctx.moveTo(sideStart.x, sideStart.y);\n  ctx.lineTo(sideEnd.x, sideEnd.y);\n  const rotatedPoint = rotated({x: pointX, y: pointY}, element.getCenterPoint(), toRadians(-element.rotation));\n  ctx.lineTo(rotatedPoint.x, rotatedPoint.y);\n  ctx.stroke();\n  ctx.restore();\n}\n\nfunction getCalloutSeparatorCoord(element, position) {\n  const {x, y, x2, y2} = element;\n  const adjust = getCalloutSeparatorAdjust(element, position);\n  let separatorStart, separatorEnd;\n  if (position === 'left' || position === 'right') {\n    separatorStart = {x: x + adjust, y};\n    separatorEnd = {x: separatorStart.x, y: y2};\n  } else {\n    //  position 'top' or 'bottom'\n    separatorStart = {x, y: y + adjust};\n    separatorEnd = {x: x2, y: separatorStart.y};\n  }\n  return {separatorStart, separatorEnd};\n}\n\nfunction getCalloutSeparatorAdjust(element, position) {\n  const {width, height, options} = element;\n  const adjust = options.callout.margin + options.borderWidth / 2;\n  if (position === 'right') {\n    return width + adjust;\n  } else if (position === 'bottom') {\n    return height + adjust;\n  }\n  return -adjust;\n}\n\nfunction getCalloutSideCoord(element, position, separatorStart) {\n  const {y, width, height, options} = element;\n  const start = options.callout.start;\n  const side = getCalloutSideAdjust(position, options.callout);\n  let sideStart, sideEnd;\n  if (position === 'left' || position === 'right') {\n    sideStart = {x: separatorStart.x, y: y + getSize(height, start)};\n    sideEnd = {x: sideStart.x + side, y: sideStart.y};\n  } else {\n    //  position 'top' or 'bottom'\n    sideStart = {x: separatorStart.x + getSize(width, start), y: separatorStart.y};\n    sideEnd = {x: sideStart.x, y: sideStart.y + side};\n  }\n  return {sideStart, sideEnd};\n}\n\nfunction getCalloutSideAdjust(position, options) {\n  const side = options.side;\n  if (position === 'left' || position === 'top') {\n    return -side;\n  }\n  return side;\n}\n\nfunction resolveCalloutPosition(element, options) {\n  const position = options.position;\n  if (positions.includes(position)) {\n    return position;\n  }\n  return resolveCalloutAutoPosition(element, options);\n}\n\nfunction resolveCalloutAutoPosition(element, options) {\n  const {x, y, x2, y2, width, height, pointX, pointY, centerX, centerY, rotation} = element;\n  const center = {x: centerX, y: centerY};\n  const start = options.start;\n  const xAdjust = getSize(width, start);\n  const yAdjust = getSize(height, start);\n  const xPoints = [x, x + xAdjust, x + xAdjust, x2];\n  const yPoints = [y + yAdjust, y2, y, y2];\n  const result = [];\n  for (let index = 0; index < 4; index++) {\n    const rotatedPoint = rotated({x: xPoints[index], y: yPoints[index]}, center, toRadians(rotation));\n    result.push({\n      position: positions[index],\n      distance: distanceBetweenPoints(rotatedPoint, {x: pointX, y: pointY})\n    });\n  }\n  return result.sort((a, b) => a.distance - b.distance)[0].position;\n}\n\nfunction isPointInRange(element, callout, position) {\n  const {pointX, pointY} = element;\n  const margin = callout.margin;\n  let x = pointX;\n  let y = pointY;\n  if (position === 'left') {\n    x += margin;\n  } else if (position === 'right') {\n    x -= margin;\n  } else if (position === 'top') {\n    y += margin;\n  } else if (position === 'bottom') {\n    y -= margin;\n  }\n  return element.inRange(x, y);\n}\n\nconst limitedLineScale = {\n  xScaleID: {min: 'xMin', max: 'xMax', start: 'left', end: 'right', startProp: 'x', endProp: 'x2'},\n  yScaleID: {min: 'yMin', max: 'yMax', start: 'bottom', end: 'top', startProp: 'y', endProp: 'y2'}\n};\n\n/**\n * @typedef { import(\"chart.js\").Chart } Chart\n * @typedef { import(\"chart.js\").Scale } Scale\n * @typedef { import(\"chart.js\").Point } Point\n * @typedef { import('../../types/element').AnnotationBoxModel } AnnotationBoxModel\n * @typedef { import('../../types/options').CoreAnnotationOptions } CoreAnnotationOptions\n * @typedef { import('../../types/options').LineAnnotationOptions } LineAnnotationOptions\n * @typedef { import('../../types/options').PointAnnotationOptions } PointAnnotationOptions\n * @typedef { import('../../types/options').PolygonAnnotationOptions } PolygonAnnotationOptions\n */\n\n/**\n * @param {Scale} scale\n * @param {number|string} value\n * @param {number} fallback\n * @returns {number}\n */\nfunction scaleValue(scale, value, fallback) {\n  value = typeof value === 'number' ? value : scale.parse(value);\n  return isFinite(value) ? scale.getPixelForValue(value) : fallback;\n}\n\n/**\n * Search the scale defined in chartjs by the axis related to the annotation options key.\n * @param {{ [key: string]: Scale }} scales\n * @param {CoreAnnotationOptions} options\n * @param {string} key\n * @returns {string}\n */\nfunction retrieveScaleID(scales, options, key) {\n  const scaleID = options[key];\n  if (scaleID || key === 'scaleID') {\n    return scaleID;\n  }\n  const axis = key.charAt(0);\n  const axes = Object.values(scales).filter((scale) => scale.axis && scale.axis === axis);\n  if (axes.length) {\n    return axes[0].id;\n  }\n  return axis;\n}\n\n/**\n * @param {Scale} scale\n * @param {{min: number, max: number, start: number, end: number}} options\n * @returns {{start: number, end: number}|undefined}\n */\nfunction getDimensionByScale(scale, options) {\n  if (scale) {\n    const reverse = scale.options.reverse;\n    const start = scaleValue(scale, options.min, reverse ? options.end : options.start);\n    const end = scaleValue(scale, options.max, reverse ? options.start : options.end);\n    return {\n      start,\n      end\n    };\n  }\n}\n\n/**\n * @param {Chart} chart\n * @param {CoreAnnotationOptions} options\n * @returns {Point}\n */\nfunction getChartPoint(chart, options) {\n  const {chartArea, scales} = chart;\n  const xScale = scales[retrieveScaleID(scales, options, 'xScaleID')];\n  const yScale = scales[retrieveScaleID(scales, options, 'yScaleID')];\n  let x = chartArea.width / 2;\n  let y = chartArea.height / 2;\n\n  if (xScale) {\n    x = scaleValue(xScale, options.xValue, xScale.left + xScale.width / 2);\n  }\n\n  if (yScale) {\n    y = scaleValue(yScale, options.yValue, yScale.top + yScale.height / 2);\n  }\n  return {x, y};\n}\n\n/**\n * @param {Chart} chart\n * @param {CoreAnnotationOptions} options\n * @returns {AnnotationBoxModel}\n */\nfunction resolveBoxProperties(chart, options) {\n  const scales = chart.scales;\n  const xScale = scales[retrieveScaleID(scales, options, 'xScaleID')];\n  const yScale = scales[retrieveScaleID(scales, options, 'yScaleID')];\n\n  if (!xScale && !yScale) {\n    return {};\n  }\n\n  let {left: x, right: x2} = xScale || chart.chartArea;\n  let {top: y, bottom: y2} = yScale || chart.chartArea;\n  const xDim = getChartDimensionByScale(xScale, {min: options.xMin, max: options.xMax, start: x, end: x2});\n  x = xDim.start;\n  x2 = xDim.end;\n  const yDim = getChartDimensionByScale(yScale, {min: options.yMin, max: options.yMax, start: y2, end: y});\n  y = yDim.start;\n  y2 = yDim.end;\n\n  return {\n    x,\n    y,\n    x2,\n    y2,\n    width: x2 - x,\n    height: y2 - y,\n    centerX: x + (x2 - x) / 2,\n    centerY: y + (y2 - y) / 2\n  };\n}\n\n/**\n * @param {Chart} chart\n * @param {PointAnnotationOptions|PolygonAnnotationOptions} options\n * @returns {AnnotationBoxModel}\n */\nfunction resolvePointProperties(chart, options) {\n  if (!isBoundToPoint(options)) {\n    const box = resolveBoxProperties(chart, options);\n    let radius = options.radius;\n    if (!radius || isNaN(radius)) {\n      radius = Math.min(box.width, box.height) / 2;\n      options.radius = radius;\n    }\n    const size = radius * 2;\n    const adjustCenterX = box.centerX + options.xAdjust;\n    const adjustCenterY = box.centerY + options.yAdjust;\n    return {\n      x: adjustCenterX - radius,\n      y: adjustCenterY - radius,\n      x2: adjustCenterX + radius,\n      y2: adjustCenterY + radius,\n      centerX: adjustCenterX,\n      centerY: adjustCenterY,\n      width: size,\n      height: size,\n      radius\n    };\n  }\n  return getChartCircle(chart, options);\n}\n/**\n * @param {Chart} chart\n * @param {LineAnnotationOptions} options\n * @returns {AnnotationBoxModel}\n */\nfunction resolveLineProperties(chart, options) {\n  const {scales, chartArea} = chart;\n  const scale = scales[options.scaleID];\n  const area = {x: chartArea.left, y: chartArea.top, x2: chartArea.right, y2: chartArea.bottom};\n\n  if (scale) {\n    resolveFullLineProperties(scale, area, options);\n  } else {\n    resolveLimitedLineProperties(scales, area, options);\n  }\n  return area;\n}\n\n/**\n * @param {Chart} chart\n * @param {CoreAnnotationOptions} options\n * @param {boolean} [centerBased=false]\n * @returns {AnnotationBoxModel}\n */\nfunction resolveBoxAndLabelProperties(chart, options) {\n  const properties = resolveBoxProperties(chart, options);\n  properties.initProperties = initAnimationProperties(chart, properties, options);\n  properties.elements = [{\n    type: 'label',\n    optionScope: 'label',\n    properties: resolveLabelElementProperties$1(chart, properties, options),\n    initProperties: properties.initProperties\n  }];\n  return properties;\n}\n\nfunction getChartCircle(chart, options) {\n  const point = getChartPoint(chart, options);\n  const size = options.radius * 2;\n  return {\n    x: point.x - options.radius + options.xAdjust,\n    y: point.y - options.radius + options.yAdjust,\n    x2: point.x + options.radius + options.xAdjust,\n    y2: point.y + options.radius + options.yAdjust,\n    centerX: point.x + options.xAdjust,\n    centerY: point.y + options.yAdjust,\n    radius: options.radius,\n    width: size,\n    height: size\n  };\n}\n\nfunction getChartDimensionByScale(scale, options) {\n  const result = getDimensionByScale(scale, options) || options;\n  return {\n    start: Math.min(result.start, result.end),\n    end: Math.max(result.start, result.end)\n  };\n}\n\nfunction resolveFullLineProperties(scale, area, options) {\n  const min = scaleValue(scale, options.value, NaN);\n  const max = scaleValue(scale, options.endValue, min);\n  if (scale.isHorizontal()) {\n    area.x = min;\n    area.x2 = max;\n  } else {\n    area.y = min;\n    area.y2 = max;\n  }\n}\n\nfunction resolveLimitedLineProperties(scales, area, options) {\n  for (const scaleId of Object.keys(limitedLineScale)) {\n    const scale = scales[retrieveScaleID(scales, options, scaleId)];\n    if (scale) {\n      const {min, max, start, end, startProp, endProp} = limitedLineScale[scaleId];\n      const dim = getDimensionByScale(scale, {min: options[min], max: options[max], start: scale[start], end: scale[end]});\n      area[startProp] = dim.start;\n      area[endProp] = dim.end;\n    }\n  }\n}\n\nfunction calculateX({properties, options}, labelSize, position, padding) {\n  const {x: start, x2: end, width: size} = properties;\n  return calculatePosition({start, end, size, borderWidth: options.borderWidth}, {\n    position: position.x,\n    padding: {start: padding.left, end: padding.right},\n    adjust: options.label.xAdjust,\n    size: labelSize.width\n  });\n}\n\nfunction calculateY({properties, options}, labelSize, position, padding) {\n  const {y: start, y2: end, height: size} = properties;\n  return calculatePosition({start, end, size, borderWidth: options.borderWidth}, {\n    position: position.y,\n    padding: {start: padding.top, end: padding.bottom},\n    adjust: options.label.yAdjust,\n    size: labelSize.height\n  });\n}\n\nfunction calculatePosition(boxOpts, labelOpts) {\n  const {start, end, borderWidth} = boxOpts;\n  const {position, padding: {start: padStart, end: padEnd}, adjust} = labelOpts;\n  const availableSize = end - borderWidth - start - padStart - padEnd - labelOpts.size;\n  return start + borderWidth / 2 + adjust + getRelativePosition(availableSize, position);\n}\n\nfunction resolveLabelElementProperties$1(chart, properties, options) {\n  const label = options.label;\n  label.backgroundColor = 'transparent';\n  label.callout.display = false;\n  const position = toPosition(label.position);\n  const padding = toPadding(label.padding);\n  const labelSize = measureLabelSize(chart.ctx, label);\n  const x = calculateX({properties, options}, labelSize, position, padding);\n  const y = calculateY({properties, options}, labelSize, position, padding);\n  const width = labelSize.width + padding.width;\n  const height = labelSize.height + padding.height;\n  return {\n    x,\n    y,\n    x2: x + width,\n    y2: y + height,\n    width,\n    height,\n    centerX: x + width / 2,\n    centerY: y + height / 2,\n    rotation: label.rotation\n  };\n\n}\n\nconst moveHooks = ['enter', 'leave'];\n\n/**\n * @typedef { import(\"chart.js\").Chart } Chart\n * @typedef { import('../../types/options').AnnotationPluginOptions } AnnotationPluginOptions\n */\n\nconst eventHooks = moveHooks.concat('click');\n\n/**\n * @param {Chart} chart\n * @param {Object} state\n * @param {AnnotationPluginOptions} options\n */\nfunction updateListeners(chart, state, options) {\n  state.listened = loadHooks(options, eventHooks, state.listeners);\n  state.moveListened = false;\n\n  moveHooks.forEach(hook => {\n    if (isFunction(options[hook])) {\n      state.moveListened = true;\n    }\n  });\n\n  if (!state.listened || !state.moveListened) {\n    state.annotations.forEach(scope => {\n      if (!state.listened && isFunction(scope.click)) {\n        state.listened = true;\n      }\n      if (!state.moveListened) {\n        moveHooks.forEach(hook => {\n          if (isFunction(scope[hook])) {\n            state.listened = true;\n            state.moveListened = true;\n          }\n        });\n      }\n    });\n  }\n}\n\n/**\n * @param {Object} state\n * @param {ChartEvent} event\n * @param {AnnotationPluginOptions} options\n * @return {boolean|undefined}\n */\nfunction handleEvent(state, event, options) {\n  if (state.listened) {\n    switch (event.type) {\n    case 'mousemove':\n    case 'mouseout':\n      return handleMoveEvents(state, event, options);\n    case 'click':\n      return handleClickEvents(state, event, options);\n    }\n  }\n}\n\nfunction handleMoveEvents(state, event, options) {\n  if (!state.moveListened) {\n    return;\n  }\n\n  let elements;\n\n  if (event.type === 'mousemove') {\n    elements = getElements(state.visibleElements, event, options.interaction);\n  } else {\n    elements = [];\n  }\n\n  const previous = state.hovered;\n  state.hovered = elements;\n\n  const context = {state, event};\n  let changed = dispatchMoveEvents(context, 'leave', previous, elements);\n  return dispatchMoveEvents(context, 'enter', elements, previous) || changed;\n}\n\nfunction dispatchMoveEvents({state, event}, hook, elements, checkElements) {\n  let changed;\n  for (const element of elements) {\n    if (checkElements.indexOf(element) < 0) {\n      changed = dispatchEvent(element.options[hook] || state.listeners[hook], element, event) || changed;\n    }\n  }\n  return changed;\n}\n\nfunction handleClickEvents(state, event, options) {\n  const listeners = state.listeners;\n  const elements = getElements(state.visibleElements, event, options.interaction);\n  let changed;\n  for (const element of elements) {\n    changed = dispatchEvent(element.options.click || listeners.click, element, event) || changed;\n  }\n  return changed;\n}\n\nfunction dispatchEvent(handler, element, event) {\n  return callback(handler, [element.$context, event]) === true;\n}\n\n/**\n * @typedef { import(\"chart.js\").Chart } Chart\n * @typedef { import('../../types/options').AnnotationPluginOptions } AnnotationPluginOptions\n * @typedef { import('../../types/element').AnnotationElement } AnnotationElement\n */\n\nconst elementHooks = ['afterDraw', 'beforeDraw'];\n\n/**\n * @param {Chart} chart\n * @param {Object} state\n * @param {AnnotationPluginOptions} options\n */\nfunction updateHooks(chart, state, options) {\n  const visibleElements = state.visibleElements;\n  state.hooked = loadHooks(options, elementHooks, state.hooks);\n\n  if (!state.hooked) {\n    visibleElements.forEach(scope => {\n      if (!state.hooked) {\n        elementHooks.forEach(hook => {\n          if (isFunction(scope.options[hook])) {\n            state.hooked = true;\n          }\n        });\n      }\n    });\n  }\n}\n\n/**\n * @param {Object} state\n * @param {AnnotationElement} element\n * @param {string} hook\n */\nfunction invokeHook(state, element, hook) {\n  if (state.hooked) {\n    const callbackHook = element.options[hook] || state.hooks[hook];\n    return callback(callbackHook, [element.$context]);\n  }\n}\n\n/**\n * @typedef { import(\"chart.js\").Chart } Chart\n * @typedef { import(\"chart.js\").Scale } Scale\n * @typedef { import('../../types/options').CoreAnnotationOptions } CoreAnnotationOptions\n */\n\n/**\n * @param {Chart} chart\n * @param {Scale} scale\n * @param {CoreAnnotationOptions[]} annotations\n */\nfunction adjustScaleRange(chart, scale, annotations) {\n  const range = getScaleLimits(chart.scales, scale, annotations);\n  let changed = changeScaleLimit(scale, range, 'min', 'suggestedMin');\n  changed = changeScaleLimit(scale, range, 'max', 'suggestedMax') || changed;\n  if (changed && isFunction(scale.handleTickRangeOptions)) {\n    scale.handleTickRangeOptions();\n  }\n}\n\n/**\n * @param {CoreAnnotationOptions[]} annotations\n * @param {{ [key: string]: Scale }} scales\n */\nfunction verifyScaleOptions(annotations, scales) {\n  for (const annotation of annotations) {\n    verifyScaleIDs(annotation, scales);\n  }\n}\n\nfunction changeScaleLimit(scale, range, limit, suggestedLimit) {\n  if (isFinite(range[limit]) && !scaleLimitDefined(scale.options, limit, suggestedLimit)) {\n    const changed = scale[limit] !== range[limit];\n    scale[limit] = range[limit];\n    return changed;\n  }\n}\n\nfunction scaleLimitDefined(scaleOptions, limit, suggestedLimit) {\n  return defined(scaleOptions[limit]) || defined(scaleOptions[suggestedLimit]);\n}\n\nfunction verifyScaleIDs(annotation, scales) {\n  for (const key of ['scaleID', 'xScaleID', 'yScaleID']) {\n    const scaleID = retrieveScaleID(scales, annotation, key);\n    if (scaleID && !scales[scaleID] && verifyProperties(annotation, key)) {\n      console.warn(`No scale found with id '${scaleID}' for annotation '${annotation.id}'`);\n    }\n  }\n}\n\nfunction verifyProperties(annotation, key) {\n  if (key === 'scaleID') {\n    return true;\n  }\n  const axis = key.charAt(0);\n  for (const prop of ['Min', 'Max', 'Value']) {\n    if (defined(annotation[axis + prop])) {\n      return true;\n    }\n  }\n  return false;\n}\n\nfunction getScaleLimits(scales, scale, annotations) {\n  const axis = scale.axis;\n  const scaleID = scale.id;\n  const scaleIDOption = axis + 'ScaleID';\n  const limits = {\n    min: valueOrDefault(scale.min, Number.NEGATIVE_INFINITY),\n    max: valueOrDefault(scale.max, Number.POSITIVE_INFINITY)\n  };\n  for (const annotation of annotations) {\n    if (annotation.scaleID === scaleID) {\n      updateLimits(annotation, scale, ['value', 'endValue'], limits);\n    } else if (retrieveScaleID(scales, annotation, scaleIDOption) === scaleID) {\n      updateLimits(annotation, scale, [axis + 'Min', axis + 'Max', axis + 'Value'], limits);\n    }\n  }\n  return limits;\n}\n\nfunction updateLimits(annotation, scale, props, limits) {\n  for (const prop of props) {\n    const raw = annotation[prop];\n    if (defined(raw)) {\n      const value = scale.parse(raw);\n      limits.min = Math.min(limits.min, value);\n      limits.max = Math.max(limits.max, value);\n    }\n  }\n}\n\nclass BoxAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    const {x, y} = rotated({x: mouseX, y: mouseY}, this.getCenterPoint(useFinalPosition), toRadians(-this.options.rotation));\n    return inBoxRange({x, y}, this.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition), axis, this.options);\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    ctx.save();\n    translate(ctx, this.getCenterPoint(), this.options.rotation);\n    drawBox(ctx, this, this.options);\n    ctx.restore();\n  }\n\n  get label() {\n    return this.elements && this.elements[0];\n  }\n\n  resolveElementProperties(chart, options) {\n    return resolveBoxAndLabelProperties(chart, options);\n  }\n}\n\nBoxAnnotation.id = 'boxAnnotation';\n\nBoxAnnotation.defaults = {\n  adjustScaleRange: true,\n  backgroundShadowColor: 'transparent',\n  borderCapStyle: 'butt',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: 'miter',\n  borderRadius: 0,\n  borderShadowColor: 'transparent',\n  borderWidth: 1,\n  display: true,\n  init: undefined,\n  hitTolerance: 0,\n  label: {\n    backgroundColor: 'transparent',\n    borderWidth: 0,\n    callout: {\n      display: false\n    },\n    color: 'black',\n    content: null,\n    display: false,\n    drawTime: undefined,\n    font: {\n      family: undefined,\n      lineHeight: undefined,\n      size: undefined,\n      style: undefined,\n      weight: 'bold'\n    },\n    height: undefined,\n    hitTolerance: undefined,\n    opacity: undefined,\n    padding: 6,\n    position: 'center',\n    rotation: undefined,\n    textAlign: 'start',\n    textStrokeColor: undefined,\n    textStrokeWidth: 0,\n    width: undefined,\n    xAdjust: 0,\n    yAdjust: 0,\n    z: undefined\n  },\n  rotation: 0,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  xMax: undefined,\n  xMin: undefined,\n  xScaleID: undefined,\n  yMax: undefined,\n  yMin: undefined,\n  yScaleID: undefined,\n  z: 0\n};\n\nBoxAnnotation.defaultRoutes = {\n  borderColor: 'color',\n  backgroundColor: 'color'\n};\n\nBoxAnnotation.descriptors = {\n  label: {\n    _fallback: true\n  }\n};\n\nclass DoughnutLabelAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    return inLabelRange(\n      {x: mouseX, y: mouseY},\n      {rect: this.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition), center: this.getCenterPoint(useFinalPosition)},\n      axis,\n      {rotation: this.rotation, borderWidth: 0, hitTolerance: this.options.hitTolerance}\n    );\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    const options = this.options;\n    if (!options.display || !options.content) {\n      return;\n    }\n    drawBackground(ctx, this);\n    ctx.save();\n    translate(ctx, this.getCenterPoint(), this.rotation);\n    drawLabel(ctx, this, options, this._fitRatio);\n    ctx.restore();\n  }\n\n  resolveElementProperties(chart, options) {\n    const meta = getDatasetMeta(chart, options);\n    if (!meta) {\n      return {};\n    }\n    const {controllerMeta, point, radius} = getControllerMeta(chart, options, meta);\n    let labelSize = measureLabelSize(chart.ctx, options);\n    const _fitRatio = getFitRatio(labelSize, radius);\n    if (shouldFit(options, _fitRatio)) {\n      labelSize = {width: labelSize.width * _fitRatio, height: labelSize.height * _fitRatio};\n    }\n    const {position, xAdjust, yAdjust} = options;\n    const boxSize = measureLabelRectangle(point, labelSize, {borderWidth: 0, position, xAdjust, yAdjust});\n    return {\n      initProperties: initAnimationProperties(chart, boxSize, options),\n      ...boxSize,\n      ...controllerMeta,\n      rotation: options.rotation,\n      _fitRatio\n    };\n  }\n}\n\nDoughnutLabelAnnotation.id = 'doughnutLabelAnnotation';\n\nDoughnutLabelAnnotation.defaults = {\n  autoFit: true,\n  autoHide: true,\n  backgroundColor: 'transparent',\n  backgroundShadowColor: 'transparent',\n  borderColor: 'transparent',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: 'miter',\n  borderShadowColor: 'transparent',\n  borderWidth: 0,\n  color: 'black',\n  content: null,\n  display: true,\n  font: {\n    family: undefined,\n    lineHeight: undefined,\n    size: undefined,\n    style: undefined,\n    weight: undefined\n  },\n  height: undefined,\n  hitTolerance: 0,\n  init: undefined,\n  opacity: undefined,\n  position: 'center',\n  rotation: 0,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  spacing: 1,\n  textAlign: 'center',\n  textStrokeColor: undefined,\n  textStrokeWidth: 0,\n  width: undefined,\n  xAdjust: 0,\n  yAdjust: 0\n};\n\nDoughnutLabelAnnotation.defaultRoutes = {\n};\n\nfunction getDatasetMeta(chart, options) {\n  return chart.getSortedVisibleDatasetMetas().reduce(function(result, value) {\n    const controller = value.controller;\n    if (controller instanceof DoughnutController &&\n      isControllerVisible(chart, options, value.data) &&\n      (!result || controller.innerRadius < result.controller.innerRadius) &&\n      controller.options.circumference >= 90) {\n      return value;\n    }\n    return result;\n  }, undefined);\n}\n\nfunction isControllerVisible(chart, options, elements) {\n  if (!options.autoHide) {\n    return true;\n  }\n  for (let i = 0; i < elements.length; i++) {\n    if (!elements[i].hidden && chart.getDataVisibility(i)) {\n      return true;\n    }\n  }\n}\n\nfunction getControllerMeta({chartArea}, options, meta) {\n  const {left, top, right, bottom} = chartArea;\n  const {innerRadius, offsetX, offsetY} = meta.controller;\n  const x = (left + right) / 2 + offsetX;\n  const y = (top + bottom) / 2 + offsetY;\n  const square = {\n    left: Math.max(x - innerRadius, left),\n    right: Math.min(x + innerRadius, right),\n    top: Math.max(y - innerRadius, top),\n    bottom: Math.min(y + innerRadius, bottom)\n  };\n  const point = {\n    x: (square.left + square.right) / 2,\n    y: (square.top + square.bottom) / 2\n  };\n  const space = options.spacing + options.borderWidth / 2;\n  const _radius = innerRadius - space;\n  const _counterclockwise = point.y > y;\n  const side = _counterclockwise ? top + space : bottom - space;\n  const angles = getAngles(side, x, y, _radius);\n  const controllerMeta = {\n    _centerX: x,\n    _centerY: y,\n    _radius,\n    _counterclockwise,\n    ...angles\n  };\n  return {\n    controllerMeta,\n    point,\n    radius: Math.min(innerRadius, Math.min(square.right - square.left, square.bottom - square.top) / 2)\n  };\n}\n\nfunction getFitRatio({width, height}, radius) {\n  const hypo = Math.sqrt(Math.pow(width, 2) + Math.pow(height, 2));\n  return (radius * 2) / hypo;\n}\n\nfunction getAngles(y, centerX, centerY, radius) {\n  const yk2 = Math.pow(centerY - y, 2);\n  const r2 = Math.pow(radius, 2);\n  const b = centerX * -2;\n  const c = Math.pow(centerX, 2) + yk2 - r2;\n  const delta = Math.pow(b, 2) - (4 * c);\n  if (delta <= 0) {\n    return {\n      _startAngle: 0,\n      _endAngle: TAU\n    };\n  }\n  const start = (-b - Math.sqrt(delta)) / 2;\n  const end = (-b + Math.sqrt(delta)) / 2;\n  return {\n    _startAngle: getAngleFromPoint({x: centerX, y: centerY}, {x: start, y}).angle,\n    _endAngle: getAngleFromPoint({x: centerX, y: centerY}, {x: end, y}).angle\n  };\n}\n\nfunction drawBackground(ctx, element) {\n  const {_centerX, _centerY, _radius, _startAngle, _endAngle, _counterclockwise, options} = element;\n  ctx.save();\n  const stroke = setBorderStyle(ctx, options);\n  ctx.fillStyle = options.backgroundColor;\n  ctx.beginPath();\n  ctx.arc(_centerX, _centerY, _radius, _startAngle, _endAngle, _counterclockwise);\n  ctx.closePath();\n  ctx.fill();\n  if (stroke) {\n    ctx.stroke();\n  }\n  ctx.restore();\n}\n\nclass LabelAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    return inLabelRange(\n      {x: mouseX, y: mouseY},\n      {rect: this.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition), center: this.getCenterPoint(useFinalPosition)},\n      axis,\n      {rotation: this.rotation, borderWidth: this.options.borderWidth, hitTolerance: this.options.hitTolerance}\n    );\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    const options = this.options;\n    const visible = !defined(this._visible) || this._visible;\n    if (!options.display || !options.content || !visible) {\n      return;\n    }\n    ctx.save();\n    translate(ctx, this.getCenterPoint(), this.rotation);\n    drawCallout(ctx, this);\n    drawBox(ctx, this, options);\n    drawLabel(ctx, getLabelSize(this), options);\n    ctx.restore();\n  }\n\n  resolveElementProperties(chart, options) {\n    let point;\n    if (!isBoundToPoint(options)) {\n      const {centerX, centerY} = resolveBoxProperties(chart, options);\n      point = {x: centerX, y: centerY};\n    } else {\n      point = getChartPoint(chart, options);\n    }\n    const padding = toPadding(options.padding);\n    const labelSize = measureLabelSize(chart.ctx, options);\n    const boxSize = measureLabelRectangle(point, labelSize, options, padding);\n    return {\n      initProperties: initAnimationProperties(chart, boxSize, options),\n      pointX: point.x,\n      pointY: point.y,\n      ...boxSize,\n      rotation: options.rotation\n    };\n  }\n}\n\nLabelAnnotation.id = 'labelAnnotation';\n\nLabelAnnotation.defaults = {\n  adjustScaleRange: true,\n  backgroundColor: 'transparent',\n  backgroundShadowColor: 'transparent',\n  borderCapStyle: 'butt',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: 'miter',\n  borderRadius: 0,\n  borderShadowColor: 'transparent',\n  borderWidth: 0,\n  callout: {\n    borderCapStyle: 'butt',\n    borderColor: undefined,\n    borderDash: [],\n    borderDashOffset: 0,\n    borderJoinStyle: 'miter',\n    borderWidth: 1,\n    display: false,\n    margin: 5,\n    position: 'auto',\n    side: 5,\n    start: '50%',\n  },\n  color: 'black',\n  content: null,\n  display: true,\n  font: {\n    family: undefined,\n    lineHeight: undefined,\n    size: undefined,\n    style: undefined,\n    weight: undefined\n  },\n  height: undefined,\n  hitTolerance: 0,\n  init: undefined,\n  opacity: undefined,\n  padding: 6,\n  position: 'center',\n  rotation: 0,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  textAlign: 'center',\n  textStrokeColor: undefined,\n  textStrokeWidth: 0,\n  width: undefined,\n  xAdjust: 0,\n  xMax: undefined,\n  xMin: undefined,\n  xScaleID: undefined,\n  xValue: undefined,\n  yAdjust: 0,\n  yMax: undefined,\n  yMin: undefined,\n  yScaleID: undefined,\n  yValue: undefined,\n  z: 0\n};\n\nLabelAnnotation.defaultRoutes = {\n  borderColor: 'color'\n};\n\nfunction getLabelSize({x, y, width, height, options}) {\n  const hBorderWidth = options.borderWidth / 2;\n  const padding = toPadding(options.padding);\n  return {\n    x: x + padding.left + hBorderWidth,\n    y: y + padding.top + hBorderWidth,\n    width: width - padding.left - padding.right - options.borderWidth,\n    height: height - padding.top - padding.bottom - options.borderWidth\n  };\n}\n\nconst pointInLine = (p1, p2, t) => ({x: p1.x + t * (p2.x - p1.x), y: p1.y + t * (p2.y - p1.y)});\nconst interpolateX = (y, p1, p2) => pointInLine(p1, p2, Math.abs((y - p1.y) / (p2.y - p1.y))).x;\nconst interpolateY = (x, p1, p2) => pointInLine(p1, p2, Math.abs((x - p1.x) / (p2.x - p1.x))).y;\nconst sqr = v => v * v;\nconst rangeLimit = (mouseX, mouseY, {x, y, x2, y2}, axis) => axis === 'y' ? {start: Math.min(y, y2), end: Math.max(y, y2), value: mouseY} : {start: Math.min(x, x2), end: Math.max(x, x2), value: mouseX};\n// http://www.independent-software.com/determining-coordinates-on-a-html-canvas-bezier-curve.html\nconst coordInCurve = (start, cp, end, t) => (1 - t) * (1 - t) * start + 2 * (1 - t) * t * cp + t * t * end;\nconst pointInCurve = (start, cp, end, t) => ({x: coordInCurve(start.x, cp.x, end.x, t), y: coordInCurve(start.y, cp.y, end.y, t)});\nconst coordAngleInCurve = (start, cp, end, t) => 2 * (1 - t) * (cp - start) + 2 * t * (end - cp);\nconst angleInCurve = (start, cp, end, t) => -Math.atan2(coordAngleInCurve(start.x, cp.x, end.x, t), coordAngleInCurve(start.y, cp.y, end.y, t)) + 0.5 * PI;\n\nclass LineAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    const hitSize = (this.options.borderWidth + this.options.hitTolerance) / 2;\n    if (axis !== 'x' && axis !== 'y') {\n      const point = {mouseX, mouseY};\n      const {path, ctx} = this;\n      if (path) {\n        setBorderStyle(ctx, this.options);\n        ctx.lineWidth += this.options.hitTolerance;\n        const {chart} = this.$context;\n        const mx = mouseX * chart.currentDevicePixelRatio;\n        const my = mouseY * chart.currentDevicePixelRatio;\n        const result = ctx.isPointInStroke(path, mx, my) || isOnLabel(this, point, useFinalPosition);\n        ctx.restore();\n        return result;\n      }\n      const epsilon = sqr(hitSize);\n      return intersects(this, point, epsilon, useFinalPosition) || isOnLabel(this, point, useFinalPosition);\n    }\n    return inAxisRange(this, {mouseX, mouseY}, axis, {hitSize, useFinalPosition});\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    const {x, y, x2, y2, cp, options} = this;\n\n    ctx.save();\n    if (!setBorderStyle(ctx, options)) {\n      // no border width, then line is not drawn\n      return ctx.restore();\n    }\n    setShadowStyle(ctx, options);\n\n    const length = Math.sqrt(Math.pow(x2 - x, 2) + Math.pow(y2 - y, 2));\n    if (options.curve && cp) {\n      drawCurve(ctx, this, cp, length);\n      return ctx.restore();\n    }\n    const {startOpts, endOpts, startAdjust, endAdjust} = getArrowHeads(this);\n    const angle = Math.atan2(y2 - y, x2 - x);\n    ctx.translate(x, y);\n    ctx.rotate(angle);\n    ctx.beginPath();\n    ctx.moveTo(0 + startAdjust, 0);\n    ctx.lineTo(length - endAdjust, 0);\n    ctx.shadowColor = options.borderShadowColor;\n    ctx.stroke();\n    drawArrowHead(ctx, 0, startAdjust, startOpts);\n    drawArrowHead(ctx, length, -endAdjust, endOpts);\n    ctx.restore();\n  }\n\n  get label() {\n    return this.elements && this.elements[0];\n  }\n\n  resolveElementProperties(chart, options) {\n    const area = resolveLineProperties(chart, options);\n    const {x, y, x2, y2} = area;\n    const inside = isLineInArea(area, chart.chartArea);\n    const properties = inside\n      ? limitLineToArea({x, y}, {x: x2, y: y2}, chart.chartArea)\n      : {x, y, x2, y2, width: Math.abs(x2 - x), height: Math.abs(y2 - y)};\n    properties.centerX = (x2 + x) / 2;\n    properties.centerY = (y2 + y) / 2;\n    properties.initProperties = initAnimationProperties(chart, properties, options);\n    if (options.curve) {\n      const p1 = {x: properties.x, y: properties.y};\n      const p2 = {x: properties.x2, y: properties.y2};\n      properties.cp = getControlPoint(properties, options, distanceBetweenPoints(p1, p2));\n    }\n    const labelProperties = resolveLabelElementProperties(chart, properties, options.label);\n    // additonal prop to manage zoom/pan\n    labelProperties._visible = inside;\n\n    properties.elements = [{\n      type: 'label',\n      optionScope: 'label',\n      properties: labelProperties,\n      initProperties: properties.initProperties\n    }];\n    return properties;\n  }\n}\n\nLineAnnotation.id = 'lineAnnotation';\n\nconst arrowHeadsDefaults = {\n  backgroundColor: undefined,\n  backgroundShadowColor: undefined,\n  borderColor: undefined,\n  borderDash: undefined,\n  borderDashOffset: undefined,\n  borderShadowColor: undefined,\n  borderWidth: undefined,\n  display: undefined,\n  fill: undefined,\n  length: undefined,\n  shadowBlur: undefined,\n  shadowOffsetX: undefined,\n  shadowOffsetY: undefined,\n  width: undefined\n};\n\nLineAnnotation.defaults = {\n  adjustScaleRange: true,\n  arrowHeads: {\n    display: false,\n    end: Object.assign({}, arrowHeadsDefaults),\n    fill: false,\n    length: 12,\n    start: Object.assign({}, arrowHeadsDefaults),\n    width: 6\n  },\n  borderDash: [],\n  borderDashOffset: 0,\n  borderShadowColor: 'transparent',\n  borderWidth: 2,\n  curve: false,\n  controlPoint: {\n    y: '-50%'\n  },\n  display: true,\n  endValue: undefined,\n  init: undefined,\n  hitTolerance: 0,\n  label: {\n    backgroundColor: 'rgba(0,0,0,0.8)',\n    backgroundShadowColor: 'transparent',\n    borderCapStyle: 'butt',\n    borderColor: 'black',\n    borderDash: [],\n    borderDashOffset: 0,\n    borderJoinStyle: 'miter',\n    borderRadius: 6,\n    borderShadowColor: 'transparent',\n    borderWidth: 0,\n    callout: Object.assign({}, LabelAnnotation.defaults.callout),\n    color: '#fff',\n    content: null,\n    display: false,\n    drawTime: undefined,\n    font: {\n      family: undefined,\n      lineHeight: undefined,\n      size: undefined,\n      style: undefined,\n      weight: 'bold'\n    },\n    height: undefined,\n    hitTolerance: undefined,\n    opacity: undefined,\n    padding: 6,\n    position: 'center',\n    rotation: 0,\n    shadowBlur: 0,\n    shadowOffsetX: 0,\n    shadowOffsetY: 0,\n    textAlign: 'center',\n    textStrokeColor: undefined,\n    textStrokeWidth: 0,\n    width: undefined,\n    xAdjust: 0,\n    yAdjust: 0,\n    z: undefined\n  },\n  scaleID: undefined,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  value: undefined,\n  xMax: undefined,\n  xMin: undefined,\n  xScaleID: undefined,\n  yMax: undefined,\n  yMin: undefined,\n  yScaleID: undefined,\n  z: 0\n};\n\nLineAnnotation.descriptors = {\n  arrowHeads: {\n    start: {\n      _fallback: true\n    },\n    end: {\n      _fallback: true\n    },\n    _fallback: true\n  }\n};\n\nLineAnnotation.defaultRoutes = {\n  borderColor: 'color'\n};\n\nfunction inAxisRange(element, {mouseX, mouseY}, axis, {hitSize, useFinalPosition}) {\n  const limit = rangeLimit(mouseX, mouseY, element.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition), axis);\n  return inLimit(limit, hitSize) || isOnLabel(element, {mouseX, mouseY}, useFinalPosition, axis);\n}\n\nfunction isLineInArea({x, y, x2, y2}, {top, right, bottom, left}) {\n  return !(\n    (x < left && x2 < left) ||\n    (x > right && x2 > right) ||\n    (y < top && y2 < top) ||\n    (y > bottom && y2 > bottom)\n  );\n}\n\nfunction limitPointToArea({x, y}, p2, {top, right, bottom, left}) {\n  if (x < left) {\n    y = interpolateY(left, {x, y}, p2);\n    x = left;\n  }\n  if (x > right) {\n    y = interpolateY(right, {x, y}, p2);\n    x = right;\n  }\n  if (y < top) {\n    x = interpolateX(top, {x, y}, p2);\n    y = top;\n  }\n  if (y > bottom) {\n    x = interpolateX(bottom, {x, y}, p2);\n    y = bottom;\n  }\n  return {x, y};\n}\n\nfunction limitLineToArea(p1, p2, area) {\n  const {x, y} = limitPointToArea(p1, p2, area);\n  const {x: x2, y: y2} = limitPointToArea(p2, p1, area);\n  return {x, y, x2, y2, width: Math.abs(x2 - x), height: Math.abs(y2 - y)};\n}\n\nfunction intersects(element, {mouseX, mouseY}, epsilon = EPSILON, useFinalPosition) {\n  // Adapted from https://stackoverflow.com/a/6853926/25507\n  const {x: x1, y: y1, x2, y2} = element.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition);\n  const dx = x2 - x1;\n  const dy = y2 - y1;\n  const lenSq = sqr(dx) + sqr(dy);\n  const t = lenSq === 0 ? -1 : ((mouseX - x1) * dx + (mouseY - y1) * dy) / lenSq;\n\n  let xx, yy;\n  if (t < 0) {\n    xx = x1;\n    yy = y1;\n  } else if (t > 1) {\n    xx = x2;\n    yy = y2;\n  } else {\n    xx = x1 + t * dx;\n    yy = y1 + t * dy;\n  }\n  return (sqr(mouseX - xx) + sqr(mouseY - yy)) <= epsilon;\n}\n\nfunction isOnLabel(element, {mouseX, mouseY}, useFinalPosition, axis) {\n  const label = element.label;\n  return label.options.display && label.inRange(mouseX, mouseY, axis, useFinalPosition);\n}\n\nfunction resolveLabelElementProperties(chart, properties, options) {\n  const borderWidth = options.borderWidth;\n  const padding = toPadding(options.padding);\n  const textSize = measureLabelSize(chart.ctx, options);\n  const width = textSize.width + padding.width + borderWidth;\n  const height = textSize.height + padding.height + borderWidth;\n  return calculateLabelPosition(properties, options, {width, height, padding}, chart.chartArea);\n}\n\nfunction calculateAutoRotation(properties) {\n  const {x, y, x2, y2} = properties;\n  const rotation = Math.atan2(y2 - y, x2 - x);\n  // Flip the rotation if it goes > PI/2 or < -PI/2, so label stays upright\n  return rotation > PI / 2 ? rotation - PI : rotation < PI / -2 ? rotation + PI : rotation;\n}\n\nfunction calculateLabelPosition(properties, label, sizes, chartArea) {\n  const {width, height, padding} = sizes;\n  const {xAdjust, yAdjust} = label;\n  const p1 = {x: properties.x, y: properties.y};\n  const p2 = {x: properties.x2, y: properties.y2};\n  const rotation = label.rotation === 'auto' ? calculateAutoRotation(properties) : toRadians(label.rotation);\n  const size = rotatedSize(width, height, rotation);\n  const t = calculateT(properties, label, {labelSize: size, padding}, chartArea);\n  const pt = properties.cp ? pointInCurve(p1, properties.cp, p2, t) : pointInLine(p1, p2, t);\n  const xCoordinateSizes = {size: size.w, min: chartArea.left, max: chartArea.right, padding: padding.left};\n  const yCoordinateSizes = {size: size.h, min: chartArea.top, max: chartArea.bottom, padding: padding.top};\n  const centerX = adjustLabelCoordinate(pt.x, xCoordinateSizes) + xAdjust;\n  const centerY = adjustLabelCoordinate(pt.y, yCoordinateSizes) + yAdjust;\n  return {\n    x: centerX - (width / 2),\n    y: centerY - (height / 2),\n    x2: centerX + (width / 2),\n    y2: centerY + (height / 2),\n    centerX,\n    centerY,\n    pointX: pt.x,\n    pointY: pt.y,\n    width,\n    height,\n    rotation: toDegrees(rotation)\n  };\n}\n\nfunction rotatedSize(width, height, rotation) {\n  const cos = Math.cos(rotation);\n  const sin = Math.sin(rotation);\n  return {\n    w: Math.abs(width * cos) + Math.abs(height * sin),\n    h: Math.abs(width * sin) + Math.abs(height * cos)\n  };\n}\n\nfunction calculateT(properties, label, sizes, chartArea) {\n  let t;\n  const space = spaceAround(properties, chartArea);\n  if (label.position === 'start') {\n    t = calculateTAdjust({w: properties.x2 - properties.x, h: properties.y2 - properties.y}, sizes, label, space);\n  } else if (label.position === 'end') {\n    t = 1 - calculateTAdjust({w: properties.x - properties.x2, h: properties.y - properties.y2}, sizes, label, space);\n  } else {\n    t = getRelativePosition(1, label.position);\n  }\n  return t;\n}\n\nfunction calculateTAdjust(lineSize, sizes, label, space) {\n  const {labelSize, padding} = sizes;\n  const lineW = lineSize.w * space.dx;\n  const lineH = lineSize.h * space.dy;\n  const x = (lineW > 0) && ((labelSize.w / 2 + padding.left - space.x) / lineW);\n  const y = (lineH > 0) && ((labelSize.h / 2 + padding.top - space.y) / lineH);\n  return clamp(Math.max(x, y), 0, 0.25);\n}\n\nfunction spaceAround(properties, chartArea) {\n  const {x, x2, y, y2} = properties;\n  const t = Math.min(y, y2) - chartArea.top;\n  const l = Math.min(x, x2) - chartArea.left;\n  const b = chartArea.bottom - Math.max(y, y2);\n  const r = chartArea.right - Math.max(x, x2);\n  return {\n    x: Math.min(l, r),\n    y: Math.min(t, b),\n    dx: l <= r ? 1 : -1,\n    dy: t <= b ? 1 : -1\n  };\n}\n\nfunction adjustLabelCoordinate(coordinate, labelSizes) {\n  const {size, min, max, padding} = labelSizes;\n  const halfSize = size / 2;\n  if (size > max - min) {\n    // if it does not fit, display as much as possible\n    return (max + min) / 2;\n  }\n  if (min >= (coordinate - padding - halfSize)) {\n    coordinate = min + padding + halfSize;\n  }\n  if (max <= (coordinate + padding + halfSize)) {\n    coordinate = max - padding - halfSize;\n  }\n  return coordinate;\n}\n\nfunction getArrowHeads(line) {\n  const options = line.options;\n  const arrowStartOpts = options.arrowHeads && options.arrowHeads.start;\n  const arrowEndOpts = options.arrowHeads && options.arrowHeads.end;\n  return {\n    startOpts: arrowStartOpts,\n    endOpts: arrowEndOpts,\n    startAdjust: getLineAdjust(line, arrowStartOpts),\n    endAdjust: getLineAdjust(line, arrowEndOpts)\n  };\n}\n\nfunction getLineAdjust(line, arrowOpts) {\n  if (!arrowOpts || !arrowOpts.display) {\n    return 0;\n  }\n  const {length, width} = arrowOpts;\n  const adjust = line.options.borderWidth / 2;\n  const p1 = {x: length, y: width + adjust};\n  const p2 = {x: 0, y: adjust};\n  return Math.abs(interpolateX(0, p1, p2));\n}\n\nfunction drawArrowHead(ctx, offset, adjust, arrowOpts) {\n  if (!arrowOpts || !arrowOpts.display) {\n    return;\n  }\n  const {length, width, fill, backgroundColor, borderColor} = arrowOpts;\n  const arrowOffsetX = Math.abs(offset - length) + adjust;\n  ctx.beginPath();\n  setShadowStyle(ctx, arrowOpts);\n  setBorderStyle(ctx, arrowOpts);\n  ctx.moveTo(arrowOffsetX, -width);\n  ctx.lineTo(offset + adjust, 0);\n  ctx.lineTo(arrowOffsetX, width);\n  if (fill === true) {\n    ctx.fillStyle = backgroundColor || borderColor;\n    ctx.closePath();\n    ctx.fill();\n    ctx.shadowColor = 'transparent';\n  } else {\n    ctx.shadowColor = arrowOpts.borderShadowColor;\n  }\n  ctx.stroke();\n}\n\nfunction getControlPoint(properties, options, distance) {\n  const {x, y, x2, y2, centerX, centerY} = properties;\n  const angle = Math.atan2(y2 - y, x2 - x);\n  const cp = toPosition(options.controlPoint, 0);\n  const point = {\n    x: centerX + getSize(distance, cp.x, false),\n    y: centerY + getSize(distance, cp.y, false)\n  };\n  return rotated(point, {x: centerX, y: centerY}, angle);\n}\n\nfunction drawArrowHeadOnCurve(ctx, {x, y}, {angle, adjust}, arrowOpts) {\n  if (!arrowOpts || !arrowOpts.display) {\n    return;\n  }\n  ctx.save();\n  ctx.translate(x, y);\n  ctx.rotate(angle);\n  drawArrowHead(ctx, 0, -adjust, arrowOpts);\n  ctx.restore();\n}\n\nfunction drawCurve(ctx, element, cp, length) {\n  const {x, y, x2, y2, options} = element;\n  const {startOpts, endOpts, startAdjust, endAdjust} = getArrowHeads(element);\n  const p1 = {x, y};\n  const p2 = {x: x2, y: y2};\n  const startAngle = angleInCurve(p1, cp, p2, 0);\n  const endAngle = angleInCurve(p1, cp, p2, 1) - PI;\n  const ps = pointInCurve(p1, cp, p2, startAdjust / length);\n  const pe = pointInCurve(p1, cp, p2, 1 - endAdjust / length);\n\n  const path = new Path2D();\n  ctx.beginPath();\n  path.moveTo(ps.x, ps.y);\n  path.quadraticCurveTo(cp.x, cp.y, pe.x, pe.y);\n  ctx.shadowColor = options.borderShadowColor;\n  ctx.stroke(path);\n  element.path = path;\n  element.ctx = ctx;\n  drawArrowHeadOnCurve(ctx, ps, {angle: startAngle, adjust: startAdjust}, startOpts);\n  drawArrowHeadOnCurve(ctx, pe, {angle: endAngle, adjust: endAdjust}, endOpts);\n}\n\nclass EllipseAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    const rotation = this.options.rotation;\n    const hitSize = (this.options.borderWidth + this.options.hitTolerance) / 2;\n    if (axis !== 'x' && axis !== 'y') {\n      return pointInEllipse({x: mouseX, y: mouseY}, this.getProps(['width', 'height', 'centerX', 'centerY'], useFinalPosition), rotation, hitSize);\n    }\n    const {x, y, x2, y2} = this.getProps(['x', 'y', 'x2', 'y2'], useFinalPosition);\n    const limit = axis === 'y' ? {start: y, end: y2} : {start: x, end: x2};\n    const rotatedPoint = rotated({x: mouseX, y: mouseY}, this.getCenterPoint(useFinalPosition), toRadians(-rotation));\n    return rotatedPoint[axis] >= limit.start - hitSize - EPSILON && rotatedPoint[axis] <= limit.end + hitSize + EPSILON;\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    const {width, height, centerX, centerY, options} = this;\n    ctx.save();\n    translate(ctx, this.getCenterPoint(), options.rotation);\n    setShadowStyle(ctx, this.options);\n    ctx.beginPath();\n    ctx.fillStyle = options.backgroundColor;\n    const stroke = setBorderStyle(ctx, options);\n    ctx.ellipse(centerX, centerY, height / 2, width / 2, PI / 2, 0, 2 * PI);\n    ctx.fill();\n    if (stroke) {\n      ctx.shadowColor = options.borderShadowColor;\n      ctx.stroke();\n    }\n    ctx.restore();\n  }\n\n  get label() {\n    return this.elements && this.elements[0];\n  }\n\n  resolveElementProperties(chart, options) {\n    return resolveBoxAndLabelProperties(chart, options);\n  }\n\n}\n\nEllipseAnnotation.id = 'ellipseAnnotation';\n\nEllipseAnnotation.defaults = {\n  adjustScaleRange: true,\n  backgroundShadowColor: 'transparent',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderShadowColor: 'transparent',\n  borderWidth: 1,\n  display: true,\n  hitTolerance: 0,\n  init: undefined,\n  label: Object.assign({}, BoxAnnotation.defaults.label),\n  rotation: 0,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  xMax: undefined,\n  xMin: undefined,\n  xScaleID: undefined,\n  yMax: undefined,\n  yMin: undefined,\n  yScaleID: undefined,\n  z: 0\n};\n\nEllipseAnnotation.defaultRoutes = {\n  borderColor: 'color',\n  backgroundColor: 'color'\n};\n\nEllipseAnnotation.descriptors = {\n  label: {\n    _fallback: true\n  }\n};\n\nfunction pointInEllipse(p, ellipse, rotation, hitSize) {\n  const {width, height, centerX, centerY} = ellipse;\n  const xRadius = width / 2;\n  const yRadius = height / 2;\n\n  if (xRadius <= 0 || yRadius <= 0) {\n    return false;\n  }\n  // https://stackoverflow.com/questions/7946187/point-and-ellipse-rotated-position-test-algorithm\n  const angle = toRadians(rotation || 0);\n  const cosAngle = Math.cos(angle);\n  const sinAngle = Math.sin(angle);\n  const a = Math.pow(cosAngle * (p.x - centerX) + sinAngle * (p.y - centerY), 2);\n  const b = Math.pow(sinAngle * (p.x - centerX) - cosAngle * (p.y - centerY), 2);\n  return (a / Math.pow(xRadius + hitSize, 2)) + (b / Math.pow(yRadius + hitSize, 2)) <= 1.0001;\n}\n\nclass PointAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    const {x, y, x2, y2, width} = this.getProps(['x', 'y', 'x2', 'y2', 'width'], useFinalPosition);\n    const hitSize = (this.options.borderWidth + this.options.hitTolerance) / 2;\n    if (axis !== 'x' && axis !== 'y') {\n      return inPointRange({x: mouseX, y: mouseY}, this.getCenterPoint(useFinalPosition), width / 2, hitSize);\n    }\n    const limit = axis === 'y' ? {start: y, end: y2, value: mouseY} : {start: x, end: x2, value: mouseX};\n    return inLimit(limit, hitSize);\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    const options = this.options;\n    const borderWidth = options.borderWidth;\n    if (options.radius < 0.1) {\n      return;\n    }\n    ctx.save();\n    ctx.fillStyle = options.backgroundColor;\n    setShadowStyle(ctx, options);\n    const stroke = setBorderStyle(ctx, options);\n    drawPoint(ctx, this, this.centerX, this.centerY);\n    if (stroke && !isImageOrCanvas(options.pointStyle)) {\n      ctx.shadowColor = options.borderShadowColor;\n      ctx.stroke();\n    }\n    ctx.restore();\n    options.borderWidth = borderWidth;\n  }\n\n  resolveElementProperties(chart, options) {\n    const properties = resolvePointProperties(chart, options);\n    properties.initProperties = initAnimationProperties(chart, properties, options);\n    return properties;\n  }\n}\n\nPointAnnotation.id = 'pointAnnotation';\n\nPointAnnotation.defaults = {\n  adjustScaleRange: true,\n  backgroundShadowColor: 'transparent',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderShadowColor: 'transparent',\n  borderWidth: 1,\n  display: true,\n  hitTolerance: 0,\n  init: undefined,\n  pointStyle: 'circle',\n  radius: 10,\n  rotation: 0,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  xAdjust: 0,\n  xMax: undefined,\n  xMin: undefined,\n  xScaleID: undefined,\n  xValue: undefined,\n  yAdjust: 0,\n  yMax: undefined,\n  yMin: undefined,\n  yScaleID: undefined,\n  yValue: undefined,\n  z: 0\n};\n\nPointAnnotation.defaultRoutes = {\n  borderColor: 'color',\n  backgroundColor: 'color'\n};\n\nclass PolygonAnnotation extends Element {\n\n  inRange(mouseX, mouseY, axis, useFinalPosition) {\n    if (axis !== 'x' && axis !== 'y') {\n      return this.options.radius >= 0.1 && this.elements.length > 1 && pointIsInPolygon(this.elements, mouseX, mouseY, useFinalPosition);\n    }\n    const rotatedPoint = rotated({x: mouseX, y: mouseY}, this.getCenterPoint(useFinalPosition), toRadians(-this.options.rotation));\n    const axisPoints = this.elements.map((point) => axis === 'y' ? point.bY : point.bX);\n    const start = Math.min(...axisPoints);\n    const end = Math.max(...axisPoints);\n    return rotatedPoint[axis] >= start && rotatedPoint[axis] <= end;\n  }\n\n  getCenterPoint(useFinalPosition) {\n    return getElementCenterPoint(this, useFinalPosition);\n  }\n\n  draw(ctx) {\n    const {elements, options} = this;\n    ctx.save();\n    ctx.beginPath();\n    ctx.fillStyle = options.backgroundColor;\n    setShadowStyle(ctx, options);\n    const stroke = setBorderStyle(ctx, options);\n    let first = true;\n    for (const el of elements) {\n      if (first) {\n        ctx.moveTo(el.x, el.y);\n        first = false;\n      } else {\n        ctx.lineTo(el.x, el.y);\n      }\n    }\n    ctx.closePath();\n    ctx.fill();\n    // If no border, don't draw it\n    if (stroke) {\n      ctx.shadowColor = options.borderShadowColor;\n      ctx.stroke();\n    }\n    ctx.restore();\n  }\n\n  resolveElementProperties(chart, options) {\n    const properties = resolvePointProperties(chart, options);\n    const {sides, rotation} = options;\n    const elements = [];\n    const angle = (2 * PI) / sides;\n    let rad = rotation * RAD_PER_DEG;\n    for (let i = 0; i < sides; i++, rad += angle) {\n      const elProps = buildPointElement(properties, options, rad);\n      elProps.initProperties = initAnimationProperties(chart, properties, options);\n      elements.push(elProps);\n    }\n    properties.elements = elements;\n    return properties;\n  }\n}\n\nPolygonAnnotation.id = 'polygonAnnotation';\n\nPolygonAnnotation.defaults = {\n  adjustScaleRange: true,\n  backgroundShadowColor: 'transparent',\n  borderCapStyle: 'butt',\n  borderDash: [],\n  borderDashOffset: 0,\n  borderJoinStyle: 'miter',\n  borderShadowColor: 'transparent',\n  borderWidth: 1,\n  display: true,\n  hitTolerance: 0,\n  init: undefined,\n  point: {\n    radius: 0\n  },\n  radius: 10,\n  rotation: 0,\n  shadowBlur: 0,\n  shadowOffsetX: 0,\n  shadowOffsetY: 0,\n  sides: 3,\n  xAdjust: 0,\n  xMax: undefined,\n  xMin: undefined,\n  xScaleID: undefined,\n  xValue: undefined,\n  yAdjust: 0,\n  yMax: undefined,\n  yMin: undefined,\n  yScaleID: undefined,\n  yValue: undefined,\n  z: 0\n};\n\nPolygonAnnotation.defaultRoutes = {\n  borderColor: 'color',\n  backgroundColor: 'color'\n};\n\nfunction buildPointElement({centerX, centerY}, {radius, borderWidth, hitTolerance}, rad) {\n  const hitSize = (borderWidth + hitTolerance) / 2;\n  const sin = Math.sin(rad);\n  const cos = Math.cos(rad);\n  const point = {x: centerX + sin * radius, y: centerY - cos * radius};\n  return {\n    type: 'point',\n    optionScope: 'point',\n    properties: {\n      x: point.x,\n      y: point.y,\n      centerX: point.x,\n      centerY: point.y,\n      bX: centerX + sin * (radius + hitSize),\n      bY: centerY - cos * (radius + hitSize)\n    }\n  };\n}\n\nfunction pointIsInPolygon(points, x, y, useFinalPosition) {\n  let isInside = false;\n  let A = points[points.length - 1].getProps(['bX', 'bY'], useFinalPosition);\n  for (const point of points) {\n    const B = point.getProps(['bX', 'bY'], useFinalPosition);\n    if ((B.bY > y) !== (A.bY > y) && x < (A.bX - B.bX) * (y - B.bY) / (A.bY - B.bY) + B.bX) {\n      isInside = !isInside;\n    }\n    A = B;\n  }\n  return isInside;\n}\n\nconst annotationTypes = {\n  box: BoxAnnotation,\n  doughnutLabel: DoughnutLabelAnnotation,\n  ellipse: EllipseAnnotation,\n  label: LabelAnnotation,\n  line: LineAnnotation,\n  point: PointAnnotation,\n  polygon: PolygonAnnotation\n};\n\n/**\n * Register fallback for annotation elements\n * For example lineAnnotation options would be looked through:\n * - the annotation object (options.plugins.annotation.annotations[id])\n * - element options (options.elements.lineAnnotation)\n * - element defaults (defaults.elements.lineAnnotation)\n * - annotation plugin defaults (defaults.plugins.annotation, this is what we are registering here)\n */\nObject.keys(annotationTypes).forEach(key => {\n  defaults.describe(`elements.${annotationTypes[key].id}`, {\n    _fallback: 'plugins.annotation.common'\n  });\n});\n\nconst directUpdater = {\n  update: Object.assign\n};\n\nconst hooks$1 = eventHooks.concat(elementHooks);\nconst resolve = (value, optDefs) => isObject(optDefs) ? resolveObj(value, optDefs) : value;\n\n\n/**\n * @typedef { import(\"chart.js\").Chart } Chart\n * @typedef { import(\"chart.js\").UpdateMode } UpdateMode\n * @typedef { import('../../types/options').AnnotationPluginOptions } AnnotationPluginOptions\n */\n\n/**\n * @param {string} prop\n * @returns {boolean}\n */\nconst isIndexable = (prop) => prop === 'color' || prop === 'font';\n\n/**\n * Resolve the annotation type, checking if is supported.\n * @param {string} [type=line] - annotation type\n * @returns {string} resolved annotation type\n */\nfunction resolveType(type = 'line') {\n  if (annotationTypes[type]) {\n    return type;\n  }\n  console.warn(`Unknown annotation type: '${type}', defaulting to 'line'`);\n  return 'line';\n}\n\n/**\n * @param {Chart} chart\n * @param {Object} state\n * @param {AnnotationPluginOptions} options\n * @param {UpdateMode} mode\n */\nfunction updateElements(chart, state, options, mode) {\n  const animations = resolveAnimations(chart, options.animations, mode);\n\n  const annotations = state.annotations;\n  const elements = resyncElements(state.elements, annotations);\n\n  for (let i = 0; i < annotations.length; i++) {\n    const annotationOptions = annotations[i];\n    const element = getOrCreateElement(elements, i, annotationOptions.type);\n    const resolver = annotationOptions.setContext(getContext(chart, element, elements, annotationOptions));\n    const properties = element.resolveElementProperties(chart, resolver);\n\n    properties.skip = toSkip(properties);\n\n    if ('elements' in properties) {\n      updateSubElements(element, properties.elements, resolver, animations);\n      // Remove the sub-element definitions from properties, so the actual elements\n      // are not overwritten by their definitions\n      delete properties.elements;\n    }\n\n    if (!defined(element.x)) {\n      // If the element is newly created, assing the properties directly - to\n      // make them readily awailable to any scriptable options. If we do not do this,\n      // the properties retruned by `resolveElementProperties` are available only\n      // after options resolution.\n      Object.assign(element, properties);\n    }\n\n    Object.assign(element, properties.initProperties);\n    properties.options = resolveAnnotationOptions(resolver);\n\n    animations.update(element, properties);\n  }\n}\n\nfunction toSkip(properties) {\n  return isNaN(properties.x) || isNaN(properties.y);\n}\n\nfunction resolveAnimations(chart, animOpts, mode) {\n  if (mode === 'reset' || mode === 'none' || mode === 'resize') {\n    return directUpdater;\n  }\n  return new Animations(chart, animOpts);\n}\n\nfunction updateSubElements(mainElement, elements, resolver, animations) {\n  const subElements = mainElement.elements || (mainElement.elements = []);\n  subElements.length = elements.length;\n  for (let i = 0; i < elements.length; i++) {\n    const definition = elements[i];\n    const properties = definition.properties;\n    const subElement = getOrCreateElement(subElements, i, definition.type, definition.initProperties);\n    const subResolver = resolver[definition.optionScope].override(definition);\n    properties.options = resolveAnnotationOptions(subResolver);\n    animations.update(subElement, properties);\n  }\n}\n\nfunction getOrCreateElement(elements, index, type, initProperties) {\n  const elementClass = annotationTypes[resolveType(type)];\n  let element = elements[index];\n  if (!element || !(element instanceof elementClass)) {\n    element = elements[index] = new elementClass();\n    Object.assign(element, initProperties);\n  }\n  return element;\n}\n\nfunction resolveAnnotationOptions(resolver) {\n  const elementClass = annotationTypes[resolveType(resolver.type)];\n  const result = {};\n  result.id = resolver.id;\n  result.type = resolver.type;\n  result.drawTime = resolver.drawTime;\n  Object.assign(result,\n    resolveObj(resolver, elementClass.defaults),\n    resolveObj(resolver, elementClass.defaultRoutes));\n  for (const hook of hooks$1) {\n    result[hook] = resolver[hook];\n  }\n  return result;\n}\n\nfunction resolveObj(resolver, defs) {\n  const result = {};\n  for (const prop of Object.keys(defs)) {\n    const optDefs = defs[prop];\n    const value = resolver[prop];\n    if (isIndexable(prop) && isArray(value)) {\n      result[prop] = value.map((item) => resolve(item, optDefs));\n    } else {\n      result[prop] = resolve(value, optDefs);\n    }\n  }\n  return result;\n}\n\nfunction getContext(chart, element, elements, annotation) {\n  return element.$context || (element.$context = Object.assign(Object.create(chart.getContext()), {\n    element,\n    get elements() {\n      return elements.filter((el) => el && el.options);\n    },\n    id: annotation.id,\n    type: 'annotation'\n  }));\n}\n\nfunction resyncElements(elements, annotations) {\n  const count = annotations.length;\n  const start = elements.length;\n\n  if (start < count) {\n    const add = count - start;\n    elements.splice(start, 0, ...new Array(add));\n  } else if (start > count) {\n    elements.splice(count, start - count);\n  }\n  return elements;\n}\n\nvar version = \"3.1.0\";\n\nconst chartStates = new Map();\nconst isNotDoughnutLabel = annotation => annotation.type !== 'doughnutLabel';\nconst hooks = eventHooks.concat(elementHooks);\n\nvar annotation = {\n  id: 'annotation',\n\n  version,\n\n  beforeRegister() {\n    requireVersion('chart.js', '4.0', Chart.version);\n  },\n\n  afterRegister() {\n    Chart.register(annotationTypes);\n  },\n\n  afterUnregister() {\n    Chart.unregister(annotationTypes);\n  },\n\n  beforeInit(chart) {\n    chartStates.set(chart, {\n      annotations: [],\n      elements: [],\n      visibleElements: [],\n      listeners: {},\n      listened: false,\n      moveListened: false,\n      hooks: {},\n      hooked: false,\n      hovered: []\n    });\n  },\n\n  beforeUpdate(chart, args, options) {\n    const state = chartStates.get(chart);\n    const annotations = state.annotations = [];\n\n    let annotationOptions = options.annotations;\n    if (isObject(annotationOptions)) {\n      Object.keys(annotationOptions).forEach(key => {\n        const value = annotationOptions[key];\n        if (isObject(value)) {\n          value.id = key;\n          annotations.push(value);\n        }\n      });\n    } else if (isArray(annotationOptions)) {\n      annotations.push(...annotationOptions);\n    }\n    verifyScaleOptions(annotations.filter(isNotDoughnutLabel), chart.scales);\n  },\n\n  afterDataLimits(chart, args) {\n    const state = chartStates.get(chart);\n    adjustScaleRange(chart, args.scale, state.annotations.filter(isNotDoughnutLabel).filter(a => a.display && a.adjustScaleRange));\n  },\n\n  afterUpdate(chart, args, options) {\n    const state = chartStates.get(chart);\n    updateListeners(chart, state, options);\n    updateElements(chart, state, options, args.mode);\n    state.visibleElements = state.elements.filter(el => !el.skip && el.options.display);\n    updateHooks(chart, state, options);\n  },\n\n  beforeDatasetsDraw(chart, _args, options) {\n    draw(chart, 'beforeDatasetsDraw', options.clip);\n  },\n\n  afterDatasetsDraw(chart, _args, options) {\n    draw(chart, 'afterDatasetsDraw', options.clip);\n  },\n\n  beforeDatasetDraw(chart, _args, options) {\n    draw(chart, _args.index, options.clip);\n  },\n\n  beforeDraw(chart, _args, options) {\n    draw(chart, 'beforeDraw', options.clip);\n  },\n\n  afterDraw(chart, _args, options) {\n    draw(chart, 'afterDraw', options.clip);\n  },\n\n  beforeEvent(chart, args, options) {\n    const state = chartStates.get(chart);\n    if (handleEvent(state, args.event, options)) {\n      args.changed = true;\n    }\n  },\n\n  afterDestroy(chart) {\n    chartStates.delete(chart);\n  },\n\n  getAnnotations(chart) {\n    const state = chartStates.get(chart);\n    return state ? state.elements : [];\n  },\n\n  // only for testing\n  _getAnnotationElementsAtEventForMode(visibleElements, event, options) {\n    return getElements(visibleElements, event, options);\n  },\n\n  defaults: {\n    animations: {\n      numbers: {\n        properties: ['x', 'y', 'x2', 'y2', 'width', 'height', 'centerX', 'centerY', 'pointX', 'pointY', 'radius'],\n        type: 'number'\n      },\n      colors: {\n        properties: ['backgroundColor', 'borderColor'],\n        type: 'color'\n      }\n    },\n    clip: true,\n    interaction: {\n      mode: undefined,\n      axis: undefined,\n      intersect: undefined\n    },\n    common: {\n      drawTime: 'afterDatasetsDraw',\n      init: false,\n      label: {\n      }\n    }\n  },\n\n  descriptors: {\n    _indexable: false,\n    _scriptable: (prop) => !hooks.includes(prop) && prop !== 'init',\n    annotations: {\n      _allKeys: false,\n      _fallback: (prop, opts) => `elements.${annotationTypes[resolveType(opts.type)].id}`\n    },\n    interaction: {\n      _fallback: true\n    },\n    common: {\n      label: {\n        _indexable: isIndexable,\n        _fallback: true\n      },\n      _indexable: isIndexable\n    }\n  },\n\n  additionalOptionScopes: ['']\n};\n\nfunction draw(chart, caller, clip) {\n  const {ctx, chartArea} = chart;\n  const state = chartStates.get(chart);\n\n  if (clip) {\n    clipArea(ctx, chartArea);\n  }\n\n  const drawableElements = getDrawableElements(state.visibleElements, caller).sort((a, b) => a.element.options.z - b.element.options.z);\n  for (const item of drawableElements) {\n    drawElement(ctx, chartArea, state, item);\n  }\n\n  if (clip) {\n    unclipArea(ctx);\n  }\n}\n\nfunction getDrawableElements(elements, caller) {\n  const drawableElements = [];\n  for (const el of elements) {\n    if (el.options.drawTime === caller) {\n      drawableElements.push({element: el, main: true});\n    }\n    if (el.elements && el.elements.length) {\n      for (const sub of el.elements) {\n        if (sub.options.display && sub.options.drawTime === caller) {\n          drawableElements.push({element: sub});\n        }\n      }\n    }\n  }\n  return drawableElements;\n}\n\nfunction drawElement(ctx, chartArea, state, item) {\n  const el = item.element;\n  if (item.main) {\n    invokeHook(state, el, 'beforeDraw');\n    el.draw(ctx, chartArea);\n    invokeHook(state, el, 'afterDraw');\n  } else {\n    el.draw(ctx, chartArea);\n  }\n}\n\nexport { annotation as default };\n", "import { Chart } from 'chart.js/auto';\nimport ChartDataLabels from 'chartjs-plugin-datalabels';\nimport htmlLegendPlugin from './charts-html-legend.js';\nimport annotationPlugin from 'chartjs-plugin-annotation';\n\nChart.defaults.font.size = 14;\nChart.defaults.font.family = '\"GT Walsheim\", sans-serif';\nChart.register(ChartDataLabels);\nChart.register(annotationPlugin);\n\nexport default Chart;\n\nChart.defaults.plugins.datalabels.display = false;\n\nexport const MONEY = new Intl.NumberFormat('en-GB', { style: 'currency', currency: 'GBP', maximumFractionDigits: 0 });\n\nexport function czHorizontalBarChart(ctx, data) {\n    return new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: data.map((v) => v.label),\n            datasets: [\n                {\n                    label: 'Charity count',\n                    data: data.map((v) => v.value),\n                    backgroundColor: data.map((v) => v.colour),\n                    borderRadius: 20,\n                    barThickness: 24,\n                }\n            ]\n        },\n        options: {\n            indexAxis: 'y',\n            responsive: true,\n            plugins: {\n                legend: {\n                    display: false,\n                },\n            },\n            scales: {\n                x: {\n                    grid: {\n                        display: false,\n                    },\n                },\n                y: {\n                    grid: {\n                        display: false,\n                    },\n                    ticks: {\n                        padding: 0,\n                        mirror: true,\n                        labelOffset: -24,\n                    },\n                    border: {\n                        display: false,\n                    }\n                }\n            }\n        },\n    });\n}\n\nexport function czVerticalBarChart(ctx, data) {\n    return new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: data.map((v) => v.label),\n            datasets: [\n                {\n                    label: 'Charity count',\n                    data: data.map((v) => v.value),\n                    backgroundColor: data.map((v) => v.colour),\n                    borderRadius: 20,\n                    barThickness: 24,\n                }\n            ]\n        },\n        options: {\n            indexAxis: 'x',\n            responsive: true,\n            plugins: {\n                legend: {\n                    display: false,\n                },\n            },\n            scales: {\n                x: {\n                    grid: {\n                        display: false,\n                    },\n                },\n                y: {\n                    grid: {\n                        display: false,\n                    },\n                    border: {\n                        display: false,\n                    }\n                }\n            }\n        },\n    });\n}\n\nexport function czPieChart(ctx, data, legend = null) {\n    if (legend) {\n        var legend_el = document.createElement('div');\n        legend_el.id = legend;\n        ctx.parentNode.insertBefore(legend_el, ctx.nextSibling);\n    }\n    return new Chart(ctx, {\n        type: 'doughnut',\n        data: {\n            labels: data.map((v) => v.label),\n            datasets: [\n                {\n                    label: 'Charity count',\n                    data: data.map((v) => v.value),\n                    backgroundColor: data.map((v) => v.colour),\n                }\n            ]\n        },\n        options: {\n            borderWidth: 0,\n            responsive: true,\n            plugins: {\n                htmlLegend: {\n                    // ID of the container to put the legend in\n                    containerID: legend,\n                },\n                legend: {\n                    display: false,\n                },\n            },\n            cutout: '33%',\n        },\n        plugins: [htmlLegendPlugin],\n    });\n}\n\n\nexport function czFundsBarChart(ctx, data) {\n    return new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: data.map((v) => v.label),\n            datasets: [\n                {\n                    label: 'Charity count',\n                    data: data.map((v) => v.value),\n                    backgroundColor: data.map((v) => v.colour),\n                }\n            ]\n        },\n        options: {\n            indexAxis: 'x',\n            responsive: true,\n            plugins: {\n                legend: {\n                    display: false,\n                },\n            },\n            scales: {\n                x: {\n                    display: false,\n                    grid: {\n                        display: false,\n                    },\n                },\n                y: {\n                    display: false,\n                    grid: {\n                        display: false,\n                    },\n                    border: {\n                        display: false,\n                    }\n                }\n            }\n        },\n    });\n}\n\nexport function czMiniFinanceChart(ctx, labels, data, label = 'Spending', color = '#F6306C') {\n    return new Chart(ctx, {\n        type: 'line',\n        data: {\n            labels: labels,\n            datasets: [{\n                label: label,\n                data: data,\n                fill: false,\n                lineTension: 0,\n                borderColor: color,\n                pointRadius: 1,\n                hitRadius: 5,\n            }]\n        },\n        options: {\n            plugins: {\n                legend: {\n                    display: false,\n                    position: 'bottom',\n                    align: 'start',\n                    labels: {\n                        boxHeight: 1,\n                    }\n                },\n            },\n            scales: {\n                y: {\n                    beginAtZero: false,\n                    ticks: {\n                        count: 10,\n                        display: false,\n                        padding: 0,\n                    },\n                    grid: {\n                        display: true,\n                    },\n                },\n                x: {\n                    ticks: {\n                        stepSize: 24,\n                        font: {\n                            size: 12\n                        }\n                    },\n                    distribution: 'series',\n                    grid: {\n                        display: false,\n                    }\n                }\n            }\n        }\n    });\n}", "import 'leaflet';\nimport '@maplibre/maplibre-gl-leaflet';\nimport 'maplibre-gl';\nimport 'leaflet.markercluster';\nimport { GeoHash } from 'geohash';\nimport { interpolateViridis, scaleLinear, interpolateRgb } from 'd3';\n\nexport function createMap(ctx, chart_data) {\n    // check map container exists\n    if (ctx === null) {\n        return;\n    }\n    const MAPSTYLE = \"/static/mapstyle.json\";\n    const UK_BOUNDS = [\n        [60.86, 1.76],\n        [49.86, -8.65]\n    ]\n    location_map = L.map(ctx, {\n        zoomSnap: 0.1,\n    });\n    L.maplibreGL({\n        style: MAPSTYLE,\n        attribution: `\n    <a href=\"https://openfreemap.org\" target=\"_blank\">OpenFreeMap</a> \n    <a href=\"https://www.openmaptiles.org/\" target=\"_blank\">&copy; OpenMapTiles</a> \n    Data from <a href=\"https://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a>`,\n    }).addTo(location_map);\n    location_map.fitBounds(UK_BOUNDS, {\n        paddingBottomRight: [0, 15]\n    })\n    location_map.setMinZoom(location_map.getZoom());\n    location_map.setMaxZoom(12);\n    if (chart_data[\"geodata\"].length < 100) {\n        var markers = L.markerClusterGroup({\n            maxClusterRadius: 30,\n            singleMarkerMode: true,\n        });\n        chart_data[\"geodata\"].forEach((v) => {\n            if (v.location === null) {\n                return;\n            }\n            var popupContent = `<a href=\"/charity/${v.org_id}/\" target=\"_blank\">${v.name}</a>`;\n            L.marker([v.location.lat, v.location.lon]).bindPopup(popupContent).addTo(markers);\n        });\n        markers.addTo(location_map);\n    } else {\n        // use geohash buckets instead\n        var values = chart_data[\"geohash\"].map((v) => v.value);\n        var max_value = Math.max(...values);\n        var median_value = values.sort((a, b) => a - b)[Math.floor(values.length / 2)];\n        // const color = scaleQuantile(values, [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]);\n        const color = scaleLinear([0, median_value, max_value], [\"#f8f8fb\", \"#6a6b98\", \"#141d44\"]);\n        const opacity = scaleLinear([0, max_value], [0.6, 0.9]);\n        const radius_adjustment = scaleLinear([0, max_value], [0.4, 1.5]);\n        // const interpolator = interpolateViridis(0, max_value);\n        chart_data[\"geohash\"].forEach((v) => {\n            var value = GeoHash.decodeGeoHash(v.label);\n            var radius = location_map.distance([value.latitude[2], value.longitude[2]], [value.latitude[0], value.longitude[0]]) / 2;\n            var polygon = L.polygon([\n                [value.latitude[0], value.longitude[1]],\n                [value.latitude[0], value.longitude[0]],\n                [value.latitude[1], value.longitude[0]],\n                [value.latitude[1], value.longitude[1]],\n            ], {\n                stroke: false,\n                fillColor: color(v.value),\n                fillOpacity: opacity(v.value)\n            });\n            // var polygon = L.circle([\n            //     value.latitude[2], value.longitude[2]\n            // ], {\n            //     radius: radius * radius_adjustment(v.value),\n            //     stroke: false,\n            //     fillColor: color(v.value),\n            //     fillOpacity: 1,\n            // });\n            polygon.bindPopup(`${v.value} charities`);\n            polygon.addTo(location_map);\n        });\n    }\n}", "export default function ascending(a, b) {\n  return a == null || b == null ? NaN : a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function descending(a, b) {\n  return a == null || b == null ? NaN\n    : b < a ? -1\n    : b > a ? 1\n    : b >= a ? 0\n    : NaN;\n}\n", "import ascending from \"./ascending.js\";\nimport descending from \"./descending.js\";\n\nexport default function bisector(f) {\n  let compare1, compare2, delta;\n\n  // If an accessor is specified, promote it to a comparator. In this case we\n  // can test whether the search value is (self-) comparable. We can\u2019t do this\n  // for a comparator (except for specific, known comparators) because we can\u2019t\n  // tell if the comparator is symmetric, and an asymmetric comparator can\u2019t be\n  // used to test whether a single value is comparable.\n  if (f.length !== 2) {\n    compare1 = ascending;\n    compare2 = (d, x) => ascending(f(d), x);\n    delta = (d, x) => f(d) - x;\n  } else {\n    compare1 = f === ascending || f === descending ? f : zero;\n    compare2 = f;\n    delta = f;\n  }\n\n  function left(a, x, lo = 0, hi = a.length) {\n    if (lo < hi) {\n      if (compare1(x, x) !== 0) return hi;\n      do {\n        const mid = (lo + hi) >>> 1;\n        if (compare2(a[mid], x) < 0) lo = mid + 1;\n        else hi = mid;\n      } while (lo < hi);\n    }\n    return lo;\n  }\n\n  function right(a, x, lo = 0, hi = a.length) {\n    if (lo < hi) {\n      if (compare1(x, x) !== 0) return hi;\n      do {\n        const mid = (lo + hi) >>> 1;\n        if (compare2(a[mid], x) <= 0) lo = mid + 1;\n        else hi = mid;\n      } while (lo < hi);\n    }\n    return lo;\n  }\n\n  function center(a, x, lo = 0, hi = a.length) {\n    const i = left(a, x, lo, hi - 1);\n    return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;\n  }\n\n  return {left, center, right};\n}\n\nfunction zero() {\n  return 0;\n}\n", "export default function number(x) {\n  return x === null ? NaN : +x;\n}\n\nexport function* numbers(values, valueof) {\n  if (valueof === undefined) {\n    for (let value of values) {\n      if (value != null && (value = +value) >= value) {\n        yield value;\n      }\n    }\n  } else {\n    let index = -1;\n    for (let value of values) {\n      if ((value = valueof(value, ++index, values)) != null && (value = +value) >= value) {\n        yield value;\n      }\n    }\n  }\n}\n", "import ascending from \"./ascending.js\";\nimport bisector from \"./bisector.js\";\nimport number from \"./number.js\";\n\nconst ascendingBisect = bisector(ascending);\nexport const bisectRight = ascendingBisect.right;\nexport const bisectLeft = ascendingBisect.left;\nexport const bisectCenter = bisector(number).center;\nexport default bisectRight;\n", "const e10 = Math.sqrt(50),\n    e5 = Math.sqrt(10),\n    e2 = Math.sqrt(2);\n\nfunction tickSpec(start, stop, count) {\n  const step = (stop - start) / Math.max(0, count),\n      power = Math.floor(Math.log10(step)),\n      error = step / Math.pow(10, power),\n      factor = error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1;\n  let i1, i2, inc;\n  if (power < 0) {\n    inc = Math.pow(10, -power) / factor;\n    i1 = Math.round(start * inc);\n    i2 = Math.round(stop * inc);\n    if (i1 / inc < start) ++i1;\n    if (i2 / inc > stop) --i2;\n    inc = -inc;\n  } else {\n    inc = Math.pow(10, power) * factor;\n    i1 = Math.round(start / inc);\n    i2 = Math.round(stop / inc);\n    if (i1 * inc < start) ++i1;\n    if (i2 * inc > stop) --i2;\n  }\n  if (i2 < i1 && 0.5 <= count && count < 2) return tickSpec(start, stop, count * 2);\n  return [i1, i2, inc];\n}\n\nexport default function ticks(start, stop, count) {\n  stop = +stop, start = +start, count = +count;\n  if (!(count > 0)) return [];\n  if (start === stop) return [start];\n  const reverse = stop < start, [i1, i2, inc] = reverse ? tickSpec(stop, start, count) : tickSpec(start, stop, count);\n  if (!(i2 >= i1)) return [];\n  const n = i2 - i1 + 1, ticks = new Array(n);\n  if (reverse) {\n    if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) / -inc;\n    else for (let i = 0; i < n; ++i) ticks[i] = (i2 - i) * inc;\n  } else {\n    if (inc < 0) for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) / -inc;\n    else for (let i = 0; i < n; ++i) ticks[i] = (i1 + i) * inc;\n  }\n  return ticks;\n}\n\nexport function tickIncrement(start, stop, count) {\n  stop = +stop, start = +start, count = +count;\n  return tickSpec(start, stop, count)[2];\n}\n\nexport function tickStep(start, stop, count) {\n  stop = +stop, start = +start, count = +count;\n  const reverse = stop < start, inc = reverse ? tickIncrement(stop, start, count) : tickIncrement(start, stop, count);\n  return (reverse ? -1 : 1) * (inc < 0 ? 1 / -inc : inc);\n}\n", "var noop = {value: () => {}};\n\nfunction dispatch() {\n  for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n    if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n    _[t] = [];\n  }\n  return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n  this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n  return typenames.trim().split(/^|\\s+/).map(function(t) {\n    var name = \"\", i = t.indexOf(\".\");\n    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n    if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n    return {type: t, name: name};\n  });\n}\n\nDispatch.prototype = dispatch.prototype = {\n  constructor: Dispatch,\n  on: function(typename, callback) {\n    var _ = this._,\n        T = parseTypenames(typename + \"\", _),\n        t,\n        i = -1,\n        n = T.length;\n\n    // If no callback was specified, return the callback of the given type and name.\n    if (arguments.length < 2) {\n      while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n      return;\n    }\n\n    // If a type was specified, set the callback for the given type and name.\n    // Otherwise, if a null callback was specified, remove callbacks of the given name.\n    if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n    while (++i < n) {\n      if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n      else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n    }\n\n    return this;\n  },\n  copy: function() {\n    var copy = {}, _ = this._;\n    for (var t in _) copy[t] = _[t].slice();\n    return new Dispatch(copy);\n  },\n  call: function(type, that) {\n    if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n    if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n    for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n  },\n  apply: function(type, that, args) {\n    if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n    for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n  }\n};\n\nfunction get(type, name) {\n  for (var i = 0, n = type.length, c; i < n; ++i) {\n    if ((c = type[i]).name === name) {\n      return c.value;\n    }\n  }\n}\n\nfunction set(type, name, callback) {\n  for (var i = 0, n = type.length; i < n; ++i) {\n    if (type[i].name === name) {\n      type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n      break;\n    }\n  }\n  if (callback != null) type.push({name: name, value: callback});\n  return type;\n}\n\nexport default dispatch;\n", "export var xhtml = \"http://www.w3.org/1999/xhtml\";\n\nexport default {\n  svg: \"http://www.w3.org/2000/svg\",\n  xhtml: xhtml,\n  xlink: \"http://www.w3.org/1999/xlink\",\n  xml: \"http://www.w3.org/XML/1998/namespace\",\n  xmlns: \"http://www.w3.org/2000/xmlns/\"\n};\n", "import namespaces from \"./namespaces.js\";\n\nexport default function(name) {\n  var prefix = name += \"\", i = prefix.indexOf(\":\");\n  if (i >= 0 && (prefix = name.slice(0, i)) !== \"xmlns\") name = name.slice(i + 1);\n  return namespaces.hasOwnProperty(prefix) ? {space: namespaces[prefix], local: name} : name; // eslint-disable-line no-prototype-builtins\n}\n", "import namespace from \"./namespace.js\";\nimport {xhtml} from \"./namespaces.js\";\n\nfunction creatorInherit(name) {\n  return function() {\n    var document = this.ownerDocument,\n        uri = this.namespaceURI;\n    return uri === xhtml && document.documentElement.namespaceURI === xhtml\n        ? document.createElement(name)\n        : document.createElementNS(uri, name);\n  };\n}\n\nfunction creatorFixed(fullname) {\n  return function() {\n    return this.ownerDocument.createElementNS(fullname.space, fullname.local);\n  };\n}\n\nexport default function(name) {\n  var fullname = namespace(name);\n  return (fullname.local\n      ? creatorFixed\n      : creatorInherit)(fullname);\n}\n", "function none() {}\n\nexport default function(selector) {\n  return selector == null ? none : function() {\n    return this.querySelector(selector);\n  };\n}\n", "import {Selection} from \"./index.js\";\nimport selector from \"../selector.js\";\n\nexport default function(select) {\n  if (typeof select !== \"function\") select = selector(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n      if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n        if (\"__data__\" in node) subnode.__data__ = node.__data__;\n        subgroup[i] = subnode;\n      }\n    }\n  }\n\n  return new Selection(subgroups, this._parents);\n}\n", "// Given something array like (or null), returns something that is strictly an\n// array. This is used to ensure that array-like objects passed to d3.selectAll\n// or selection.selectAll are converted into proper arrays when creating a\n// selection; we don\u2019t ever want to create a selection backed by a live\n// HTMLCollection or NodeList. However, note that selection.selectAll will use a\n// static NodeList as a group, since it safely derived from querySelectorAll.\nexport default function array(x) {\n  return x == null ? [] : Array.isArray(x) ? x : Array.from(x);\n}\n", "function empty() {\n  return [];\n}\n\nexport default function(selector) {\n  return selector == null ? empty : function() {\n    return this.querySelectorAll(selector);\n  };\n}\n", "import {Selection} from \"./index.js\";\nimport array from \"../array.js\";\nimport selectorAll from \"../selectorAll.js\";\n\nfunction arrayAll(select) {\n  return function() {\n    return array(select.apply(this, arguments));\n  };\n}\n\nexport default function(select) {\n  if (typeof select === \"function\") select = arrayAll(select);\n  else select = selectorAll(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        subgroups.push(select.call(node, node.__data__, i, group));\n        parents.push(node);\n      }\n    }\n  }\n\n  return new Selection(subgroups, parents);\n}\n", "export default function(selector) {\n  return function() {\n    return this.matches(selector);\n  };\n}\n\nexport function childMatcher(selector) {\n  return function(node) {\n    return node.matches(selector);\n  };\n}\n\n", "import {childMatcher} from \"../matcher.js\";\n\nvar find = Array.prototype.find;\n\nfunction childFind(match) {\n  return function() {\n    return find.call(this.children, match);\n  };\n}\n\nfunction childFirst() {\n  return this.firstElementChild;\n}\n\nexport default function(match) {\n  return this.select(match == null ? childFirst\n      : childFind(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {childMatcher} from \"../matcher.js\";\n\nvar filter = Array.prototype.filter;\n\nfunction children() {\n  return Array.from(this.children);\n}\n\nfunction childrenFilter(match) {\n  return function() {\n    return filter.call(this.children, match);\n  };\n}\n\nexport default function(match) {\n  return this.selectAll(match == null ? children\n      : childrenFilter(typeof match === \"function\" ? match : childMatcher(match)));\n}\n", "import {Selection} from \"./index.js\";\nimport matcher from \"../matcher.js\";\n\nexport default function(match) {\n  if (typeof match !== \"function\") match = matcher(match);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n        subgroup.push(node);\n      }\n    }\n  }\n\n  return new Selection(subgroups, this._parents);\n}\n", "export default function(update) {\n  return new Array(update.length);\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n  return new Selection(this._enter || this._groups.map(sparse), this._parents);\n}\n\nexport function EnterNode(parent, datum) {\n  this.ownerDocument = parent.ownerDocument;\n  this.namespaceURI = parent.namespaceURI;\n  this._next = null;\n  this._parent = parent;\n  this.__data__ = datum;\n}\n\nEnterNode.prototype = {\n  constructor: EnterNode,\n  appendChild: function(child) { return this._parent.insertBefore(child, this._next); },\n  insertBefore: function(child, next) { return this._parent.insertBefore(child, next); },\n  querySelector: function(selector) { return this._parent.querySelector(selector); },\n  querySelectorAll: function(selector) { return this._parent.querySelectorAll(selector); }\n};\n", "export default function(x) {\n  return function() {\n    return x;\n  };\n}\n", "import {Selection} from \"./index.js\";\nimport {EnterNode} from \"./enter.js\";\nimport constant from \"../constant.js\";\n\nfunction bindIndex(parent, group, enter, update, exit, data) {\n  var i = 0,\n      node,\n      groupLength = group.length,\n      dataLength = data.length;\n\n  // Put any non-null nodes that fit into update.\n  // Put any null nodes into enter.\n  // Put any remaining data into enter.\n  for (; i < dataLength; ++i) {\n    if (node = group[i]) {\n      node.__data__ = data[i];\n      update[i] = node;\n    } else {\n      enter[i] = new EnterNode(parent, data[i]);\n    }\n  }\n\n  // Put any non-null nodes that don\u2019t fit into exit.\n  for (; i < groupLength; ++i) {\n    if (node = group[i]) {\n      exit[i] = node;\n    }\n  }\n}\n\nfunction bindKey(parent, group, enter, update, exit, data, key) {\n  var i,\n      node,\n      nodeByKeyValue = new Map,\n      groupLength = group.length,\n      dataLength = data.length,\n      keyValues = new Array(groupLength),\n      keyValue;\n\n  // Compute the key for each node.\n  // If multiple nodes have the same key, the duplicates are added to exit.\n  for (i = 0; i < groupLength; ++i) {\n    if (node = group[i]) {\n      keyValues[i] = keyValue = key.call(node, node.__data__, i, group) + \"\";\n      if (nodeByKeyValue.has(keyValue)) {\n        exit[i] = node;\n      } else {\n        nodeByKeyValue.set(keyValue, node);\n      }\n    }\n  }\n\n  // Compute the key for each datum.\n  // If there a node associated with this key, join and add it to update.\n  // If there is not (or the key is a duplicate), add it to enter.\n  for (i = 0; i < dataLength; ++i) {\n    keyValue = key.call(parent, data[i], i, data) + \"\";\n    if (node = nodeByKeyValue.get(keyValue)) {\n      update[i] = node;\n      node.__data__ = data[i];\n      nodeByKeyValue.delete(keyValue);\n    } else {\n      enter[i] = new EnterNode(parent, data[i]);\n    }\n  }\n\n  // Add any remaining nodes that were not bound to data to exit.\n  for (i = 0; i < groupLength; ++i) {\n    if ((node = group[i]) && (nodeByKeyValue.get(keyValues[i]) === node)) {\n      exit[i] = node;\n    }\n  }\n}\n\nfunction datum(node) {\n  return node.__data__;\n}\n\nexport default function(value, key) {\n  if (!arguments.length) return Array.from(this, datum);\n\n  var bind = key ? bindKey : bindIndex,\n      parents = this._parents,\n      groups = this._groups;\n\n  if (typeof value !== \"function\") value = constant(value);\n\n  for (var m = groups.length, update = new Array(m), enter = new Array(m), exit = new Array(m), j = 0; j < m; ++j) {\n    var parent = parents[j],\n        group = groups[j],\n        groupLength = group.length,\n        data = arraylike(value.call(parent, parent && parent.__data__, j, parents)),\n        dataLength = data.length,\n        enterGroup = enter[j] = new Array(dataLength),\n        updateGroup = update[j] = new Array(dataLength),\n        exitGroup = exit[j] = new Array(groupLength);\n\n    bind(parent, group, enterGroup, updateGroup, exitGroup, data, key);\n\n    // Now connect the enter nodes to their following update node, such that\n    // appendChild can insert the materialized enter node before this node,\n    // rather than at the end of the parent node.\n    for (var i0 = 0, i1 = 0, previous, next; i0 < dataLength; ++i0) {\n      if (previous = enterGroup[i0]) {\n        if (i0 >= i1) i1 = i0 + 1;\n        while (!(next = updateGroup[i1]) && ++i1 < dataLength);\n        previous._next = next || null;\n      }\n    }\n  }\n\n  update = new Selection(update, parents);\n  update._enter = enter;\n  update._exit = exit;\n  return update;\n}\n\n// Given some data, this returns an array-like view of it: an object that\n// exposes a length property and allows numeric indexing. Note that unlike\n// selectAll, this isn\u2019t worried about \u201Clive\u201D collections because the resulting\n// array will only be used briefly while data is being bound. (It is possible to\n// cause the data to change while iterating by using a key function, but please\n// don\u2019t; we\u2019d rather avoid a gratuitous copy.)\nfunction arraylike(data) {\n  return typeof data === \"object\" && \"length\" in data\n    ? data // Array, TypedArray, NodeList, array-like\n    : Array.from(data); // Map, Set, iterable, string, or anything else\n}\n", "import sparse from \"./sparse.js\";\nimport {Selection} from \"./index.js\";\n\nexport default function() {\n  return new Selection(this._exit || this._groups.map(sparse), this._parents);\n}\n", "export default function(onenter, onupdate, onexit) {\n  var enter = this.enter(), update = this, exit = this.exit();\n  if (typeof onenter === \"function\") {\n    enter = onenter(enter);\n    if (enter) enter = enter.selection();\n  } else {\n    enter = enter.append(onenter + \"\");\n  }\n  if (onupdate != null) {\n    update = onupdate(update);\n    if (update) update = update.selection();\n  }\n  if (onexit == null) exit.remove(); else onexit(exit);\n  return enter && update ? enter.merge(update).order() : update;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(context) {\n  var selection = context.selection ? context.selection() : context;\n\n  for (var groups0 = this._groups, groups1 = selection._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n    for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group0[i] || group1[i]) {\n        merge[i] = node;\n      }\n    }\n  }\n\n  for (; j < m0; ++j) {\n    merges[j] = groups0[j];\n  }\n\n  return new Selection(merges, this._parents);\n}\n", "export default function() {\n\n  for (var groups = this._groups, j = -1, m = groups.length; ++j < m;) {\n    for (var group = groups[j], i = group.length - 1, next = group[i], node; --i >= 0;) {\n      if (node = group[i]) {\n        if (next && node.compareDocumentPosition(next) ^ 4) next.parentNode.insertBefore(node, next);\n        next = node;\n      }\n    }\n  }\n\n  return this;\n}\n", "import {Selection} from \"./index.js\";\n\nexport default function(compare) {\n  if (!compare) compare = ascending;\n\n  function compareNode(a, b) {\n    return a && b ? compare(a.__data__, b.__data__) : !a - !b;\n  }\n\n  for (var groups = this._groups, m = groups.length, sortgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, sortgroup = sortgroups[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        sortgroup[i] = node;\n      }\n    }\n    sortgroup.sort(compareNode);\n  }\n\n  return new Selection(sortgroups, this._parents).order();\n}\n\nfunction ascending(a, b) {\n  return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;\n}\n", "export default function() {\n  var callback = arguments[0];\n  arguments[0] = this;\n  callback.apply(null, arguments);\n  return this;\n}\n", "export default function() {\n  return Array.from(this);\n}\n", "export default function() {\n\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length; i < n; ++i) {\n      var node = group[i];\n      if (node) return node;\n    }\n  }\n\n  return null;\n}\n", "export default function() {\n  let size = 0;\n  for (const node of this) ++size; // eslint-disable-line no-unused-vars\n  return size;\n}\n", "export default function() {\n  return !this.node();\n}\n", "export default function(callback) {\n\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n      if (node = group[i]) callback.call(node, node.__data__, i, group);\n    }\n  }\n\n  return this;\n}\n", "import namespace from \"../namespace.js\";\n\nfunction attrRemove(name) {\n  return function() {\n    this.removeAttribute(name);\n  };\n}\n\nfunction attrRemoveNS(fullname) {\n  return function() {\n    this.removeAttributeNS(fullname.space, fullname.local);\n  };\n}\n\nfunction attrConstant(name, value) {\n  return function() {\n    this.setAttribute(name, value);\n  };\n}\n\nfunction attrConstantNS(fullname, value) {\n  return function() {\n    this.setAttributeNS(fullname.space, fullname.local, value);\n  };\n}\n\nfunction attrFunction(name, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.removeAttribute(name);\n    else this.setAttribute(name, v);\n  };\n}\n\nfunction attrFunctionNS(fullname, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.removeAttributeNS(fullname.space, fullname.local);\n    else this.setAttributeNS(fullname.space, fullname.local, v);\n  };\n}\n\nexport default function(name, value) {\n  var fullname = namespace(name);\n\n  if (arguments.length < 2) {\n    var node = this.node();\n    return fullname.local\n        ? node.getAttributeNS(fullname.space, fullname.local)\n        : node.getAttribute(fullname);\n  }\n\n  return this.each((value == null\n      ? (fullname.local ? attrRemoveNS : attrRemove) : (typeof value === \"function\"\n      ? (fullname.local ? attrFunctionNS : attrFunction)\n      : (fullname.local ? attrConstantNS : attrConstant)))(fullname, value));\n}\n", "export default function(node) {\n  return (node.ownerDocument && node.ownerDocument.defaultView) // node is a Node\n      || (node.document && node) // node is a Window\n      || node.defaultView; // node is a Document\n}\n", "import defaultView from \"../window.js\";\n\nfunction styleRemove(name) {\n  return function() {\n    this.style.removeProperty(name);\n  };\n}\n\nfunction styleConstant(name, value, priority) {\n  return function() {\n    this.style.setProperty(name, value, priority);\n  };\n}\n\nfunction styleFunction(name, value, priority) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) this.style.removeProperty(name);\n    else this.style.setProperty(name, v, priority);\n  };\n}\n\nexport default function(name, value, priority) {\n  return arguments.length > 1\n      ? this.each((value == null\n            ? styleRemove : typeof value === \"function\"\n            ? styleFunction\n            : styleConstant)(name, value, priority == null ? \"\" : priority))\n      : styleValue(this.node(), name);\n}\n\nexport function styleValue(node, name) {\n  return node.style.getPropertyValue(name)\n      || defaultView(node).getComputedStyle(node, null).getPropertyValue(name);\n}\n", "function propertyRemove(name) {\n  return function() {\n    delete this[name];\n  };\n}\n\nfunction propertyConstant(name, value) {\n  return function() {\n    this[name] = value;\n  };\n}\n\nfunction propertyFunction(name, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (v == null) delete this[name];\n    else this[name] = v;\n  };\n}\n\nexport default function(name, value) {\n  return arguments.length > 1\n      ? this.each((value == null\n          ? propertyRemove : typeof value === \"function\"\n          ? propertyFunction\n          : propertyConstant)(name, value))\n      : this.node()[name];\n}\n", "function classArray(string) {\n  return string.trim().split(/^|\\s+/);\n}\n\nfunction classList(node) {\n  return node.classList || new ClassList(node);\n}\n\nfunction ClassList(node) {\n  this._node = node;\n  this._names = classArray(node.getAttribute(\"class\") || \"\");\n}\n\nClassList.prototype = {\n  add: function(name) {\n    var i = this._names.indexOf(name);\n    if (i < 0) {\n      this._names.push(name);\n      this._node.setAttribute(\"class\", this._names.join(\" \"));\n    }\n  },\n  remove: function(name) {\n    var i = this._names.indexOf(name);\n    if (i >= 0) {\n      this._names.splice(i, 1);\n      this._node.setAttribute(\"class\", this._names.join(\" \"));\n    }\n  },\n  contains: function(name) {\n    return this._names.indexOf(name) >= 0;\n  }\n};\n\nfunction classedAdd(node, names) {\n  var list = classList(node), i = -1, n = names.length;\n  while (++i < n) list.add(names[i]);\n}\n\nfunction classedRemove(node, names) {\n  var list = classList(node), i = -1, n = names.length;\n  while (++i < n) list.remove(names[i]);\n}\n\nfunction classedTrue(names) {\n  return function() {\n    classedAdd(this, names);\n  };\n}\n\nfunction classedFalse(names) {\n  return function() {\n    classedRemove(this, names);\n  };\n}\n\nfunction classedFunction(names, value) {\n  return function() {\n    (value.apply(this, arguments) ? classedAdd : classedRemove)(this, names);\n  };\n}\n\nexport default function(name, value) {\n  var names = classArray(name + \"\");\n\n  if (arguments.length < 2) {\n    var list = classList(this.node()), i = -1, n = names.length;\n    while (++i < n) if (!list.contains(names[i])) return false;\n    return true;\n  }\n\n  return this.each((typeof value === \"function\"\n      ? classedFunction : value\n      ? classedTrue\n      : classedFalse)(names, value));\n}\n", "function textRemove() {\n  this.textContent = \"\";\n}\n\nfunction textConstant(value) {\n  return function() {\n    this.textContent = value;\n  };\n}\n\nfunction textFunction(value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    this.textContent = v == null ? \"\" : v;\n  };\n}\n\nexport default function(value) {\n  return arguments.length\n      ? this.each(value == null\n          ? textRemove : (typeof value === \"function\"\n          ? textFunction\n          : textConstant)(value))\n      : this.node().textContent;\n}\n", "function htmlRemove() {\n  this.innerHTML = \"\";\n}\n\nfunction htmlConstant(value) {\n  return function() {\n    this.innerHTML = value;\n  };\n}\n\nfunction htmlFunction(value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    this.innerHTML = v == null ? \"\" : v;\n  };\n}\n\nexport default function(value) {\n  return arguments.length\n      ? this.each(value == null\n          ? htmlRemove : (typeof value === \"function\"\n          ? htmlFunction\n          : htmlConstant)(value))\n      : this.node().innerHTML;\n}\n", "function raise() {\n  if (this.nextSibling) this.parentNode.appendChild(this);\n}\n\nexport default function() {\n  return this.each(raise);\n}\n", "function lower() {\n  if (this.previousSibling) this.parentNode.insertBefore(this, this.parentNode.firstChild);\n}\n\nexport default function() {\n  return this.each(lower);\n}\n", "import creator from \"../creator.js\";\n\nexport default function(name) {\n  var create = typeof name === \"function\" ? name : creator(name);\n  return this.select(function() {\n    return this.appendChild(create.apply(this, arguments));\n  });\n}\n", "import creator from \"../creator.js\";\nimport selector from \"../selector.js\";\n\nfunction constantNull() {\n  return null;\n}\n\nexport default function(name, before) {\n  var create = typeof name === \"function\" ? name : creator(name),\n      select = before == null ? constantNull : typeof before === \"function\" ? before : selector(before);\n  return this.select(function() {\n    return this.insertBefore(create.apply(this, arguments), select.apply(this, arguments) || null);\n  });\n}\n", "function remove() {\n  var parent = this.parentNode;\n  if (parent) parent.removeChild(this);\n}\n\nexport default function() {\n  return this.each(remove);\n}\n", "function selection_cloneShallow() {\n  var clone = this.cloneNode(false), parent = this.parentNode;\n  return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nfunction selection_cloneDeep() {\n  var clone = this.cloneNode(true), parent = this.parentNode;\n  return parent ? parent.insertBefore(clone, this.nextSibling) : clone;\n}\n\nexport default function(deep) {\n  return this.select(deep ? selection_cloneDeep : selection_cloneShallow);\n}\n", "export default function(value) {\n  return arguments.length\n      ? this.property(\"__data__\", value)\n      : this.node().__data__;\n}\n", "function contextListener(listener) {\n  return function(event) {\n    listener.call(this, event, this.__data__);\n  };\n}\n\nfunction parseTypenames(typenames) {\n  return typenames.trim().split(/^|\\s+/).map(function(t) {\n    var name = \"\", i = t.indexOf(\".\");\n    if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n    return {type: t, name: name};\n  });\n}\n\nfunction onRemove(typename) {\n  return function() {\n    var on = this.__on;\n    if (!on) return;\n    for (var j = 0, i = -1, m = on.length, o; j < m; ++j) {\n      if (o = on[j], (!typename.type || o.type === typename.type) && o.name === typename.name) {\n        this.removeEventListener(o.type, o.listener, o.options);\n      } else {\n        on[++i] = o;\n      }\n    }\n    if (++i) on.length = i;\n    else delete this.__on;\n  };\n}\n\nfunction onAdd(typename, value, options) {\n  return function() {\n    var on = this.__on, o, listener = contextListener(value);\n    if (on) for (var j = 0, m = on.length; j < m; ++j) {\n      if ((o = on[j]).type === typename.type && o.name === typename.name) {\n        this.removeEventListener(o.type, o.listener, o.options);\n        this.addEventListener(o.type, o.listener = listener, o.options = options);\n        o.value = value;\n        return;\n      }\n    }\n    this.addEventListener(typename.type, listener, options);\n    o = {type: typename.type, name: typename.name, value: value, listener: listener, options: options};\n    if (!on) this.__on = [o];\n    else on.push(o);\n  };\n}\n\nexport default function(typename, value, options) {\n  var typenames = parseTypenames(typename + \"\"), i, n = typenames.length, t;\n\n  if (arguments.length < 2) {\n    var on = this.node().__on;\n    if (on) for (var j = 0, m = on.length, o; j < m; ++j) {\n      for (i = 0, o = on[j]; i < n; ++i) {\n        if ((t = typenames[i]).type === o.type && t.name === o.name) {\n          return o.value;\n        }\n      }\n    }\n    return;\n  }\n\n  on = value ? onAdd : onRemove;\n  for (i = 0; i < n; ++i) this.each(on(typenames[i], value, options));\n  return this;\n}\n", "import defaultView from \"../window.js\";\n\nfunction dispatchEvent(node, type, params) {\n  var window = defaultView(node),\n      event = window.CustomEvent;\n\n  if (typeof event === \"function\") {\n    event = new event(type, params);\n  } else {\n    event = window.document.createEvent(\"Event\");\n    if (params) event.initEvent(type, params.bubbles, params.cancelable), event.detail = params.detail;\n    else event.initEvent(type, false, false);\n  }\n\n  node.dispatchEvent(event);\n}\n\nfunction dispatchConstant(type, params) {\n  return function() {\n    return dispatchEvent(this, type, params);\n  };\n}\n\nfunction dispatchFunction(type, params) {\n  return function() {\n    return dispatchEvent(this, type, params.apply(this, arguments));\n  };\n}\n\nexport default function(type, params) {\n  return this.each((typeof params === \"function\"\n      ? dispatchFunction\n      : dispatchConstant)(type, params));\n}\n", "export default function*() {\n  for (var groups = this._groups, j = 0, m = groups.length; j < m; ++j) {\n    for (var group = groups[j], i = 0, n = group.length, node; i < n; ++i) {\n      if (node = group[i]) yield node;\n    }\n  }\n}\n", "import selection_select from \"./select.js\";\nimport selection_selectAll from \"./selectAll.js\";\nimport selection_selectChild from \"./selectChild.js\";\nimport selection_selectChildren from \"./selectChildren.js\";\nimport selection_filter from \"./filter.js\";\nimport selection_data from \"./data.js\";\nimport selection_enter from \"./enter.js\";\nimport selection_exit from \"./exit.js\";\nimport selection_join from \"./join.js\";\nimport selection_merge from \"./merge.js\";\nimport selection_order from \"./order.js\";\nimport selection_sort from \"./sort.js\";\nimport selection_call from \"./call.js\";\nimport selection_nodes from \"./nodes.js\";\nimport selection_node from \"./node.js\";\nimport selection_size from \"./size.js\";\nimport selection_empty from \"./empty.js\";\nimport selection_each from \"./each.js\";\nimport selection_attr from \"./attr.js\";\nimport selection_style from \"./style.js\";\nimport selection_property from \"./property.js\";\nimport selection_classed from \"./classed.js\";\nimport selection_text from \"./text.js\";\nimport selection_html from \"./html.js\";\nimport selection_raise from \"./raise.js\";\nimport selection_lower from \"./lower.js\";\nimport selection_append from \"./append.js\";\nimport selection_insert from \"./insert.js\";\nimport selection_remove from \"./remove.js\";\nimport selection_clone from \"./clone.js\";\nimport selection_datum from \"./datum.js\";\nimport selection_on from \"./on.js\";\nimport selection_dispatch from \"./dispatch.js\";\nimport selection_iterator from \"./iterator.js\";\n\nexport var root = [null];\n\nexport function Selection(groups, parents) {\n  this._groups = groups;\n  this._parents = parents;\n}\n\nfunction selection() {\n  return new Selection([[document.documentElement]], root);\n}\n\nfunction selection_selection() {\n  return this;\n}\n\nSelection.prototype = selection.prototype = {\n  constructor: Selection,\n  select: selection_select,\n  selectAll: selection_selectAll,\n  selectChild: selection_selectChild,\n  selectChildren: selection_selectChildren,\n  filter: selection_filter,\n  data: selection_data,\n  enter: selection_enter,\n  exit: selection_exit,\n  join: selection_join,\n  merge: selection_merge,\n  selection: selection_selection,\n  order: selection_order,\n  sort: selection_sort,\n  call: selection_call,\n  nodes: selection_nodes,\n  node: selection_node,\n  size: selection_size,\n  empty: selection_empty,\n  each: selection_each,\n  attr: selection_attr,\n  style: selection_style,\n  property: selection_property,\n  classed: selection_classed,\n  text: selection_text,\n  html: selection_html,\n  raise: selection_raise,\n  lower: selection_lower,\n  append: selection_append,\n  insert: selection_insert,\n  remove: selection_remove,\n  clone: selection_clone,\n  datum: selection_datum,\n  on: selection_on,\n  dispatch: selection_dispatch,\n  [Symbol.iterator]: selection_iterator\n};\n\nexport default selection;\n", "export default function(constructor, factory, prototype) {\n  constructor.prototype = factory.prototype = prototype;\n  prototype.constructor = constructor;\n}\n\nexport function extend(parent, definition) {\n  var prototype = Object.create(parent.prototype);\n  for (var key in definition) prototype[key] = definition[key];\n  return prototype;\n}\n", "import define, {extend} from \"./define.js\";\n\nexport function Color() {}\n\nexport var darker = 0.7;\nexport var brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n    reN = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n    reP = \"\\\\s*([+-]?(?:\\\\d*\\\\.)?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n    reHex = /^#([0-9a-f]{3,8})$/,\n    reRgbInteger = new RegExp(`^rgb\\\\(${reI},${reI},${reI}\\\\)$`),\n    reRgbPercent = new RegExp(`^rgb\\\\(${reP},${reP},${reP}\\\\)$`),\n    reRgbaInteger = new RegExp(`^rgba\\\\(${reI},${reI},${reI},${reN}\\\\)$`),\n    reRgbaPercent = new RegExp(`^rgba\\\\(${reP},${reP},${reP},${reN}\\\\)$`),\n    reHslPercent = new RegExp(`^hsl\\\\(${reN},${reP},${reP}\\\\)$`),\n    reHslaPercent = new RegExp(`^hsla\\\\(${reN},${reP},${reP},${reN}\\\\)$`);\n\nvar named = {\n  aliceblue: 0xf0f8ff,\n  antiquewhite: 0xfaebd7,\n  aqua: 0x00ffff,\n  aquamarine: 0x7fffd4,\n  azure: 0xf0ffff,\n  beige: 0xf5f5dc,\n  bisque: 0xffe4c4,\n  black: 0x000000,\n  blanchedalmond: 0xffebcd,\n  blue: 0x0000ff,\n  blueviolet: 0x8a2be2,\n  brown: 0xa52a2a,\n  burlywood: 0xdeb887,\n  cadetblue: 0x5f9ea0,\n  chartreuse: 0x7fff00,\n  chocolate: 0xd2691e,\n  coral: 0xff7f50,\n  cornflowerblue: 0x6495ed,\n  cornsilk: 0xfff8dc,\n  crimson: 0xdc143c,\n  cyan: 0x00ffff,\n  darkblue: 0x00008b,\n  darkcyan: 0x008b8b,\n  darkgoldenrod: 0xb8860b,\n  darkgray: 0xa9a9a9,\n  darkgreen: 0x006400,\n  darkgrey: 0xa9a9a9,\n  darkkhaki: 0xbdb76b,\n  darkmagenta: 0x8b008b,\n  darkolivegreen: 0x556b2f,\n  darkorange: 0xff8c00,\n  darkorchid: 0x9932cc,\n  darkred: 0x8b0000,\n  darksalmon: 0xe9967a,\n  darkseagreen: 0x8fbc8f,\n  darkslateblue: 0x483d8b,\n  darkslategray: 0x2f4f4f,\n  darkslategrey: 0x2f4f4f,\n  darkturquoise: 0x00ced1,\n  darkviolet: 0x9400d3,\n  deeppink: 0xff1493,\n  deepskyblue: 0x00bfff,\n  dimgray: 0x696969,\n  dimgrey: 0x696969,\n  dodgerblue: 0x1e90ff,\n  firebrick: 0xb22222,\n  floralwhite: 0xfffaf0,\n  forestgreen: 0x228b22,\n  fuchsia: 0xff00ff,\n  gainsboro: 0xdcdcdc,\n  ghostwhite: 0xf8f8ff,\n  gold: 0xffd700,\n  goldenrod: 0xdaa520,\n  gray: 0x808080,\n  green: 0x008000,\n  greenyellow: 0xadff2f,\n  grey: 0x808080,\n  honeydew: 0xf0fff0,\n  hotpink: 0xff69b4,\n  indianred: 0xcd5c5c,\n  indigo: 0x4b0082,\n  ivory: 0xfffff0,\n  khaki: 0xf0e68c,\n  lavender: 0xe6e6fa,\n  lavenderblush: 0xfff0f5,\n  lawngreen: 0x7cfc00,\n  lemonchiffon: 0xfffacd,\n  lightblue: 0xadd8e6,\n  lightcoral: 0xf08080,\n  lightcyan: 0xe0ffff,\n  lightgoldenrodyellow: 0xfafad2,\n  lightgray: 0xd3d3d3,\n  lightgreen: 0x90ee90,\n  lightgrey: 0xd3d3d3,\n  lightpink: 0xffb6c1,\n  lightsalmon: 0xffa07a,\n  lightseagreen: 0x20b2aa,\n  lightskyblue: 0x87cefa,\n  lightslategray: 0x778899,\n  lightslategrey: 0x778899,\n  lightsteelblue: 0xb0c4de,\n  lightyellow: 0xffffe0,\n  lime: 0x00ff00,\n  limegreen: 0x32cd32,\n  linen: 0xfaf0e6,\n  magenta: 0xff00ff,\n  maroon: 0x800000,\n  mediumaquamarine: 0x66cdaa,\n  mediumblue: 0x0000cd,\n  mediumorchid: 0xba55d3,\n  mediumpurple: 0x9370db,\n  mediumseagreen: 0x3cb371,\n  mediumslateblue: 0x7b68ee,\n  mediumspringgreen: 0x00fa9a,\n  mediumturquoise: 0x48d1cc,\n  mediumvioletred: 0xc71585,\n  midnightblue: 0x191970,\n  mintcream: 0xf5fffa,\n  mistyrose: 0xffe4e1,\n  moccasin: 0xffe4b5,\n  navajowhite: 0xffdead,\n  navy: 0x000080,\n  oldlace: 0xfdf5e6,\n  olive: 0x808000,\n  olivedrab: 0x6b8e23,\n  orange: 0xffa500,\n  orangered: 0xff4500,\n  orchid: 0xda70d6,\n  palegoldenrod: 0xeee8aa,\n  palegreen: 0x98fb98,\n  paleturquoise: 0xafeeee,\n  palevioletred: 0xdb7093,\n  papayawhip: 0xffefd5,\n  peachpuff: 0xffdab9,\n  peru: 0xcd853f,\n  pink: 0xffc0cb,\n  plum: 0xdda0dd,\n  powderblue: 0xb0e0e6,\n  purple: 0x800080,\n  rebeccapurple: 0x663399,\n  red: 0xff0000,\n  rosybrown: 0xbc8f8f,\n  royalblue: 0x4169e1,\n  saddlebrown: 0x8b4513,\n  salmon: 0xfa8072,\n  sandybrown: 0xf4a460,\n  seagreen: 0x2e8b57,\n  seashell: 0xfff5ee,\n  sienna: 0xa0522d,\n  silver: 0xc0c0c0,\n  skyblue: 0x87ceeb,\n  slateblue: 0x6a5acd,\n  slategray: 0x708090,\n  slategrey: 0x708090,\n  snow: 0xfffafa,\n  springgreen: 0x00ff7f,\n  steelblue: 0x4682b4,\n  tan: 0xd2b48c,\n  teal: 0x008080,\n  thistle: 0xd8bfd8,\n  tomato: 0xff6347,\n  turquoise: 0x40e0d0,\n  violet: 0xee82ee,\n  wheat: 0xf5deb3,\n  white: 0xffffff,\n  whitesmoke: 0xf5f5f5,\n  yellow: 0xffff00,\n  yellowgreen: 0x9acd32\n};\n\ndefine(Color, color, {\n  copy(channels) {\n    return Object.assign(new this.constructor, this, channels);\n  },\n  displayable() {\n    return this.rgb().displayable();\n  },\n  hex: color_formatHex, // Deprecated! Use color.formatHex.\n  formatHex: color_formatHex,\n  formatHex8: color_formatHex8,\n  formatHsl: color_formatHsl,\n  formatRgb: color_formatRgb,\n  toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n  return this.rgb().formatHex();\n}\n\nfunction color_formatHex8() {\n  return this.rgb().formatHex8();\n}\n\nfunction color_formatHsl() {\n  return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n  return this.rgb().formatRgb();\n}\n\nexport default function color(format) {\n  var m, l;\n  format = (format + \"\").trim().toLowerCase();\n  return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n      : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n      : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n      : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n      : null) // invalid hex\n      : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n      : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n      : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n      : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n      : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n      : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n      : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n      : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n      : null;\n}\n\nfunction rgbn(n) {\n  return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n  if (a <= 0) r = g = b = NaN;\n  return new Rgb(r, g, b, a);\n}\n\nexport function rgbConvert(o) {\n  if (!(o instanceof Color)) o = color(o);\n  if (!o) return new Rgb;\n  o = o.rgb();\n  return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nexport function rgb(r, g, b, opacity) {\n  return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nexport function Rgb(r, g, b, opacity) {\n  this.r = +r;\n  this.g = +g;\n  this.b = +b;\n  this.opacity = +opacity;\n}\n\ndefine(Rgb, rgb, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n  },\n  rgb() {\n    return this;\n  },\n  clamp() {\n    return new Rgb(clampi(this.r), clampi(this.g), clampi(this.b), clampa(this.opacity));\n  },\n  displayable() {\n    return (-0.5 <= this.r && this.r < 255.5)\n        && (-0.5 <= this.g && this.g < 255.5)\n        && (-0.5 <= this.b && this.b < 255.5)\n        && (0 <= this.opacity && this.opacity <= 1);\n  },\n  hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n  formatHex: rgb_formatHex,\n  formatHex8: rgb_formatHex8,\n  formatRgb: rgb_formatRgb,\n  toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}`;\n}\n\nfunction rgb_formatHex8() {\n  return `#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity) ? 1 : this.opacity) * 255)}`;\n}\n\nfunction rgb_formatRgb() {\n  const a = clampa(this.opacity);\n  return `${a === 1 ? \"rgb(\" : \"rgba(\"}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${a === 1 ? \")\" : `, ${a})`}`;\n}\n\nfunction clampa(opacity) {\n  return isNaN(opacity) ? 1 : Math.max(0, Math.min(1, opacity));\n}\n\nfunction clampi(value) {\n  return Math.max(0, Math.min(255, Math.round(value) || 0));\n}\n\nfunction hex(value) {\n  value = clampi(value);\n  return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n  if (a <= 0) h = s = l = NaN;\n  else if (l <= 0 || l >= 1) h = s = NaN;\n  else if (s <= 0) h = NaN;\n  return new Hsl(h, s, l, a);\n}\n\nexport function hslConvert(o) {\n  if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n  if (!(o instanceof Color)) o = color(o);\n  if (!o) return new Hsl;\n  if (o instanceof Hsl) return o;\n  o = o.rgb();\n  var r = o.r / 255,\n      g = o.g / 255,\n      b = o.b / 255,\n      min = Math.min(r, g, b),\n      max = Math.max(r, g, b),\n      h = NaN,\n      s = max - min,\n      l = (max + min) / 2;\n  if (s) {\n    if (r === max) h = (g - b) / s + (g < b) * 6;\n    else if (g === max) h = (b - r) / s + 2;\n    else h = (r - g) / s + 4;\n    s /= l < 0.5 ? max + min : 2 - max - min;\n    h *= 60;\n  } else {\n    s = l > 0 && l < 1 ? 0 : h;\n  }\n  return new Hsl(h, s, l, o.opacity);\n}\n\nexport function hsl(h, s, l, opacity) {\n  return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n  this.h = +h;\n  this.s = +s;\n  this.l = +l;\n  this.opacity = +opacity;\n}\n\ndefine(Hsl, hsl, extend(Color, {\n  brighter(k) {\n    k = k == null ? brighter : Math.pow(brighter, k);\n    return new Hsl(this.h, this.s, this.l * k, this.opacity);\n  },\n  darker(k) {\n    k = k == null ? darker : Math.pow(darker, k);\n    return new Hsl(this.h, this.s, this.l * k, this.opacity);\n  },\n  rgb() {\n    var h = this.h % 360 + (this.h < 0) * 360,\n        s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n        l = this.l,\n        m2 = l + (l < 0.5 ? l : 1 - l) * s,\n        m1 = 2 * l - m2;\n    return new Rgb(\n      hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n      hsl2rgb(h, m1, m2),\n      hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n      this.opacity\n    );\n  },\n  clamp() {\n    return new Hsl(clamph(this.h), clampt(this.s), clampt(this.l), clampa(this.opacity));\n  },\n  displayable() {\n    return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n        && (0 <= this.l && this.l <= 1)\n        && (0 <= this.opacity && this.opacity <= 1);\n  },\n  formatHsl() {\n    const a = clampa(this.opacity);\n    return `${a === 1 ? \"hsl(\" : \"hsla(\"}${clamph(this.h)}, ${clampt(this.s) * 100}%, ${clampt(this.l) * 100}%${a === 1 ? \")\" : `, ${a})`}`;\n  }\n}));\n\nfunction clamph(value) {\n  value = (value || 0) % 360;\n  return value < 0 ? value + 360 : value;\n}\n\nfunction clampt(value) {\n  return Math.max(0, Math.min(1, value || 0));\n}\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n  return (h < 60 ? m1 + (m2 - m1) * h / 60\n      : h < 180 ? m2\n      : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n      : m1) * 255;\n}\n", "export function basis(t1, v0, v1, v2, v3) {\n  var t2 = t1 * t1, t3 = t2 * t1;\n  return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n      + (4 - 6 * t2 + 3 * t3) * v1\n      + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n      + t3 * v3) / 6;\n}\n\nexport default function(values) {\n  var n = values.length - 1;\n  return function(t) {\n    var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n        v1 = values[i],\n        v2 = values[i + 1],\n        v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n        v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n    return basis((t - i / n) * n, v0, v1, v2, v3);\n  };\n}\n", "import {basis} from \"./basis.js\";\n\nexport default function(values) {\n  var n = values.length;\n  return function(t) {\n    var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n        v0 = values[(i + n - 1) % n],\n        v1 = values[i % n],\n        v2 = values[(i + 1) % n],\n        v3 = values[(i + 2) % n];\n    return basis((t - i / n) * n, v0, v1, v2, v3);\n  };\n}\n", "export default x => () => x;\n", "import constant from \"./constant.js\";\n\nfunction linear(a, d) {\n  return function(t) {\n    return a + t * d;\n  };\n}\n\nfunction exponential(a, b, y) {\n  return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n    return Math.pow(a + t * b, y);\n  };\n}\n\nexport function hue(a, b) {\n  var d = b - a;\n  return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);\n}\n\nexport function gamma(y) {\n  return (y = +y) === 1 ? nogamma : function(a, b) {\n    return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);\n  };\n}\n\nexport default function nogamma(a, b) {\n  var d = b - a;\n  return d ? linear(a, d) : constant(isNaN(a) ? b : a);\n}\n", "import {rgb as colorRgb} from \"d3-color\";\nimport basis from \"./basis.js\";\nimport basisClosed from \"./basisClosed.js\";\nimport nogamma, {gamma} from \"./color.js\";\n\nexport default (function rgbGamma(y) {\n  var color = gamma(y);\n\n  function rgb(start, end) {\n    var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),\n        g = color(start.g, end.g),\n        b = color(start.b, end.b),\n        opacity = nogamma(start.opacity, end.opacity);\n    return function(t) {\n      start.r = r(t);\n      start.g = g(t);\n      start.b = b(t);\n      start.opacity = opacity(t);\n      return start + \"\";\n    };\n  }\n\n  rgb.gamma = rgbGamma;\n\n  return rgb;\n})(1);\n\nfunction rgbSpline(spline) {\n  return function(colors) {\n    var n = colors.length,\n        r = new Array(n),\n        g = new Array(n),\n        b = new Array(n),\n        i, color;\n    for (i = 0; i < n; ++i) {\n      color = colorRgb(colors[i]);\n      r[i] = color.r || 0;\n      g[i] = color.g || 0;\n      b[i] = color.b || 0;\n    }\n    r = spline(r);\n    g = spline(g);\n    b = spline(b);\n    color.opacity = 1;\n    return function(t) {\n      color.r = r(t);\n      color.g = g(t);\n      color.b = b(t);\n      return color + \"\";\n    };\n  };\n}\n\nexport var rgbBasis = rgbSpline(basis);\nexport var rgbBasisClosed = rgbSpline(basisClosed);\n", "export default function(a, b) {\n  if (!b) b = [];\n  var n = a ? Math.min(b.length, a.length) : 0,\n      c = b.slice(),\n      i;\n  return function(t) {\n    for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n    return c;\n  };\n}\n\nexport function isNumberArray(x) {\n  return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n", "import value from \"./value.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n  return (isNumberArray(b) ? numberArray : genericArray)(a, b);\n}\n\nexport function genericArray(a, b) {\n  var nb = b ? b.length : 0,\n      na = a ? Math.min(nb, a.length) : 0,\n      x = new Array(na),\n      c = new Array(nb),\n      i;\n\n  for (i = 0; i < na; ++i) x[i] = value(a[i], b[i]);\n  for (; i < nb; ++i) c[i] = b[i];\n\n  return function(t) {\n    for (i = 0; i < na; ++i) c[i] = x[i](t);\n    return c;\n  };\n}\n", "export default function(a, b) {\n  var d = new Date;\n  return a = +a, b = +b, function(t) {\n    return d.setTime(a * (1 - t) + b * t), d;\n  };\n}\n", "export default function(a, b) {\n  return a = +a, b = +b, function(t) {\n    return a * (1 - t) + b * t;\n  };\n}\n", "import value from \"./value.js\";\n\nexport default function(a, b) {\n  var i = {},\n      c = {},\n      k;\n\n  if (a === null || typeof a !== \"object\") a = {};\n  if (b === null || typeof b !== \"object\") b = {};\n\n  for (k in b) {\n    if (k in a) {\n      i[k] = value(a[k], b[k]);\n    } else {\n      c[k] = b[k];\n    }\n  }\n\n  return function(t) {\n    for (k in i) c[k] = i[k](t);\n    return c;\n  };\n}\n", "import number from \"./number.js\";\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n    reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n  return function() {\n    return b;\n  };\n}\n\nfunction one(b) {\n  return function(t) {\n    return b(t) + \"\";\n  };\n}\n\nexport default function(a, b) {\n  var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n      am, // current match in a\n      bm, // current match in b\n      bs, // string preceding current number in b, if any\n      i = -1, // index in s\n      s = [], // string constants and placeholders\n      q = []; // number interpolators\n\n  // Coerce inputs to strings.\n  a = a + \"\", b = b + \"\";\n\n  // Interpolate pairs of numbers in a & b.\n  while ((am = reA.exec(a))\n      && (bm = reB.exec(b))) {\n    if ((bs = bm.index) > bi) { // a string precedes the next number in b\n      bs = b.slice(bi, bs);\n      if (s[i]) s[i] += bs; // coalesce with previous string\n      else s[++i] = bs;\n    }\n    if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n      if (s[i]) s[i] += bm; // coalesce with previous string\n      else s[++i] = bm;\n    } else { // interpolate non-matching numbers\n      s[++i] = null;\n      q.push({i: i, x: number(am, bm)});\n    }\n    bi = reB.lastIndex;\n  }\n\n  // Add remains of b.\n  if (bi < b.length) {\n    bs = b.slice(bi);\n    if (s[i]) s[i] += bs; // coalesce with previous string\n    else s[++i] = bs;\n  }\n\n  // Special optimization for only a single match.\n  // Otherwise, interpolate each of the numbers and rejoin the string.\n  return s.length < 2 ? (q[0]\n      ? one(q[0].x)\n      : zero(b))\n      : (b = q.length, function(t) {\n          for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n          return s.join(\"\");\n        });\n}\n", "import {color} from \"d3-color\";\nimport rgb from \"./rgb.js\";\nimport {genericArray} from \"./array.js\";\nimport date from \"./date.js\";\nimport number from \"./number.js\";\nimport object from \"./object.js\";\nimport string from \"./string.js\";\nimport constant from \"./constant.js\";\nimport numberArray, {isNumberArray} from \"./numberArray.js\";\n\nexport default function(a, b) {\n  var t = typeof b, c;\n  return b == null || t === \"boolean\" ? constant(b)\n      : (t === \"number\" ? number\n      : t === \"string\" ? ((c = color(b)) ? (b = c, rgb) : string)\n      : b instanceof color ? rgb\n      : b instanceof Date ? date\n      : isNumberArray(b) ? numberArray\n      : Array.isArray(b) ? genericArray\n      : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? object\n      : number)(a, b);\n}\n", "export default function(a, b) {\n  return a = +a, b = +b, function(t) {\n    return Math.round(a * (1 - t) + b * t);\n  };\n}\n", "var degrees = 180 / Math.PI;\n\nexport var identity = {\n  translateX: 0,\n  translateY: 0,\n  rotate: 0,\n  skewX: 0,\n  scaleX: 1,\n  scaleY: 1\n};\n\nexport default function(a, b, c, d, e, f) {\n  var scaleX, scaleY, skewX;\n  if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n  if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n  if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n  if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n  return {\n    translateX: e,\n    translateY: f,\n    rotate: Math.atan2(b, a) * degrees,\n    skewX: Math.atan(skewX) * degrees,\n    scaleX: scaleX,\n    scaleY: scaleY\n  };\n}\n", "import decompose, {identity} from \"./decompose.js\";\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nexport function parseCss(value) {\n  const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n  return m.isIdentity ? identity : decompose(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nexport function parseSvg(value) {\n  if (value == null) return identity;\n  if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n  svgNode.setAttribute(\"transform\", value);\n  if (!(value = svgNode.transform.baseVal.consolidate())) return identity;\n  value = value.matrix;\n  return decompose(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n", "import number from \"../number.js\";\nimport {parseCss, parseSvg} from \"./parse.js\";\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n  function pop(s) {\n    return s.length ? s.pop() + \" \" : \"\";\n  }\n\n  function translate(xa, ya, xb, yb, s, q) {\n    if (xa !== xb || ya !== yb) {\n      var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n      q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n    } else if (xb || yb) {\n      s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n    }\n  }\n\n  function rotate(a, b, s, q) {\n    if (a !== b) {\n      if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n      q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: number(a, b)});\n    } else if (b) {\n      s.push(pop(s) + \"rotate(\" + b + degParen);\n    }\n  }\n\n  function skewX(a, b, s, q) {\n    if (a !== b) {\n      q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: number(a, b)});\n    } else if (b) {\n      s.push(pop(s) + \"skewX(\" + b + degParen);\n    }\n  }\n\n  function scale(xa, ya, xb, yb, s, q) {\n    if (xa !== xb || ya !== yb) {\n      var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n      q.push({i: i - 4, x: number(xa, xb)}, {i: i - 2, x: number(ya, yb)});\n    } else if (xb !== 1 || yb !== 1) {\n      s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n    }\n  }\n\n  return function(a, b) {\n    var s = [], // string constants and placeholders\n        q = []; // number interpolators\n    a = parse(a), b = parse(b);\n    translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n    rotate(a.rotate, b.rotate, s, q);\n    skewX(a.skewX, b.skewX, s, q);\n    scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n    a = b = null; // gc\n    return function(t) {\n      var i = -1, n = q.length, o;\n      while (++i < n) s[(o = q[i]).i] = o.x(t);\n      return s.join(\"\");\n    };\n  };\n}\n\nexport var interpolateTransformCss = interpolateTransform(parseCss, \"px, \", \"px)\", \"deg)\");\nexport var interpolateTransformSvg = interpolateTransform(parseSvg, \", \", \")\", \")\");\n", "var frame = 0, // is an animation frame pending?\n    timeout = 0, // is a timeout pending?\n    interval = 0, // are any timers active?\n    pokeDelay = 1000, // how frequently we check for clock skew\n    taskHead,\n    taskTail,\n    clockLast = 0,\n    clockNow = 0,\n    clockSkew = 0,\n    clock = typeof performance === \"object\" && performance.now ? performance : Date,\n    setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nexport function now() {\n  return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n  clockNow = 0;\n}\n\nexport function Timer() {\n  this._call =\n  this._time =\n  this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n  constructor: Timer,\n  restart: function(callback, delay, time) {\n    if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n    time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n    if (!this._next && taskTail !== this) {\n      if (taskTail) taskTail._next = this;\n      else taskHead = this;\n      taskTail = this;\n    }\n    this._call = callback;\n    this._time = time;\n    sleep();\n  },\n  stop: function() {\n    if (this._call) {\n      this._call = null;\n      this._time = Infinity;\n      sleep();\n    }\n  }\n};\n\nexport function timer(callback, delay, time) {\n  var t = new Timer;\n  t.restart(callback, delay, time);\n  return t;\n}\n\nexport function timerFlush() {\n  now(); // Get the current time, if not already set.\n  ++frame; // Pretend we\u2019ve set an alarm, if we haven\u2019t already.\n  var t = taskHead, e;\n  while (t) {\n    if ((e = clockNow - t._time) >= 0) t._call.call(undefined, e);\n    t = t._next;\n  }\n  --frame;\n}\n\nfunction wake() {\n  clockNow = (clockLast = clock.now()) + clockSkew;\n  frame = timeout = 0;\n  try {\n    timerFlush();\n  } finally {\n    frame = 0;\n    nap();\n    clockNow = 0;\n  }\n}\n\nfunction poke() {\n  var now = clock.now(), delay = now - clockLast;\n  if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n  var t0, t1 = taskHead, t2, time = Infinity;\n  while (t1) {\n    if (t1._call) {\n      if (time > t1._time) time = t1._time;\n      t0 = t1, t1 = t1._next;\n    } else {\n      t2 = t1._next, t1._next = null;\n      t1 = t0 ? t0._next = t2 : taskHead = t2;\n    }\n  }\n  taskTail = t0;\n  sleep(time);\n}\n\nfunction sleep(time) {\n  if (frame) return; // Soonest alarm already set, or will be.\n  if (timeout) timeout = clearTimeout(timeout);\n  var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n  if (delay > 24) {\n    if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n    if (interval) interval = clearInterval(interval);\n  } else {\n    if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n    frame = 1, setFrame(wake);\n  }\n}\n", "import {Timer} from \"./timer.js\";\n\nexport default function(callback, delay, time) {\n  var t = new Timer;\n  delay = delay == null ? 0 : +delay;\n  t.restart(elapsed => {\n    t.stop();\n    callback(elapsed + delay);\n  }, delay, time);\n  return t;\n}\n", "import {dispatch} from \"d3-dispatch\";\nimport {timer, timeout} from \"d3-timer\";\n\nvar emptyOn = dispatch(\"start\", \"end\", \"cancel\", \"interrupt\");\nvar emptyTween = [];\n\nexport var CREATED = 0;\nexport var SCHEDULED = 1;\nexport var STARTING = 2;\nexport var STARTED = 3;\nexport var RUNNING = 4;\nexport var ENDING = 5;\nexport var ENDED = 6;\n\nexport default function(node, name, id, index, group, timing) {\n  var schedules = node.__transition;\n  if (!schedules) node.__transition = {};\n  else if (id in schedules) return;\n  create(node, id, {\n    name: name,\n    index: index, // For context during callback.\n    group: group, // For context during callback.\n    on: emptyOn,\n    tween: emptyTween,\n    time: timing.time,\n    delay: timing.delay,\n    duration: timing.duration,\n    ease: timing.ease,\n    timer: null,\n    state: CREATED\n  });\n}\n\nexport function init(node, id) {\n  var schedule = get(node, id);\n  if (schedule.state > CREATED) throw new Error(\"too late; already scheduled\");\n  return schedule;\n}\n\nexport function set(node, id) {\n  var schedule = get(node, id);\n  if (schedule.state > STARTED) throw new Error(\"too late; already running\");\n  return schedule;\n}\n\nexport function get(node, id) {\n  var schedule = node.__transition;\n  if (!schedule || !(schedule = schedule[id])) throw new Error(\"transition not found\");\n  return schedule;\n}\n\nfunction create(node, id, self) {\n  var schedules = node.__transition,\n      tween;\n\n  // Initialize the self timer when the transition is created.\n  // Note the actual delay is not known until the first callback!\n  schedules[id] = self;\n  self.timer = timer(schedule, 0, self.time);\n\n  function schedule(elapsed) {\n    self.state = SCHEDULED;\n    self.timer.restart(start, self.delay, self.time);\n\n    // If the elapsed delay is less than our first sleep, start immediately.\n    if (self.delay <= elapsed) start(elapsed - self.delay);\n  }\n\n  function start(elapsed) {\n    var i, j, n, o;\n\n    // If the state is not SCHEDULED, then we previously errored on start.\n    if (self.state !== SCHEDULED) return stop();\n\n    for (i in schedules) {\n      o = schedules[i];\n      if (o.name !== self.name) continue;\n\n      // While this element already has a starting transition during this frame,\n      // defer starting an interrupting transition until that transition has a\n      // chance to tick (and possibly end); see d3/d3-transition#54!\n      if (o.state === STARTED) return timeout(start);\n\n      // Interrupt the active transition, if any.\n      if (o.state === RUNNING) {\n        o.state = ENDED;\n        o.timer.stop();\n        o.on.call(\"interrupt\", node, node.__data__, o.index, o.group);\n        delete schedules[i];\n      }\n\n      // Cancel any pre-empted transitions.\n      else if (+i < id) {\n        o.state = ENDED;\n        o.timer.stop();\n        o.on.call(\"cancel\", node, node.__data__, o.index, o.group);\n        delete schedules[i];\n      }\n    }\n\n    // Defer the first tick to end of the current frame; see d3/d3#1576.\n    // Note the transition may be canceled after start and before the first tick!\n    // Note this must be scheduled before the start event; see d3/d3-transition#16!\n    // Assuming this is successful, subsequent callbacks go straight to tick.\n    timeout(function() {\n      if (self.state === STARTED) {\n        self.state = RUNNING;\n        self.timer.restart(tick, self.delay, self.time);\n        tick(elapsed);\n      }\n    });\n\n    // Dispatch the start event.\n    // Note this must be done before the tween are initialized.\n    self.state = STARTING;\n    self.on.call(\"start\", node, node.__data__, self.index, self.group);\n    if (self.state !== STARTING) return; // interrupted\n    self.state = STARTED;\n\n    // Initialize the tween, deleting null tween.\n    tween = new Array(n = self.tween.length);\n    for (i = 0, j = -1; i < n; ++i) {\n      if (o = self.tween[i].value.call(node, node.__data__, self.index, self.group)) {\n        tween[++j] = o;\n      }\n    }\n    tween.length = j + 1;\n  }\n\n  function tick(elapsed) {\n    var t = elapsed < self.duration ? self.ease.call(null, elapsed / self.duration) : (self.timer.restart(stop), self.state = ENDING, 1),\n        i = -1,\n        n = tween.length;\n\n    while (++i < n) {\n      tween[i].call(node, t);\n    }\n\n    // Dispatch the end event.\n    if (self.state === ENDING) {\n      self.on.call(\"end\", node, node.__data__, self.index, self.group);\n      stop();\n    }\n  }\n\n  function stop() {\n    self.state = ENDED;\n    self.timer.stop();\n    delete schedules[id];\n    for (var i in schedules) return; // eslint-disable-line no-unused-vars\n    delete node.__transition;\n  }\n}\n", "import {STARTING, ENDING, ENDED} from \"./transition/schedule.js\";\n\nexport default function(node, name) {\n  var schedules = node.__transition,\n      schedule,\n      active,\n      empty = true,\n      i;\n\n  if (!schedules) return;\n\n  name = name == null ? null : name + \"\";\n\n  for (i in schedules) {\n    if ((schedule = schedules[i]).name !== name) { empty = false; continue; }\n    active = schedule.state > STARTING && schedule.state < ENDING;\n    schedule.state = ENDED;\n    schedule.timer.stop();\n    schedule.on.call(active ? \"interrupt\" : \"cancel\", node, node.__data__, schedule.index, schedule.group);\n    delete schedules[i];\n  }\n\n  if (empty) delete node.__transition;\n}\n", "import interrupt from \"../interrupt.js\";\n\nexport default function(name) {\n  return this.each(function() {\n    interrupt(this, name);\n  });\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction tweenRemove(id, name) {\n  var tween0, tween1;\n  return function() {\n    var schedule = set(this, id),\n        tween = schedule.tween;\n\n    // If this node shared tween with the previous node,\n    // just assign the updated shared tween and we\u2019re done!\n    // Otherwise, copy-on-write.\n    if (tween !== tween0) {\n      tween1 = tween0 = tween;\n      for (var i = 0, n = tween1.length; i < n; ++i) {\n        if (tween1[i].name === name) {\n          tween1 = tween1.slice();\n          tween1.splice(i, 1);\n          break;\n        }\n      }\n    }\n\n    schedule.tween = tween1;\n  };\n}\n\nfunction tweenFunction(id, name, value) {\n  var tween0, tween1;\n  if (typeof value !== \"function\") throw new Error;\n  return function() {\n    var schedule = set(this, id),\n        tween = schedule.tween;\n\n    // If this node shared tween with the previous node,\n    // just assign the updated shared tween and we\u2019re done!\n    // Otherwise, copy-on-write.\n    if (tween !== tween0) {\n      tween1 = (tween0 = tween).slice();\n      for (var t = {name: name, value: value}, i = 0, n = tween1.length; i < n; ++i) {\n        if (tween1[i].name === name) {\n          tween1[i] = t;\n          break;\n        }\n      }\n      if (i === n) tween1.push(t);\n    }\n\n    schedule.tween = tween1;\n  };\n}\n\nexport default function(name, value) {\n  var id = this._id;\n\n  name += \"\";\n\n  if (arguments.length < 2) {\n    var tween = get(this.node(), id).tween;\n    for (var i = 0, n = tween.length, t; i < n; ++i) {\n      if ((t = tween[i]).name === name) {\n        return t.value;\n      }\n    }\n    return null;\n  }\n\n  return this.each((value == null ? tweenRemove : tweenFunction)(id, name, value));\n}\n\nexport function tweenValue(transition, name, value) {\n  var id = transition._id;\n\n  transition.each(function() {\n    var schedule = set(this, id);\n    (schedule.value || (schedule.value = {}))[name] = value.apply(this, arguments);\n  });\n\n  return function(node) {\n    return get(node, id).value[name];\n  };\n}\n", "import {color} from \"d3-color\";\nimport {interpolateNumber, interpolateRgb, interpolateString} from \"d3-interpolate\";\n\nexport default function(a, b) {\n  var c;\n  return (typeof b === \"number\" ? interpolateNumber\n      : b instanceof color ? interpolateRgb\n      : (c = color(b)) ? (b = c, interpolateRgb)\n      : interpolateString)(a, b);\n}\n", "import {interpolateTransformSvg as interpolateTransform} from \"d3-interpolate\";\nimport {namespace} from \"d3-selection\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction attrRemove(name) {\n  return function() {\n    this.removeAttribute(name);\n  };\n}\n\nfunction attrRemoveNS(fullname) {\n  return function() {\n    this.removeAttributeNS(fullname.space, fullname.local);\n  };\n}\n\nfunction attrConstant(name, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = this.getAttribute(name);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction attrConstantNS(fullname, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = this.getAttributeNS(fullname.space, fullname.local);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction attrFunction(name, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0, value1 = value(this), string1;\n    if (value1 == null) return void this.removeAttribute(name);\n    string0 = this.getAttribute(name);\n    string1 = value1 + \"\";\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nfunction attrFunctionNS(fullname, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0, value1 = value(this), string1;\n    if (value1 == null) return void this.removeAttributeNS(fullname.space, fullname.local);\n    string0 = this.getAttributeNS(fullname.space, fullname.local);\n    string1 = value1 + \"\";\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nexport default function(name, value) {\n  var fullname = namespace(name), i = fullname === \"transform\" ? interpolateTransform : interpolate;\n  return this.attrTween(name, typeof value === \"function\"\n      ? (fullname.local ? attrFunctionNS : attrFunction)(fullname, i, tweenValue(this, \"attr.\" + name, value))\n      : value == null ? (fullname.local ? attrRemoveNS : attrRemove)(fullname)\n      : (fullname.local ? attrConstantNS : attrConstant)(fullname, i, value));\n}\n", "import {namespace} from \"d3-selection\";\n\nfunction attrInterpolate(name, i) {\n  return function(t) {\n    this.setAttribute(name, i.call(this, t));\n  };\n}\n\nfunction attrInterpolateNS(fullname, i) {\n  return function(t) {\n    this.setAttributeNS(fullname.space, fullname.local, i.call(this, t));\n  };\n}\n\nfunction attrTweenNS(fullname, value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && attrInterpolateNS(fullname, i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nfunction attrTween(name, value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && attrInterpolate(name, i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(name, value) {\n  var key = \"attr.\" + name;\n  if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  var fullname = namespace(name);\n  return this.tween(key, (fullname.local ? attrTweenNS : attrTween)(fullname, value));\n}\n", "import {get, init} from \"./schedule.js\";\n\nfunction delayFunction(id, value) {\n  return function() {\n    init(this, id).delay = +value.apply(this, arguments);\n  };\n}\n\nfunction delayConstant(id, value) {\n  return value = +value, function() {\n    init(this, id).delay = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each((typeof value === \"function\"\n          ? delayFunction\n          : delayConstant)(id, value))\n      : get(this.node(), id).delay;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction durationFunction(id, value) {\n  return function() {\n    set(this, id).duration = +value.apply(this, arguments);\n  };\n}\n\nfunction durationConstant(id, value) {\n  return value = +value, function() {\n    set(this, id).duration = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each((typeof value === \"function\"\n          ? durationFunction\n          : durationConstant)(id, value))\n      : get(this.node(), id).duration;\n}\n", "import {get, set} from \"./schedule.js\";\n\nfunction easeConstant(id, value) {\n  if (typeof value !== \"function\") throw new Error;\n  return function() {\n    set(this, id).ease = value;\n  };\n}\n\nexport default function(value) {\n  var id = this._id;\n\n  return arguments.length\n      ? this.each(easeConstant(id, value))\n      : get(this.node(), id).ease;\n}\n", "import {set} from \"./schedule.js\";\n\nfunction easeVarying(id, value) {\n  return function() {\n    var v = value.apply(this, arguments);\n    if (typeof v !== \"function\") throw new Error;\n    set(this, id).ease = v;\n  };\n}\n\nexport default function(value) {\n  if (typeof value !== \"function\") throw new Error;\n  return this.each(easeVarying(this._id, value));\n}\n", "import {matcher} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\n\nexport default function(match) {\n  if (typeof match !== \"function\") match = matcher(match);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = [], node, i = 0; i < n; ++i) {\n      if ((node = group[i]) && match.call(node, node.__data__, i, group)) {\n        subgroup.push(node);\n      }\n    }\n  }\n\n  return new Transition(subgroups, this._parents, this._name, this._id);\n}\n", "import {Transition} from \"./index.js\";\n\nexport default function(transition) {\n  if (transition._id !== this._id) throw new Error;\n\n  for (var groups0 = this._groups, groups1 = transition._groups, m0 = groups0.length, m1 = groups1.length, m = Math.min(m0, m1), merges = new Array(m0), j = 0; j < m; ++j) {\n    for (var group0 = groups0[j], group1 = groups1[j], n = group0.length, merge = merges[j] = new Array(n), node, i = 0; i < n; ++i) {\n      if (node = group0[i] || group1[i]) {\n        merge[i] = node;\n      }\n    }\n  }\n\n  for (; j < m0; ++j) {\n    merges[j] = groups0[j];\n  }\n\n  return new Transition(merges, this._parents, this._name, this._id);\n}\n", "import {get, set, init} from \"./schedule.js\";\n\nfunction start(name) {\n  return (name + \"\").trim().split(/^|\\s+/).every(function(t) {\n    var i = t.indexOf(\".\");\n    if (i >= 0) t = t.slice(0, i);\n    return !t || t === \"start\";\n  });\n}\n\nfunction onFunction(id, name, listener) {\n  var on0, on1, sit = start(name) ? init : set;\n  return function() {\n    var schedule = sit(this, id),\n        on = schedule.on;\n\n    // If this node shared a dispatch with the previous node,\n    // just assign the updated shared dispatch and we\u2019re done!\n    // Otherwise, copy-on-write.\n    if (on !== on0) (on1 = (on0 = on).copy()).on(name, listener);\n\n    schedule.on = on1;\n  };\n}\n\nexport default function(name, listener) {\n  var id = this._id;\n\n  return arguments.length < 2\n      ? get(this.node(), id).on.on(name)\n      : this.each(onFunction(id, name, listener));\n}\n", "function removeFunction(id) {\n  return function() {\n    var parent = this.parentNode;\n    for (var i in this.__transition) if (+i !== id) return;\n    if (parent) parent.removeChild(this);\n  };\n}\n\nexport default function() {\n  return this.on(\"end.remove\", removeFunction(this._id));\n}\n", "import {selector} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n  var name = this._name,\n      id = this._id;\n\n  if (typeof select !== \"function\") select = selector(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = new Array(m), j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, subgroup = subgroups[j] = new Array(n), node, subnode, i = 0; i < n; ++i) {\n      if ((node = group[i]) && (subnode = select.call(node, node.__data__, i, group))) {\n        if (\"__data__\" in node) subnode.__data__ = node.__data__;\n        subgroup[i] = subnode;\n        schedule(subgroup[i], name, id, i, subgroup, get(node, id));\n      }\n    }\n  }\n\n  return new Transition(subgroups, this._parents, name, id);\n}\n", "import {selectorAll} from \"d3-selection\";\nimport {Transition} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function(select) {\n  var name = this._name,\n      id = this._id;\n\n  if (typeof select !== \"function\") select = selectorAll(select);\n\n  for (var groups = this._groups, m = groups.length, subgroups = [], parents = [], j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        for (var children = select.call(node, node.__data__, i, group), child, inherit = get(node, id), k = 0, l = children.length; k < l; ++k) {\n          if (child = children[k]) {\n            schedule(child, name, id, k, children, inherit);\n          }\n        }\n        subgroups.push(children);\n        parents.push(node);\n      }\n    }\n  }\n\n  return new Transition(subgroups, parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\n\nvar Selection = selection.prototype.constructor;\n\nexport default function() {\n  return new Selection(this._groups, this._parents);\n}\n", "import {interpolateTransformCss as interpolateTransform} from \"d3-interpolate\";\nimport {style} from \"d3-selection\";\nimport {set} from \"./schedule.js\";\nimport {tweenValue} from \"./tween.js\";\nimport interpolate from \"./interpolate.js\";\n\nfunction styleNull(name, interpolate) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0 = style(this, name),\n        string1 = (this.style.removeProperty(name), style(this, name));\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, string10 = string1);\n  };\n}\n\nfunction styleRemove(name) {\n  return function() {\n    this.style.removeProperty(name);\n  };\n}\n\nfunction styleConstant(name, interpolate, value1) {\n  var string00,\n      string1 = value1 + \"\",\n      interpolate0;\n  return function() {\n    var string0 = style(this, name);\n    return string0 === string1 ? null\n        : string0 === string00 ? interpolate0\n        : interpolate0 = interpolate(string00 = string0, value1);\n  };\n}\n\nfunction styleFunction(name, interpolate, value) {\n  var string00,\n      string10,\n      interpolate0;\n  return function() {\n    var string0 = style(this, name),\n        value1 = value(this),\n        string1 = value1 + \"\";\n    if (value1 == null) string1 = value1 = (this.style.removeProperty(name), style(this, name));\n    return string0 === string1 ? null\n        : string0 === string00 && string1 === string10 ? interpolate0\n        : (string10 = string1, interpolate0 = interpolate(string00 = string0, value1));\n  };\n}\n\nfunction styleMaybeRemove(id, name) {\n  var on0, on1, listener0, key = \"style.\" + name, event = \"end.\" + key, remove;\n  return function() {\n    var schedule = set(this, id),\n        on = schedule.on,\n        listener = schedule.value[key] == null ? remove || (remove = styleRemove(name)) : undefined;\n\n    // If this node shared a dispatch with the previous node,\n    // just assign the updated shared dispatch and we\u2019re done!\n    // Otherwise, copy-on-write.\n    if (on !== on0 || listener0 !== listener) (on1 = (on0 = on).copy()).on(event, listener0 = listener);\n\n    schedule.on = on1;\n  };\n}\n\nexport default function(name, value, priority) {\n  var i = (name += \"\") === \"transform\" ? interpolateTransform : interpolate;\n  return value == null ? this\n      .styleTween(name, styleNull(name, i))\n      .on(\"end.style.\" + name, styleRemove(name))\n    : typeof value === \"function\" ? this\n      .styleTween(name, styleFunction(name, i, tweenValue(this, \"style.\" + name, value)))\n      .each(styleMaybeRemove(this._id, name))\n    : this\n      .styleTween(name, styleConstant(name, i, value), priority)\n      .on(\"end.style.\" + name, null);\n}\n", "function styleInterpolate(name, i, priority) {\n  return function(t) {\n    this.style.setProperty(name, i.call(this, t), priority);\n  };\n}\n\nfunction styleTween(name, value, priority) {\n  var t, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t = (i0 = i) && styleInterpolate(name, i, priority);\n    return t;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(name, value, priority) {\n  var key = \"style.\" + (name += \"\");\n  if (arguments.length < 2) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  return this.tween(key, styleTween(name, value, priority == null ? \"\" : priority));\n}\n", "import {tweenValue} from \"./tween.js\";\n\nfunction textConstant(value) {\n  return function() {\n    this.textContent = value;\n  };\n}\n\nfunction textFunction(value) {\n  return function() {\n    var value1 = value(this);\n    this.textContent = value1 == null ? \"\" : value1;\n  };\n}\n\nexport default function(value) {\n  return this.tween(\"text\", typeof value === \"function\"\n      ? textFunction(tweenValue(this, \"text\", value))\n      : textConstant(value == null ? \"\" : value + \"\"));\n}\n", "function textInterpolate(i) {\n  return function(t) {\n    this.textContent = i.call(this, t);\n  };\n}\n\nfunction textTween(value) {\n  var t0, i0;\n  function tween() {\n    var i = value.apply(this, arguments);\n    if (i !== i0) t0 = (i0 = i) && textInterpolate(i);\n    return t0;\n  }\n  tween._value = value;\n  return tween;\n}\n\nexport default function(value) {\n  var key = \"text\";\n  if (arguments.length < 1) return (key = this.tween(key)) && key._value;\n  if (value == null) return this.tween(key, null);\n  if (typeof value !== \"function\") throw new Error;\n  return this.tween(key, textTween(value));\n}\n", "import {Transition, newId} from \"./index.js\";\nimport schedule, {get} from \"./schedule.js\";\n\nexport default function() {\n  var name = this._name,\n      id0 = this._id,\n      id1 = newId();\n\n  for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        var inherit = get(node, id0);\n        schedule(node, name, id1, i, group, {\n          time: inherit.time + inherit.delay + inherit.duration,\n          delay: 0,\n          duration: inherit.duration,\n          ease: inherit.ease\n        });\n      }\n    }\n  }\n\n  return new Transition(groups, this._parents, name, id1);\n}\n", "import {set} from \"./schedule.js\";\n\nexport default function() {\n  var on0, on1, that = this, id = that._id, size = that.size();\n  return new Promise(function(resolve, reject) {\n    var cancel = {value: reject},\n        end = {value: function() { if (--size === 0) resolve(); }};\n\n    that.each(function() {\n      var schedule = set(this, id),\n          on = schedule.on;\n\n      // If this node shared a dispatch with the previous node,\n      // just assign the updated shared dispatch and we\u2019re done!\n      // Otherwise, copy-on-write.\n      if (on !== on0) {\n        on1 = (on0 = on).copy();\n        on1._.cancel.push(cancel);\n        on1._.interrupt.push(cancel);\n        on1._.end.push(end);\n      }\n\n      schedule.on = on1;\n    });\n\n    // The selection was empty, resolve end immediately\n    if (size === 0) resolve();\n  });\n}\n", "import {selection} from \"d3-selection\";\nimport transition_attr from \"./attr.js\";\nimport transition_attrTween from \"./attrTween.js\";\nimport transition_delay from \"./delay.js\";\nimport transition_duration from \"./duration.js\";\nimport transition_ease from \"./ease.js\";\nimport transition_easeVarying from \"./easeVarying.js\";\nimport transition_filter from \"./filter.js\";\nimport transition_merge from \"./merge.js\";\nimport transition_on from \"./on.js\";\nimport transition_remove from \"./remove.js\";\nimport transition_select from \"./select.js\";\nimport transition_selectAll from \"./selectAll.js\";\nimport transition_selection from \"./selection.js\";\nimport transition_style from \"./style.js\";\nimport transition_styleTween from \"./styleTween.js\";\nimport transition_text from \"./text.js\";\nimport transition_textTween from \"./textTween.js\";\nimport transition_transition from \"./transition.js\";\nimport transition_tween from \"./tween.js\";\nimport transition_end from \"./end.js\";\n\nvar id = 0;\n\nexport function Transition(groups, parents, name, id) {\n  this._groups = groups;\n  this._parents = parents;\n  this._name = name;\n  this._id = id;\n}\n\nexport default function transition(name) {\n  return selection().transition(name);\n}\n\nexport function newId() {\n  return ++id;\n}\n\nvar selection_prototype = selection.prototype;\n\nTransition.prototype = transition.prototype = {\n  constructor: Transition,\n  select: transition_select,\n  selectAll: transition_selectAll,\n  selectChild: selection_prototype.selectChild,\n  selectChildren: selection_prototype.selectChildren,\n  filter: transition_filter,\n  merge: transition_merge,\n  selection: transition_selection,\n  transition: transition_transition,\n  call: selection_prototype.call,\n  nodes: selection_prototype.nodes,\n  node: selection_prototype.node,\n  size: selection_prototype.size,\n  empty: selection_prototype.empty,\n  each: selection_prototype.each,\n  on: transition_on,\n  attr: transition_attr,\n  attrTween: transition_attrTween,\n  style: transition_style,\n  styleTween: transition_styleTween,\n  text: transition_text,\n  textTween: transition_textTween,\n  remove: transition_remove,\n  tween: transition_tween,\n  delay: transition_delay,\n  duration: transition_duration,\n  ease: transition_ease,\n  easeVarying: transition_easeVarying,\n  end: transition_end,\n  [Symbol.iterator]: selection_prototype[Symbol.iterator]\n};\n", "export function cubicIn(t) {\n  return t * t * t;\n}\n\nexport function cubicOut(t) {\n  return --t * t * t + 1;\n}\n\nexport function cubicInOut(t) {\n  return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n", "import {Transition, newId} from \"../transition/index.js\";\nimport schedule from \"../transition/schedule.js\";\nimport {easeCubicInOut} from \"d3-ease\";\nimport {now} from \"d3-timer\";\n\nvar defaultTiming = {\n  time: null, // Set on use.\n  delay: 0,\n  duration: 250,\n  ease: easeCubicInOut\n};\n\nfunction inherit(node, id) {\n  var timing;\n  while (!(timing = node.__transition) || !(timing = timing[id])) {\n    if (!(node = node.parentNode)) {\n      throw new Error(`transition ${id} not found`);\n    }\n  }\n  return timing;\n}\n\nexport default function(name) {\n  var id,\n      timing;\n\n  if (name instanceof Transition) {\n    id = name._id, name = name._name;\n  } else {\n    id = newId(), (timing = defaultTiming).time = now(), name = name == null ? null : name + \"\";\n  }\n\n  for (var groups = this._groups, m = groups.length, j = 0; j < m; ++j) {\n    for (var group = groups[j], n = group.length, node, i = 0; i < n; ++i) {\n      if (node = group[i]) {\n        schedule(node, name, id, i, group, timing || inherit(node, id));\n      }\n    }\n  }\n\n  return new Transition(groups, this._parents, name, id);\n}\n", "import {selection} from \"d3-selection\";\nimport selection_interrupt from \"./interrupt.js\";\nimport selection_transition from \"./transition.js\";\n\nselection.prototype.interrupt = selection_interrupt;\nselection.prototype.transition = selection_transition;\n", "import {dispatch} from \"d3-dispatch\";\nimport {dragDisable, dragEnable} from \"d3-drag\";\nimport {interpolate} from \"d3-interpolate\";\nimport {pointer, select} from \"d3-selection\";\nimport {interrupt} from \"d3-transition\";\nimport constant from \"./constant.js\";\nimport BrushEvent from \"./event.js\";\nimport noevent, {nopropagation} from \"./noevent.js\";\n\nvar MODE_DRAG = {name: \"drag\"},\n    MODE_SPACE = {name: \"space\"},\n    MODE_HANDLE = {name: \"handle\"},\n    MODE_CENTER = {name: \"center\"};\n\nconst {abs, max, min} = Math;\n\nfunction number1(e) {\n  return [+e[0], +e[1]];\n}\n\nfunction number2(e) {\n  return [number1(e[0]), number1(e[1])];\n}\n\nvar X = {\n  name: \"x\",\n  handles: [\"w\", \"e\"].map(type),\n  input: function(x, e) { return x == null ? null : [[+x[0], e[0][1]], [+x[1], e[1][1]]]; },\n  output: function(xy) { return xy && [xy[0][0], xy[1][0]]; }\n};\n\nvar Y = {\n  name: \"y\",\n  handles: [\"n\", \"s\"].map(type),\n  input: function(y, e) { return y == null ? null : [[e[0][0], +y[0]], [e[1][0], +y[1]]]; },\n  output: function(xy) { return xy && [xy[0][1], xy[1][1]]; }\n};\n\nvar XY = {\n  name: \"xy\",\n  handles: [\"n\", \"w\", \"e\", \"s\", \"nw\", \"ne\", \"sw\", \"se\"].map(type),\n  input: function(xy) { return xy == null ? null : number2(xy); },\n  output: function(xy) { return xy; }\n};\n\nvar cursors = {\n  overlay: \"crosshair\",\n  selection: \"move\",\n  n: \"ns-resize\",\n  e: \"ew-resize\",\n  s: \"ns-resize\",\n  w: \"ew-resize\",\n  nw: \"nwse-resize\",\n  ne: \"nesw-resize\",\n  se: \"nwse-resize\",\n  sw: \"nesw-resize\"\n};\n\nvar flipX = {\n  e: \"w\",\n  w: \"e\",\n  nw: \"ne\",\n  ne: \"nw\",\n  se: \"sw\",\n  sw: \"se\"\n};\n\nvar flipY = {\n  n: \"s\",\n  s: \"n\",\n  nw: \"sw\",\n  ne: \"se\",\n  se: \"ne\",\n  sw: \"nw\"\n};\n\nvar signsX = {\n  overlay: +1,\n  selection: +1,\n  n: null,\n  e: +1,\n  s: null,\n  w: -1,\n  nw: -1,\n  ne: +1,\n  se: +1,\n  sw: -1\n};\n\nvar signsY = {\n  overlay: +1,\n  selection: +1,\n  n: -1,\n  e: null,\n  s: +1,\n  w: null,\n  nw: -1,\n  ne: -1,\n  se: +1,\n  sw: +1\n};\n\nfunction type(t) {\n  return {type: t};\n}\n\n// Ignore right-click, since that should open the context menu.\nfunction defaultFilter(event) {\n  return !event.ctrlKey && !event.button;\n}\n\nfunction defaultExtent() {\n  var svg = this.ownerSVGElement || this;\n  if (svg.hasAttribute(\"viewBox\")) {\n    svg = svg.viewBox.baseVal;\n    return [[svg.x, svg.y], [svg.x + svg.width, svg.y + svg.height]];\n  }\n  return [[0, 0], [svg.width.baseVal.value, svg.height.baseVal.value]];\n}\n\nfunction defaultTouchable() {\n  return navigator.maxTouchPoints || (\"ontouchstart\" in this);\n}\n\n// Like d3.local, but with the name \u201C__brush\u201D rather than auto-generated.\nfunction local(node) {\n  while (!node.__brush) if (!(node = node.parentNode)) return;\n  return node.__brush;\n}\n\nfunction empty(extent) {\n  return extent[0][0] === extent[1][0]\n      || extent[0][1] === extent[1][1];\n}\n\nexport function brushSelection(node) {\n  var state = node.__brush;\n  return state ? state.dim.output(state.selection) : null;\n}\n\nexport function brushX() {\n  return brush(X);\n}\n\nexport function brushY() {\n  return brush(Y);\n}\n\nexport default function() {\n  return brush(XY);\n}\n\nfunction brush(dim) {\n  var extent = defaultExtent,\n      filter = defaultFilter,\n      touchable = defaultTouchable,\n      keys = true,\n      listeners = dispatch(\"start\", \"brush\", \"end\"),\n      handleSize = 6,\n      touchending;\n\n  function brush(group) {\n    var overlay = group\n        .property(\"__brush\", initialize)\n      .selectAll(\".overlay\")\n      .data([type(\"overlay\")]);\n\n    overlay.enter().append(\"rect\")\n        .attr(\"class\", \"overlay\")\n        .attr(\"pointer-events\", \"all\")\n        .attr(\"cursor\", cursors.overlay)\n      .merge(overlay)\n        .each(function() {\n          var extent = local(this).extent;\n          select(this)\n              .attr(\"x\", extent[0][0])\n              .attr(\"y\", extent[0][1])\n              .attr(\"width\", extent[1][0] - extent[0][0])\n              .attr(\"height\", extent[1][1] - extent[0][1]);\n        });\n\n    group.selectAll(\".selection\")\n      .data([type(\"selection\")])\n      .enter().append(\"rect\")\n        .attr(\"class\", \"selection\")\n        .attr(\"cursor\", cursors.selection)\n        .attr(\"fill\", \"#777\")\n        .attr(\"fill-opacity\", 0.3)\n        .attr(\"stroke\", \"#fff\")\n        .attr(\"shape-rendering\", \"crispEdges\");\n\n    var handle = group.selectAll(\".handle\")\n      .data(dim.handles, function(d) { return d.type; });\n\n    handle.exit().remove();\n\n    handle.enter().append(\"rect\")\n        .attr(\"class\", function(d) { return \"handle handle--\" + d.type; })\n        .attr(\"cursor\", function(d) { return cursors[d.type]; });\n\n    group\n        .each(redraw)\n        .attr(\"fill\", \"none\")\n        .attr(\"pointer-events\", \"all\")\n        .on(\"mousedown.brush\", started)\n      .filter(touchable)\n        .on(\"touchstart.brush\", started)\n        .on(\"touchmove.brush\", touchmoved)\n        .on(\"touchend.brush touchcancel.brush\", touchended)\n        .style(\"touch-action\", \"none\")\n        .style(\"-webkit-tap-highlight-color\", \"rgba(0,0,0,0)\");\n  }\n\n  brush.move = function(group, selection, event) {\n    if (group.tween) {\n      group\n          .on(\"start.brush\", function(event) { emitter(this, arguments).beforestart().start(event); })\n          .on(\"interrupt.brush end.brush\", function(event) { emitter(this, arguments).end(event); })\n          .tween(\"brush\", function() {\n            var that = this,\n                state = that.__brush,\n                emit = emitter(that, arguments),\n                selection0 = state.selection,\n                selection1 = dim.input(typeof selection === \"function\" ? selection.apply(this, arguments) : selection, state.extent),\n                i = interpolate(selection0, selection1);\n\n            function tween(t) {\n              state.selection = t === 1 && selection1 === null ? null : i(t);\n              redraw.call(that);\n              emit.brush();\n            }\n\n            return selection0 !== null && selection1 !== null ? tween : tween(1);\n          });\n    } else {\n      group\n          .each(function() {\n            var that = this,\n                args = arguments,\n                state = that.__brush,\n                selection1 = dim.input(typeof selection === \"function\" ? selection.apply(that, args) : selection, state.extent),\n                emit = emitter(that, args).beforestart();\n\n            interrupt(that);\n            state.selection = selection1 === null ? null : selection1;\n            redraw.call(that);\n            emit.start(event).brush(event).end(event);\n          });\n    }\n  };\n\n  brush.clear = function(group, event) {\n    brush.move(group, null, event);\n  };\n\n  function redraw() {\n    var group = select(this),\n        selection = local(this).selection;\n\n    if (selection) {\n      group.selectAll(\".selection\")\n          .style(\"display\", null)\n          .attr(\"x\", selection[0][0])\n          .attr(\"y\", selection[0][1])\n          .attr(\"width\", selection[1][0] - selection[0][0])\n          .attr(\"height\", selection[1][1] - selection[0][1]);\n\n      group.selectAll(\".handle\")\n          .style(\"display\", null)\n          .attr(\"x\", function(d) { return d.type[d.type.length - 1] === \"e\" ? selection[1][0] - handleSize / 2 : selection[0][0] - handleSize / 2; })\n          .attr(\"y\", function(d) { return d.type[0] === \"s\" ? selection[1][1] - handleSize / 2 : selection[0][1] - handleSize / 2; })\n          .attr(\"width\", function(d) { return d.type === \"n\" || d.type === \"s\" ? selection[1][0] - selection[0][0] + handleSize : handleSize; })\n          .attr(\"height\", function(d) { return d.type === \"e\" || d.type === \"w\" ? selection[1][1] - selection[0][1] + handleSize : handleSize; });\n    }\n\n    else {\n      group.selectAll(\".selection,.handle\")\n          .style(\"display\", \"none\")\n          .attr(\"x\", null)\n          .attr(\"y\", null)\n          .attr(\"width\", null)\n          .attr(\"height\", null);\n    }\n  }\n\n  function emitter(that, args, clean) {\n    var emit = that.__brush.emitter;\n    return emit && (!clean || !emit.clean) ? emit : new Emitter(that, args, clean);\n  }\n\n  function Emitter(that, args, clean) {\n    this.that = that;\n    this.args = args;\n    this.state = that.__brush;\n    this.active = 0;\n    this.clean = clean;\n  }\n\n  Emitter.prototype = {\n    beforestart: function() {\n      if (++this.active === 1) this.state.emitter = this, this.starting = true;\n      return this;\n    },\n    start: function(event, mode) {\n      if (this.starting) this.starting = false, this.emit(\"start\", event, mode);\n      else this.emit(\"brush\", event);\n      return this;\n    },\n    brush: function(event, mode) {\n      this.emit(\"brush\", event, mode);\n      return this;\n    },\n    end: function(event, mode) {\n      if (--this.active === 0) delete this.state.emitter, this.emit(\"end\", event, mode);\n      return this;\n    },\n    emit: function(type, event, mode) {\n      var d = select(this.that).datum();\n      listeners.call(\n        type,\n        this.that,\n        new BrushEvent(type, {\n          sourceEvent: event,\n          target: brush,\n          selection: dim.output(this.state.selection),\n          mode,\n          dispatch: listeners\n        }),\n        d\n      );\n    }\n  };\n\n  function started(event) {\n    if (touchending && !event.touches) return;\n    if (!filter.apply(this, arguments)) return;\n\n    var that = this,\n        type = event.target.__data__.type,\n        mode = (keys && event.metaKey ? type = \"overlay\" : type) === \"selection\" ? MODE_DRAG : (keys && event.altKey ? MODE_CENTER : MODE_HANDLE),\n        signX = dim === Y ? null : signsX[type],\n        signY = dim === X ? null : signsY[type],\n        state = local(that),\n        extent = state.extent,\n        selection = state.selection,\n        W = extent[0][0], w0, w1,\n        N = extent[0][1], n0, n1,\n        E = extent[1][0], e0, e1,\n        S = extent[1][1], s0, s1,\n        dx = 0,\n        dy = 0,\n        moving,\n        shifting = signX && signY && keys && event.shiftKey,\n        lockX,\n        lockY,\n        points = Array.from(event.touches || [event], t => {\n          const i = t.identifier;\n          t = pointer(t, that);\n          t.point0 = t.slice();\n          t.identifier = i;\n          return t;\n        });\n\n    interrupt(that);\n    var emit = emitter(that, arguments, true).beforestart();\n\n    if (type === \"overlay\") {\n      if (selection) moving = true;\n      const pts = [points[0], points[1] || points[0]];\n      state.selection = selection = [[\n          w0 = dim === Y ? W : min(pts[0][0], pts[1][0]),\n          n0 = dim === X ? N : min(pts[0][1], pts[1][1])\n        ], [\n          e0 = dim === Y ? E : max(pts[0][0], pts[1][0]),\n          s0 = dim === X ? S : max(pts[0][1], pts[1][1])\n        ]];\n      if (points.length > 1) move(event);\n    } else {\n      w0 = selection[0][0];\n      n0 = selection[0][1];\n      e0 = selection[1][0];\n      s0 = selection[1][1];\n    }\n\n    w1 = w0;\n    n1 = n0;\n    e1 = e0;\n    s1 = s0;\n\n    var group = select(that)\n        .attr(\"pointer-events\", \"none\");\n\n    var overlay = group.selectAll(\".overlay\")\n        .attr(\"cursor\", cursors[type]);\n\n    if (event.touches) {\n      emit.moved = moved;\n      emit.ended = ended;\n    } else {\n      var view = select(event.view)\n          .on(\"mousemove.brush\", moved, true)\n          .on(\"mouseup.brush\", ended, true);\n      if (keys) view\n          .on(\"keydown.brush\", keydowned, true)\n          .on(\"keyup.brush\", keyupped, true)\n\n      dragDisable(event.view);\n    }\n\n    redraw.call(that);\n    emit.start(event, mode.name);\n\n    function moved(event) {\n      for (const p of event.changedTouches || [event]) {\n        for (const d of points)\n          if (d.identifier === p.identifier) d.cur = pointer(p, that);\n      }\n      if (shifting && !lockX && !lockY && points.length === 1) {\n        const point = points[0];\n        if (abs(point.cur[0] - point[0]) > abs(point.cur[1] - point[1]))\n          lockY = true;\n        else\n          lockX = true;\n      }\n      for (const point of points)\n        if (point.cur) point[0] = point.cur[0], point[1] = point.cur[1];\n      moving = true;\n      noevent(event);\n      move(event);\n    }\n\n    function move(event) {\n      const point = points[0], point0 = point.point0;\n      var t;\n\n      dx = point[0] - point0[0];\n      dy = point[1] - point0[1];\n\n      switch (mode) {\n        case MODE_SPACE:\n        case MODE_DRAG: {\n          if (signX) dx = max(W - w0, min(E - e0, dx)), w1 = w0 + dx, e1 = e0 + dx;\n          if (signY) dy = max(N - n0, min(S - s0, dy)), n1 = n0 + dy, s1 = s0 + dy;\n          break;\n        }\n        case MODE_HANDLE: {\n          if (points[1]) {\n            if (signX) w1 = max(W, min(E, points[0][0])), e1 = max(W, min(E, points[1][0])), signX = 1;\n            if (signY) n1 = max(N, min(S, points[0][1])), s1 = max(N, min(S, points[1][1])), signY = 1;\n          } else {\n            if (signX < 0) dx = max(W - w0, min(E - w0, dx)), w1 = w0 + dx, e1 = e0;\n            else if (signX > 0) dx = max(W - e0, min(E - e0, dx)), w1 = w0, e1 = e0 + dx;\n            if (signY < 0) dy = max(N - n0, min(S - n0, dy)), n1 = n0 + dy, s1 = s0;\n            else if (signY > 0) dy = max(N - s0, min(S - s0, dy)), n1 = n0, s1 = s0 + dy;\n          }\n          break;\n        }\n        case MODE_CENTER: {\n          if (signX) w1 = max(W, min(E, w0 - dx * signX)), e1 = max(W, min(E, e0 + dx * signX));\n          if (signY) n1 = max(N, min(S, n0 - dy * signY)), s1 = max(N, min(S, s0 + dy * signY));\n          break;\n        }\n      }\n\n      if (e1 < w1) {\n        signX *= -1;\n        t = w0, w0 = e0, e0 = t;\n        t = w1, w1 = e1, e1 = t;\n        if (type in flipX) overlay.attr(\"cursor\", cursors[type = flipX[type]]);\n      }\n\n      if (s1 < n1) {\n        signY *= -1;\n        t = n0, n0 = s0, s0 = t;\n        t = n1, n1 = s1, s1 = t;\n        if (type in flipY) overlay.attr(\"cursor\", cursors[type = flipY[type]]);\n      }\n\n      if (state.selection) selection = state.selection; // May be set by brush.move!\n      if (lockX) w1 = selection[0][0], e1 = selection[1][0];\n      if (lockY) n1 = selection[0][1], s1 = selection[1][1];\n\n      if (selection[0][0] !== w1\n          || selection[0][1] !== n1\n          || selection[1][0] !== e1\n          || selection[1][1] !== s1) {\n        state.selection = [[w1, n1], [e1, s1]];\n        redraw.call(that);\n        emit.brush(event, mode.name);\n      }\n    }\n\n    function ended(event) {\n      nopropagation(event);\n      if (event.touches) {\n        if (event.touches.length) return;\n        if (touchending) clearTimeout(touchending);\n        touchending = setTimeout(function() { touchending = null; }, 500); // Ghost clicks are delayed!\n      } else {\n        dragEnable(event.view, moving);\n        view.on(\"keydown.brush keyup.brush mousemove.brush mouseup.brush\", null);\n      }\n      group.attr(\"pointer-events\", \"all\");\n      overlay.attr(\"cursor\", cursors.overlay);\n      if (state.selection) selection = state.selection; // May be set by brush.move (on start)!\n      if (empty(selection)) state.selection = null, redraw.call(that);\n      emit.end(event, mode.name);\n    }\n\n    function keydowned(event) {\n      switch (event.keyCode) {\n        case 16: { // SHIFT\n          shifting = signX && signY;\n          break;\n        }\n        case 18: { // ALT\n          if (mode === MODE_HANDLE) {\n            if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n            if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n            mode = MODE_CENTER;\n            move(event);\n          }\n          break;\n        }\n        case 32: { // SPACE; takes priority over ALT\n          if (mode === MODE_HANDLE || mode === MODE_CENTER) {\n            if (signX < 0) e0 = e1 - dx; else if (signX > 0) w0 = w1 - dx;\n            if (signY < 0) s0 = s1 - dy; else if (signY > 0) n0 = n1 - dy;\n            mode = MODE_SPACE;\n            overlay.attr(\"cursor\", cursors.selection);\n            move(event);\n          }\n          break;\n        }\n        default: return;\n      }\n      noevent(event);\n    }\n\n    function keyupped(event) {\n      switch (event.keyCode) {\n        case 16: { // SHIFT\n          if (shifting) {\n            lockX = lockY = shifting = false;\n            move(event);\n          }\n          break;\n        }\n        case 18: { // ALT\n          if (mode === MODE_CENTER) {\n            if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n            if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n            mode = MODE_HANDLE;\n            move(event);\n          }\n          break;\n        }\n        case 32: { // SPACE\n          if (mode === MODE_SPACE) {\n            if (event.altKey) {\n              if (signX) e0 = e1 - dx * signX, w0 = w1 + dx * signX;\n              if (signY) s0 = s1 - dy * signY, n0 = n1 + dy * signY;\n              mode = MODE_CENTER;\n            } else {\n              if (signX < 0) e0 = e1; else if (signX > 0) w0 = w1;\n              if (signY < 0) s0 = s1; else if (signY > 0) n0 = n1;\n              mode = MODE_HANDLE;\n            }\n            overlay.attr(\"cursor\", cursors[type]);\n            move(event);\n          }\n          break;\n        }\n        default: return;\n      }\n      noevent(event);\n    }\n  }\n\n  function touchmoved(event) {\n    emitter(this, arguments).moved(event);\n  }\n\n  function touchended(event) {\n    emitter(this, arguments).ended(event);\n  }\n\n  function initialize() {\n    var state = this.__brush || {selection: null};\n    state.extent = number2(extent.apply(this, arguments));\n    state.dim = dim;\n    return state;\n  }\n\n  brush.extent = function(_) {\n    return arguments.length ? (extent = typeof _ === \"function\" ? _ : constant(number2(_)), brush) : extent;\n  };\n\n  brush.filter = function(_) {\n    return arguments.length ? (filter = typeof _ === \"function\" ? _ : constant(!!_), brush) : filter;\n  };\n\n  brush.touchable = function(_) {\n    return arguments.length ? (touchable = typeof _ === \"function\" ? _ : constant(!!_), brush) : touchable;\n  };\n\n  brush.handleSize = function(_) {\n    return arguments.length ? (handleSize = +_, brush) : handleSize;\n  };\n\n  brush.keyModifiers = function(_) {\n    return arguments.length ? (keys = !!_, brush) : keys;\n  };\n\n  brush.on = function() {\n    var value = listeners.on.apply(listeners, arguments);\n    return value === listeners ? brush : value;\n  };\n\n  return brush;\n}\n", "export default function(x) {\n  return Math.abs(x = Math.round(x)) >= 1e21\n      ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n      : x.toString(10);\n}\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nexport function formatDecimalParts(x, p) {\n  if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, \u00B1Infinity\n  var i, coefficient = x.slice(0, i);\n\n  // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n  // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n  return [\n    coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n    +x.slice(i + 1)\n  ];\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x) {\n  return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n}\n", "export default function(grouping, thousands) {\n  return function(value, width) {\n    var i = value.length,\n        t = [],\n        j = 0,\n        g = grouping[0],\n        length = 0;\n\n    while (i > 0 && g > 0) {\n      if (length + g + 1 > width) g = Math.max(1, width - length);\n      t.push(value.substring(i -= g, i + g));\n      if ((length += g + 1) > width) break;\n      g = grouping[j = (j + 1) % grouping.length];\n    }\n\n    return t.reverse().join(thousands);\n  };\n}\n", "export default function(numerals) {\n  return function(value) {\n    return value.replace(/[0-9]/g, function(i) {\n      return numerals[+i];\n    });\n  };\n}\n", "// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nexport default function formatSpecifier(specifier) {\n  if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n  var match;\n  return new FormatSpecifier({\n    fill: match[1],\n    align: match[2],\n    sign: match[3],\n    symbol: match[4],\n    zero: match[5],\n    width: match[6],\n    comma: match[7],\n    precision: match[8] && match[8].slice(1),\n    trim: match[9],\n    type: match[10]\n  });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nexport function FormatSpecifier(specifier) {\n  this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n  this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n  this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n  this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n  this.zero = !!specifier.zero;\n  this.width = specifier.width === undefined ? undefined : +specifier.width;\n  this.comma = !!specifier.comma;\n  this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n  this.trim = !!specifier.trim;\n  this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n  return this.fill\n      + this.align\n      + this.sign\n      + this.symbol\n      + (this.zero ? \"0\" : \"\")\n      + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n      + (this.comma ? \",\" : \"\")\n      + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n      + (this.trim ? \"~\" : \"\")\n      + this.type;\n};\n", "// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\nexport default function(s) {\n  out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n    switch (s[i]) {\n      case \".\": i0 = i1 = i; break;\n      case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n      default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n    }\n  }\n  return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport var prefixExponent;\n\nexport default function(x, p) {\n  var d = formatDecimalParts(x, p);\n  if (!d) return x + \"\";\n  var coefficient = d[0],\n      exponent = d[1],\n      i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n      n = coefficient.length;\n  return i === n ? coefficient\n      : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n      : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n      : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n}\n", "import {formatDecimalParts} from \"./formatDecimal.js\";\n\nexport default function(x, p) {\n  var d = formatDecimalParts(x, p);\n  if (!d) return x + \"\";\n  var coefficient = d[0],\n      exponent = d[1];\n  return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n      : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n      : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n}\n", "import formatDecimal from \"./formatDecimal.js\";\nimport formatPrefixAuto from \"./formatPrefixAuto.js\";\nimport formatRounded from \"./formatRounded.js\";\n\nexport default {\n  \"%\": (x, p) => (x * 100).toFixed(p),\n  \"b\": (x) => Math.round(x).toString(2),\n  \"c\": (x) => x + \"\",\n  \"d\": formatDecimal,\n  \"e\": (x, p) => x.toExponential(p),\n  \"f\": (x, p) => x.toFixed(p),\n  \"g\": (x, p) => x.toPrecision(p),\n  \"o\": (x) => Math.round(x).toString(8),\n  \"p\": (x, p) => formatRounded(x * 100, p),\n  \"r\": formatRounded,\n  \"s\": formatPrefixAuto,\n  \"X\": (x) => Math.round(x).toString(16).toUpperCase(),\n  \"x\": (x) => Math.round(x).toString(16)\n};\n", "export default function(x) {\n  return x;\n}\n", "import exponent from \"./exponent.js\";\nimport formatGroup from \"./formatGroup.js\";\nimport formatNumerals from \"./formatNumerals.js\";\nimport formatSpecifier from \"./formatSpecifier.js\";\nimport formatTrim from \"./formatTrim.js\";\nimport formatTypes from \"./formatTypes.js\";\nimport {prefixExponent} from \"./formatPrefixAuto.js\";\nimport identity from \"./identity.js\";\n\nvar map = Array.prototype.map,\n    prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"\u00B5\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\nexport default function(locale) {\n  var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n      currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n      currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n      decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n      numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n      percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n      minus = locale.minus === undefined ? \"\u2212\" : locale.minus + \"\",\n      nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n  function newFormat(specifier) {\n    specifier = formatSpecifier(specifier);\n\n    var fill = specifier.fill,\n        align = specifier.align,\n        sign = specifier.sign,\n        symbol = specifier.symbol,\n        zero = specifier.zero,\n        width = specifier.width,\n        comma = specifier.comma,\n        precision = specifier.precision,\n        trim = specifier.trim,\n        type = specifier.type;\n\n    // The \"n\" type is an alias for \",g\".\n    if (type === \"n\") comma = true, type = \"g\";\n\n    // The \"\" type, and any invalid type, is an alias for \".12~g\".\n    else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n    // If zero fill is specified, padding goes after sign and before digits.\n    if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n    // Compute the prefix and suffix.\n    // For SI-prefix, the suffix is lazily computed.\n    var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n        suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n    // What format function should we use?\n    // Is this an integer type?\n    // Can this type generate exponential notation?\n    var formatType = formatTypes[type],\n        maybeSuffix = /[defgprs%]/.test(type);\n\n    // Set the default precision if not specified,\n    // or clamp the specified precision to the supported range.\n    // For significant precision, it must be in [1, 21].\n    // For fixed precision, it must be in [0, 20].\n    precision = precision === undefined ? 6\n        : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n        : Math.max(0, Math.min(20, precision));\n\n    function format(value) {\n      var valuePrefix = prefix,\n          valueSuffix = suffix,\n          i, n, c;\n\n      if (type === \"c\") {\n        valueSuffix = formatType(value) + valueSuffix;\n        value = \"\";\n      } else {\n        value = +value;\n\n        // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n        var valueNegative = value < 0 || 1 / value < 0;\n\n        // Perform the initial formatting.\n        value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n        // Trim insignificant zeros.\n        if (trim) value = formatTrim(value);\n\n        // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n        if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n        // Compute the prefix and suffix.\n        valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n        valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n        // Break the formatted value into the integer \u201Cvalue\u201D part that can be\n        // grouped, and fractional or exponential \u201Csuffix\u201D part that is not.\n        if (maybeSuffix) {\n          i = -1, n = value.length;\n          while (++i < n) {\n            if (c = value.charCodeAt(i), 48 > c || c > 57) {\n              valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n              value = value.slice(0, i);\n              break;\n            }\n          }\n        }\n      }\n\n      // If the fill character is not \"0\", grouping is applied before padding.\n      if (comma && !zero) value = group(value, Infinity);\n\n      // Compute the padding.\n      var length = valuePrefix.length + value.length + valueSuffix.length,\n          padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n      // If the fill character is \"0\", grouping is applied after padding.\n      if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n      // Reconstruct the final output based on the desired alignment.\n      switch (align) {\n        case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n        case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n        case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n        default: value = padding + valuePrefix + value + valueSuffix; break;\n      }\n\n      return numerals(value);\n    }\n\n    format.toString = function() {\n      return specifier + \"\";\n    };\n\n    return format;\n  }\n\n  function formatPrefix(specifier, value) {\n    var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n        e = Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3,\n        k = Math.pow(10, -e),\n        prefix = prefixes[8 + e / 3];\n    return function(value) {\n      return f(k * value) + prefix;\n    };\n  }\n\n  return {\n    format: newFormat,\n    formatPrefix: formatPrefix\n  };\n}\n", "import formatLocale from \"./locale.js\";\n\nvar locale;\nexport var format;\nexport var formatPrefix;\n\ndefaultLocale({\n  thousands: \",\",\n  grouping: [3],\n  currency: [\"$\", \"\"]\n});\n\nexport default function defaultLocale(definition) {\n  locale = formatLocale(definition);\n  format = locale.format;\n  formatPrefix = locale.formatPrefix;\n  return locale;\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step) {\n  return Math.max(0, -exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, value) {\n  return Math.max(0, Math.max(-8, Math.min(8, Math.floor(exponent(value) / 3))) * 3 - exponent(Math.abs(step)));\n}\n", "import exponent from \"./exponent.js\";\n\nexport default function(step, max) {\n  step = Math.abs(step), max = Math.abs(max) - step;\n  return Math.max(0, exponent(max) - exponent(step)) + 1;\n}\n", "export function initRange(domain, range) {\n  switch (arguments.length) {\n    case 0: break;\n    case 1: this.range(domain); break;\n    default: this.range(range).domain(domain); break;\n  }\n  return this;\n}\n\nexport function initInterpolator(domain, interpolator) {\n  switch (arguments.length) {\n    case 0: break;\n    case 1: {\n      if (typeof domain === \"function\") this.interpolator(domain);\n      else this.range(domain);\n      break;\n    }\n    default: {\n      this.domain(domain);\n      if (typeof interpolator === \"function\") this.interpolator(interpolator);\n      else this.range(interpolator);\n      break;\n    }\n  }\n  return this;\n}\n", "export default function constants(x) {\n  return function() {\n    return x;\n  };\n}\n", "export default function number(x) {\n  return +x;\n}\n", "import {bisect} from \"d3-array\";\nimport {interpolate as interpolateValue, interpolateNumber, interpolateRound} from \"d3-interpolate\";\nimport constant from \"./constant.js\";\nimport number from \"./number.js\";\n\nvar unit = [0, 1];\n\nexport function identity(x) {\n  return x;\n}\n\nfunction normalize(a, b) {\n  return (b -= (a = +a))\n      ? function(x) { return (x - a) / b; }\n      : constant(isNaN(b) ? NaN : 0.5);\n}\n\nfunction clamper(a, b) {\n  var t;\n  if (a > b) t = a, a = b, b = t;\n  return function(x) { return Math.max(a, Math.min(b, x)); };\n}\n\n// normalize(a, b)(x) takes a domain value x in [a,b] and returns the corresponding parameter t in [0,1].\n// interpolate(a, b)(t) takes a parameter t in [0,1] and returns the corresponding range value x in [a,b].\nfunction bimap(domain, range, interpolate) {\n  var d0 = domain[0], d1 = domain[1], r0 = range[0], r1 = range[1];\n  if (d1 < d0) d0 = normalize(d1, d0), r0 = interpolate(r1, r0);\n  else d0 = normalize(d0, d1), r0 = interpolate(r0, r1);\n  return function(x) { return r0(d0(x)); };\n}\n\nfunction polymap(domain, range, interpolate) {\n  var j = Math.min(domain.length, range.length) - 1,\n      d = new Array(j),\n      r = new Array(j),\n      i = -1;\n\n  // Reverse descending domains.\n  if (domain[j] < domain[0]) {\n    domain = domain.slice().reverse();\n    range = range.slice().reverse();\n  }\n\n  while (++i < j) {\n    d[i] = normalize(domain[i], domain[i + 1]);\n    r[i] = interpolate(range[i], range[i + 1]);\n  }\n\n  return function(x) {\n    var i = bisect(domain, x, 1, j) - 1;\n    return r[i](d[i](x));\n  };\n}\n\nexport function copy(source, target) {\n  return target\n      .domain(source.domain())\n      .range(source.range())\n      .interpolate(source.interpolate())\n      .clamp(source.clamp())\n      .unknown(source.unknown());\n}\n\nexport function transformer() {\n  var domain = unit,\n      range = unit,\n      interpolate = interpolateValue,\n      transform,\n      untransform,\n      unknown,\n      clamp = identity,\n      piecewise,\n      output,\n      input;\n\n  function rescale() {\n    var n = Math.min(domain.length, range.length);\n    if (clamp !== identity) clamp = clamper(domain[0], domain[n - 1]);\n    piecewise = n > 2 ? polymap : bimap;\n    output = input = null;\n    return scale;\n  }\n\n  function scale(x) {\n    return x == null || isNaN(x = +x) ? unknown : (output || (output = piecewise(domain.map(transform), range, interpolate)))(transform(clamp(x)));\n  }\n\n  scale.invert = function(y) {\n    return clamp(untransform((input || (input = piecewise(range, domain.map(transform), interpolateNumber)))(y)));\n  };\n\n  scale.domain = function(_) {\n    return arguments.length ? (domain = Array.from(_, number), rescale()) : domain.slice();\n  };\n\n  scale.range = function(_) {\n    return arguments.length ? (range = Array.from(_), rescale()) : range.slice();\n  };\n\n  scale.rangeRound = function(_) {\n    return range = Array.from(_), interpolate = interpolateRound, rescale();\n  };\n\n  scale.clamp = function(_) {\n    return arguments.length ? (clamp = _ ? true : identity, rescale()) : clamp !== identity;\n  };\n\n  scale.interpolate = function(_) {\n    return arguments.length ? (interpolate = _, rescale()) : interpolate;\n  };\n\n  scale.unknown = function(_) {\n    return arguments.length ? (unknown = _, scale) : unknown;\n  };\n\n  return function(t, u) {\n    transform = t, untransform = u;\n    return rescale();\n  };\n}\n\nexport default function continuous() {\n  return transformer()(identity, identity);\n}\n", "import {tickStep} from \"d3-array\";\nimport {format, formatPrefix, formatSpecifier, precisionFixed, precisionPrefix, precisionRound} from \"d3-format\";\n\nexport default function tickFormat(start, stop, count, specifier) {\n  var step = tickStep(start, stop, count),\n      precision;\n  specifier = formatSpecifier(specifier == null ? \",f\" : specifier);\n  switch (specifier.type) {\n    case \"s\": {\n      var value = Math.max(Math.abs(start), Math.abs(stop));\n      if (specifier.precision == null && !isNaN(precision = precisionPrefix(step, value))) specifier.precision = precision;\n      return formatPrefix(specifier, value);\n    }\n    case \"\":\n    case \"e\":\n    case \"g\":\n    case \"p\":\n    case \"r\": {\n      if (specifier.precision == null && !isNaN(precision = precisionRound(step, Math.max(Math.abs(start), Math.abs(stop))))) specifier.precision = precision - (specifier.type === \"e\");\n      break;\n    }\n    case \"f\":\n    case \"%\": {\n      if (specifier.precision == null && !isNaN(precision = precisionFixed(step))) specifier.precision = precision - (specifier.type === \"%\") * 2;\n      break;\n    }\n  }\n  return format(specifier);\n}\n", "import {ticks, tickIncrement} from \"d3-array\";\nimport continuous, {copy} from \"./continuous.js\";\nimport {initRange} from \"./init.js\";\nimport tickFormat from \"./tickFormat.js\";\n\nexport function linearish(scale) {\n  var domain = scale.domain;\n\n  scale.ticks = function(count) {\n    var d = domain();\n    return ticks(d[0], d[d.length - 1], count == null ? 10 : count);\n  };\n\n  scale.tickFormat = function(count, specifier) {\n    var d = domain();\n    return tickFormat(d[0], d[d.length - 1], count == null ? 10 : count, specifier);\n  };\n\n  scale.nice = function(count) {\n    if (count == null) count = 10;\n\n    var d = domain();\n    var i0 = 0;\n    var i1 = d.length - 1;\n    var start = d[i0];\n    var stop = d[i1];\n    var prestep;\n    var step;\n    var maxIter = 10;\n\n    if (stop < start) {\n      step = start, start = stop, stop = step;\n      step = i0, i0 = i1, i1 = step;\n    }\n    \n    while (maxIter-- > 0) {\n      step = tickIncrement(start, stop, count);\n      if (step === prestep) {\n        d[i0] = start\n        d[i1] = stop\n        return domain(d);\n      } else if (step > 0) {\n        start = Math.floor(start / step) * step;\n        stop = Math.ceil(stop / step) * step;\n      } else if (step < 0) {\n        start = Math.ceil(start * step) / step;\n        stop = Math.floor(stop * step) / step;\n      } else {\n        break;\n      }\n      prestep = step;\n    }\n\n    return scale;\n  };\n\n  return scale;\n}\n\nexport default function linear() {\n  var scale = continuous();\n\n  scale.copy = function() {\n    return copy(scale, linear());\n  };\n\n  initRange.apply(scale, arguments);\n\n  return linearish(scale);\n}\n", "export function Transform(k, x, y) {\n  this.k = k;\n  this.x = x;\n  this.y = y;\n}\n\nTransform.prototype = {\n  constructor: Transform,\n  scale: function(k) {\n    return k === 1 ? this : new Transform(this.k * k, this.x, this.y);\n  },\n  translate: function(x, y) {\n    return x === 0 & y === 0 ? this : new Transform(this.k, this.x + this.k * x, this.y + this.k * y);\n  },\n  apply: function(point) {\n    return [point[0] * this.k + this.x, point[1] * this.k + this.y];\n  },\n  applyX: function(x) {\n    return x * this.k + this.x;\n  },\n  applyY: function(y) {\n    return y * this.k + this.y;\n  },\n  invert: function(location) {\n    return [(location[0] - this.x) / this.k, (location[1] - this.y) / this.k];\n  },\n  invertX: function(x) {\n    return (x - this.x) / this.k;\n  },\n  invertY: function(y) {\n    return (y - this.y) / this.k;\n  },\n  rescaleX: function(x) {\n    return x.copy().domain(x.range().map(this.invertX, this).map(x.invert, x));\n  },\n  rescaleY: function(y) {\n    return y.copy().domain(y.range().map(this.invertY, this).map(y.invert, y));\n  },\n  toString: function() {\n    return \"translate(\" + this.x + \",\" + this.y + \") scale(\" + this.k + \")\";\n  }\n};\n\nexport var identity = new Transform(1, 0, 0);\n\ntransform.prototype = Transform.prototype;\n\nexport default function transform(node) {\n  while (!node.__zoom) if (!(node = node.parentNode)) return identity;\n  return node.__zoom;\n}\n", "import { default as Chart, MONEY, czPieChart, czHorizontalBarChart, czVerticalBarChart } from './charts.js';\nimport { createMap } from './maps-dashboard.js'\n\nconst MAX_LENGTH = 100;\n\nfunction getIncomeData(income_data, max_length = MAX_LENGTH, sort_by = \"size\") {\n    if (income_data.length > max_length) {\n        income_data = income_data.map(a => [a, Math.random()])\n            .sort((a, b) => { return a[1] < b[1] ? -1 : 1; })\n            .slice(0, max_length)\n            .map(a => a[0]);\n    }\n    return income_data;\n}\n\n\nfunction ImdDecileChart(ctx, labels, data, label) {\n    return new Chart(ctx, {\n        type: 'bar',\n        data: {\n            labels: labels,\n            datasets: [\n                {\n                    label: label,\n                    data: data,\n                    backgroundColor: '#7777a5',\n                    borderRadius: 20,\n                    barThickness: 24,\n                }\n            ]\n        },\n        options: {\n            animation: false,\n            indexAxis: 'x',\n            responsive: true,\n            plugins: {\n                legend: {\n                    display: false,\n                },\n            },\n            scales: {\n                x: {\n                    grid: {\n                        display: false,\n                    },\n                    title: {\n                        display: true,\n                        text: 'IMD decile',\n                    }\n                },\n                y: {\n                    grid: {\n                        display: false,\n                    },\n                    border: {\n                        display: false,\n                    },\n                    ticks: {\n                        callback: function (value) {\n                            return (value * 100).toFixed(0) + '%';\n                        }\n                    }\n                }\n            }\n        },\n    });\n}\n\nexport function createChart(ctx, chart_id, chart_data) {\n    var chart;\n    if (chart_id === \"income_expenditure\") {\n        var income_data = getIncomeData(chart_data[\"income_expenditure\"]);\n        chart = new Chart(ctx, {\n            type: 'bar',\n            data: {\n                labels: income_data.map((v) => v.name),\n                datasets: [{\n                    label: 'Income',\n                    data: income_data.map((v) => v.latest_income),\n                    borderWidth: 0,\n                    borderRadius: 20,\n                    stack: 1,\n                    backgroundColor: '#7777a5',\n                    //barThickness: 15,\n                }, {\n                    label: 'Spending',\n                    data: income_data.map((v) => -v.latest_spending),\n                    borderWidth: 0,\n                    borderRadius: 20,\n                    stack: 1,\n                    backgroundColor: '#141c44',\n                    //barThickness: 15,\n                }]\n            },\n            options: {\n                responsive: false,\n                maintainAspectRatio: false,\n                plugins: {\n                    legend: {\n                        display: false,\n                    },\n                    tooltip: {\n                        callbacks: {\n                            label: function (context) {\n                                let label = context.dataset.label || '';\n\n                                if (label) {\n                                    label += ': ';\n                                }\n                                if (context.parsed.y !== null) {\n                                    label += MONEY.format(Math.abs(context.parsed.y));\n                                }\n                                return label;\n                            }\n                        }\n                    }\n                },\n                scales: {\n                    y: {\n                        stacked: true,\n                        grid: {\n                            display: false,\n                        },\n                        // type: 'logarithmic',\n                        ticks: {\n                            // Include a dollar sign in the ticks\n                            callback: function (value, index, ticks) {\n                                var max_tick = Math.max(...ticks.map((tick) => Math.abs(tick.value)));\n                                var return_value = Math.abs(value);\n                                var suffix = '';\n                                if (max_tick > 1000000000) {\n                                    return_value = return_value / 1000000000;\n                                    suffix = 'bn';\n                                } else if (max_tick > 1000000) {\n                                    return_value = return_value / 1000000;\n                                    suffix = 'm';\n                                } else if (max_tick > 1000) {\n                                    return_value = return_value / 1000;\n                                    suffix = 'k';\n                                }\n                                return MONEY.format(return_value) + suffix;\n                            }\n                        }\n                    },\n                    x: {\n                        display: false,\n                    }\n                }\n            }\n        });\n\n        document.querySelector(\"#income-expenditure-sort\").addEventListener(\"change\", function (e) {\n            if (e.target.value === \"name\") {\n                var data = chart_data[\"income_expenditure\"].map((v) => v);\n                data.sort((a, b) => a.name.localeCompare(b.name))\n                data = data.slice(0, MAX_LENGTH);\n            } else if (e.target.value === \"size\") {\n                var data = chart_data[\"largest_charities\"].map((v) => v);\n                data.sort((a, b) => b.latest_spending - a.latest_spending);\n                data = data.slice(0, MAX_LENGTH);\n            } else {\n                var data = getIncomeData(chart_data[\"income_expenditure\"]);\n            }\n            chart.data.datasets[0].data = data.map((v) => v.latest_income);\n            chart.data.datasets[1].data = data.map((v) => -v.latest_spending);\n            chart.data.labels = data.map((v) => v.name);\n            chart.update();\n        });\n        document.querySelector(\"#income-expenditure-sort\").value = \"size\";\n        document.querySelector(\"#income-expenditure-sort\").dispatchEvent(new Event('change', { 'bubbles': true }));\n    } else if (chart_id == \"income_cagr_range\") {\n        chart = czVerticalBarChart(ctx, chart_data);\n    } else if (chart_id == \"number_of_trustees\") {\n        chart = czPieChart(ctx, chart_data, 'trustees_legend');\n    } else if (chart_id == \"number_of_volunteers\") {\n        chart = czPieChart(ctx, chart_data, 'volunteers_legend');\n    } else if (chart_id == \"annual_return_submission_on_time\") {\n        chart = czHorizontalBarChart(ctx, chart_data);\n    } else if (chart_id == \"age_range\") {\n        chart = czHorizontalBarChart(ctx, chart_data);\n    } else if (chart_id == \"imd_decile\") {\n        chart = ImdDecileChart(\n            ctx.querySelector(\"canvas\"),\n            chart_data.map((v) => v.label),\n            chart_data.map((v) => v.proportion),\n            'Proportion of charities'\n        );\n        ctx.querySelectorAll(\"[name=imd_chart_type]\").forEach((el) => {\n            el.addEventListener(\"change\", function (e) {\n                if (e.target.value === \"proportion\") {\n                    chart.data.datasets[0].data = chart_data.map((v) => v.proportion);\n                    chart.options.plugins.title.text = 'Proportion of charities';\n                } else if (e.target.value === \"spending_proportion\") {\n                    chart.data.datasets[0].data = chart_data.map((v) => v.spending_proportion);\n                    chart.options.plugins.title.text = 'Proportion of charity spending';\n                }\n                chart.update();\n            });\n        });\n    } else if (chart_id == \"geodata\") {\n        chart = createMap(ctx, chart_data);\n    } else {\n        console.warn(\"Unknown chart ID:\", chart_id);\n    }\n\n    return chart;\n}", "// packages/persist/src/index.js\nfunction src_default(Alpine) {\n  let persist = () => {\n    let alias;\n    let storage;\n    try {\n      storage = localStorage;\n    } catch (e) {\n      console.error(e);\n      console.warn(\"Alpine: $persist is using temporary storage since localStorage is unavailable.\");\n      let dummy = /* @__PURE__ */ new Map();\n      storage = {\n        getItem: dummy.get.bind(dummy),\n        setItem: dummy.set.bind(dummy)\n      };\n    }\n    return Alpine.interceptor((initialValue, getter, setter, path, key) => {\n      let lookup = alias || `_x_${path}`;\n      let initial = storageHas(lookup, storage) ? storageGet(lookup, storage) : initialValue;\n      setter(initial);\n      Alpine.effect(() => {\n        let value = getter();\n        storageSet(lookup, value, storage);\n        setter(value);\n      });\n      return initial;\n    }, (func) => {\n      func.as = (key) => {\n        alias = key;\n        return func;\n      }, func.using = (target) => {\n        storage = target;\n        return func;\n      };\n    });\n  };\n  Object.defineProperty(Alpine, \"$persist\", { get: () => persist() });\n  Alpine.magic(\"persist\", persist);\n  Alpine.persist = (key, { get, set }, storage = localStorage) => {\n    let initial = storageHas(key, storage) ? storageGet(key, storage) : get();\n    set(initial);\n    Alpine.effect(() => {\n      let value = get();\n      storageSet(key, value, storage);\n      set(value);\n    });\n  };\n}\nfunction storageHas(key, storage) {\n  return storage.getItem(key) !== null;\n}\nfunction storageGet(key, storage) {\n  let value = storage.getItem(key);\n  if (value === void 0)\n    return;\n  return JSON.parse(value);\n}\nfunction storageSet(key, value, storage) {\n  storage.setItem(key, JSON.stringify(value));\n}\n\n// packages/persist/builds/module.js\nvar module_default = src_default;\nexport {\n  module_default as default,\n  src_default as persist\n};\n", "import Alpine from 'alpinejs'\nimport mask from '@alpinejs/mask'\nimport dialog from '@fylgja/alpinejs-dialog';\nimport { createChart } from './charts-dashboard.js'\nimport persist from '@alpinejs/persist'\n\nwindow.Alpine = Alpine\n\nAlpine.plugin(mask)\nAlpine.plugin(dialog)\nAlpine.plugin(persist)\n\ndocument.addEventListener('alpine:init', () => {\n    Alpine.data('filterbox', () => ({\n        selectedBox: 0,\n        showPrevious: true,\n        showNext: true,\n        numberOfBoxes() {\n            return this.$refs.boxes.querySelectorAll(\".filter-box\").length;\n        },\n        selectNextBox() {\n            this.$refs.boxes.scrollBy({\n                top: 0,\n                left: 150,\n                behavior: \"smooth\",\n            });\n        },\n        selectPreviousBox() {\n            this.$refs.boxes.scrollBy({\n                top: 0,\n                left: -150,\n                behavior: \"smooth\",\n            });\n        },\n        init() {\n            this.checkFirstElement = new IntersectionObserver((entries) => {\n                this.showPrevious = (entries[0].intersectionRatio <= 0);\n            }, { threshold: 0, root: this.$refs.boxes, rootMargin: \"0px 0px 0px -200px\" });\n            this.checkLastElement = new IntersectionObserver((entries) => {\n                this.showNext = (entries[0].intersectionRatio <= 0);\n            }, { threshold: 0, root: this.$refs.boxes, rootMargin: \"0px -200px 0px 0px\" });\n            var boxes = this.$refs.boxes.querySelectorAll(\".filter-box\")\n            this.checkFirstElement.observe(boxes[0]);\n            this.checkLastElement.observe(boxes[boxes.length - 1]);\n        },\n    }));\n\n    Alpine.data('checkboxes', () => ({\n        selectAll: false,\n        selectedItems: [],\n        openFields: false,\n\n        selectAllCheckboxes() {\n            this.selectAll = !this.selectAll\n\n            let checkboxes = document.querySelectorAll('input[type=checkbox][name=selected-charity]');\n            let allValues = [];\n\n            [...checkboxes].map((el) => {\n                allValues.push(el.value)\n\n                this.selectedItems = this.selectAll ? allValues : []\n            })\n        }\n    }))\n\n    Alpine.data('chart', (chart_item) => ({\n        id: chart_item.id,\n        js_data: chart_item.js_data,\n        columns: chart_item.columns,\n        context: chart_item.context,\n        title: chart_item.title,\n        init() {\n            if (chart_item.js_data === null) {\n                return;\n            }\n            console.log(\"Creating chart with ID:\", chart_item.id);\n            createChart(this.$refs.chart_ctx, chart_item.id, chart_item.js_data);\n        }\n    }));\n});\n\n\nexport default Alpine", "import 'htmx.org'\nimport { createToast } from './htmx-toast.js'\n\nwindow.htmx = require('htmx.org');\n\ndocument.body.addEventListener('htmx:beforeSwap', function (event) {\n    if (event.detail.xhr.status === 422) {\n        const targetError = event.detail.requestConfig.elt.attributes.getNamedItem('hx-target-error').value;\n        if (targetError) {\n            event.detail.shouldSwap = true;\n            event.detail.target = htmx.find(targetError);\n        }\n    }\n});\n\ndocument.body.addEventListener('htmx:responseError', function (event) {\n    createToast({\n        title: event.detail.xhr.status + \": \" + event.detail.xhr.statusText,\n        message: \"Problem loading page\",\n        tags: \"error\"\n    })\n});\n\nhtmx.on(\"messages\", (event) => {\n    event.detail.value.forEach((message) => {\n        createToast(message)\n    })\n})\n\n// Remove elements with x-from-template attribute when history is restored\n// https://github.com/alpinejs/alpine/discussions/2924#discussioncomment-3877977\nhtmx.on('htmx:historyRestore', (evt) => {\n    document.querySelectorAll('[x-from-template]').forEach((e) => e.remove())\n})\n", "export function createToast(message) {\n    // Clone the template\n    const element = Array.from(\n        document.querySelector(\"#toast-template\").content.cloneNode(true).childNodes\n    ).filter(node => node.nodeType === 1)[0]\n    const container = document.querySelector(\"#toast-container\")\n\n    // Set the CSS class\n    element.classList.add(message.tags)\n\n    // Set the title\n    if (message.title) {\n        element.querySelector(\"h4\").innerText = message.title\n    } else {\n        element.querySelector(\"h4\").remove()\n    }\n\n    // Set the text\n    element.querySelector(\"p\").innerText = message.message\n\n    // Add the new element to the container\n    container.appendChild(element)\n\n    // Add the close button event listener\n    element.querySelector(\".close-button\").addEventListener(\"click\", () => {\n        element.remove()\n    })\n\n    // Remove the element after 5 seconds\n    setTimeout(() => {\n        element.remove()\n    }, 5000)\n\n}", "\ndocument.querySelectorAll(\".sidebar-card details\").forEach(function (details) {\n    details.classList.add(\"js-animate\");\n    if (details.open) {\n        details.classList.add(\"show\");\n    }\n    details.addEventListener(\"toggle\", (event) => {\n        if (details.open) {\n            details.classList.add(\"show\");\n        } else {\n            details.classList.remove(\"show\");\n        }\n    });\n});", "import { czPieChart, czFundsBarChart } from './charts.js';\n\nfunction createIncomeChart() {\n    var ctx_income_chart = document.getElementById('income-chart');\n    if (!CZ_DATA[\"income_chart\"] || !ctx_income_chart) {\n        return;\n    }\n    return czPieChart(ctx_income_chart, CZ_DATA[\"income_chart\"], legend = false);\n}\n\nfunction createSpendingChart() {\n    var ctx_spending_chart = document.getElementById('spending-chart');\n    if (!CZ_DATA[\"spending_chart\"] || !ctx_spending_chart) {\n        return;\n    }\n    return czPieChart(ctx_spending_chart, CZ_DATA[\"spending_chart\"], legend = false);\n}\n\n\nfunction createFundsChart() {\n    var ctx_funds_chart = document.getElementById('funds-chart');\n    if (!CZ_DATA[\"funds_chart\"] || !ctx_funds_chart) {\n        return;\n    }\n    var funds_chart = czFundsBarChart(ctx_funds_chart, CZ_DATA[\"funds_chart\"], legend = false);\n}\n\nexport default function createCharts() {\n    createIncomeChart();\n    createSpendingChart();\n    createFundsChart();\n}", "import { default as Chart } from './charts.js';\n\nexport default function createCharts() {\n    var ctx = document.getElementById('change-over-time');\n    if (!CZ_DATA[\"financial_history\"] || !ctx) {\n        return;\n    }\n    var finances = CZ_DATA[\"financial_history\"];\n    var prefix = \"\u00A3\";\n\n    return new Chart(ctx, {\n        type: 'line',\n        data: {\n            labels: finances.map((x) => x.fye.slice(0, 4)),\n            datasets: [{\n                label: 'Income',\n                data: finances.map((x) => x.income),\n                fill: false,\n                lineTension: 0,\n                borderColor: '#4A3CE6',\n                pointRadius: 1,\n                hitRadius: 5,\n            }, {\n                label: 'Spending',\n                data: finances.map((x) => x.spending),\n                fill: false,\n                lineTension: 0,\n                borderColor: '#F6306C',\n                pointRadius: 1,\n                hitRadius: 5,\n            }]\n        },\n        options: {\n            plugins: {\n                legend: {\n                    position: 'bottom',\n                    align: 'start',\n                    labels: {\n                        boxHeight: 1,\n                    }\n                }\n            },\n            scales: {\n                y: {\n                    beginAtZero: true,\n                    ticks: {\n                        callback: function (value, index, values) {\n                            if (value > 1000000000) {\n                                return prefix + (value / 1000000000) + \"bn\";\n                            } else if (value > 1000000) {\n                                return prefix + (value / 1000000) + \"m\";\n                            } else if (value > 1000) {\n                                return prefix + (value / 1000) + \"k\";\n                            }\n                            return prefix + value;\n                        },\n                        count: 2,\n                    },\n                    grid: {\n                        display: false,\n                    }\n                },\n                x: {\n                    /*type: 'time',\n                    time: {\n                        unit: 'month',\n                        displayFormats: {\n                            month: 'YYYY',\n                        }\n                    },*/\n                    ticks: {\n                        stepSize: 24,\n                    },\n                    distribution: 'series',\n                    grid: {\n                        display: false,\n                    }\n                }\n            }\n        }\n    });\n}", "import { czMiniFinanceChart } from './charts.js';\n\nexport function createMiniExpenditureChart() {\n    var ctx = document.getElementById('expenditure-change-over-time');\n    if (!CZ_DATA[\"financial_history\"] || !ctx) {\n        return;\n    }\n    var finances = CZ_DATA[\"financial_history\"].slice(-5);\n\n    var color = '#F6306C';\n    if (finances[0].spending < finances[finances.length - 1].spending) {\n        color = '#68C7C3';\n    }\n\n    return czMiniFinanceChart(\n        ctx,\n        finances.map((x) => x.fye.slice(0, 4)),\n        finances.map((x) => x.spending),\n        'Spending',\n        color\n    );\n}\n\nexport function createMiniIncomeChart() {\n    var ctx = document.getElementById('income-change-over-time');\n    if (!CZ_DATA[\"financial_history\"] || !ctx) {\n        return;\n    }\n    var finances = CZ_DATA[\"financial_history\"].slice(-5);\n\n    var color = '#F6306C';\n    if (finances[0].income < finances[finances.length - 1].income) {\n        color = '#68C7C3';\n    }\n\n    return czMiniFinanceChart(\n        ctx,\n        finances.map((x) => x.fye.slice(0, 4)),\n        finances.map((x) => x.income),\n        'Income',\n        color\n    );\n}", "import { setupCopyText } from './copytext.js'\nimport { setupTables } from './tables.js'\nimport { default as Alpine } from './setupAlpine.js'\nimport './setupHtmx.js'\nimport './sidebarcards.js'\nimport { default as Chart } from './charts.js'\nimport { default as createOverviewCharts } from './charts-charity-overview.js'\nimport { default as createFinanceCharts } from './charts-charity-finances.js'\nimport { createMiniExpenditureChart, createMiniIncomeChart } from './charts-checks-finances.js'\n\nfunction main() {\n    setupCopyText();\n    createOverviewCharts();\n    createFinanceCharts();\n    createMiniExpenditureChart();\n    createMiniIncomeChart();\n    setupTables();\n}\n\ndocument.addEventListener(\"htmx:afterSettle\", function (event) {\n    main();\n});\n\ndocument.addEventListener(\"DOMContentLoaded\", function (event) {\n    main();\n});\n\nwindow.Chart = Chart;\nAlpine.start();"],
  "mappings": "q0BAQO,SAASA,GAAOC,GAAM,CAC5B,IAAIC,GAAGC,GAAGC,GAAKC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AAW,QAAQ,kBAAqB,MAAM,EAAE,EAEhDC,GAAQ,UACZ,OAAID,GAAS,CAAC,EAAE,SAAWA,GAASA,GAAS,OAAS,CAAC,EAAE,WACrDC,GAAQ,WAGLC,GACHH,GACAC,GAAS,IAAKG,IAAMA,GAAE,IAAI,MAAM,EAAG,CAAC,CAAC,EACrCH,GAAS,IAAKG,IAAMA,GAAE,QAAQ,EAC9B,WACAF,EACJ,EACJ,CAEO,SAASG,IAAwB,CACpC,IAAIL,GAAM,SAAS,eAAe,yBAAyB,EAC3D,GAAI,GAAC,QAAQ,mBAAwB,CAACA,IAGtC,KAAIC,GAAW,QAAQ,kBAAqB,MAAM,EAAE,EAEhDC,GAAQ,UACZ,OAAID,GAAS,CAAC,EAAE,OAASA,GAASA,GAAS,OAAS,CAAC,EAAE,SACnDC,GAAQ,WAGLC,GACHH,GACAC,GAAS,IAAKG,IAAMA,GAAE,IAAI,MAAM,EAAG,CAAC,CAAC,EACrCH,GAAS,IAAKG,IAAMA,GAAE,MAAM,EAC5B,SACAF,EACJ,EACJ,CChCA,SAASI,IAAO,CACZC,GAAc,EACdC,GAAqB,EACrBA,GAAoB,EACpBC,GAA2B,EAC3BC,GAAsB,EACtBC,GAAY,CAChB,CAEA,SAAS,iBAAiB,mBAAoB,SAAUC,GAAO,CAC3DN,GAAK,CACT,CAAC,EAED,SAAS,iBAAiB,mBAAoB,SAAUM,GAAO,CAC3DN,GAAK,CACT,CAAC,EAED,OAAO,MAAQO,GACfC,GAAO,MAAM",
  "names": ["extend", "dest", "i", "j", "len", "src", "create", "F", "proto", "bind", "fn", "obj", "slice", "args", "lastId", "stamp", "throttle", "time", "context", "lock", "wrapperFn", "later", "wrapNum", "x", "range", "includeMax", "max", "min", "d", "falseFn", "formatNum", "num", "precision", "pow", "trim", "str", "splitWords", "setOptions", "options", "getParamString", "existingUrl", "uppercase", "params", "templateRe", "template", "data", "key", "value", "isArray", "indexOf", "array", "el", "emptyImageUrl", "getPrefixed", "name", "lastTime", "timeoutDefer", "timeToCall", "requestFn", "cancelFn", "id", "requestAnimFrame", "immediate", "cancelAnimFrame", "Class", "props", "NewClass", "Util.setOptions", "parentProto", "Util.create", "Util.extend", "checkDeprecatedMixinEvents", "parentOptions", "init", "includes", "Util.isArray", "Events", "types", "type", "Util.splitWords", "removeAll", "_once", "newListener", "listeners", "Util.falseFn", "index", "listener", "propagate", "event", "l", "_fn", "Util.stamp", "e", "Evented", "Point", "y", "round", "trunc", "v", "point", "toPoint", "Bounds", "a", "b", "points", "min2", "max2", "toBounds", "bounds", "xIntersects", "yIntersects", "xOverlaps", "yOverlaps", "bufferRatio", "heightBuffer", "widthBuffer", "LatLngBounds", "corner1", "corner2", "latlngs", "sw", "ne", "sw2", "ne2", "LatLng", "toLatLng", "toLatLngBounds", "latIntersects", "lngIntersects", "latOverlaps", "lngOverlaps", "maxMargin", "lat", "lng", "alt", "margin", "Util.formatNum", "other", "Earth", "sizeInMeters", "latAccuracy", "lngAccuracy", "c", "CRS", "latlng", "zoom", "projectedPoint", "scale", "untransformedPoint", "s", "Util.wrapNum", "center", "newCenter", "latShift", "lngShift", "newSw", "newNe", "latlng1", "latlng2", "rad", "lat1", "lat2", "sinDLat", "sinDLon", "earthRadius", "SphericalMercator", "sin", "Transformation", "toTransformation", "EPSG3857", "EPSG900913", "svgCreate", "pointsToPath", "rings", "closed", "len2", "p", "Browser", "style", "ie", "ielt9", "edge", "webkit", "userAgentContains", "android", "android23", "webkitVer", "androidStock", "opera", "chrome", "gecko", "safari", "phantom", "opera12", "win", "ie3d", "webkit3d", "gecko3d", "any3d", "mobile", "mobileWebkit", "mobileWebkit3d", "msPointer", "pointer", "touchNative", "touch", "mobileOpera", "mobileGecko", "retina", "passiveEvents", "supportsPassiveOption", "opts", "canvas", "svg", "inlineSvg", "div", "vml", "shape", "mac", "linux", "POINTER_DOWN", "POINTER_MOVE", "POINTER_UP", "POINTER_CANCEL", "pEvent", "handle", "_onPointerStart", "_handlePointer", "_pointers", "_pointerDocListener", "addPointerListener", "handler", "_addPointerDocListener", "removePointerListener", "_globalPointerDown", "_globalPointerMove", "_globalPointerUp", "DomEvent.preventDefault", "makeDblclick", "newEvent", "prop", "delay", "addDoubleTapListener", "last", "detail", "simDblclick", "path", "DomEvent.getPropagationPath", "now", "removeDoubleTapListener", "handlers", "TRANSFORM", "testProp", "TRANSITION", "TRANSITION_END", "get", "getStyle", "css", "tagName", "className", "container", "remove", "parent", "empty", "toFront", "toBack", "hasClass", "getClass", "addClass", "classes", "setClass", "removeClass", "Util.trim", "setOpacity", "_setOpacityIE", "filter", "filterName", "setTransform", "offset", "pos", "setPosition", "getPosition", "disableTextSelection", "enableTextSelection", "_userSelect", "DomEvent.on", "DomEvent.off", "userSelectProperty", "disableImageDrag", "enableImageDrag", "_outlineElement", "_outlineStyle", "preventOutline", "element", "restoreOutline", "getSizedParentNode", "getScale", "rect", "on", "addOne", "eventsKey", "off", "batchRemove", "removeOne", "Util.indexOf", "filterFn", "mouseSubst", "originalHandler", "isExternalTarget", "stopPropagation", "disableScrollPropagation", "disableClickPropagation", "preventDefault", "stop", "getPropagationPath", "ev", "getMousePosition", "wheelPxFactor", "getWheelDelta", "related", "PosAnimation", "newPos", "duration", "easeLinearity", "DomUtil.getPosition", "Util.requestAnimFrame", "elapsed", "progress", "DomUtil.setPosition", "Util.cancelAnimFrame", "t", "Map", "Util.bind", "DomUtil.TRANSITION", "DomUtil.TRANSITION_END", "moved", "delta", "viewHalf", "containerPoint", "centerOffset", "paddingTL", "paddingBR", "paddingOffset", "swPoint", "nePoint", "target", "DomUtil.addClass", "targetCenter", "targetZoom", "from", "to", "size", "startZoom", "w0", "w1", "u1", "rho", "rho2", "r", "s1", "s2", "t1", "b1", "sq", "log", "sinh", "n", "cosh", "tanh", "r0", "w", "u", "easeOut", "start", "S", "frame", "oldZoom", "pixelCenter", "pixelPoint", "pixelBounds", "paddedBounds", "paddedSize", "oldSize", "newSize", "oldCenter", "onResponse", "onError", "error", "message", "HandlerClass", "DomUtil.remove", "pane", "DomUtil.create", "inside", "padding", "nw", "se", "boundsSize", "snap", "scalex", "scaley", "topLeftPoint", "toZoom", "fromZoom", "crs", "layerPoint", "DomEvent.getMousePosition", "DomUtil.get", "position", "DomUtil.getStyle", "panes", "noMoveStart", "loading", "zoomChanged", "supressEvent", "onOff", "targets", "isHover", "dragging", "DomEvent.isExternalTarget", "DomUtil.preventOutline", "canvasTargets", "synth", "filtered", "isMarker", "callback", "pixelOrigin", "topLeft", "latLngBounds", "centerPoint", "viewBounds", "newBounds", "pxBounds", "maxBounds", "projectedMaxBounds", "minOffset", "maxOffset", "dx", "dy", "left", "right", "DomUtil.removeClass", "proxy", "DomUtil.TRANSFORM", "transform", "DomUtil.setTransform", "z", "startAnim", "noUpdate", "createMap", "Control", "map", "corner", "control", "corners", "createCorner", "vSide", "hSide", "Layers", "layerA", "layerB", "nameA", "nameB", "baseLayers", "overlays", "layer", "acceptableHeight", "collapsed", "DomEvent.disableClickPropagation", "DomEvent.disableScrollPropagation", "section", "link", "overlay", "DomUtil.empty", "baseLayersPresent", "overlaysPresent", "baseLayersCount", "checked", "radioHtml", "radioFragment", "label", "input", "holder", "inputs", "addedLayers", "removedLayers", "that", "layers", "Zoom", "zoomName", "html", "title", "DomEvent.stop", "Scale", "maxMeters", "meters", "maxFeet", "maxMiles", "miles", "feet", "text", "ratio", "pow10", "ukrainianFlag", "Attribution", "prefix", "attribs", "prefixAndAttribs", "attribution", "Handler", "Mixin", "START", "Draggable", "dragStartTarget", "DomUtil.hasClass", "DomUtil.disableImageDrag", "DomUtil.disableTextSelection", "first", "sizedParent", "DomUtil.getSizedParentNode", "DomUtil.getScale", "mouseevent", "noInertia", "DomUtil.enableImageDrag", "DomUtil.enableTextSelection", "fireDragend", "clipPolygon", "clippedPoints", "edges", "k", "LineUtil._getBitCode", "LineUtil._getEdgeIntersection", "polygonCenter", "p1", "p2", "f", "area", "LineUtil.isFlat", "centroidLatLng", "areaBounds", "centroid", "latlngCenter", "coords", "latSum", "lngSum", "simplify", "tolerance", "sqTolerance", "_reducePoints", "_simplifyDP", "pointToSegmentDistance", "_sqClosestPointOnSegment", "closestPointOnSegment", "ArrayConstructor", "markers", "_simplifyDPStep", "newPoints", "maxSqDist", "sqDist", "reducedPoints", "prev", "_sqDist", "_lastCode", "clipSegment", "useLastCode", "codeA", "_getBitCode", "codeB", "codeOut", "newCode", "_getEdgeIntersection", "code", "dot", "isFlat", "_flat", "polylineCenter", "halfDist", "segDist", "dist", "LonLat", "Mercator", "tmp", "con", "ts", "phi", "dphi", "EPSG3395", "EPSG4326", "Simple", "Layer", "targetEl", "events", "method", "minZoom", "maxZoom", "oldZoomSpan", "LayerGroup", "layerId", "methodName", "zIndex", "layerGroup", "FeatureGroup", "featureGroup", "Icon", "oldIcon", "img", "sizeOption", "anchor", "icon", "IconDefault", "strip", "re", "idx", "match", "MarkerDrag", "marker", "speed", "iconPos", "origin", "panBounds", "movement", "shadow", "Marker", "latLng", "oldLatLng", "classToAdd", "addIcon", "newShadow", "addShadow", "opt", "draggable", "opacity", "DomUtil.setOpacity", "iconOpts", "Path", "CircleMarker", "radius", "r2", "circleMarker", "Circle", "legacyOptions", "half", "latR", "top", "bottom", "lngR", "circle", "Polyline", "minDistance", "minPoint", "closest", "LineUtil._sqClosestPointOnSegment", "jLen", "LineUtil.polylineCenter", "result", "flat", "projectedBounds", "ring", "parts", "segment", "LineUtil.clipSegment", "LineUtil.simplify", "part", "LineUtil.pointToSegmentDistance", "polyline", "LineUtil._flat", "Polygon", "PolyUtil.polygonCenter", "clipped", "PolyUtil.clipPolygon", "polygon", "GeoJSON", "geojson", "features", "feature", "geometryToLayer", "asFeature", "geometry", "pointToLayer", "_coordsToLatLng", "coordsToLatLng", "_pointToLayer", "coordsToLatLngs", "geoLayer", "featureLayer", "pointToLayerFn", "levelsDeep", "latLngToCoords", "latLngsToCoords", "getFeature", "newGeometry", "PointToGeoJSON", "multi", "holes", "isGeometryCollection", "jsons", "json", "geoJSON", "geoJson", "ImageOverlay", "url", "styleOpts", "DomUtil.toFront", "DomUtil.toBack", "wasElementSupplied", "image", "errorUrl", "imageOverlay", "VideoOverlay", "vid", "sourceElements", "sources", "source", "videoOverlay", "video", "SVGOverlay", "svgOverlay", "DivOverlay", "content", "node", "OverlayClass", "old", "Popup", "DomEvent.stopPropagation", "wrapper", "closeButton", "width", "height", "maxHeight", "scrolledClass", "marginBottom", "containerHeight", "containerWidth", "layerPos", "containerPos", "popup", "Tooltip", "subX", "subY", "tooltipPoint", "direction", "tooltipWidth", "tooltipHeight", "tooltip", "DivIcon", "bgPos", "divIcon", "GridLayer", "tileZoom", "Util.throttle", "compare", "edgeZIndex", "nextFrame", "willPrune", "tile", "fade", "level", "x2", "y2", "z2", "coords2", "animating", "noPrune", "tileZoomChanged", "translate", "tileSize", "mapZoom", "halfSize", "tileRange", "tileCenter", "queue", "noPruneRange", "fragment", "tileBounds", "nwPoint", "sePoint", "bp", "tilePos", "err", "newCoords", "gridLayer", "TileLayer", "noRedraw", "done", "invertedY", "Util.template", "zoomReverse", "zoomOffset", "tilePoint", "Util.emptyImageUrl", "tileLayer", "TileLayerWMS", "wmsParams", "realRetina", "projectionKey", "bbox", "tileLayerWMS", "Renderer", "currentCenterPoint", "topLeftOffset", "Canvas", "m", "order", "next", "dashArray", "dashValue", "ctx", "clickedLayer", "candidateHoveredLayer", "vmlCreate", "vmlMixin", "stroke", "fill", "SVG", "arc", "renderer", "Rectangle", "rectangle", "BoxZoom", "DoubleClickZoom", "Drag", "pxCenter", "pxWorldCenter", "threshold", "limit", "worldWidth", "halfWidth", "newX1", "newX2", "newX", "ease", "speedVector", "limitedSpeed", "limitedSpeedVector", "decelerationDuration", "Keyboard", "body", "docEl", "panDelta", "keys", "codes", "zoomDelta", "newLatLng", "ScrollWheelZoom", "DomEvent.getWheelDelta", "debounce", "d2", "d3", "d4", "tapHoldDelay", "TapHold", "cancelClickPrevent", "simulatedEvent", "TouchZoom", "moveFn", "define", "t", "__awaiter", "thisArg", "_arguments", "P", "generator", "Promise", "resolve", "reject", "fulfilled", "value", "step", "next", "e", "rejected", "result", "done", "then", "apply", "r", "SuppressedError", "pointGeometry", "Point", "x", "y", "this", "prototype", "clone", "add", "p", "_add", "sub", "_sub", "multByPoint", "_multByPoint", "divByPoint", "_divByPoint", "mult", "k", "_mult", "div", "_div", "rotate", "a", "_rotate", "rotateAround", "_rotateAround", "matMult", "m", "_matMult", "unit", "_unit", "perp", "_perp", "round", "_round", "mag", "Math", "sqrt", "equals", "other", "dist", "distSqr", "dx", "dy", "angle", "atan2", "angleTo", "b", "angleWith", "angleWithSep", "cos", "sin", "convert", "Array", "isArray", "unitbezier", "UnitBezier", "p1x", "p1y", "p2x", "p2y", "cx", "bx", "ax", "cy", "by", "ay", "sampleCurveX", "sampleCurveY", "sampleCurveDerivativeX", "solveCurveX", "epsilon", "i", "x2", "abs", "d2", "t0", "t1", "solve", "l", "supportsOffscreenCanvas", "offscreenCanvasDistorted", "offscreenCanvasSupported", "OffscreenCanvas", "getContext", "createImageBitmap", "isOffscreenCanvasDistorted", "context", "size", "willReadFrequently", "base", "fillStyle", "fillRect", "floor", "data", "getImageData", "bezier", "defaultEasing", "clamp", "n", "min", "max", "wrap", "d", "w", "extend", "dest", "sources", "src", "id", "mapObject", "input", "iterator", "output", "key", "call", "filterObject", "map", "warnOnceHistory", "warnOnce", "message", "console", "warn", "isCounterClockwise", "c", "isWorker", "self", "WorkerGlobalScope", "_isSafari", "isImageBitmap", "image", "ImageBitmap", "transparentPngUrl", "readImageUsingVideoFrame", "width", "height", "VideoFrame", "Error", "frame", "timestamp", "format", "startsWith", "swapBR", "Uint8ClampedArray", "copyTo", "destRowOffset", "offset", "stride", "sourceLeft", "sourceTop", "rect", "layout", "length", "tmp", "close", "offscreenCanvas", "offscreenCanvasContext", "ABORT_ERROR", "createAbortError", "config", "MAX_PARALLEL_IMAGE_REQUESTS", "MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME", "MAX_TILE_CACHE_ZOOM_LEVELS", "REGISTERED_PROTOCOLS", "WORKER_URL", "getProtocol", "url", "substring", "indexOf", "GLOBAL_DISPATCHER_ID", "AJAXError", "constructor", "status", "statusText", "body", "super", "getReferrer", "worker", "referrer", "window", "location", "protocol", "parent", "href", "makeRequest", "requestParameters", "abortController", "test", "protocolLoadFn", "actor", "sendAsync", "type", "targetMapId", "fetch", "Request", "AbortController", "Object", "hasOwnProperty", "request", "method", "credentials", "headers", "cache", "signal", "has", "set", "response", "ok", "blob", "parsePromise", "arrayBuffer", "json", "text", "aborted", "cacheControl", "get", "expires", "mustQueue", "xhr", "XMLHttpRequest", "open", "responseType", "setRequestHeader", "_a", "Accept", "withCredentials", "onerror", "onload", "JSON", "parse", "err", "getResponseHeader", "Blob", "addEventListener", "abort", "send", "sameOrigin", "inComingUrl", "urlObj", "URL", "locationObj", "host", "_addEventListener", "listener", "listenerList", "push", "_removeEventListener", "index", "splice", "Event", "ErrorEvent", "error", "Evented", "on", "_listeners", "off", "_oneTimeListeners", "once", "fire", "event", "properties", "listens", "target", "listeners", "slice", "oneTimeListeners", "_eventedParent", "_eventedParentData", "setEventedParent", "v8Spec", "$version", "$root", "version", "required", "values", "name", "metadata", "center", "zoom", "bearing", "default", "period", "units", "pitch", "light", "sky", "projection", "terrain", "sprite", "glyphs", "transition", "layers", "source", "source_vector", "vector", "tiles", "bounds", "scheme", "xyz", "tms", "minzoom", "maxzoom", "attribution", "promoteId", "volatile", "source_raster", "raster", "tileSize", "source_raster_dem", "encoding", "terrarium", "mapbox", "custom", "redFactor", "blueFactor", "greenFactor", "baseShift", "source_geojson", "geojson", "buffer", "maximum", "minimum", "filter", "tolerance", "cluster", "clusterRadius", "clusterMaxZoom", "clusterMinPoints", "clusterProperties", "lineMetrics", "generateId", "source_video", "video", "urls", "coordinates", "source_image", "layer", "fill", "line", "symbol", "circle", "heatmap", "hillshade", "background", "paint", "layout_background", "visibility", "visible", "none", "layout_fill", "expression", "interpolated", "parameters", "layout_circle", "layout_heatmap", "layout_line", "butt", "square", "bevel", "miter", "requires", "layout_symbol", "point", "auto", "never", "always", "cooperative", "viewport", "both", "tokens", "left", "right", "top", "bottom", "horizontal", "vertical", "uppercase", "lowercase", "layout_raster", "layout_hillshade", "filter_operator", "in", "all", "any", "geometry_type", "LineString", "Polygon", "function", "stops", "property", "identity", "exponential", "interval", "categorical", "colorSpace", "rgb", "lab", "hcl", "function_stop", "anchor", "position", "color", "intensity", "exaggeration", "mercator", "globe", "paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_symbol", "overridable", "paint_raster", "linear", "nearest", "paint_hillshade", "paint_background", "duration", "delay", "constant", "refProperties", "deref", "forEach", "deepEqual", "keys", "addCommand", "commands", "command", "addSource", "sourceId", "after", "args", "removeSource", "sourcesRemoved", "updateSource", "canUpdateGeoJSON", "before", "prop", "diffLayerPropertyChanges", "layerId", "klass", "pluckId", "indexById", "group", "ValidationError", "identifier", "__line__", "extendBy", "inputs", "ExpressionParsingError", "Scope", "bindings", "concat", "NullType", "kind", "NumberType", "StringType", "BooleanType", "ColorType", "ObjectType", "ValueType", "CollatorType", "FormattedType", "PaddingType", "ResolvedImageType", "VariableAnchorOffsetCollectionType", "array$1", "itemType", "N", "toString$1", "valueMemberTypes", "checkSubtype", "expected", "memberType", "isValidType", "provided", "allowedTypes", "some", "isValidNativeType", "verifyType", "sample", "Xn", "Zn", "t2", "t3", "deg2rad", "PI", "rad2deg", "constrainAngle", "rgbToLab", "g", "alpha", "z", "xyz2lab", "rgb2xyz", "pow", "labToRgb", "isNaN", "lab2xyz", "xyz2rgb", "parseHex", "hex", "parseInt", "padEnd", "parseAlpha", "asPercentage", "validateNumbers", "array", "Number", "namedColors", "aliceblue", "antiquewhite", "aqua", "aquamarine", "azure", "beige", "bisque", "black", "blanchedalmond", "blue", "blueviolet", "brown", "burlywood", "cadetblue", "chartreuse", "chocolate", "coral", "cornflowerblue", "cornsilk", "crimson", "cyan", "darkblue", "darkcyan", "darkgoldenrod", "darkgray", "darkgreen", "darkgrey", "darkkhaki", "darkmagenta", "darkolivegreen", "darkorange", "darkorchid", "darkred", "darksalmon", "darkseagreen", "darkslateblue", "darkslategray", "darkslategrey", "darkturquoise", "darkviolet", "deeppink", "deepskyblue", "dimgray", "dimgrey", "dodgerblue", "firebrick", "floralwhite", "forestgreen", "fuchsia", "gainsboro", "ghostwhite", "gold", "goldenrod", "gray", "green", "greenyellow", "grey", "honeydew", "hotpink", "indianred", "indigo", "ivory", "khaki", "lavender", "lavenderblush", "lawngreen", "lemonchiffon", "lightblue", "lightcoral", "lightcyan", "lightgoldenrodyellow", "lightgray", "lightgreen", "lightgrey", "lightpink", "lightsalmon", "lightseagreen", "lightskyblue", "lightslategray", "lightslategrey", "lightsteelblue", "lightyellow", "lime", "limegreen", "linen", "magenta", "maroon", "mediumaquamarine", "mediumblue", "mediumorchid", "mediumpurple", "mediumseagreen", "mediumslateblue", "mediumspringgreen", "mediumturquoise", "mediumvioletred", "midnightblue", "mintcream", "mistyrose", "moccasin", "navajowhite", "navy", "oldlace", "olive", "olivedrab", "orange", "orangered", "orchid", "palegoldenrod", "palegreen", "paleturquoise", "palevioletred", "papayawhip", "peachpuff", "peru", "pink", "plum", "powderblue", "purple", "rebeccapurple", "red", "rosybrown", "royalblue", "saddlebrown", "salmon", "sandybrown", "seagreen", "seashell", "sienna", "silver", "skyblue", "slateblue", "slategray", "slategrey", "snow", "springgreen", "steelblue", "tan", "teal", "thistle", "tomato", "turquoise", "violet", "wheat", "white", "whitesmoke", "yellow", "yellowgreen", "Color", "premultiplied", "overwriteGetter", "static", "rgba", "toLowerCase", "trim", "namedColorsMatch", "rgbMatch", "match", "_", "rp", "f1", "gp", "f2", "bp", "f3", "ap", "argFormat", "join", "valFormat", "maxValue", "hslMatch", "h", "s", "hsla", "f", "Infinity", "rgbColor", "NaN", "getterKey", "lazyValue", "defineProperty", "toString", "transparent", "Collator", "caseSensitive", "diacriticSensitive", "locale", "sensitivity", "collator", "Intl", "usage", "compare", "lhs", "rhs", "resolvedLocale", "resolvedOptions", "FormattedSection", "scale", "fontStack", "textColor", "Formatted", "sections", "unformatted", "isEmpty", "section", "fromString", "Padding", "val", "stringify", "anchors", "Set", "VariableAnchorOffsetCollection", "anchorValue", "offsetValue", "ResolvedImage", "options", "available", "validateRGBA", "isValue", "mixed", "item", "typeOf", "String", "Literal", "expectedType", "evaluate", "eachChild", "outputDefined", "RuntimeError", "toJSON", "types$1", "string", "number", "boolean", "object", "Assertion", "parsed", "ctx", "fn", "every", "arg", "types", "Coercion", "Boolean", "parseColor", "pad", "coll", "num", "geometryTypes", "EvaluationContext", "globals", "feature", "featureState", "formattedSection", "_parseColorCache", "availableImages", "canonical", "geometryType", "geometry", "canonicalID", "cached", "ParsingContext", "registry", "isConstantFunc", "path", "scope", "errors", "part", "_isConstant", "expr", "_parse", "annotate", "typeAnnotation", "op", "Expr", "actual", "ec", "Let", "binding", "Var", "boundExpression", "At", "In", "needle", "haystack", "IndexOf", "fromIndex", "rawIndex", "Match", "inputType", "outputType", "cases", "outputs", "otherwise", "labels", "labelContext", "label", "MAX_SAFE_INTEGER", "out", "Case", "branches", "Slice", "beginIndex", "endIndex", "findStopLessThanOrEqualTo", "lastIndex", "currentValue", "nextValue", "lowerIndex", "upperIndex", "currentIndex", "Step", "labelKey", "valueKey", "stopCount", "getDefaultExportFromCjs", "__esModule", "undefined", "UnitBezier$1", "from", "to", "interpolate", "spaceKey", "hue0", "chroma0", "light0", "alphaF", "hue1", "chroma1", "light1", "alphaT", "hue", "chroma", "dh", "padding", "variableAnchorOffsetCollection", "fromValues", "toValues", "fx", "fy", "tx", "ty", "Interpolate", "operator", "interpolation", "lower", "upper", "exponentialInterpolation", "controlPoints", "rest", "interpolationFactor", "outputLower", "outputUpper", "lowerValue", "upperValue", "difference", "progress", "Coalesce", "parsedArgs", "needsAnnotation", "requestedImageName", "argCount", "isComparableType", "eqCollate", "makeComparison", "compareBasic", "compareWithCollator", "isOrderComparison", "Comparison", "hasUntypedArgument", "lt", "rt", "Equals", "NotEquals", "LessThan", "GreaterThan", "LessThanOrEqual", "GreaterThanOrEqual", "CollatorExpression", "NumberFormat", "currency", "minFractionDigits", "maxFractionDigits", "style", "minimumFractionDigits", "maximumFractionDigits", "FormatExpression", "firstArg", "nextTokenMayBeObject", "font", "lastExpression", "content", "evaluatedContent", "ImageExpression", "evaluatedImageName", "Length", "EXTENT", "getTileCoordinates", "log", "tilesAtZoom", "getLngLatFromTileCoord", "coord", "mercatorX", "mercatorY", "atan", "exp", "updateBBox", "bbox", "boxWithinBox", "bbox1", "bbox2", "pointOnBoundary", "p1", "p2", "x1", "y1", "y2", "segmentIntersectSegment", "v1", "v2", "twoSided", "lineIntersectPolygon", "polygon", "ring", "j", "pointWithinPolygon", "rings", "trueIfOnBoundary", "inside", "pointWithinPolygons", "polygons", "lineStringWithinPolygon", "lineStringWithinPolygons", "q1", "q2", "x3", "y3", "det1", "det2", "getTilePolygon", "getTilePolygons", "updatePoint", "polyBBox", "worldSize", "halfWorldSize", "shift", "getTilePoints", "pointBBox", "shifts", "tilePoints", "points", "getTileLines", "lineBBox", "tileLines", "tileLine", "Within", "geometries", "polygonsCoords", "features", "polygonGeometry", "tilePolygon", "tilePolygons", "TinyQueue$1", "_down", "_up", "pop", "peek", "pos", "current", "halfLength", "bestChild", "quickselect", "arr", "quickselectStep", "defaultCompare", "sd", "swap", "classifyRings", "maxRings", "ccw", "area", "calculateSignedArea", "compareAreas", "sum", "len", "FE", "E2", "RAD", "CheapRuler", "lat", "coslat", "w2", "kx", "ky", "distance", "pointOnLine", "minX", "minY", "minI", "minT", "minDist", "sqDist", "deg", "compareDistPair", "getRangeSize", "range", "isRangeSafe", "threshold", "splitRange", "isLine", "size1", "getBBox", "coords", "getPolygonBBox", "isValidBBox", "bboxToBBoxDistance", "ruler", "pointToLineDistance", "nearestPoint", "segmentToSegmentDistance", "dist1", "dist2", "lineToLineDistance", "line1", "range1", "line2", "range2", "pointsToPointsDistance", "points1", "points2", "pointToPolygonDistance", "front", "back", "lineToPolygonDistance", "polygonIntersect", "poly1", "poly2", "polygonToPolygonDistance", "polygon1", "polygon2", "currentMiniDist", "ring1", "len1", "ring2", "len2", "updateQueue", "distQueue", "miniDist", "rangeA", "tempDist", "updateQueueTwoSets", "pointSet1", "pointSet2", "pointsToPolygonDistance", "TinyQueue", "distPair", "newRangesA", "pointSetToPointSetDistance", "isLine1", "isLine2", "rangeB", "threshold1", "threshold2", "sublibe", "newRangesB", "toSimpleGeometry", "lineString", "Distance", "flat", "pointPosition", "linePositions", "expressions$1", "at", "case", "coalesce", "let", "literal", "var", "within", "CompoundExpression", "_evaluate", "definition", "definitions", "availableOverloads", "overloads", "signature", "signatureContext", "params", "isExpressionConstant", "argParseFailed", "signatures", "stringifySignature", "actualTypes", "obj", "v", "varargs", "isTypeAnnotation", "childrenConstant", "child", "isFeatureConstant", "isGlobalPropertyConstant", "isStateConstant", "success", "supportsPropertyExpression", "spec", "supportsZoomExpression", "supportsInterpolation", "getType", "isFunction$1", "identityFunction", "createFunction", "propertySpec", "isColor", "zoomAndFeatureDependent", "zoomDependent", "parseFn", "stop", "innerFun", "hashedStops", "categoricalKeyType", "evaluateExponentialFunction", "evaluateIntervalFunction", "evaluateCategoricalFunction", "create", "evaluateIdentityFunction", "featureFunctions", "zoomStops", "featureFunctionStops", "interpolationType", "bind", "coalesce$1", "keyType", "interp", "evaluatedLower", "evaluatedUpper", "register", "typeof", "heatmapDensity", "lineProgress", "accumulated", "ln2", "LN2", "pi", "E", "log10", "LN10", "ln", "log2", "asin", "acos", "ceil", "isSupportedScript", "upcase", "toUpperCase", "downcase", "StyleExpression", "_warningHistory", "_evaluator", "_defaultValue", "_enumValues", "evaluateWithoutErrorHandling", "isExpression", "createExpression", "parser", "enum", "formatted", "resolvedImage", "ZoomConstantExpression", "_styleExpression", "isStateDependent", "ZoomDependentExpression", "createPropertyExpression", "expressionInput", "isFeatureConstantResult", "isZoomConstant", "zoomCurve", "findZoomCurve", "StylePropertyFunction", "specification", "_parameters", "_specification", "serialized", "childResult", "isExpressionFilter", "filterSpec", "createFilter", "needGeometry", "convertFilter$1", "compiled", "globalProperties", "geometryNeeded", "convertComparisonOp$1", "convertNegation", "filters", "convertInOp$1", "convertHasOp$1", "sort", "stringify$1", "str", "getKey", "validateConstants", "constants", "unbundle", "valueOf", "deepUnbundle", "unbundledValue", "validateObject", "elementSpecs", "valueSpec", "elementValidators", "objectElementValidators", "styleSpec", "validateSpec", "objectKey", "elementSpecKey", "split", "elementSpec", "validateElement", "validateArray", "arraySpec", "validateArrayElement", "arrayElementValidator", "arrayElementSpec", "arrayIndex", "validateNumber", "validateFunction", "functionValueSpec", "functionType", "stopKeyType", "previousStopDomainValue", "previousStopDomainZoom", "stopDomainValues", "isZoomFunction", "isPropertyFunction", "isZoomAndPropertyFunction", "validateFunctionStop", "validateStopDomainValue", "reportValue", "isFinite", "validateExpression", "expressionContext", "expressionObj", "propertyKey", "propertyType", "validateEnum", "validateFilter", "validateNonExpressionFilter", "validateProperty", "layerSpec", "layerType", "transitionMatch", "tokenMatch", "exec", "o", "validatePaintProperty", "validateLayoutProperty", "validateLayer", "ref", "otherLayer", "sourceType", "validateString", "validateSource", "replace", "sourceName", "rasterDEM", "rasterDEMSpec", "rootType", "isCustomEncoding", "customEncodingKeys", "encodingName", "includes", "mapExpr", "reduceExpr", "validateLight", "lightSpec", "validateSky", "skySpec", "validateTerrain", "terrainSpec", "validateSprite", "allSpriteIds", "allSpriteURLs", "VALIDATORS", "projectionSpec", "validate", "validateGlyphsUrl", "validateStyleMin", "sortErrors", "injectValidateSpec", "validator", "wrapCleanErrors", "inner", "paintProperty", "layoutProperty", "validateStyle", "emitValidationErrors", "emitter", "hasErrors", "TransferableGridIndex", "extent", "cells", "ArrayBuffer", "Int32Array", "start", "end", "subarray", "bboxesOffset", "bboxes", "insert", "_insertReadonly", "uid", "_forEachCell", "_insertCell", "cellIndex", "query", "intersectionTest", "_queryCell", "seenUids", "cell", "u", "arg1", "arg2", "cx1", "_convertToCellCoord", "cy1", "cx2", "cy2", "_convertFromCellCoord", "toArrayBuffer", "metadataLength", "totalCellLength", "grid", "transferables", "writeable", "omit", "shallow", "expressions", "_classRegistryKey", "isArrayBuffer", "getClassRegistryKey", "$name", "isSerializeHandledByBuiltin", "classRegistryKey", "Date", "RegExp", "isView", "ImageData", "serialize", "deserialize", "ZoomHistory", "first", "update", "now", "floorZ", "lastIntegerZoom", "lastIntegerZoomTime", "lastZoom", "lastFloorZoom", "unicodeBlockLookup", "char", "Khmer", "Katakana", "Kanbun", "allowsVerticalWritingMode", "chars", "charHasUprightVerticalOrientation", "charCodeAt", "allowsLetterSpacing", "charAllowsLetterSpacing", "sanitizedRegExpFromScriptCodes", "scriptCodes", "supportedPropertyEscapes", "code", "pe", "cursiveScriptRegExp", "fromCodePoint", "ideographicBreakingRegExp", "isChar", "charHasRotatedVerticalOrientation", "rtlScriptRegExp", "charInRTLScript", "charInSupportedScript", "canRenderRTL", "stringContainsRTLText", "rtlWorkerPlugin", "applyArabicShaping", "processBidirectionalText", "processStyledBidirectionalText", "pluginStatus", "pluginURL", "setState", "state", "getState", "setMethods", "rtlTextPlugin", "isParsed", "getPluginURL", "getRTLTextPluginStatus", "EvaluationParameters", "fadeDuration", "zoomHistory", "crossFadingFactor", "getCrossfadeParameters", "fraction", "fromScale", "toScale", "PropertyValue", "isDataDriven", "possiblyEvaluate", "TransitionablePropertyValue", "transitioned", "prior", "TransitioningPropertyValue", "untransitioned", "Transitionable", "_properties", "_values", "defaultTransitionablePropertyValues", "getValue", "setValue", "getTransition", "setTransition", "Transitioning", "begin", "finalValue", "defaultTransitioningPropertyValues", "PossiblyEvaluated", "hasTransition", "Layout", "defaultPropertyValues", "hasValue", "PossiblyEvaluatedPropertyValue", "isConstant", "constantOr", "defaultPossiblyEvaluatedValues", "DataConstantProperty", "interpolationFn", "interpolates", "DataDrivenProperty", "overrides", "interpolatedValue", "CrossFadedDataDrivenProperty", "evaluatedValue", "constantValue", "_calculate", "cameraVal", "mid", "CrossFadedProperty", "ColorRampProperty", "Properties", "overridableProperties", "defaultPropertyValue", "defaultTransitionablePropertyValue", "TRANSITION_SUFFIX", "StyleLayer", "_featureFilter", "sourceLayer", "_unevaluatedLayout", "_transitionablePaint", "setPaintProperty", "setLayoutProperty", "_transitioningPaint", "_crossfadeParameters", "getLayoutProperty", "_validate", "getPaintProperty", "endsWith", "transitionable", "isCrossFadedProperty", "wasDataDriven", "oldValue", "_handleSpecialPaintPropertyUpdate", "newValue", "_handleOverridablePaintPropertyUpdate", "isHidden", "updateTransitions", "recalculate", "is3D", "isTileClipped", "hasOffscreenPass", "resize", "viewTypes", "Int8", "Int8Array", "Uint8", "Uint8Array", "Int16", "Int16Array", "Uint16", "Uint16Array", "Int32", "Uint32", "Uint32Array", "Float32", "Float32Array", "Struct", "structArray", "_structArray", "_pos1", "_pos2", "_pos4", "_pos8", "StructArray", "isTransferred", "capacity", "_trim", "byteLength", "bytesPerElement", "_refreshViews", "clear", "reserve", "oldUint8Array", "uint8", "createLayout", "members", "alignment", "maxSize", "member", "typeSize", "BYTES_PER_ELEMENT", "memberOffset", "align", "components", "StructArrayLayout2i4", "int16", "emplaceBack", "v0", "emplace", "o2", "StructArrayLayout3i6", "StructArrayLayout4i8", "v3", "StructArrayLayout2i4i12", "v4", "v5", "StructArrayLayout2i4ub8", "o1", "StructArrayLayout2f8", "float32", "o4", "StructArrayLayout10ui20", "uint16", "v6", "v7", "v8", "v9", "StructArrayLayout4i4ui4i24", "v10", "v11", "StructArrayLayout3f12", "StructArrayLayout1ul4", "uint32", "StructArrayLayout6i1ul2ui20", "StructArrayLayout2i2i2i12", "StructArrayLayout2f1f2i16", "StructArrayLayout2ub2f2i16", "StructArrayLayout3ui6", "StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48", "v12", "v13", "v14", "v15", "v16", "StructArrayLayout8i15ui1ul2f2ui64", "v17", "v18", "v19", "v20", "v21", "v22", "v23", "v24", "v25", "v26", "v27", "StructArrayLayout1f4", "StructArrayLayout1ui2f12", "StructArrayLayout1ul2ui8", "StructArrayLayout2ui4", "StructArrayLayout1ui2", "StructArrayLayout4f16", "CollisionBoxStruct", "anchorPointX", "anchorPointY", "featureIndex", "sourceLayerIndex", "bucketIndex", "anchorPoint", "CollisionBoxArray", "PlacedSymbolStruct", "anchorX", "anchorY", "glyphStartIndex", "numGlyphs", "vertexStartIndex", "lineStartIndex", "lineLength", "segment", "lowerSize", "upperSize", "lineOffsetX", "lineOffsetY", "writingMode", "placedOrientation", "hidden", "crossTileID", "associatedIconIndex", "PlacedSymbolArray", "SymbolInstanceStruct", "rightJustifiedTextSymbolIndex", "centerJustifiedTextSymbolIndex", "leftJustifiedTextSymbolIndex", "verticalPlacedTextSymbolIndex", "placedIconSymbolIndex", "verticalPlacedIconSymbolIndex", "textBoxStartIndex", "textBoxEndIndex", "verticalTextBoxStartIndex", "verticalTextBoxEndIndex", "iconBoxStartIndex", "iconBoxEndIndex", "verticalIconBoxStartIndex", "verticalIconBoxEndIndex", "numHorizontalGlyphVertices", "numVerticalGlyphVertices", "numIconVertices", "numVerticalIconVertices", "useRuntimeCollisionCircles", "textBoxScale", "collisionCircleDiameter", "textAnchorOffsetStartIndex", "textAnchorOffsetEndIndex", "SymbolInstanceArray", "GlyphOffsetArray", "getoffsetX", "SymbolLineVertexArray", "getx", "gety", "gettileUnitDistanceFromAnchor", "TextAnchorOffsetStruct", "textAnchor", "textOffset0", "textOffset1", "TextAnchorOffsetArray", "FeatureIndexStruct", "FeatureIndexArray", "PosArray", "CircleLayoutArray", "FillLayoutArray", "FillExtrusionLayoutArray", "LineLayoutArray", "LineExtLayoutArray", "PatternLayoutArray", "SymbolLayoutArray", "SymbolDynamicLayoutArray", "SymbolOpacityArray", "CollisionBoxLayoutArray", "CollisionVertexArray", "TriangleIndexArray", "LineIndexArray", "SegmentVector", "segments", "prepareSegment", "numVertices", "layoutVertexArray", "indexArray", "sortKey", "MAX_VERTEX_ARRAY_LENGTH", "vertexLength", "vertexOffset", "primitiveOffset", "primitiveLength", "destroy", "vaos", "packUint8ToFloat", "patternAttributes", "ca", "ha", "seed", "remainder", "bytes", "h1", "h1b", "c1", "c2", "k1", "pa", "fa", "murmur3", "require$$0", "murmur2", "murmurhashJsModule", "exports", "FeaturePositionMap", "ids", "positions", "indexed", "getNumericId", "getPositions", "intId", "Float64Array", "numValue", "pivot", "Uniform", "gl", "Uniform1f", "uniform1f", "Uniform4f", "uniform4f", "UniformColor", "emptyMat4", "packColor", "ConstantBinder", "names", "uniformNames", "setUniform", "uniform", "getBinding", "CrossFadedConstantBinder", "patternFrom", "patternTo", "pixelRatioFrom", "pixelRatioTo", "setConstantPatternPositions", "posTo", "posFrom", "pixelRatio", "tlbr", "uniformName", "substr", "SourceExpressionBinder", "PaintVertexArray", "paintVertexAttributes", "paintVertexArray", "populatePaintArray", "newLength", "imagePositions", "_setPaintValue", "updatePaintArray", "upload", "paintVertexBuffer", "updateData", "createVertexBuffer", "CompositeExpressionBinder", "useIntegerZoom", "minColor", "maxColor", "currentZoom", "factor", "CrossFadedCompositeBinder", "zoomInPaintVertexArray", "zoomOutPaintVertexArray", "_setPaintValues", "patterns", "imageMin", "imageMid", "imageMax", "tl", "br", "zoomInPaintVertexBuffer", "zoomOutPaintVertexBuffer", "ProgramConfiguration", "filterProperties", "binders", "_buffers", "paintAttributeNames", "propType", "isCrossFaded", "StructArrayLayout", "layoutType", "cacheKey", "getMaxValue", "binder", "populatePaintArrays", "updatePaintArrays", "featureStates", "featureMap", "vtLayer", "dirty", "defines", "getBinderAttributes", "getBinderUniforms", "uniforms", "getPaintVertexBuffers", "getUniforms", "locations", "setUniforms", "binderUniforms", "updatePaintBuffers", "crossfade", "patternVertexBuffer", "ProgramConfigurationSet", "programConfigurations", "needsUpload", "_featureMap", "_bufferOffset", "binderType", "defaultLayouts", "composite", "layoutException", "MAX", "BITS", "MIN", "loadGeometry", "toEvaluationFeature", "addCircleVertex", "extrudeX", "extrudeY", "CircleBucket", "overscaling", "layerIds", "hasPattern", "stateDependentLayerIds", "populate", "styleLayer", "bucketFeatures", "circleSortKey", "sortFeaturesByKey", "evaluationFeature", "bucketFeature", "addFeature", "states", "stateDependentLayers", "uploadPending", "uploaded", "layoutVertexBuffer", "layoutAttributes", "indexBuffer", "createIndexBuffer", "polygonIntersectsPolygon", "polygonA", "polygonB", "polygonContainsPoint", "lineIntersectsLine", "polygonIntersectsBufferedPoint", "radius", "pointIntersectsBufferedLine", "polygonIntersectsMultiPolygon", "multiPolygon", "multiPolygonContainsPoint", "lineIntersectsBufferedLine", "lineA", "lineB", "a0", "a1", "lineSegmentIntersectsLineSegment", "b0", "b1", "radiusSquared", "distToSegmentSquared", "l2", "edgeIntersectsBox", "e1", "e2", "corners", "dir", "getMaximumPaintValue", "bucket", "translateDistance", "translate", "queryGeometry", "translateAnchor", "pixelsToTileUnits", "pt", "translated", "properties$8", "EPSILON", "ARRAY_TYPE", "multiply", "a00", "a01", "a02", "a03", "a10", "a11", "a12", "a13", "a20", "a21", "a22", "a23", "a30", "a31", "a32", "a33", "b2", "b3", "hypot", "arguments", "mul", "transformMat4", "glMatrix.ARRAY_TYPE", "CircleStyleLayer", "createBucket", "queryRadius", "circleBucket", "queryIntersectsFeature", "transform", "pixelPosMatrix", "translatedPolygon", "alignWithMap", "transformedPolygon", "projectPoint", "transformedSize", "transformedPoint", "adjustedSize", "projectedCenter", "vec4.transformMat4", "cameraToCenterDistance", "HeatmapBucket", "properties$7", "createImage", "channels", "RangeError", "resizeImage", "newImage", "copyImage", "srcImg", "dstImg", "srcPt", "dstPt", "srcData", "dstData", "srcOffset", "dstOffset", "AlphaImage", "RGBAImage", "copy", "renderColorRamp", "evaluationGlobals", "resolution", "clips", "renderPixel", "evaluationKey", "pxColor", "clip", "HEATMAP_FULL_RENDER_FBO_KEY", "HeatmapStyleLayer", "heatmapFbos", "Map", "_updateColorRamp", "colorRamp", "colorRampTexture", "delete", "properties$6", "HillshadeStyleLayer", "earcut", "holeIndices", "dim", "hasHoles", "outerLen", "outerNode", "linkedList", "triangles", "prev", "invSize", "queue", "list", "steiner", "getLeftmost", "compareX", "eliminateHole", "maxX", "maxY", "earcutLinked", "clockwise", "last", "insertNode", "removeNode", "filterPoints", "again", "ear", "pass", "zOrder", "prevZ", "nextZ", "numMerges", "inSize", "tail", "q", "pSize", "qSize", "isEarHashed", "isEar", "cureLocalIntersections", "splitEarcut", "x0", "y0", "pointInTriangle", "minZ", "maxZ", "intersects", "locallyInside", "isValidDiagonal", "splitPolygon", "hole", "bridge", "hx", "hy", "qx", "mx", "my", "tanMin", "sectorContainsSector", "bridgeReverse", "leftmost", "px", "py", "sign", "o3", "onSegment", "a2", "createNode", "an", "patternDependencies", "patternProperty", "constantPattern", "addPatternDependencies", "patternFeature", "patternPropertyValue", "FillBucket", "patternFeatures", "indexArray2", "segments2", "fillSortKey", "addFeatures", "indexBuffer2", "triangleSegment", "triangleIndex", "flattened", "lineSegment", "lineIndex", "indices", "properties$5", "FillStyleLayer", "outlineColor", "centroidAttributes", "vectortilefeature", "VectorTileFeature", "pbf", "_pbf", "_geometry", "_keys", "readFields", "readFeature", "tag", "readVarint", "signedArea", "cmd", "lines", "cmdLen", "readSVarint", "toGeoJSON", "project", "vectortilelayer", "VectorTileLayer", "_features", "readLayer", "readString", "readFloat", "readDouble", "readVarint64", "readBoolean", "readTile", "vectorTile", "VectorTile", "require$$1", "require$$2", "vectorTileFeatureTypes", "mvt", "FACTOR", "addVertex", "vertexArray", "nx", "ny", "nz", "FillExtrusionBucket", "centroidVertexArray", "centroidVertexBuffer", "centroid", "vertexCount", "isEntirelyOutside", "edgeDistance", "isBoundaryEdge", "bottomRight", "averageX", "averageY", "properties$4", "FillExtrusionStyleLayer", "projectedQueryGeometry", "projected", "zBase", "zTop", "projectedBase", "projectedTop", "baseXZ", "baseYZ", "baseZZ", "baseWZ", "topXZ", "topYZ", "topZZ", "topWZ", "ringBase", "ringTop", "sX", "sY", "sZ", "sW", "baseZ", "baseW", "topX", "topY", "topZ", "topW", "closestDistance", "getIntersectionDistance", "topA", "face", "dot", "projectedFace", "ab", "ac", "dotABAB", "dotABAC", "dotACAC", "dotAPAB", "dotAPAC", "denom", "lineLayoutAttributes", "lineLayoutAttributesExt", "COS_HALF_SHARP_CORNER", "MAX_LINE_DISTANCE", "LINE_DISTANCE_BUFFER_BITS", "LineBucket", "lineClipsArray", "gradients", "layoutVertexArray2", "maxLineLength", "lineSortKey", "patternBucketFeature", "layoutVertexBuffer2", "layoutAttributesExt", "lineFeatureClips", "cap", "miterLimit", "roundLimit", "lineClips", "addLine", "vertices", "scaledDistance", "totalDistance", "updateScaledDistance", "isPolygon", "sharpCornerOffset", "currentVertex", "prevVertex", "nextVertex", "prevNormal", "nextNormal", "joinNormal", "cosAngle", "cosHalfAngle", "miterLength", "approxAngle", "isSharpCorner", "lineTurnsLeft", "prevSegmentLength", "newPrevVertex", "updateDistance", "addCurrentVertex", "middleVertex", "currentJoin", "bevelLength", "offsetA", "offsetB", "extrude", "addHalfVertex", "nextSegmentLength", "newCurrentVertex", "normal", "endLeft", "endRight", "rightX", "rightY", "up", "linesofarScaled", "properties$3", "LineFloorwidthProperty", "lineFloorwidthProperty", "LineStyleLayer", "gradientVersion", "gradientExpression", "stepInterpolant", "lineBucket", "getLineWidth", "halfWidth", "lineOffset", "newRings", "ringIndex", "newRing", "aToB", "bToC", "multiLine", "lineWidth", "lineGapWidth", "symbolLayoutAttributes", "dynamicLayoutAttributes", "collisionVertexAttributes", "collisionBoxLayout", "collisionCircleLayout", "transformText", "toLocaleUpperCase", "toLocaleLowerCase", "verticalizedCharacterMap", "$", "ONE_EM", "Pbf", "ieee754", "isLE", "mLen", "nBytes", "eLen", "eMax", "eBias", "nBits", "buf", "Varint", "Fixed64", "Bytes", "Fixed32", "SHIFT_LEFT_32", "SHIFT_RIGHT_32", "utf8TextDecoder", "TextDecoder", "readPackedEnd", "toNum", "low", "high", "isSigned", "makeRoomForExtraLength", "startPos", "extraLen", "realloc", "writePackedVarint", "writeVarint", "writePackedSVarint", "writeSVarint", "writePackedFloat", "writeFloat", "writePackedDouble", "writeDouble", "writePackedBoolean", "writeBoolean", "writePackedFixed32", "writeFixed32", "writePackedSFixed32", "writeSFixed32", "writePackedFixed64", "writeFixed64", "writePackedSFixed64", "writeSFixed64", "readUInt32", "writeInt32", "readInt32", "readField", "skip", "readMessage", "readFixed32", "readSFixed32", "readFixed64", "readSFixed64", "decode", "bytesPerSequence", "fromCharCode", "readBytes", "readPackedVarint", "readPackedSVarint", "readPackedBoolean", "readPackedFloat", "readPackedDouble", "readPackedFixed32", "readPackedSFixed32", "readPackedFixed64", "readPackedSFixed64", "writeTag", "finish", "lsb", "writeString", "lead", "writeBytes", "writeRawMessage", "writeMessage", "writeBytesField", "writeFixed32Field", "writeSFixed32Field", "writeFixed64Field", "writeSFixed64Field", "writeVarintField", "writeSVarintField", "writeStringField", "writeFloatField", "writeDoubleField", "writeBooleanField", "Iu", "su", "border", "readFontstacks", "readFontstack", "bitmap", "advance", "readGlyph", "metrics", "glyph", "GLYPH_PBF_BORDER", "potpack", "boxes", "maxWidth", "box", "spaces", "space", "IMAGE_PADDING", "ImagePosition", "paddedRect", "stretchX", "stretchY", "textFitWidth", "textFitHeight", "displaySize", "ImageAtlas", "icons", "iconPositions", "patternPositions", "haveRenderCallbacks", "bins", "addImages", "bin", "images", "hasRenderCallback", "patchUpdatedImages", "imageManager", "texture", "dispatchRenderCallbacks", "updatedImages", "patchUpdatedImage", "getImage", "WritingMode", "ah", "SHAPING_DEFAULT_OFFSET", "SectionOptions", "imageName", "textOptions", "imageOptions", "TaggedString", "sectionIndex", "imageSectionID", "defaultFontStack", "addImageSection", "addTextSection", "getSection", "getSectionIndex", "getCharCode", "verticalizePunctuation", "nextCharCode", "prevCharCode", "beginningWhitespace", "whitespace", "trailingWhitespace", "getMaxScale", "reduce", "forText", "nextImageSectionCharCode", "getNextImageSectionCharCode", "forImage", "shapeText", "glyphMap", "glyphPositions", "lineHeight", "textJustify", "spacing", "allowVerticalPlacement", "layoutTextSize", "layoutTextSizeThisZoom", "logicalInput", "fromFeature", "untaggedLines", "determineLineBreaks", "taggedLine", "processedLines", "lineBreakPoints", "lineBreak", "positionedLines", "shaping", "iconsInText", "verticalizable", "maxLineHeight", "justify", "lineMaxScale", "maxLineOffset", "positionedLine", "positionedGlyphs", "codePoint", "baselineOffset", "verticalAdvance", "imagePosition", "glyphPosition", "justifyLine", "currentLineHeight", "horizontalAlign", "verticalAlign", "getAnchorAlignment", "blockHeight", "lineCount", "shiftX", "shiftY", "positionedGlyph", "breakable", "breakableBefore", "getGlyphAdvance", "calculateBadness", "targetWidth", "penalty", "isLastBreak", "raggedness", "calculatePenalty", "nextCodePoint", "penalizableIdeographicBreak", "evaluateBreak", "breakIndex", "breakX", "potentialBreaks", "bestPriorBreak", "bestBreakBadness", "potentialBreak", "breakBadness", "badness", "priorBreak", "leastBadBreaks", "lastLineBreak", "potentialLineBreaks", "totalWidth", "hasServerSuggestedBreakpoints", "currentX", "ideographicBreak", "lastPositionedGlyph", "lineIndent", "shapeIcon", "iconOffset", "iconAnchor", "applyTextFit", "shapedIcon", "iconLeft", "iconTop", "iconWidth", "iconHeight", "_b", "contentAspectRatio", "newIconWidth", "newIconHeight", "fitIconToText", "shapedText", "textFit", "fontScale", "collisionPadding", "textLeft", "textRight", "textTop", "textBottom", "MAX_GLYPH_ICON_SIZE", "SIZE_PACK_FACTOR", "MAX_PACKED_SIZE", "getSizeData", "tileZoom", "layoutSize", "minZoom", "maxZoom", "minSize", "getOverlapMode", "overlapProp", "allowOverlapProp", "overlap", "shaderOpacityAttributes", "ox", "oy", "sizeVertex", "isSDF", "pixelOffsetX", "pixelOffsetY", "minFontScaleX", "minFontScaleY", "aSizeX", "aSizeY", "addDynamicAttributes", "dynamicLayoutVertexArray", "containsRTLText", "formattedText", "SymbolBuffers", "opacityVertexArray", "hasVisibleVertices", "placedSymbolArray", "dynamicIndexBuffer", "dynamicLayoutVertexBuffer", "opacityVertexBuffer", "itemSize", "CollisionBuffers", "LayoutArray", "IndexArray", "collisionVertexArray", "collisionVertexBuffer", "SymbolBucket", "collisionBoxArray", "hasRTLText", "sortKeyRanges", "collisionCircleArray", "placementInvProjMatrix", "mat4.identity", "placementViewportMatrix", "unevaluatedLayoutValues", "textSizeData", "iconSizeData", "canOverlap", "sortFeaturesByY", "writingModes", "wm", "sourceID", "createArrays", "icon", "glyphOffsetArray", "lineVertexArray", "symbolInstances", "textAnchorOffsets", "calculateGlyphDependencies", "stack", "textAlongLine", "doesAllowVerticalWritingMode", "verticalChar", "charAt", "textFont", "textField", "iconImage", "hasText", "hasIcon", "symbolSortKey", "iconDependencies", "stacks", "glyphDependencies", "resolvedTokens", "getValueAndResolveTokens", "factory", "bucketHasRTLText", "sectionFont", "sectionStack", "leftIndex", "rightIndex", "mergedFeatures", "mergedIndex", "mergeFromRight", "leftKey", "rightKey", "geom", "mergeFromLeft", "onRight", "hasDebugData", "textCollisionBox", "iconCollisionBox", "destroyDebugData", "addToLineVertexArray", "sumForwardLength", "sumBackwardLength", "tileUnitDistanceFromAnchor", "vertex", "addSymbols", "arrays", "quads", "alongLine", "labelAnchor", "glyphOffsetArrayStart", "tr", "bl", "tex", "pixelOffsetTL", "pixelOffsetBR", "glyphOffset", "_addCollisionDebugVertex", "addCollisionDebugVertices", "boxAnchorPoint", "symbolInstance", "addDebugCollisionBoxes", "startIndex", "isText", "generateCollisionDebugBuffers", "_deserializeCollisionBoxesForSymbol", "textStartIndex", "textEndIndex", "verticalTextStartIndex", "verticalTextEndIndex", "iconStartIndex", "iconEndIndex", "verticalIconStartIndex", "verticalIconEndIndex", "collisionArrays", "textBox", "textFeatureIndex", "verticalTextBox", "verticalTextFeatureIndex", "iconBox", "iconFeatureIndex", "verticalIconBox", "verticalIconFeatureIndex", "deserializeCollisionBoxes", "hasTextData", "hasIconData", "hasTextCollisionBoxData", "hasIconCollisionBoxData", "addIndicesForPlacedSymbol", "iconOrText", "placedSymbolIndex", "placedSymbol", "vertexIndex", "getSortedSymbolIndexes", "sortedAngle", "symbolInstanceIndexes", "rotatedYs", "featureIndexes", "aIndex", "bIndex", "addToSortKeyRanges", "symbolInstanceIndex", "symbolInstanceEnd", "symbolInstanceStart", "sortFeatures", "featureSortOrder", "MAX_GLYPHS", "properties$2", "runtimeType", "getOverride", "hasOverride", "FormatSectionOverride", "defaultValue", "SymbolStyleLayer", "deduped", "_setPaintOverrides", "unevaluated", "hasPaintOverride", "overridden", "override", "styleExpression", "propertyName", "hasOverrides", "checkSections", "checkExpression", "properties$1", "BackgroundStyleLayer", "RasterStyleLayer", "CustomStyleLayer", "implementation", "onAdd", "painter", "onRemove", "renderingMode", "prerender", "ThrottledInvoker", "methodToThrottle", "_methodToThrottle", "_triggered", "MessageChannel", "_channel", "port2", "onmessage", "trigger", "port1", "postMessage", "setTimeout", "remove", "earthRadius", "LngLat", "lng", "toArray", "distanceTo", "lngLat", "rad", "lat1", "lat2", "lon", "earthCircumference", "circumferenceAtLatitude", "latitude", "mercatorXfromLng", "mercatorYfromLat", "mercatorZfromAltitude", "altitude", "latFromMercatorY", "MercatorCoordinate", "lngLatLike", "toLngLat", "toAltitude", "meterInMercatorCoordinateUnits", "getMercCoords", "CanonicalTileID", "calculateKey", "quadkey", "mask", "isChildOf", "dz", "getTilePoint", "UnwrappedTileID", "OverscaledTileID", "overscaledZ", "scaledTo", "targetZ", "zDifference", "calculateScaledKey", "withWrap", "children", "sourceMaxZoom", "isLessThan", "wrapped", "unwrapTo", "overscaleFactor", "toUnwrapped", "DEMData", "_idx", "MIN_SAFE_INTEGER", "ele", "pixels", "unpack", "getUnpackVector", "getPixels", "backfillBorder", "borderTile", "xMin", "xMax", "yMin", "yMax", "DictionaryCoder", "strings", "_stringToNumber", "_numberToString", "encode", "GeoJSONFeature", "vectorTileFeature", "_vectorTileFeature", "_z", "_x", "_y", "FeatureIndex", "tileID", "grid3D", "featureIndexArray", "loadVTLayers", "vtLayers", "vt", "Protobuf", "rawTileData", "sourceLayerCoder", "styleLayers", "serializedLayers", "sourceFeatureState", "featureFilter", "queryPadding", "getBounds", "matching", "cameraBounds", "cameraQueryGeometry", "matching3D", "bx1", "by1", "bx2", "by2", "boxX1", "boxY1", "boxX2", "boxY2", "corner", "topDownFeatureComparator", "previousIndex", "featureGeometry", "loadMatchingFeature", "filterLayerIDs", "layerIDs", "bucketLayerIDs", "sourceLayerName", "getId", "layerID", "serializedLayer", "evaluateProperties", "intersectionZ", "geojsonFeature", "layerResult", "lookupSymbolFeatures", "symbolFeatureIndexes", "symbolFeatureIndex", "hasLayer", "sourceLayerId", "serializedProperties", "styleLayerProperties", "clipLine", "clippedLines", "clippedLine", "p0", "Anchor", "checkMaxAngle", "labelLength", "windowSize", "maxAngle", "anchorDistance", "recentCorners", "recentAngleDelta", "angleDelta", "getLineLength", "getAngleWindowSize", "glyphSize", "boxScale", "getShapedLabelLength", "getCenterAnchor", "angleWindowSize", "prevDistance", "centerDistance", "segmentDistance", "getAnchors", "tileExtent", "shapedLabelLength", "isLineContinued", "resample", "placeAtMiddle", "halfLabelLength", "markedDistance", "segmentDist", "getIconQuads", "iconRotate", "isSDFIcon", "hasIconTextFit", "imageWidth", "imageHeight", "reduceRanges", "stretchWidth", "stretchHeight", "fixedWidth", "fixedHeight", "stretchOffsetX", "stretchContentWidth", "stretchOffsetY", "stretchContentHeight", "fixedOffsetX", "fixedContentWidth", "fixedOffsetY", "fixedContentHeight", "contentWidth", "contentHeight", "sumWithinRange", "makeBox", "leftEm", "getEmOffset", "stretch", "leftPx", "getPxOffset", "fixed", "topEm", "topPx", "rightEm", "rightPx", "bottomEm", "bottomPx", "matrix", "xCuts", "stretchZonesToCuts", "yCuts", "xi", "yi", "ranges", "stretchZones", "fixedSize", "stretchSize", "cuts", "stretchOffset", "iconSize", "fixedOffset", "CollisionFeature", "shaped", "alignLine", "boxStartIndex", "circleDiameter", "rotateRadians", "boxEndIndex", "findPoleOfInaccessibility", "polygonRings", "precision", "debug", "outerRing", "cellSize", "cellQueue", "Queue", "compareMax", "Cell", "bestCell", "numProbes", "minDistSq", "SQRT2", "TextAnchorEnum", "aq", "INVALID_TEXT_OFFSET", "POSITIVE_INFINITY", "evaluateVariableOffset", "offsetX", "offsetY", "radialOffset", "hypotenuse", "getTextVariableAnchorOffset", "variableAnchorOffset", "sourceValues", "destValues", "variableAnchor", "textOffset", "anchorOffsets", "getAnchorJustification", "shapedTextOrientations", "imageMap", "sizes", "layoutIconSize", "textMaxSize", "defaultHorizontalShaping", "getDefaultHorizontalShaping", "tilePixelRatio", "textMaxBoxScale", "iconBoxScale", "symbolMinDistance", "textPadding", "iconPadding", "textMaxAngle", "iconAlongLine", "symbolPlacement", "textRepeatDistance", "iconTextFit", "verticallyShapedIcon", "addSymbolAtAnchor", "lineArray", "textCollisionFeature", "iconCollisionFeature", "verticalTextCollisionFeature", "verticalIconCollisionFeature", "placedTextSymbolIndices", "verticalTextRotation", "iconQuads", "verticalIconQuads", "sizeData", "compositeIconSizes", "justifications", "justification", "textRotate", "singleLine", "addTextVertices", "horizontalOnly", "getCollisionCircleHeight", "prevHeight", "anchorIsTooClose", "poi", "placementTypes", "placedIconIndex", "glyphQuads", "textureRect", "rectBuffer", "rotateVerticalGlyph", "halfAdvance", "sdf", "builtInOffset", "verticalizedLabelOffset", "textureScale", "isDoubleResolution", "verticalRotation", "xHalfWidthOffsetCorrection", "halfWidthOffsetCorrection", "verticalOffsetCorrection", "compositeTextSizes", "placementType", "horizontalShaping", "repeatDistance", "compareText", "otherAnchors", "ARRAY_TYPES", "KDBush", "magic", "versionAndType", "ArrayType", "nodeSize", "numItems", "IndexArrayType", "arrayTypeIndex", "coordsByteSize", "idsByteSize", "padCoords", "_pos", "_finished", "numAdded", "axis", "qy", "r2", "select", "swapItem", "PerformanceMarkers", "bg", "lastFrameTime", "frameTimes", "frameTimeTarget", "loadTimeKey", "fullLoadTimeKey", "PerformanceUtils", "mark", "marker", "performance", "currTimestamp", "clearMetrics", "clearMeasures", "clearMarks", "getPerformanceMetrics", "measure", "load", "fullLoad", "loadTime", "getEntriesByName", "fullLoadTime", "totalFrames", "fps", "curr", "droppedFrames", "frameTime", "acc", "percentDroppedFrames", "oo", "userAgent", "navigator", "safari", "Ji", "Z", "mapId", "resolveRejects", "tasks", "taskQueue", "abortControllers", "messageHandlers", "invoker", "process", "subscription", "unsubscribe", "removeEventListener", "receive", "globalScope", "registerMessageHandler", "handler", "random", "cancelMessage", "origin", "sourceMapId", "buffers", "messageToPost", "assign", "transfer", "processTask", "task", "resolveReject", "completeTask", "responseMessage", "Tu", "uo", "Pc", "Vc", "Ec", "Ao", "jc", "Zi", "$a", "ls", "$c", "F", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "a14", "a15", "b4", "b5", "b6", "b7", "b8", "b9", "b10", "b11", "b12", "b13", "b14", "b15", "glMatrix.EPSILON", "document", "createElement", "muted", "onloadstart", "crossOrigin", "appendChild", "Fs", "dc", "zn", "ja", "Nc", "removeOrAddSourceCommands", "beforeLayers", "beforeOrder", "afterOrder", "beforeIndex", "afterIndex", "tracker", "clean", "beforeLayer", "afterLayer", "insertBeforeLayerId", "lastIndexOf", "layerObject", "render", "uniform1i", "uniformMatrix4fv", "Aa", "Sa", "Kt", "uniform3f", "uniform2f", "near", "far", "lr", "bt", "nf", "ho", "eu", "ko", "So", "Zs", "na", "header", "$0", "$1", "$2", "$3", "maxAge", "po", "uSizeT", "uSize", "cc", "aDeltaY", "aDeltaX", "bDeltaY", "bDeltaX", "denominator", "aInterpolation", "Hc", "qa", "lo", "tlX", "tlY", "brX", "brY", "iu", "b00", "b01", "b02", "b03", "b04", "b05", "b06", "b07", "b08", "b09", "det", "bh", "Ju", "Mh", "styleKey", "Ii", "D", "I", "Oc", "Fc", "fovy", "aspect", "bn", "Ri", "degrees", "lnglat", "fromLngLat", "zc", "Dh", "L", "customProtocol", "loadFn", "cachedKeys", "groups", "wi", "qc", "Zc", "$u", "iconsNeedLinear", "keepUpright", "textSize", "fontstack", "unformattedText", "spacingIfAllowed", "addVerticalShapingForPointLabelIfNeeded", "sdfIcons", "showCollisionBoxes", "_marks", "resourceTimingData", "imgBitmap", "origWidth", "origHeight", "drawImage", "imgData", "clearRect", "Uc", "img", "Image", "revokeObjectURL", "requestAnimationFrame", "createObjectURL", "T", "O", "_o", "Eu", "rs", "di", "fi", "G", "A", "azimuthal", "polar", "Ce", "Ui", "StyleLayerIndex", "layerConfigs", "keyCache", "_layerConfigs", "_layers", "removedIds", "layerConfig", "createStyleLayer", "familiesBySource", "groupByLayout", "sourceGroup", "sourceLayerFamilies", "GlyphAtlas", "stackPositions", "WorkerTile", "collectResourceTiming", "returnDependencies", "inFlightDependencies", "layerIndex", "bm", "buckets", "layerFamilies", "family", "recalculateLayers", "aF", "getGlyphsPromise", "getIconsPromise", "getPatternsPromise", "iconMap", "patternMap", "glyphAtlas", "imageAtlas", "performSymbolLayout", "bq", "bs", "glyphAtlasImage", "VectorTileWorkerSource", "fetching", "loading", "loaded", "loadVectorTile", "getArrayBuffer", "rawData", "ex", "errorMessage", "loadTile", "tileUid", "perf", "RequestPerformance", "workerTile", "resourceTiming", "reloadTile", "parseResult", "abortTile", "removeTile", "RasterDEMTileWorkerSource", "rawImageData", "imagePixels", "R", "bw", "dem", "rewindRings", "outer", "rewindRing", "reverse", "rewind", "gj", "bz", "geojson_wrapper", "GeoJSONWrapper", "FeatureWrapper", "rawGeometry", "tags", "bA", "fromVectorTileJs", "tile", "writeLayer", "keycache", "valuecache", "writeFeature", "writeValue", "writeProperties", "writeGeometry", "keyIndex", "valueIndex", "zigzag", "count", "vtPbfModule", "fromGeojsonVt", "defaultOptions", "minPoints", "props", "fround", "OFFSET_ID", "OFFSET_NUM", "OFFSET_PROP", "Supercluster", "trees", "clusterProps", "time", "timerId", "lngX", "latY", "tree", "_createTree", "timeEnd", "_cluster", "getClusters", "minLng", "minLat", "maxLng", "maxLat", "easternHem", "westernHem", "_limitZoom", "clusters", "getClusterJSON", "getChildren", "clusterId", "originId", "_getOriginId", "originZoom", "_getOriginZoom", "errorMsg", "getLeaves", "limit", "leaves", "_appendLeaves", "getTile", "z2", "_addTileFeatures", "getClusterExpansionZoom", "expansionZoom", "cluster_id", "skipped", "point_count", "isCluster", "getClusterProperties", "nextData", "neighborIds", "numPointsOrigin", "numPoints", "neighborId", "wx", "wy", "clusterPropIndex", "numPoints2", "_map", "original", "yLat", "abbrev", "propIndex", "point_count_abbreviated", "simplify", "sqTolerance", "maxSqDist", "minPosToMid", "getSqSegDist", "posToMid", "createFeature", "calcLineBBox", "convertFeature", "convertPoint", "convertLine", "convertLines", "singleGeometry", "newPolygon", "projectX", "projectY", "k2", "minAll", "maxAll", "clipped", "newGeometry", "clipPoints", "clipLines", "newGeom", "addPoint", "trackMetrics", "newSlice", "intersect", "intersectX", "intersectY", "segLen", "az", "exited", "shiftFeatureCoords", "newFeatures", "shiftCoords", "newPoints", "transformTile", "transformed", "transformPoint", "createTile", "numSimplified", "numFeatures", "simplified", "tileFeature", "isOuter", "indexMaxZoom", "indexMaxPoints", "GeoJSONVT", "tileCoords", "stats", "total", "merged", "splitTile", "cz", "toID", "zoomSteps", "k3", "k4", "z0", "getFeatureId", "isUpdateableGeoJSON", "seenIds", "toUpdateable", "GeoJSONWorkerSource", "_dataUpdateable", "_abortController", "_geoJSONIndex", "geoJSONTile", "geojsonWrapper", "_geojsonTileLayer", "_feature", "vtpbf", "byteOffset", "loadData", "_pendingRequest", "_pendingData", "loadAndProcessGeoJSON", "superclusterOptions", "mapExpressions", "reduceExpressions", "propertyNames", "mapExpression", "mapExpressionParsed", "reduceExpressionParsed", "bC", "pointProperties", "geojsonVtOptions", "isAbortError", "abandoned", "getData", "loadGeoJSON", "getJSON", "dataDiff", "updateable", "diff", "removeAll", "cloneProperties", "removeAllProperties", "removeProperties", "addOrUpdateProperties", "_c", "_d", "_params", "getClusterChildren", "getClusterLeaves", "Worker", "Actor", "layerIndexes", "workerSources", "demWorkerSources", "externalWorkerSourceTypes", "registerWorkerSource", "WorkerSource", "addProtocol", "removeProtocol", "registerRTLTextPlugin", "_getDEMWorkerSource", "_getWorkerSource", "_mapId", "_syncRTLPluginState", "importScripts", "_setImages", "_getLayerIndex", "workerSource", "ws", "incomingState", "urlToLoad", "loadedState", "_getAvailableImages", "linkEl", "reducedMotionQuery", "browser", "frameAsync", "cancelAnimationFrame", "getImageCanvasContext", "canvas", "resolveURL", "hardwareConcurrency", "prefersReducedMotion", "matchMedia", "matches", "DOM", "docStyle", "tagName", "className", "container", "el", "namespaceURI", "createElementNS", "selectProp", "userSelect", "transformProp", "callback", "capture", "preventDefault", "stopPropagation", "suppressClickInternal", "element", "getBoundingClientRect", "offsetWidth", "offsetHeight", "boundingClientRect", "clientX", "clientLeft", "clientY", "clientTop", "getScale", "getPoint", "touches", "button", "node", "parentNode", "removeChild", "documentElement", "testProp", "webpSupported", "supported", "testSupport", "webpCheckComplete", "webpImgTest", "webpImgTestOnloadComplete", "testWebpTextureUpload", "glForTesting", "createTexture", "bindTexture", "TEXTURE_2D", "texImage2D", "RGBA", "UNSIGNED_BYTE", "isContextLost", "deleteTexture", "ImageRequest", "imageRequestQueue", "currentParallelImageRequests", "throttleControlCallbackHandleCounter", "throttleControlCallbacks", "resetRequestQueue", "addThrottleControl", "handle", "removeThrottleControl", "callbackHandle", "processQueue", "supportImageRefresh", "accept", "onError", "onSuccess", "doImageRequest", "itemInQueue", "canUseHTMLImageElement", "getImagePromise", "getImageUsingHtmlImage", "HTMLImageElement", "arrayBufferToImageBitmap", "arrayBufferToImage", "maxImageRequests", "numImageRequests", "topItemInQueue", "fetchPriority", "RequestManager", "transformRequestFn", "_transformRequestFn", "transformRequest", "setTransformRequest", "sqrLen", "coerceSpriteToArray", "resultArray", "dedupArray", "normalizeSpriteURL", "extension", "Texture", "useMipmap", "pixelStoreUnpackFlipY", "pixelStoreUnpack", "pixelStoreUnpackPremultiplyAlpha", "premultiply", "HTMLCanvasElement", "HTMLVideoElement", "texSubImage2D", "isSizePowerOfTwo", "generateMipmap", "minFilter", "LINEAR_MIPMAP_NEAREST", "LINEAR", "texParameteri", "TEXTURE_MAG_FILTER", "TEXTURE_MIN_FILTER", "TEXTURE_WRAP_S", "TEXTURE_WRAP_T", "renderStyleImage", "userImage", "ImageManager", "callbackDispatchedThisFrame", "requestors", "atlasImage", "isLoaded", "setLoaded", "promiseResolve", "_getImagesForIds", "spriteData", "addImage", "valid", "_validateStretch", "_validateContent", "updateImage", "oldImage", "removeImage", "listImages", "getImages", "_reject", "hasAllDependencies", "getPixelSize", "getPattern", "pattern", "_updatePatternAtlas", "atlasTexture", "CLAMP_TO_EDGE", "dst", "beginFrame", "INF", "edt", "gridSize", "edt1d", "qr", "GlyphManager", "requestManager", "localIdeographFontFamily", "entries", "setURL", "getGlyphs", "glyphsPromises", "_getAndCacheGlyphsPromise", "updatedGlyphs", "entry", "requests", "_tinySDF", "promise", "loadGlyphRange", "_doesCharSupportLocalGlyph", "fontFamily", "tinySDF", "fontWeight", "TinySDF", "fontSize", "cutoff", "draw", "glyphWidth", "glyphHeight", "glyphLeft", "glyphTop", "glyphAdvance", "urlTemplate", "parseGlyphPbf", "fontStyle", "_createCanvas", "textBaseline", "textAlign", "gridOuter", "gridInner", "actualBoundingBoxAscent", "actualBoundingBoxDescent", "actualBoundingBoxLeft", "actualBoundingBoxRight", "measureText", "fillText", "LightPositionProperty", "sphericalToCartesian", "lightProperties", "Light", "lightOptions", "_transitionable", "setLight", "_transitioning", "getLight", "Sky", "setSky", "getSky", "calculateFogBlendOpacity", "LineAtlas", "nextRow", "dashEntry", "getDash", "dasharray", "addDash", "getDashRanges", "lineAtlasWidth", "isDash", "zeroLength", "currentDashLength", "dashLength", "addRoundDash", "halfStretch", "currIndex", "distLeft", "distRight", "signedDistance", "distMiddle", "distEdge", "addRegularDash", "ALPHA", "REPEAT", "PRELOAD_POOL_ID", "WorkerPool", "active", "acquire", "workers", "workerCount", "release", "numActive", "terminate", "isPreloaded", "availableLogicalProcessors", "globalWorkerPool", "globalDispatcher", "getGlobalWorkerPool", "isSafari", "C", "globalThis", "Dispatcher", "workerPool", "actors", "currentActor", "broadcast", "promises", "getActor", "mapRemoved", "getGlobalDispatcher", "getPixelPosMatrix", "mat4.create", "mat4.translate", "J", "mat4.scale", "mat4.multiply", "calculatePosMatrix", "queryRenderedFeatures", "sourceCache", "has3DLayer", "maxPitchScaleFactor", "tilesIn", "sortTilesIn", "renderedFeatureLayers", "tileIn", "wrappedTileID", "queryResults", "_state", "wrappedIDLayerMap", "wrappedID", "wrappedIDLayers", "tileFeatures", "wrappedIDFeatures", "resultFeatures", "featureWrapper", "getFeatureState", "idA", "idB", "loadTileJson", "tileJSON", "pick", "M", "vector_layers", "vectorLayerIds", "LngLatBounds", "sw", "ne", "setSouthWest", "setNorthEast", "_ne", "_sw", "sw2", "ne2", "getCenter", "getSouthWest", "getNorthEast", "getNorthWest", "getWest", "getNorth", "getSouthEast", "getEast", "getSouth", "contains", "containsLongitude", "latAccuracy", "lngAccuracy", "adjustAntiMeridian", "TileBounds", "validateBounds", "level", "Q", "VectorTileSource", "dispatcher", "eventedParent", "reparseOverscaled", "_loaded", "_options", "_collectResourceTiming", "dataType", "_tileJSONRequest", "_requestManager", "sourceCaches", "clearTiles", "tileBounds", "sourceDataType", "hasTile", "setSourceProperty", "setTiles", "setUrl", "getPixelRatio", "messageType", "reloadPromise", "_afterTileLoadWorkerResponse", "_refreshExpiredTiles", "setExpiryData", "loadVectorData", "catch", "unloadTile", "unloadVectorData", "RasterTileSource", "roundZoom", "getTileTexture", "saveTileTexture", "RasterDEMTileSource", "neighboringTiles", "_getNeighboringTiles", "U", "readImageNow", "needsHillshadePrepare", "needsTerrainPrepare", "W", "pxw", "nxw", "backfilled", "S", "demTexture", "fbo", "GeoJSONSource", "_removed", "_pendingLoads", "_data", "workerOptions", "X", "_updateWorkerData", "setData", "setClusterOptions", "rasterBoundsAttributes", "ImageSource", "newCoordinates", "_request", "_finishLoading", "finally", "setCoordinates", "cornerCoords", "dMax", "_boundsArray", "RasterBoundsArray", "boundsBuffer", "prepare", "boundsSegments", "simpleSegment", "newTilesLoaded", "VideoSource", "getVideo", "loop", "triggerRepaint", "play", "pause", "seek", "seconds", "seekableRange", "seekable", "currentTime", "readyState", "paused", "CanvasSource", "animate", "getElementById", "_hasInvalidDimensions", "_playing", "getCanvas", "registeredSources", "getSourceType", "RTLPluginLoadedEventName", "RTLMainThreadPlugin", "_syncState", "statusToSend", "clearRTLTextPlugin", "setRTLTextPlugin", "url_1", "deferred", "_requestImport", "lazyLoad", "rtlMainThreadPlugin", "rtlMainThreadPluginFactory", "Tile", "timeAdded", "fadeEndTime", "uniqueId", "uses", "expirationTime", "hasSymbolBuckets", "dependencies", "rtt", "rttCoords", "expiredRequestCount", "registerFadeDuration", "wasRequested", "clearTextures", "justReloaded", "hasData", "latestFeatureIndex", "latestRawTileData", "getLayer", "lId", "imageAtlasTexture", "glyphAtlasTexture", "getBucket", "querySourceFeatures", "patternsLoaded", "parsedCC", "parseCacheControl", "getTime", "isExpired", "delta", "getExpiryTimeout", "setFeatureState", "sourceLayerStates", "holdingForFade", "symbolFadeHoldUntil", "symbolFadeFinished", "clearFadeHold", "setHoldDuration", "setDependencies", "namespace", "dep", "hasDependency", "namespaces", "TileCache", "reset", "removedData", "timeout", "clearTimeout", "order", "expiryTimeout", "dataWrapper", "_getAndRemoveByKey", "getAndRemove", "getByKey", "dataIndex", "setMaxSize", "filterFn", "removed", "SourceFeatureState", "stateChanges", "deletedStates", "updateState", "featureId", "newState", "ft", "removeFeatureState", "reconciledState", "featureDeletions", "initializeTileState", "coalesceChanges", "featuresChanged", "layerStates", "SourceCache", "_dataHandler", "_sourceErrored", "_source", "_tiles", "_cache", "_unloadTile", "_timers", "_cacheTimers", "_maxTileCacheSize", "_maxTileCacheZoomLevels", "_loadedParentTiles", "_coveredTiles", "_didEmitContent", "_updated", "_sourceLoaded", "used", "usedForTerrain", "getSource", "_paused", "resume", "shouldReload", "_shouldReloadOnResume", "reload", "_loadTile", "_tileLoaded", "_abortTile", "getIds", "compareTileId", "getRenderableIds", "symbolLayer", "renderables", "_isIdRenderable", "a_", "b_", "rotatedA", "rotatedB", "hasRenderableParent", "parentTile", "findLoadedParent", "_reloadTile", "previousState", "refreshedUponExpiration", "_setTileReloadTimer", "_backfillDEM", "borderId", "getTileByID", "fillBorder", "_retainLoadedChildren", "idealTiles", "maxCoveringZoom", "retain", "topmostLoadedID", "parentID", "minCoveringZoom", "parentTileID", "_getLoadedTile", "findLoadedSibling", "updateCacheSize", "widthInTiles", "heightInTiles", "viewDependentMaxSize", "handleWrapJump", "wrapDelta", "_prevLng", "_updateCoveredAndRetainedTiles", "idealTileIDs", "tilesForFading", "fadingTiles", "siblingTile", "fadeTileRef", "_addTile", "idealRasterTileIDs", "missingTileIDs", "getVisibleUnwrappedCoordinates", "unwrapped", "coveringTiles", "coveringZoomLevel", "maxOverzooming", "maxUnderzooming", "parents", "parent2", "noPendingDataEmissions", "_updateRetainedTiles", "isRasterType", "retainedId", "keysDifference", "_fadeDuration", "_removeTile", "_updateLoadedParentTileCache", "_updateLoadedSiblingTileCache", "releaseSymbolFadeTiles", "checked", "missingTiles", "childCoord", "childTile", "parentWasRequested", "parentId", "cancelPendingTileRequestsWhileZooming", "tileKey", "currentId", "_loadedSiblingTiles", "eventSourceDataType", "pointQueryGeometry", "tileResults", "cameraPointQueryGeometry", "getCameraQueryGeometry", "pointCoordinate", "tileSpaceBounds", "tileSpaceQueryGeometry", "tileSpaceCameraQueryGeometry", "getVisibleCoordinates", "posMatrix", "reloadTilesForDependencies", "aWrap", "bWrap", "PathInterpolator", "points_", "padding_", "_distances", "paddedLength", "lerp", "distOfCurrentIdx", "distToTarget", "idxOfPrevPoint", "distOfPrevIdx", "segmentLength", "segmentT", "overlapAllowed", "overlapA", "overlapB", "allowed", "GridIndex", "boxCells", "circleCells", "xCellCount", "yCellCount", "circleKeys", "boxKeys", "circles", "xScale", "yScale", "boxUid", "circleUid", "keysLength", "_insertBoxCell", "insertCircle", "_insertCircleCell", "_query", "hitTest", "overlapMode", "predicate", "hitTestCircle", "_queryCellCircle", "queryArgs", "boxCell", "circleCell", "_circleAndRectCollide", "_circlesCollide", "_convertToXCellCoord", "_convertToYCellCoord", "r1", "bothRadii", "circleX", "circleY", "halfRectWidth", "distX", "halfRectHeight", "distY", "getLabelPlaneMatrix", "pitchWithMap", "rotateWithMap", "mat4.rotateZ", "labelPlaneMatrix", "getGlCoordMatrix", "mat4.clone", "K", "glCoordMatrix", "getElevation", "xyTransformMat4", "signedDistanceFromCamera", "isOccluded", "getPerspectiveRatio", "isVisible", "clippingBuffer", "updateLineLabels", "rotateToLine", "unwrappedTileID", "viewportWidth", "viewportHeight", "translation", "partiallyEvaluatedSize", "symbolSize.evaluateSizeForZoom", "placedSymbols", "aspectRatio", "useVertical", "hideGlyphs", "anchorPos", "perspectiveRatio", "symbolSize.evaluateSizeForFeature", "ai", "pitchScaledFontSize", "projectionContext", "projectionCache", "projections", "offsets", "cachedAnchorPoint", "anyProjectionOccluded", "tileAnchorPoint", "placeUnflipped", "placeGlyphsAlongLine", "notEnoughRoom", "needsFlipping", "placeFirstAndLastGlyph", "flip", "glyphEndIndex", "lineEndIndex", "firstGlyphOffset", "lastGlyphOffset", "firstPlacedGlyph", "placeGlyphAlongLine", "lastPlacedGlyph", "requiresOrientationChange", "firstPoint", "lastPoint", "placedGlyphs", "firstAndLastGlyph", "orientationChange", "glyphIndex", "tileVertexIndex", "tileSegmentEnd", "projectedVertex", "previousTilePoint", "currentTilePoint", "previousProjectedPoint", "minimumLength", "projectionMatrix", "_projectTruncatedLineSegment", "singleGlyph", "aj", "unitVertexToBeProjected", "projectedUnitVertex", "projectTileCoordinatesToViewport", "projectedUnitSegment", "projectLineVertexToViewport", "syntheticVertexArgs", "previousLineVertexIndex", "direction", "distanceFromAnchor", "previousVertex", "absOffsetX", "translatedX", "translatedY", "useSpecialProjectionForSymbols", "projectTileCoordinates", "transformToOffsetNormal", "segmentVector", "findOffsetIntersectionPoint", "prevToCurrentOffsetNormal", "offsetPreviousVertex", "offsetCurrentVertex", "currentToNextOffsetNormal", "offsetNextSegmentBegin", "offsetNextSegmentEnd", "findLineIntersection", "anchorSegment", "combinedOffsetX", "offsetIntersectionPoint", "currentSegmentDistance", "pathVertices", "currentLineSegment", "prevToCurrent", "segmentAngle", "hiddenGlyphAttributes", "viewportPadding", "CollisionIndex", "ignoredGrid", "mapProjection", "pitchFactor", "_pitch", "screenRightBoundary", "screenBottomBoundary", "gridRightBoundary", "gridBottomBoundary", "perspectiveRatioCutoff", "placeCollisionBox", "collisionBox", "textPixelRatio", "collisionGroupPredicate", "projectedPoint", "projectAndGetPerspectiveRatio", "tileToViewport", "projectedBox", "_projectCollisionBox", "pointX", "pointY", "allPointsOccluded", "isInsideGrid", "placeable", "offscreen", "isOffscreen", "placeCollisionCircles", "labelToScreenMatrix", "showCollisionCircles", "circlePixelDiameter", "textPixelPadding", "placedCollisionCircles", "tileUnitAnchorPoint", "labelPlaneFontScale", "projection.placeFirstAndLastGlyph", "collisionDetected", "inGrid", "entirelyOffscreen", "screenPlaneMin", "screenPlaneMax", "interpolator", "projectedPath", "circleDist", "screenSpacePath", "projectPathToScreenSpace", "minPoint", "maxPoint", "seg", "numCircles", "circlePosition", "centerX", "centerY", "projection.project", "queryRenderedSymbols", "viewportQueryGeometry", "gridPoint", "seenFeatures", "featureKey", "bucketInstanceId", "intersectionTests.polygonIntersectsPolygon", "am", "insertCollisionBox", "ignorePlacement", "collisionGroupID", "insertCollisionCircles", "collisionCircles", "_unwrappedTileID", "projection.xyTransformMat4", "getViewportMatrix", "vecEast", "vecSouth", "translatedAnchor", "toEast", "basePoint", "distanceMultiplier", "zoomFraction", "getPitchedTextCorrection", "offsetXmin", "offsetXmax", "offsetXhalf", "offsetYmin", "offsetYmax", "offsetYhalf", "offsetsArray", "anyPointVisible", "getAABB", "ao", "pixelValue", "OpacityState", "prevState", "increment", "placed", "skipFade", "opacity", "JointOpacityState", "placedText", "placedIcon", "JointPlacement", "CollisionCircleArray", "invProjMatrix", "viewportMatrix", "RetainedQueryData", "CollisionGroups", "crossSourceCollisions", "maxGroupID", "collisionGroups", "ID", "nextGroupID", "calculateVariableLayoutShift", "au", "Placement", "prevPlacement", "collisionIndex", "placements", "opacities", "variableOffsets", "stale", "commitTime", "retainedQueryData", "collisionCircleArrays", "collisionBoxArrays", "placedOrientations", "_getTerrainElevationFunc", "getBucketParts", "results", "sortAcrossTiles", "symbolBucket", "bucketFeatureIndex", "pixelsToTiles", "translationText", "translatePosition", "translationIcon", "textLabelPlaneMatrix", "projection.getLabelPlaneMatrix", "glMatrix", "projection.getGlCoordMatrix", "partiallyEvaluatedTextSize", "ag", "collisionGroup", "attemptAnchorPlacement", "textAnchorOffset", "textOverlapMode", "orientation", "placedGlyphBoxes", "prevAnchor", "markUsedJustification", "markUsedOrientation", "placeLayerBucketPart", "bucketPart", "seenCrossTileIDs", "textOptional", "iconOptional", "ar", "textAlwaysOverlap", "iconOverlapMode", "iconAlwaysOverlap", "zOrderByViewportY", "alwaysShowText", "alwaysShowIcon", "placeSymbol", "symbolIndex", "placeText", "placeIcon", "placedVerticalText", "placedGlyphCircles", "placedIconBoxes", "updatePreviousOrientationIfNotPlaced", "isPlaced", "previousOrientation", "prevPlacedOrientation", "placeTextForPlacementModes", "placeHorizontalFn", "placeVerticalFn", "placementMode", "textAnchorOffsetStart", "textAnchorOffsetEnd", "placeBox", "collisionTextBox", "placedFeature", "placeBoxForVariableAnchors", "collisionIconBox", "variableIconBox", "placedBox", "placementPasses", "occluded", "prevOrientation", "prevOffset", "placeIconFeature", "iconWithoutText", "textWithoutIcon", "hasIconBox", "storeCollisionData", "symbolIndexes", "circleArray", "mat4.invert", "boxArray", "realCollisionBox", "placedAnchor", "autoIndex", "indexes", "horizontalIndexes", "commit", "zoomAtLastRecencyCheck", "placementChanged", "prevZoomAdjustment", "zoomAdjustment", "symbolFadeChange", "prevOpacities", "prevOffsets", "prevOrientations", "jointPlacement", "prevOpacity", "jointOpacity", "lastPlacementChangeTime", "updateLayerOpacities", "updateBucketOpacities", "duplicateOpacityState", "textAllowOverlap", "iconAllowOverlap", "hasVariablePlacement", "defaultOpacityState", "addOpacities", "PACKED_HIDDEN_OPACITY", "boxArrays", "opacityState", "horizontalHidden", "verticalHidden", "packedOpacity", "packOpacity", "symbolHidden", "useHorizontal", "realBoxes", "variableOffset", "updateCollisionVertices", "verticalIconUsed", "instance", "hasTransitions", "stillRecent", "durationAdjustment", "setStale", "notUsed", "realBox", "shift25", "shift24", "shift17", "shift16", "shift9", "shift8", "shift1", "targetBit", "opacityBits", "createProjection", "_t", "_transform", "_anchor", "_tile", "_ele", "inViewportPixelUnitsUnits", "sinA", "cosA", "getCircleRadiusCorrection", "LayerPlacement", "_sortAcrossTiles", "_currentTileIndex", "_currentPartIndex", "_seenCrossTileIDs", "_bucketParts", "continuePlacement", "placement", "shouldPausePlacement", "bucketParts", "PauseablePlacement", "forceFullPlacement", "_currentPlacementIndex", "_forceFullPlacement", "_showCollisionBoxes", "_done", "isDone", "layerTiles", "startTime", "placementZoom", "_inProgressLayer", "roundingFactor", "TileLayerIndex", "_symbolsByKey", "symbolInstancesByKey", "instances", "symbols", "crossTileIDs", "getScaledCoordinates", "childTileID", "localX", "localY", "localZ", "yWorld", "yOffset", "findMatches", "newTileID", "zoomCrossTileIDs", "scaledSymbolCoord", "thisTileSymbol", "getCrossTileIDsLists", "CrossTileIDs", "maxCrossTileID", "generate", "CrossTileSymbolLayerIndex", "usedCrossTileIDs", "zoomIndexes", "newZoomIndex", "addBucket", "removeBucketCrossTileIDs", "childIndex", "parentIndex", "removedBucket", "removeStaleBuckets", "currentIDs", "tilesChanged", "CrossTileSymbolIndex", "maxBucketInstanceId", "bucketsInCurrentPlacement", "addLayer", "symbolBucketsChanged", "currentBucketIDs", "pruneUnusedLayers", "usedLayers", "usedLayerMap", "usedLayer", "evented", "_emitValidationErrors", "empty", "emptyStyle", "aw", "Style", "_rtlPluginLoaded", "_getMapId", "glyphManager", "lineAtlas", "crossTileSymbolIndex", "_spritesImagesIds", "_order", "_availableImages", "_resetUpdates", "_validateLayer", "loadURL", "previousStyle", "_loadStyleRequest", "_load", "loadJSON", "_frameRequest", "loadEmpty", "nextState", "transformStyle", "stylesheet", "_loadSprite", "_createLayers", "setTerrain", "dereferencedLayers", "_serializedLayers", "styledLayer", "isUpdate", "completion", "_spriteRequest", "originalSprite", "spriteArray", "jsonsMap", "imagesMap", "jsonRequestParameters", "imageRequestParameters", "spriteName", "spriteId", "imagesToRemove", "_changedImages", "imageId", "_changed", "_unloadSprite", "_updatedSources", "_serializeByIds", "returnClone", "serializedLayersDictionary", "_serializedAllLayers", "aB", "toPush", "allLayerIds", "_checkLoaded", "changed", "updatedIds", "_updatedLayers", "_removedLayers", "_updateWorkerLayers", "action", "_reloadSource", "_clearSource", "_updateTilesForChangedImages", "_updateTilesForChangedGlyphs", "_updatedPaintProps", "sourcesUsedBefore", "sourceCacheId", "sourcesUsedBeforeId", "changedImages", "_glyphsDidChange", "serializedStyle", "changes", "diffStyles", "operations", "_getOperationsToPerform", "unimplemented", "styleChangeOperation", "removeLayer", "setFilter", "setLayerZoomRange", "setGeoJSONSourceData", "setGlyphs", "setSprite", "_afterImageUpdated", "isSourceLoaded", "geojsonSource", "validateCustomStyleLayer", "aD", "_layerOrderChanged", "_updateLayer", "moveLayer", "newIndex", "getLayersOrder", "getFilter", "aE", "getTerrain", "myStyleSheet", "_flattenAndSortRenderedFeatures", "sourceResults", "isLayer3D", "features3D", "sourceResult", "layerFeatures", "topmost3D", "includedSources", "renderedSymbols", "bucketQueryData", "queryData", "bucketSymbols", "layerSymbols", "sortedA", "symbolFeature", "layerName", "dataTiles", "dataID", "_update", "skyOptions", "_remove", "_updateSources", "_generateCollisionBoxes", "_updatePlacement", "placementCommitted", "layerBucketsChanged", "pauseablePlacement", "_releaseSymbolFadeTiles", "glypgs", "getGlyphsUrl", "glyphsUrl", "addSprite", "spriteToAdd", "updatedSprite", "removeSprite", "internalSpriteRepresentation", "find", "findIndex", "getSprite", "posAttributes", "shaders", "prelude", "compile", "backgroundPattern", "clippingMask", "heatmapTexture", "collisionCircle", "fillOutline", "fillOutlinePattern", "fillPattern", "fillExtrusion", "fillExtrusionPattern", "hillshadePrepare", "lineGradient", "linePattern", "lineSDF", "symbolIcon", "symbolSDF", "symbolTextAndIcon", "terrainDepth", "terrainCoords", "fragmentSource", "vertexSource", "re", "staticAttributes", "fragmentUniforms", "vertexUniforms", "staticUniforms", "fragmentPragmas", "operation", "attrType", "unpackType", "VertexArrayObject", "boundProgram", "boundLayoutVertexBuffer", "boundPaintVertexBuffers", "boundIndexBuffer", "boundVertexOffset", "boundDynamicVertexBuffer", "vao", "program", "paintVertexBuffers", "dynamicVertexBuffer", "dynamicVertexBuffer2", "dynamicVertexBuffer3", "paintBuffersDiffer", "boundDynamicVertexBuffer2", "boundDynamicVertexBuffer3", "freshBind", "bindVertexArray", "dynamicDraw", "numNextAttributes", "numAttributes", "createVertexArray", "enableAttributes", "vertexBuffer", "setVertexAttribPointers", "currentNumAttributes", "deleteVertexArray", "terrainUniformValues", "eleDelta", "fogMatrix", "u_matrix", "u_texture", "u_ele_delta", "u_fog_matrix", "u_fog_color", "u_fog_ground_blend", "u_fog_ground_blend_opacity", "u_horizon_color", "u_horizon_fog_blend", "getTokenizedAttributesAndUniforms", "token", "Program", "configuration", "fixedUniforms", "showOverdrawInspector", "createProgram", "staticAttrInfo", "dynamicAttrInfo", "allAttrInfo", "preludeUniformsInfo", "staticUniformsInfo", "dynamicUniformsInfo", "uniformList", "allUniformsInfo", "fragmentShader", "createShader", "FRAGMENT_SHADER", "failedToCreate", "shaderSource", "compileShader", "getShaderParameter", "COMPILE_STATUS", "getShaderInfoLog", "attachShader", "vertexShader", "VERTEX_SHADER", "attributes", "uniformLocations", "bindAttribLocation", "linkProgram", "getProgramParameter", "LINK_STATUS", "getProgramInfoLog", "deleteShader", "it", "uniformLocation", "getUniformLocation", "terrainUniforms", "u_depth", "Uniform1i", "aH", "u_terrain", "u_terrain_dim", "aI", "u_terrain_matrix", "UniformMatrix4f", "aJ", "u_terrain_unpack", "aK", "u_terrain_exaggeration", "drawMode", "depthMode", "stencilMode", "colorMode", "cullFaceMode", "uniformValues", "currentProperties", "dynamicLayoutBuffer", "dynamicLayoutBuffer2", "dynamicLayoutBuffer3", "setDepthMode", "setStencilMode", "setColorMode", "setCullFace", "activeTexture", "TEXTURE2", "depthTexture", "TEXTURE3", "primitiveSize", "LINES", "TRIANGLES", "LINE_STRIP", "drawElements", "UNSIGNED_SHORT", "patternUniformValues", "tileRatio", "numTiles", "tileSizeAtNearestZoom", "pixelX", "pixelY", "u_image", "u_texsize", "u_scale", "u_fade", "u_pixel_coord_upper", "u_pixel_coord_lower", "fillExtrusionUniformValues", "shouldUseVerticalGradient", "_lp", "lightPos", "lightMat", "mat3.create", "lightColor", "u_lightpos", "u_lightintensity", "u_lightcolor", "u_vertical_gradient", "u_opacity", "fillExtrusionPatternUniformValues", "u_height_factor", "fillUniformValues", "fillPatternUniformValues", "fillOutlineUniformValues", "drawingBufferSize", "u_world", "fillOutlinePatternUniformValues", "circleUniformValues", "extrudeScale", "pixelsToGLUnits", "u_camera_to_center_distance", "u_scale_with_map", "translatePosMatrix", "u_pitch_with_map", "u_device_pixel_ratio", "u_extrude_scale", "collisionCircleUniformValues", "invMatrix", "u_inv_matrix", "u_viewport_size", "debugUniformValues", "scaleRatio", "u_color", "u_overlay", "u_overlay_scale", "clippingMaskUniformValues", "heatmapUniformValues", "u_intensity", "heatmapTextureUniformValues", "textureUnit", "colorRampUnit", "mat4.ortho", "drawingBufferWidth", "drawingBufferHeight", "u_color_ramp", "getTileLatRange", "lineUniformValues", "calculateMatrix", "u_ratio", "u_units_to_pixels", "lineGradientUniformValues", "u_image_height", "linePatternUniformValues", "tileZoomRatio", "calculateTileRatio", "lineSDFUniformValues", "posA", "posB", "widthA", "widthB", "u_patternscale_a", "u_patternscale_b", "u_sdfgamma", "u_tex_y_a", "u_tex_y_b", "u_mix", "rasterUniformValues", "parentTL", "parentScaleBy", "fade", "u_tl_parent", "u_scale_parent", "u_buffer_scale", "u_fade_t", "mix", "u_image0", "u_image1", "u_brightness_low", "u_brightness_high", "u_saturation_factor", "saturation", "u_contrast_factor", "contrast", "u_spin_weights", "spinWeights", "symbolIconUniformValues", "rotateInShader", "isAlongLine", "isVariableAnchor", "texSize", "pitchedScale", "u_is_size_zoom_constant", "u_is_size_feature_constant", "u_size_t", "u_size", "u_pitch", "u_rotate_symbol", "u_aspect_ratio", "u_fade_change", "u_label_plane_matrix", "u_coord_matrix", "u_is_text", "u_is_along_line", "u_is_variable_anchor", "u_translation", "u_pitched_scale", "symbolSDFUniformValues", "isHalo", "u_gamma_scale", "u_is_halo", "symbolTextAndIconUniformValues", "texSizeSDF", "texSizeIcon", "u_texsize_icon", "u_texture_icon", "backgroundUniformValues", "backgroundPatternUniformValues", "imagePosA", "imagePosB", "u_pattern_tl_a", "u_pattern_br_a", "u_pattern_tl_b", "u_pattern_br_b", "u_pattern_size_a", "u_pattern_size_b", "u_scale_a", "u_scale_b", "u_tile_units_to_pixels", "programUniforms", "Uniform3f", "aN", "Uniform2f", "aO", "u_pixel_extrude_scale", "aL", "u_latrange", "u_light", "u_shadow", "u_highlight", "u_accent", "u_dimension", "u_zoom", "u_unpack", "u_terrain_coords_id", "u_sky_color", "u_horizon", "u_sky_horizon_blend", "IndexBuffer", "createBuffer", "unbindVAO", "bindElementBuffer", "bufferData", "ELEMENT_ARRAY_BUFFER", "DYNAMIC_DRAW", "STATIC_DRAW", "bufferSubData", "deleteBuffer", "AttributeType", "VertexBuffer", "bindVertexBuffer", "ARRAY_BUFFER", "attribIndex", "enableVertexAttribArray", "vertexAttribPointer", "WeakMap", "isWebGL2", "getParameter", "VERSION", "BaseValue", "getDefault", "setDefault", "ClearColor", "clearColor", "ClearDepth", "clearDepth", "ClearStencil", "clearStencil", "ColorMask", "colorMask", "DepthMask", "depthMask", "StencilMask", "stencilMask", "StencilFunc", "func", "ALWAYS", "stencilFunc", "StencilOp", "KEEP", "stencilOp", "StencilTest", "enable", "STENCIL_TEST", "disable", "DepthRange", "depthRange", "DepthTest", "DEPTH_TEST", "DepthFunc", "LESS", "depthFunc", "Blend", "BLEND", "BlendFunc", "ONE", "ZERO", "blendFunc", "BlendColor", "blendColor", "BlendEquation", "FUNC_ADD", "blendEquation", "CullFace", "CULL_FACE", "CullFaceSide", "BACK", "cullFace", "FrontFace", "CCW", "frontFace", "ProgramValue", "useProgram", "ActiveTextureUnit", "TEXTURE0", "Viewport", "BindFramebuffer", "bindFramebuffer", "FRAMEBUFFER", "BindRenderbuffer", "bindRenderbuffer", "RENDERBUFFER", "BindTexture", "BindVertexBuffer", "bindBuffer", "BindElementBuffer", "BindVertexArray", "getExtension", "bindVertexArrayOES", "PixelStoreUnpack", "pixelStorei", "UNPACK_ALIGNMENT", "PixelStoreUnpackPremultiplyAlpha", "UNPACK_PREMULTIPLY_ALPHA_WEBGL", "PixelStoreUnpackFlipY", "UNPACK_FLIP_Y_WEBGL", "FramebufferAttachment", "ColorAttachment", "setDirty", "framebufferTexture2D", "COLOR_ATTACHMENT0", "DepthAttachment", "framebufferRenderbuffer", "DEPTH_ATTACHMENT", "DepthStencilAttachment", "DEPTH_STENCIL_ATTACHMENT", "Framebuffer", "hasDepth", "hasStencil", "framebuffer", "createFramebuffer", "colorAttachment", "depthAttachment", "checkFramebufferStatus", "FRAMEBUFFER_COMPLETE", "renderbuffer", "deleteRenderbuffer", "deleteFramebuffer", "ColorMode", "blendFunction", "Replace", "disabled", "aM", "unblended", "alphaBlended", "Context", "stencilTest", "depthTest", "blend", "cullFaceSide", "extTextureFilterAnisotropic", "extTextureFilterAnisotropicMax", "MAX_TEXTURE_MAX_ANISOTROPY_EXT", "maxTextureSize", "MAX_TEXTURE_SIZE", "HALF_FLOAT", "extColorBufferHalfFloat", "RGBA16F", "RGBA16F_EXT", "RGB16F", "RGB16F_EXT", "extTextureHalfFloat", "HALF_FLOAT_OES", "createRenderbuffer", "storageFormat", "rbo", "renderbufferStorage", "depth", "stencil", "COLOR_BUFFER_BIT", "DEPTH_BUFFER_BIT", "STENCIL_BUFFER_BIT", "mode", "fail", "depthFail", "createVertexArrayOES", "deleteVertexArrayOES", "DepthMode", "ReadOnly", "ReadWrite", "StencilMode", "CullFaceMode", "quadTriangles", "drawCollisionDebug", "tileBatches", "circleCount", "circleOffset", "invTransform", "mat4.mul", "aQ", "colorModeForRenderPass", "getTerrainData", "circleProgram", "vertexData", "CollisionCircleLayoutArray", "batch", "circleIdx", "collision", "quadCount", "triCount", "QuadTriangleArray", "idx", "backCCW", "identityMat4", "calculateVariableRenderShift", "renderTextSize", "getShiftedAnchor", "projectedAnchorPoint", "transformAngle", "pitchedTextShiftCorrection", "adjustedShift", "tileAnchorShifted", "symbolProjection.project", "east", "symbolProjection.projectTileCoordinatesToViewport", "updateVariableAnchorsForBucket", "tileScale", "updateTextFitIcon", "dynamicTextLayoutVertexArray", "dynamicIconLayoutVertexArray", "placedTextShifts", "tileAnchor", "projectedAnchor", "symbolProjection.getPerspectiveRatio", "evaluateSizeForFeature", "pitchedTextCorrection", "shiftedAnchor", "symbolProjection.hideGlyphs", "placedIcons", "getSymbolProgramName", "drawLayerSymbols", "rotationAlignment", "pitchAlignment", "isViewportLine", "hasSortKey", "depthModeForSublayer", "tileRenderState", "pitchedTextRescaling", "programConfiguration", "evaluateSizeForZoom", "terrainData", "atlasInterpolation", "atlasInterpolationIcon", "atlasTextureIcon", "rotating", "zooming", "NEAREST", "iconScaled", "baseMatrix", "symbolProjection.getLabelPlaneMatrix", "glCoordMatrixForShader", "symbolProjection.getGlCoordMatrix", "glCoordMatrixForSymbolPlacement", "hasVariableAnchors", "symbolProjection.updateLineLabels", "shaderVariableAnchor", "uLabelPlaneMatrix", "uglCoordMatrix", "hasHalo", "oldSegments", "segmentState", "TEXTURE1", "drawSymbolElements", "prepareHeatmapTerrain", "createHeatmapFbo", "renderHeatmapTerrain", "getColorRampTexture", "rasterBoundsBuffer", "quadTriangleIndexBuffer", "rasterBoundsSegments", "numType", "internalFormat", "updatePatternPositionsInProgram", "drawFillTiles", "isOutline", "fillPropertyName", "programName", "terrainCoord", "tileMatrix", "stencilModeForClipping", "drawExtrusionTiles", "renderHillshade", "shadow", "highlight", "accent", "moving", "prepareHillshade", "textureStride", "pixelData", "renderTexture", "getFadeValues", "sinceTile", "sinceParent", "idealZ", "fadeIn", "childOpacity", "topColor", "btmColor", "leftColor", "rightColor", "centerColor", "drawHorizontalLine", "drawDebugSSRect", "drawVerticalLine", "SCISSOR_TEST", "scissor", "drawDebugTile", "tileRawData", "tileSizeKb", "tileIdText", "initDebugOverlayCanvas", "debugOverlayCanvas", "ctx2d", "shadowColor", "shadowBlur", "strokeStyle", "strokeText", "debugOverlayTexture", "debugBuffer", "debugSegments", "tileBorderIndexBuffer", "drawTerrain", "LEQUAL", "depthRangeFor3D", "mesh", "getTerrainMesh", "renderToTexture", "getTexture", "getMeshFrameDelta", "calculateFogMatrix", "Mesh", "Painter", "_tileTextures", "terrainFacilitator", "renderTime", "setup", "numSublayers", "depthEpsilon", "tileExtentArray", "tileExtentBuffer", "tileExtentSegments", "debugArray", "rasterBoundsArray", "viewportArray", "viewportBuffer", "viewportSegments", "tileLineStripIndices", "LineStripIndexArray", "quadTriangleIndices", "stencilClearMode", "nextStencilID", "currentStencilSource", "_renderTileClippingMasks", "tileIDs", "_tileClippingMaskIDs", "REPLACE", "stencilModeFor3D", "NOTEQUAL", "EQUAL", "stencilConfigForOverlap", "minTileZ", "stencilValues", "zToStencilMode", "GEQUAL", "_showOverdrawInspector", "CONSTANT_COLOR", "renderPass", "opaquePassEnabledForLayer", "currentLayer", "opaquePassCutoff", "coordsAscending", "coordsDescending", "coordsDescendingSymbol", "maybeDrawDepthAndCoords", "prepareForRender", "renderLayer", "skyUniforms", "getHorizon", "showTileBoundaries", "selectedSource", "flatMap", "vectorSources", "otherSources", "considerSource", "showPadding", "centerPoint", "requireExact", "prevMatrix", "currMatrix", "modelViewProjectionMatrix", "doUpdate", "mat4.exactEquals", "mat4.equals", "a$", "tilesAfterTime", "mat4.copy", "getRenderableTiles", "getFramebuffer", "devicePixelRatio", "getCoordsTexture", "coordsIndex", "pixelToTileScale", "strokeWidth", "strokeOpacity", "segmentsRenderStates", "segmentsState", "aU", "gradient", "programId", "firstTile", "prevProgram", "programChanged", "atlas", "layerGradient", "gradientTexture", "textureResolution", "potentialOverzoom", "nextPowerOfTwo", "stencilModes", "textureFilter", "texParameterf", "TEXTURE_MAX_ANISOTROPY_EXT", "isPatternMissing", "setCustomLayerDefaults", "customLayerMatrix", "setBaseState", "farZ", "nearZ", "fov", "_fov", "translatedMatrix", "textures", "overLimit", "Frustum", "planes", "invProj", "frustumCoords", "vec4.mul", "frustumPlanes", "vec3.sub", "Aabb", "min_", "max_", "quadrant", "qMin", "vec3.clone", "qMax", "distanceX", "distanceY", "frustum", "aabbPoints", "fullyInside", "plane", "pointsInside", "vec4.dot", "projMin", "MAX_VALUE", "projMax", "EdgeInsets", "MAX_VALID_LATITUDE", "Transform", "minPitch", "maxPitch", "renderWorldCopies", "_renderWorldCopies", "_minZoom", "_maxZoom", "_minPitch", "_maxPitch", "setMaxBounds", "_center", "_elevation", "_unmodified", "_edgeInsets", "_posMatrixCache", "_alignedPosMatrixCache", "_fogMatrixCache", "minElevationForCurrentTile", "that", "latRange", "lngRange", "_calcMatrices", "centerOffset", "rotationMatrix", "mat2.create", "_zoom", "constrainedZoom", "zoomScale", "_constrain", "elevation", "isPaddingEqual", "interpolatePadding", "scaleZoom", "utl", "utr", "ubl", "ubr", "w0", "w1", "extraWorldCopy", "actualZ", "cameraCoord", "getCameraPoint", "centerCoord", "cameraPoint", "cameraFrustum", "fromInvProjectionMatrix", "invModelViewProjectionMatrix", "radiusOfMaxLvlLodInTiles", "newRootTile", "aabb", "fullyVisible", "intersectResult", "refPoint", "longestDim", "distanceSq", "vec2.sqrLen", "tileDistanceToCamera", "childX", "childY", "childZ", "minMax", "getMinMaxElevation", "minElevation", "maxElevation", "unmodified", "unproject", "getCameraPosition", "pointLocation", "_pixelPerMeter", "recalculateZoom", "origElevation", "origAltitude", "getElevationForLngLatZoom", "requiredAltitude", "requiredWorldSize", "setLocationAtPoint", "loc", "locationCoordinate", "newCenter", "coordinateLocation", "locationPoint", "coordinatePoint", "pixelMatrix3D", "coordinate", "coord0", "coord1", "pixelMatrixInverse", "z1", "pixelMatrix", "getMaxBounds", "calculateTileMatrix", "unwrappedX", "worldMatrix", "aligned", "posMatrixKey", "alignedModelViewProjectionMatrix", "mercatorMatrix", "getConstrained", "almost180", "scaleY", "scaleX", "screenWidth", "screenHeight", "originalX", "originalY", "modifiedX", "modifiedY", "newPoint", "h2", "wrappedX", "_constraining", "cameraToSeaLevelDistance", "cameraToLowestPointDistance", "lowestPlane", "groundAngle", "fovAboveCenter", "topHalfSurfaceDistance", "horizon", "fovCenterToHorizon", "topHalfSurfaceDistanceHorizon", "topHalfMinDistance", "mat4.perspective", "mat4.rotateX", "ad", "xShift", "yShift", "angleCos", "angleSin", "alignedM", "as", "lngLatToCameraDepth", "throttle", "lastCallArgs", "pending", "lastCallContext", "later", "Hash", "hashName", "_getCurrentHash", "hash", "_hashName", "keyval", "_onHashChange", "dragRotate", "isEnabled", "touchZoomRotate", "getBearing", "jumpTo", "_updateHashUnthrottled", "getHashString", "history", "replaceState", "_removeHash", "currentHash", "baseHash", "targetHash", "replaceString", "_updateHash", "encodeURIComponent", "addTo", "mapFeedback", "getZoom", "getPitch", "found", "parts", "defaultInertiaOptions", "linearity", "easing", "defaultPanInertiaOptions", "deceleration", "maxSpeed", "defaultZoomInertiaOptions", "defaultBearingInertiaOptions", "defaultPitchInertiaOptions", "HandlerInertia", "_inertiaBuffer", "record", "settings", "_drainInertiaBuffer", "inertia", "_onMoveEnd", "panInertiaOptions", "deltas", "pan", "pinchAround", "around", "zoomDelta", "bearingDelta", "pitchDelta", "panDelta", "easeOptions", "calculateEasing", "amount", "extendDuration", "noMoveStart", "inertiaDuration", "inertiaOptions", "speed", "MapMouseEvent", "_defaultPrevented", "defaultPrevented", "originalEvent", "mousePos", "MapTouchEvent", "changedTouches", "touchPos", "getCanvasContainer", "lngLats", "MapWheelEvent", "MapEventHandler", "_clickTolerance", "clickTolerance", "_mousedownPos", "wheel", "_firePreventable", "mousedown", "mouseup", "click", "dblclick", "mouseover", "mouseout", "touchstart", "touchmove", "touchend", "touchcancel", "mapEvent", "isActive", "BlockableMapEventHandler", "_delayContextMenu", "_ignoreContextMenu", "_contextMenuEvent", "mousemove", "contextmenu", "TransformProvider", "_requestedCameraState", "BoxZoomHandler", "_tr", "_el", "_container", "getContainer", "_enabled", "_active", "shiftKey", "disableDrag", "_startPos", "_lastPos", "mousemoveWindow", "_box", "classList", "_fireEvent", "setTransform", "mouseupWindow", "suppressClick", "cameraAnimation", "fitScreenCoordinates", "keydown", "keyCode", "enableDrag", "indexTouches", "SingleTapRecognizer", "numTouches", "mapTouches", "timeStamp", "newTouches", "TapRecognizer", "singleTap", "numTaps", "lastTime", "lastTap", "tap", "soonEnough", "closeEnough", "TapZoomHandler", "_zoomIn", "_zoomOut", "zoomInPoint", "zoomOutPoint", "easeTo", "DragHandler", "_moveStateManager", "moveStateManager", "_moveFunction", "move", "_activateOnStart", "activateOnStart", "assignEvents", "_moved", "_lastPoint", "endMove", "_move", "dragStart", "isValidStartEvent", "startMove", "dragMove", "isValidMoveEvent", "movePoint", "dragEnd", "isValidEndEvent", "getClickTolerance", "BUTTONS_FLAGS", "MouseMoveStateManager", "_correctEvent", "checkCorrectEvent", "eventButton", "mouseButton", "_eventButton", "_e", "flag", "buttons", "OneFingerTouchMoveStateManager", "_firstTouch", "_isOneFingerTouch", "targetTouches", "_isSameTouchEvent", "generateMouseRotationHandler", "bearingDegreesPerPixelMoved", "mouseMoveStateManager", "ctrlKey", "generateMousePitchHandler", "pitchDegreesPerPixelMoved", "TouchPanHandler", "_touches", "_sum", "_shouldBePrevented", "touchesCount", "cooperativeGestures", "_calculateTransform", "notifyGestureBlocked", "touchPointSum", "touchDeltaSum", "touchDeltaCount", "prevPoint", "TwoFingersTouchHandler", "_firstTwoTouches", "_start", "getTouchById", "_aroundCenter", "getZoomDelta", "lastDistance", "TwoFingersTouchZoomHandler", "_distance", "_startDistance", "getBearingDelta", "TwoFingersTouchRotateHandler", "_minDiameter", "_startVector", "_vector", "lastVector", "_isBelowThreshold", "bearingDeltaSinceStart", "isVertical", "TwoFingersTouchPitchHandler", "_currentTouchCount", "_valid", "_firstMove", "_lastPoints", "vectorA", "vectorB", "gestureBeginsVertically", "movedA", "movedB", "isSameDirection", "panStep", "bearingStep", "pitchStep", "KeyboardHandler", "stepOptions", "_panStep", "_bearingStep", "_pitchStep", "_rotationDisabled", "altKey", "metaKey", "zoomDir", "bearingDir", "pitchDir", "xDir", "yDir", "easeId", "easeOut", "disableRotation", "enableRotation", "wheelZoomDelta", "ScrollZoomHandler", "triggerRenderFrame", "_onTimeout", "initialEvent", "_type", "_delta", "_lastValue", "_triggerRenderFrame", "_defaultZoomRate", "_wheelZoomRate", "setZoomRate", "zoomRate", "setWheelZoomRate", "wheelZoomRate", "_finishTimeout", "isZooming", "_zooming", "isBypassed", "deltaMode", "WheelEvent", "DOM_DELTA_LINE", "deltaY", "timeDelta", "_lastWheelEventTime", "_timeout", "_lastWheelEvent", "_frameId", "_around", "_aroundPoint", "renderFrame", "_targetZoom", "_startZoom", "_easing", "_smoothOutEasing", "targetZoom", "startZoom", "finished", "lastWheelEventTimeDiff", "noInertia", "needsRenderFrame", "_prevEase", "currentEase", "DoubleClickZoomHandler", "clickZoom", "TapZoom", "_clickZoom", "_tapZoom", "ClickZoomHandler", "TapDragZoomHandler", "_tap", "_swipePoint", "_swipeTouch", "_tapTime", "_tapPoint", "swipePoint", "newSwipePoint", "DragPanHandler", "mousePan", "touchPan", "_mousePan", "_touchPan", "_inertiaOptions", "DragRotateHandler", "mouseRotate", "mousePitch", "_pitchWithRotate", "pitchWithRotate", "_mouseRotate", "_mousePitch", "TwoFingersTouchZoomRotateHandler", "touchZoom", "touchRotate", "tapDragZoom", "_touchZoom", "_touchRotate", "_tapDragZoom", "CooperativeGesturesHandler", "_bypassKey", "_setupUI", "mapCanvasContainer", "desktopMessage", "_getUIString", "mobileMessage", "desktopDiv", "textContent", "mobileDiv", "setAttribute", "_destroyUI", "gestureType", "isMoving", "drag", "RenderFrameEvent", "hasChange", "HandlerManager", "handleWindowEvent", "handleEvent", "eventName", "_updatingCamera", "inputEvent", "mergedHandlerResult", "eventsInProgress", "activeHandlers", "eventTouches", "_getMapTouches", "handlerName", "_handlers", "_blockedByActive", "mergeHandlerResult", "deactivatedHandlers", "_previousActiveHandlers", "_changes", "_stop", "_inertia", "_fireEvents", "_handlersById", "_bearingSnap", "bearingSnap", "_eventsInProgress", "_addDefaultHandlers", "passive", "listenerOptions", "boxZoom", "interactive", "tapZoom", "doubleClickZoom", "touchPitch", "dragPan", "scrollZoom", "keyboard", "allowEndAnimation", "isRotating", "myName", "handlerResult", "eventData", "_applyChanges", "combined", "combinedEventsInProgress", "combinedDeactivatedHandlers", "change", "_updateMapTransform", "combinedResult", "_getTransformForUpdate", "_terrainMovement", "_elevationFreeze", "_applyUpdatedTransform", "newEventsInProgress", "wasMoving", "nowMoving", "startEvents", "endEvents", "originalEndEvent", "stillMoving", "finishedMoving", "inertialEase", "shouldSnapToNorth", "essential", "resetNorth", "freezeElevation", "_requestFrame", "_renderTaskQueue", "Camera", "_renderFrameCallback", "_easeStart", "_easeOptions", "_onEaseFrame", "_easeFrameId", "_requestRenderFrame", "_moving", "setCenter", "panBy", "panTo", "setZoom", "zoomTo", "zoomIn", "zoomOut", "setBearing", "getPadding", "setPadding", "rotateTo", "resetNorthPitch", "snapToNorth", "setPitch", "cameraForBounds", "_cameraForBoxAndBearing", "defaultPadding", "edgePadding", "nwWorld", "neWorld", "seWorld", "swWorld", "bearingRadians", "degreesToRadians", "nwRotatedWorld", "neRotatedWorld", "seRotatedWorld", "swRotatedWorld", "upperRight", "lowerLeft", "rotatedPaddingOffset", "offsetAtFinalZoom", "fitBounds", "_fitInternal", "calculatedOptions", "flyTo", "zoomChanged", "bearingChanged", "pitchChanged", "calculateCameraOptionsFromTo", "altitudeFrom", "altitudeTo", "fromMerc", "toMerc", "distance3D", "groundDistance", "startBearing", "startPitch", "startPadding", "_normalizeBearing", "offsetAsPoint", "pointAtOffset", "locationAtOffset", "_normalizeCenter", "finalScale", "aroundPoint", "currently", "_rotating", "pitching", "_pitching", "_padding", "_easeId", "_prepareEase", "_prepareElevation", "_ease", "_updateElevation", "speedup", "_fireMoveEvents", "interruptingEaseId", "_finalizeElevation", "_afterEase", "_elevationCenter", "_elevationStart", "_elevationTarget", "getMinTileElevationForLngLatZoom", "pitch1", "transformCameraUpdate", "_elevateCameraIfInsideTerrain", "camera", "minAltitude", "newCamera", "modifiers", "finalTransform", "modifier", "nextTransform", "wasZooming", "wasRotating", "wasPitching", "coercedOptions", "curve", "rho", "u1", "wMax", "rho2", "zoomOutFactor", "descent", "sinh", "cosh", "r0", "screenSpeed", "maxDuration", "isEasing", "allowGestures", "_cancelRenderFrame", "_onEaseEnd", "onEaseEnd", "handlers", "currentBearing", "queryTerrainElevation", "defaultAttributionControlOptions", "compact", "customAttribution", "AttributionControl", "_toggleAttribution", "removeAttribute", "_updateData", "_updateAttributions", "_updateCompact", "_compact", "_updateCompactMinimize", "getDefaultPosition", "_compactButton", "_setElementTitle", "_innerContainer", "_attribHTML", "title", "attributions", "styleOwner", "owner", "styleId", "attrib", "attribHTML", "innerHTML", "_editLink", "LogoControl", "containerChildren", "rel", "display", "TaskQueue", "_queue", "_id", "_cleared", "_currentlyRunning", "cancelled", "running", "run", "pos3dAttributes", "TerrainSourceCache", "_renderableTilesKeys", "_sourceTileCache", "deltaZoom", "destruct", "freeRtt", "getTerrainCoords", "_tileID", "getSourceTile", "searchForDEM", "Terrain", "qualityFactor", "meshSize", "_demMatrixCache", "_coordsTextureSize", "getDEMElevation", "isInBoundsForZoomLngLat", "_getOverscaledTileIDFromLngLatZoom", "_emptyDemTexture", "_emptyDepthTexture", "_emptyDemUnpack", "_emptyDemMatrix", "sourceTile", "matrixKey", "demMatrix", "mat4.fromScaling", "_fboDepthTexture", "_fbo", "_fboCoordsTexture", "DEPTH_COMPONENT16", "_coordsTexture", "fbHeight", "readPixels", "coordsSize", "depthAtPoint", "_mesh", "Pos3dArray", "meshSize2", "offsetTop", "offsetBottom", "offsetLeft", "offsetRight", "be", "mercatorCoordinate", "tileX", "tileY", "RenderPool", "_context", "_size", "_tileSize", "_objects", "_recentlyUsed", "_stamp", "_createObject", "DEPTH_STENCIL", "stamp", "inUse", "getObjectForId", "useObject", "stampObject", "getOrCreateFreeObject", "freeObject", "freeAllObjects", "isFull", "LAYERS", "RenderToTexture", "pool", "_stacks", "_prevType", "_rttTiles", "_renderableTiles", "_renderableLayerIds", "_coordsDescendingInv", "_coordsDescendingInvStr", "isLastLayer", "defaultLocale", "packageJSON", "attributionControl", "maplibreLogo", "failIfMajorPerformanceCaveat", "preserveDrawingBuffer", "refreshExpiredTiles", "trackResize", "maxTileCacheSize", "maxTileCacheZoomLevels", "maxCanvasSize", "touchmoveWindow", "showCompass", "showZoom", "visualizePitch", "MouseRotateWrapper", "startMouse", "moveMouse", "offTemp", "startTouch", "moveTouch", "mapRotateTolerance", "mapPitchTolerance", "touchMoveStateManager", "Bs", "supportsGeolocation", "smartWrap", "priorPos", "originalLngLat", "anchorTranslate", "applyAnchorClass", "prefix", "Marker", "_onKeyPress", "legacyCode", "charCode", "togglePopup", "_onMapClick", "targetElement", "_element", "_popup", "isFullyLoaded", "_lngLat", "_flatPos", "_offset", "rotation", "_rotationAlignment", "_rotation", "_pitchAlignment", "_subpixelPositioning", "_updateOpacity", "_onMove", "_isDragging", "_pointerdownPos", "_positionDelta", "setLngLat", "pointerEvents", "_onUp", "_addDragHandler", "_color", "_scale", "_draggable", "draggable", "subpixelPositioning", "setOpacity", "opacityWhenCovered", "_defaultMarker", "svg", "createNS", "defaultHeight", "defaultWidth", "setAttributeNS", "markerLarge", "page1", "ellipses", "rx", "ry", "ellipse", "bgPath", "borderPath", "maki", "circleContainer", "circle1", "circle2", "setDraggable", "_opacityTimeout", "getLngLat", "getElement", "setPopup", "popup", "_originalTabIndex", "linearOffset", "markerRadius", "markerHeight", "getAttribute", "setSubpixelPositioning", "getPopup", "_opacityWhenCovered", "isOpen", "force", "_opacity", "terrainDistance", "metersToCenter", "elevationToCenter", "terrainDistanceCenter", "centerIsInvisible", "getOffset", "setOffset", "addClassName", "removeClassName", "toggleClassName", "toggle", "shouldBeDraggable", "isDraggable", "setRotation", "getRotation", "setRotationAlignment", "getRotationAlignment", "setPitchAlignment", "getPitchAlignment", "positionOptions", "enableHighAccuracy", "maximumAge", "fitBoundsOptions", "trackUserLocation", "showAccuracyCircle", "showUserLocation", "numberOfWatches", "noTimeout", "updateScale", "clientHeight", "maxMeters", "maxFeet", "setScale", "maxDistance", "pow10", "multiplier", "closeButton", "closeOnClick", "focusAfterOpen", "focusQuerySelector", "normalizeOffset", "cornerOffset", "convertedOffset", "Es", "Ua", "et", "vs", "ds", "ms", "fs", "ba", "_onFullscreenChange", "fullscreenElement", "mozFullScreenElement", "webkitFullscreenElement", "msFullscreenElement", "shadowRoot", "_fullscreen", "_handleFullscreenChange", "_onClickFullscreen", "_isFullscreen", "_exitFullscreen", "_requestFullscreen", "HTMLElement", "_fullscreenchange", "_controlContainer", "_fullscreenButton", "_updateTitle", "_getTitle", "_prevCooperativeGesturesEnabled", "exitFullscreen", "mozCancelFullScreen", "msExitFullscreen", "webkitCancelFullScreen", "_togglePseudoFullScreen", "requestFullscreen", "mozRequestFullScreen", "msRequestFullscreen", "webkitRequestFullscreen", "_onSuccess", "_isOutOfMapMaxBounds", "_setErrorState", "_updateMarker", "_finish", "_lastKnownPosition", "_watchState", "_geolocateButton", "_updateCamera", "_dotElement", "longitude", "accuracy", "newBounds", "geolocateSource", "_accuracyCircleMarker", "_userLocationDotMarker", "_accuracy", "_updateCircleRadius", "_onZoom", "_onError", "_geolocationWatchID", "_clearWatch", "_timeoutId", "_finishSetupUI", "_circleElement", "_setup", "forceRecalculation", "permissions", "geolocation", "checkGeolocationSupport", "clearWatch", "southEastPoint", "northEastPoint", "mapHeightInMeters", "watchPosition", "getCurrentPosition", "Ea", "H", "Ps", "_idleTriggered", "_crossFadingFactor", "_controls", "_contextLost", "_contextRestored", "_setupPainter", "_onMapScroll", "scrollTop", "scrollLeft", "_onWindowOnline", "_interactive", "_failIfMajorPerformanceCaveat", "_preserveDrawingBuffer", "_antialias", "antialias", "_trackResize", "_crossSourceCollisions", "_locale", "_overridePixelRatio", "_maxCanvasSize", "_imageQueueHandle", "maxBounds", "_setupContainer", "initialResizeEventCaptured", "throttledResizeCallback", "redraw", "_resizeObserver", "ResizeObserver", "observe", "_hash", "_localIdeographFontFamily", "_validateStyle", "setStyle", "addControl", "logoPosition", "control", "controlElement", "positionContainer", "_controlPositions", "insertBefore", "firstChild", "removeControl", "ci", "hasControl", "dimensions", "_containerDimensions", "clampedPixelRatio", "_getClampedPixelRatio", "_resizeCanvas", "fireMoving", "maxCanvasWidth", "maxCanvasHeight", "canvasWidth", "canvasHeight", "setPixelRatio", "setMinZoom", "getMinZoom", "setMaxZoom", "getMaxZoom", "setMinPitch", "getMinPitch", "setMaxPitch", "getMaxPitch", "getRenderWorldCopies", "setRenderWorldCopies", "_createDelegatedListener", "mousein", "delegates", "existingLayers", "delegate", "_saveDelegatedListener", "delegatedListener", "_delegatedListeners", "_removeDelegatedListener", "layerIdsOrListener", "geometryOrOptions", "isGeometry", "_diffStyle", "_updateStyle", "_lazyInitEmptyStyle", "_updateDiff", "getStyle", "isStyleLoaded", "_terrainDataCallback", "thisLayer", "areTilesLoaded", "existingImage", "imageData", "hasImage", "loadImage", "beforeId", "spriteUrl", "_canvasContainer", "_canvas", "clientWidth", "canvasContainer", "controlContainer", "positionName", "webglcontextcreationerrorDetailObject", "requestedAttributes", "statusMessage", "msg", "_styleDirty", "_sourcesDirty", "updateStyle", "_render", "paintStartTimeStamp", "crossFading", "_placementDirty", "somethingDirty", "_repaint", "_fullyLoaded", "disconnect", "loseContext", "bf", "_showTileBoundaries", "_showPadding", "repaint", "_vertices", "getCameraTargetElevation", "_updateZoomButtons", "isMax", "isMin", "_zoomInButton", "_zoomOutButton", "_rotateCompassArrow", "_compassIcon", "_setButtonTitle", "_createButton", "_compass", "_handler", "_content", "_onClose", "_onMouseMove", "_onMouseUp", "_onDrag", "cursor", "_trackPointer", "_tip", "_closeButton", "anchorComponents", "offsetedPos", "closeOnMove", "_focusFirstElement", "trackPointer", "setText", "setDOMContent", "createTextNode", "setHTML", "html", "frag", "createDocumentFragment", "temp", "getMaxWidth", "setMaxWidth", "htmlNode", "hasChildNodes", "_createCloseButton", "firstFocusable", "querySelector", "focus", "setUnit", "_toggleTerrain", "_updateTerrainIcon", "_terrainButton", "ss", "is", "gs", "tt", "SourceType", "workerUrl", "numRequests", "lazy", "maplibregl$1", "maplibregl", "require_leaflet_maplibre_gl", "__commonJSMin", "exports", "module", "root", "factory", "L", "maplibregl", "options", "map", "paneName", "halfSize", "center", "p", "container", "size", "offset", "topLeft", "canvas", "e", "gl", "tr", "scale", "padding", "viewHalf", "zoom", "MarkerClusterGroup", "options", "animate", "layer", "visibleLayer", "currentZoom", "layersArray", "skipLayerAddEvent", "fg", "npg", "chunked", "chunkInterval", "chunkProgress", "l", "offset", "originalArray", "m", "started", "process", "start", "elapsed", "markers", "otherMarker", "needsClustering", "i", "layersArray2", "l2", "marker", "bounds", "method", "context", "needsRemoving", "thisNeedsRemoving", "j", "layers", "id", "result", "anArray", "callback", "map", "showMarker", "vMarker", "obj", "z", "gridUnclustered", "minZoom", "e", "isPopupOpen", "from", "to", "dragStart", "removeFromDistanceGrid", "dontUpdateMap", "gridClusters", "cluster", "el", "oel", "type", "data", "propagate", "childCount", "c", "spiderfyOnMaxZoom", "showCoverageOnHover", "zoomToBoundsOnClick", "spiderfyOnEveryZoom", "bottomCluster", "newBounds", "maxZoom", "radius", "radiusFn", "zoom", "markerPoint", "closest", "parent", "newCluster", "lastParent", "fn", "mapZoom", "maxLat", "group", "output", "icon", "previousZoomLevel", "newZoomLevel", "startPos", "n", "me", "MarkerCluster", "a", "b", "storageArray", "ignoreDraggedMarker", "fitBoundsOptions", "childClusters", "boundsZoom", "newClusters", "new1", "isNotificationFromChild", "child", "latSum", "lngSum", "totalCount", "childLatLng", "center", "cm", "mapMinZoom", "zoomLevel", "nm", "k", "previousBounds", "exceptBounds", "boundsToApplyTo", "zoomLevelToStart", "zoomLevelToStop", "runAtEveryLevel", "runAtBottomLevel", "backup", "cellSize", "point", "x", "y", "grid", "row", "cell", "stamp", "len", "removed", "dist", "objectPoint", "closestDistSq", "coord", "p", "p2", "dx", "dy", "cpt", "bl", "vY", "vX", "baseLine", "latLngs", "maxD", "maxPt", "newPoints", "pt", "d", "convexHullBaseLines", "t", "minLat", "maxLng", "minLng", "maxLatPt", "minLatPt", "maxLngPt", "minLngPt", "minPt", "ch", "childMarkers", "points", "positions", "zoomDetails", "count", "centerPt", "circumference", "legLength", "angleStep", "res", "angle", "spiderfyDistanceMultiplier", "separation", "lengthFactor", "legOptions", "leg", "newPos", "thisLayerLatLng", "thisLayerPos", "svg", "finalLegOpacity", "legPath", "nonAnimatable", "stillThereChildCount", "directlyRefreshClusters", "require_geohash", "__commonJSMin", "exports", "GeoHash", "refine_interval", "interval", "cd", "mask", "latitude", "longitude", "is_even", "i", "lat", "lon", "bit", "ch", "precision", "geohash", "srcHash", "dir", "lastChr", "type", "base", "require_htmx_min", "__commonJSMin", "e", "t", "r", "n", "i", "a", "o", "s", "l", "u", "f", "c", "h", "v", "M", "X", "d", "D", "U", "g", "m", "p", "x", "B", "F", "V", "y", "b", "w", "j", "S", "E", "_", "C", "R", "z", "$", "T", "O", "W", "q", "H", "G", "J", "L", "A", "Z", "N", "K", "I", "k", "P", "Y", "setupCopyText", "el", "ev", "toast", "setupTables", "table_wrapper", "table", "thead", "tbody", "header_cells", "table_rows", "first_row", "cell", "i", "width", "table_copy", "table_copy_wrapper", "table_offset_left", "table_offset_top", "flushPending", "flushing", "queue", "lastFlushedIndex", "scheduler", "callback", "queueJob", "job", "queueFlush", "dequeueJob", "index", "flushJobs", "i", "reactive", "effect", "release", "raw", "shouldSchedule", "disableEffectScheduling", "setReactivityEngine", "engine", "task", "overrideEffect", "override", "elementBoundEffect", "el", "cleanup2", "effectReference", "dispatch", "name", "detail", "walk", "el2", "skip", "node", "warn", "message", "args", "started", "start", "startObservingMutations", "onElAdded", "initTree", "onElRemoved", "destroyTree", "onAttributesAdded", "attrs", "directives", "handle", "outNestedComponents", "closestRoot", "allSelectors", "rootSelectorCallbacks", "initSelectorCallbacks", "rootSelectors", "fn", "addRootSelector", "selectorCallback", "addInitSelector", "includeInitSelectors", "findClosest", "element", "selector", "isRoot", "initInterceptors", "interceptInit", "walker", "intercept", "deferHandlingDirectives", "root", "cleanupAttributes", "cleanupElement", "onAttributeAddeds", "onElRemoveds", "onElAddeds", "onAttributeRemoved", "names", "value", "observer", "onMutate", "currentlyObserving", "stopObservingMutations", "flushObserver", "recordQueue", "willProcessRecordQueue", "processRecordQueue", "mutateDom", "result", "isCollecting", "deferredMutations", "deferMutations", "flushAndStopDeferringMutations", "mutations", "addedNodes", "removedNodes", "addedAttributes", "removedAttributes", "oldValue", "add2", "remove", "scope", "mergeProxies", "closestDataStack", "addScopeToNode", "data2", "referenceNode", "objects", "mergeProxyTrap", "obj", "thisProxy", "collapseProxies", "acc", "key", "initInterceptors2", "isObject2", "val", "recurse", "basePath", "enumerable", "path", "interceptor", "mutateObj", "get", "set", "initialValue", "initialize", "innerValue", "carry", "segment", "magics", "magic", "injectMagics", "memoizedUtilities", "getUtilities", "utilities", "getElementBoundUtilities", "tryCatch", "expression", "e", "handleError", "error2", "shouldAutoEvaluateFunctions", "dontAutoEvaluateFunctions", "cache", "evaluate", "extras", "evaluateLater", "theEvaluatorFunction", "normalEvaluator", "setEvaluator", "newEvaluator", "overriddenMagics", "dataStack", "evaluator", "generateEvaluatorFromFunction", "generateEvaluatorFromString", "func", "receiver", "scope2", "params", "runIfTypeOfFunction", "evaluatorMemo", "generateFunctionFromString", "AsyncFunction", "rightSideSafeExpression", "func2", "completeScope", "promise", "prefixAsString", "prefix", "subject", "setPrefix", "newPrefix", "directiveHandlers", "directive", "directive2", "pos", "directiveOrder", "attributes", "originalAttributeOverride", "vAttributes", "staticAttributes", "attributesOnly", "attribute", "attr", "transformedAttributeMap", "toTransformedAttributes", "newName", "oldName", "outNonAlpineAttributes", "toParsedDirectives", "byPriority", "getDirectiveHandler", "isDeferringHandlers", "directiveHandlerStacks", "currentHandlerStackKey", "flushHandlers", "stopDeferring", "cleanups", "effect3", "cleanupEffect", "alpine_default", "noop", "handler4", "fullHandler", "startingWith", "replacement", "into", "newValue", "attributeTransformers", "transform", "mapAttributes", "alpineAttributeRegex", "typeMatch", "valueMatch", "modifiers", "original", "DEFAULT", "a", "b", "typeA", "typeB", "tickStack", "isHolding", "nextTick", "releaseNextTicks", "res", "holdNextTicks", "setClasses", "setClassesFromString", "setClassesFromObject", "classString", "split", "classString2", "missingClasses", "addClassesAndReturnUndo", "classes", "classObject", "forAdd", "bool", "forRemove", "added", "removed", "setStyles", "setStylesFromObject", "setStylesFromString", "previousStyles", "value2", "kebabCase", "once", "fallback", "called", "evaluate2", "registerTransitionsFromHelper", "registerTransitionsFromClassString", "stage", "registerTransitionObject", "doesntSpecify", "transitioningIn", "transitioningOut", "wantsAll", "wantsOpacity", "wantsScale", "opacityValue", "scaleValue", "modifierValue", "delay", "origin", "property", "durationIn", "durationOut", "easing", "setFunction", "defaultValue", "before", "after", "transition", "show", "hide", "nextTick2", "clickAwayCompatibleShow", "resolve", "reject", "closest", "closestHide", "hideAfterChildren", "parent", "during", "start2", "end", "undoStart", "undoDuring", "undoEnd", "performTransition", "stages", "interrupted", "reachedBefore", "reachedEnd", "finish", "duration", "rawValue", "match", "isCloning", "skipDuringClone", "onlyDuringClone", "cloneNode", "from", "to", "dontRegisterReactiveSideEffects", "isCloningLegacy", "clone", "oldEl", "newEl", "cloneTree", "hasRunThroughFirstEl", "el3", "callback2", "storedEffect", "shouldSkipRegisteringDataDuringClone", "bind", "camelCase", "bindInputValue", "bindStyles", "bindClasses", "bindAttributeAndProperty", "bindAttribute", "checkedAttrLooseCompare", "updateSelect", "setPropertyIfChanged", "attributeShouldntBePreservedIfFalsy", "isBooleanAttr", "setIfChanged", "attrName", "propName", "arrayWrappedValue", "option", "char", "valueA", "valueB", "getBinding", "getAttributeBinding", "extractProp", "extract", "binding", "debounce", "wait", "timeout", "context", "later", "throttle", "limit", "inThrottle", "entangle", "outerGet", "outerSet", "innerGet", "innerSet", "firstRun", "outerHash", "innerHash", "outerHashLatest", "innerHashLatest", "reference", "outer", "inner", "plugin", "stores", "isReactive", "store", "getStores", "binds", "bind2", "bindings", "getBindings", "applyBindingsObject", "injectBindingProviders", "cleanupRunners", "datas", "data", "injectDataProviders", "Alpine", "makeMap", "str", "expectsLowerCase", "map", "list", "specialBooleanAttrs", "isBooleanAttr2", "EMPTY_OBJ", "EMPTY_ARR", "hasOwnProperty", "hasOwn", "isArray", "isMap", "toTypeString", "isString", "isSymbol", "isObject", "objectToString", "toRawType", "isIntegerKey", "cacheStringFunction", "camelizeRE", "camelize", "_", "c", "hyphenateRE", "hyphenate", "capitalize", "toHandlerKey", "hasChanged", "targetMap", "effectStack", "activeEffect", "ITERATE_KEY", "MAP_KEY_ITERATE_KEY", "isEffect", "effect2", "options", "createReactiveEffect", "stop", "cleanup", "uid", "enableTracking", "resetTracking", "deps", "shouldTrack", "trackStack", "pauseTracking", "last", "track", "target", "type", "depsMap", "dep", "trigger", "oldTarget", "effects", "effectsToAdd", "key2", "run", "isNonTrackableKeys", "builtInSymbols", "get2", "createGetter", "readonlyGet", "arrayInstrumentations", "createArrayInstrumentations", "instrumentations", "arr", "toRaw", "l", "isReadonly", "shallow", "shallowReadonlyMap", "readonlyMap", "shallowReactiveMap", "reactiveMap", "targetIsArray", "isRef", "readonly", "reactive2", "set2", "createSetter", "hadKey", "deleteProperty", "has", "ownKeys", "mutableHandlers", "readonlyHandlers", "toReactive", "toReadonly", "toShallow", "getProto", "v", "get$1", "isShallow", "rawTarget", "rawKey", "has2", "wrap", "has$1", "size", "add", "set$1", "get3", "checkIdentityKeys", "deleteEntry", "clear", "hadItems", "createForEach", "thisArg", "observed", "createIterableMethod", "method", "targetIsMap", "isPair", "isKeyOnly", "innerIterator", "done", "createReadonlyMethod", "createInstrumentations", "mutableInstrumentations2", "shallowInstrumentations2", "readonlyInstrumentations2", "shallowReadonlyInstrumentations2", "mutableInstrumentations", "readonlyInstrumentations", "shallowInstrumentations", "shallowReadonlyInstrumentations", "createInstrumentationGetter", "mutableCollectionHandlers", "readonlyCollectionHandlers", "targetTypeMap", "rawType", "getTargetType", "createReactiveObject", "baseHandlers", "collectionHandlers", "proxyMap", "existingProxy", "targetType", "proxy", "r", "evaluateLater2", "firstTime", "getArrayOfRefObject", "refObjects", "currentEl", "globalIdMemo", "findAndIncrementId", "closestIdRoot", "setIdRoot", "id", "warnMissingPluginMagic", "magicName", "slug", "evaluateInnerSet", "releaseEntanglement", "getTarget", "clone2", "eventName", "placeInDom", "clone3", "target2", "modifiers2", "teleportContainerDuringClone", "handler", "on", "event", "listenerTarget", "wrapHandler", "wrapper", "dotSyntax", "camelCase2", "nextModifier", "isNumeric", "next", "isKeyEvent", "isListeningForASpecificKeyThatHasntBeenPressed", "kebabCase2", "keyModifiers", "debounceIndex", "keyToModifiers", "selectedSystemKeyModifiers", "modifier", "modifierToKeyMap", "scopeTarget", "evaluateGet", "evaluateSet", "getValue", "isGetterSetter", "setValue", "removeListener", "getInputValue", "removeResetListener", "currentValue", "safeParseNumber", "checkedAttrLooseCompare2", "number", "isNumeric2", "handler2", "bindingProviders", "storeKeyForXFor", "magicContext", "dataProviderContext", "reactiveData", "undo", "toggle", "iteratorNames", "parseForExpression", "evaluateItems", "evaluateKey", "loop", "templateEl", "items", "isNumeric3", "lookup", "prevKeys", "scopes", "keys", "getIterationScopeVariables", "adds", "moves", "removes", "sames", "lastKey", "prevIndex", "keyInSpot", "keyForSpot", "elInSpot", "elForSpot", "marker", "lastKey2", "lastEl", "reactiveScope", "newScope", "forIteratorRE", "stripParensRE", "forAliasRE", "inMatch", "item", "iteratorMatch", "scopeVariables", "handler3", "warnMissingPluginDirective", "directiveName", "src_default", "module_default", "src_default", "Alpine", "el", "value", "expression", "effect", "evaluateLater", "templateFn", "lastInputValue", "evaluator", "input", "result", "value2", "formatMoney", "processInputValue", "el2", "shouldRestoreCursor", "template", "setInput", "formatInput", "restoreCursorPosition", "strippedDownInput", "stripDown", "buildUp", "callback", "cursorPosition", "unformattedValue", "beforeLeftOfCursorBeforeFormatting", "newPosition", "inputToBeStripped", "output", "regexes", "wildcardTemplate", "i", "j", "found", "clean", "delimiter", "thousands", "precision", "addThousands", "input2", "thousands2", "counter", "minus", "strippedInput", "module_default", "dialog_default", "Alpine", "fylgjaAlpineDialog", "el", "expression", "modifiers", "evaluateLater", "cleanup", "evaluate", "lockPageScroll", "closeby", "modifierValue", "escapeDialog", "backdropDialog", "methodDialog", "scrollLock", "use", "event", "rect", "key", "fallback", "rawValue", "allowedValues", "options", "module_default", "round", "v", "lim", "l", "h", "p2b", "n2b", "v", "lim", "round", "b2n", "n2p", "map$1", "hex", "h1", "b", "h2", "eq", "isShort", "hexParse", "str", "len", "ret", "alpha", "a", "f", "hexString", "HUE_RE", "hsl2rgbn", "h", "s", "l", "n", "k", "hsv2rgbn", "hwb2rgbn", "w", "rgb", "i", "hueValue", "r", "g", "d", "max", "rgb2hsl", "min", "calln", "c", "hsl2rgb", "hwb2rgb", "hsv2rgb", "hue", "hueParse", "m", "p2b", "p1", "p2", "rotate", "deg", "hslString", "map", "names$1", "unpack", "unpacked", "keys", "tkeys", "j", "ok", "nk", "names", "nameParse", "RGB_RE", "rgbParse", "rgbString", "to", "from", "interpolate", "rgb1", "rgb2", "t", "modHSL", "ratio", "tmp", "clone", "proto", "fromObject", "input", "functionParse", "Color", "_Color", "type", "obj", "color", "weight", "c1", "c2", "w2", "p", "w1", "val", "noop", "uid", "id", "isNullOrUndef", "value", "isArray", "Array", "type", "Object", "prototype", "toString", "call", "slice", "isObject", "isNumberFinite", "Number", "isFinite", "finiteOrDefault", "defaultValue", "valueOrDefault", "toPercentage", "dimension", "endsWith", "parseFloat", "toDimension", "callback", "fn", "args", "thisArg", "apply", "each", "loopable", "reverse", "i", "len", "keys", "length", "_elementsEqual", "a0", "a1", "ilen", "v0", "v1", "datasetIndex", "index", "clone", "source", "map", "target", "create", "klen", "k", "isValidKey", "key", "indexOf", "_merger", "options", "tval", "sval", "merge", "sources", "merger", "current", "mergeIf", "_mergerIf", "hasOwnProperty", "keyResolvers", "v", "x", "o", "y", "_splitKey", "key", "parts", "split", "keys", "tmp", "part", "endsWith", "slice", "push", "_getKeyResolver", "obj", "k", "resolveObjectKey", "_capitalize", "str", "charAt", "toUpperCase", "defined", "value", "isFunction", "setsEqual", "a", "b", "size", "item", "has", "_isClickEvent", "e", "type", "PI", "Math", "TAU", "PITAU", "INFINITY", "Number", "POSITIVE_INFINITY", "RAD_PER_DEG", "HALF_PI", "QUARTER_PI", "TWO_THIRDS_PI", "log10", "sign", "almostEquals", "epsilon", "abs", "niceNum", "range", "roundedRange", "round", "niceRange", "pow", "floor", "fraction", "_factorize", "result", "sqrt", "i", "sort", "pop", "isNumber", "n", "isNaN", "parseFloat", "isFinite", "almostWhole", "rounded", "_setMinAndMaxByKey", "array", "target", "property", "ilen", "length", "min", "max", "toRadians", "degrees", "toDegrees", "radians", "_decimalPlaces", "isFiniteNumber", "p", "getAngleFromPoint", "centrePoint", "anglePoint", "distanceFromXCenter", "distanceFromYCenter", "radialDistanceFromCenter", "angle", "atan2", "distance", "distanceBetweenPoints", "pt1", "pt2", "_angleDiff", "_normalizeAngle", "_angleBetween", "start", "end", "sameAngleIsFullCircle", "s", "angleToStart", "angleToEnd", "startToAngle", "endToAngle", "_limitValue", "_int16Range", "_isBetween", "_lookup", "table", "cmp", "index", "hi", "lo", "mid", "_lookupByKey", "last", "ti", "_rlookupByKey", "_filterBetween", "values", "arrayEvents", "listenArrayEvents", "listener", "_chartjs", "listeners", "Object", "defineProperty", "configurable", "enumerable", "forEach", "method", "base", "args", "res", "apply", "object", "unlistenArrayEvents", "stub", "indexOf", "splice", "_arrayUnique", "items", "set", "Set", "Array", "from", "requestAnimFrame", "window", "callback", "requestAnimationFrame", "throttled", "fn", "thisArg", "argsToUse", "ticking", "args", "call", "apply", "debounce", "delay", "timeout", "clearTimeout", "setTimeout", "_toLeftRightCenter", "align", "_alignStartEnd", "start", "end", "_textX", "left", "right", "rtl", "_getStartAndCountOfVisiblePoints", "meta", "points", "animationsDisabled", "pointCount", "length", "count", "_sorted", "iScale", "_parsed", "axis", "min", "max", "minDefined", "maxDefined", "getUserBounds", "_limitValue", "Math", "_lookupByKey", "lo", "getPixelForValue", "hi", "_scaleRangesChanged", "xScale", "yScale", "_scaleRanges", "newRanges", "xmin", "xmax", "ymin", "ymax", "changed", "Object", "assign", "atEdge", "t", "elasticIn", "s", "p", "pow", "sin", "TAU", "elasticOut", "effects", "linear", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeInSine", "cos", "HALF_PI", "easeOutSine", "easeInOutSine", "PI", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInCirc", "sqrt", "easeOutCirc", "easeInOutCirc", "easeInElastic", "easeOutElastic", "easeInOutElastic", "easeInBack", "easeOutBack", "easeInOutBack", "easeInBounce", "easeOutBounce", "d", "m", "easeInOutBounce", "isPatternOrGradient", "value", "type", "toString", "color", "Color", "getHoverColor", "saturate", "darken", "hexString", "numbers", "colors", "applyAnimationsDefaults", "defaults", "set", "undefined", "duration", "easing", "from", "loop", "to", "describe", "_fallback", "_indexable", "_scriptable", "name", "properties", "active", "animation", "resize", "show", "animations", "visible", "hide", "v", "applyLayoutsDefaults", "autoPadding", "padding", "top", "bottom", "intlCache", "Map", "getNumberFormat", "locale", "options", "cacheKey", "JSON", "stringify", "formatter", "get", "Intl", "NumberFormat", "formatNumber", "num", "format", "formatters", "values", "isArray", "numeric", "tickValue", "index", "ticks", "chart", "notation", "delta", "maxTick", "abs", "calculateDelta", "logDelta", "log10", "numDecimal", "isNaN", "floor", "minimumFractionDigits", "maximumFractionDigits", "logarithmic", "remain", "significand", "includes", "Ticks", "applyScaleDefaults", "display", "offset", "reverse", "beginAtZero", "bounds", "clip", "grace", "grid", "lineWidth", "drawOnChartArea", "drawTicks", "tickLength", "tickWidth", "_ctx", "tickColor", "border", "dash", "dashOffset", "width", "title", "text", "minRotation", "maxRotation", "mirror", "textStrokeWidth", "textStrokeColor", "autoSkip", "autoSkipPadding", "labelOffset", "minor", "major", "crossAlign", "showLabelBackdrop", "backdropColor", "backdropPadding", "route", "startsWith", "overrides", "create", "descriptors", "getScope", "node", "key", "keys", "split", "i", "n", "k", "root", "scope", "merge", "Defaults", "constructor", "_descriptors", "_appliers", "backgroundColor", "borderColor", "datasets", "devicePixelRatio", "context", "platform", "getDevicePixelRatio", "elements", "events", "font", "family", "size", "style", "lineHeight", "weight", "hover", "hoverBackgroundColor", "ctx", "hoverBorderColor", "hoverColor", "indexAxis", "interaction", "mode", "intersect", "includeInvisible", "maintainAspectRatio", "onHover", "onClick", "parsing", "plugins", "responsive", "scale", "scales", "showLine", "drawActiveElementsOnTop", "override", "targetScope", "targetName", "scopeObject", "targetScopeObject", "privateName", "defineProperties", "writable", "enumerable", "local", "target", "isObject", "valueOrDefault", "appliers", "forEach", "toFontString", "isNullOrUndef", "_measureText", "data", "gc", "longest", "string", "textWidth", "measureText", "push", "_longestText", "arrayOfThings", "cache", "garbageCollect", "save", "ilen", "j", "jlen", "thing", "nestedThing", "restore", "gcLen", "splice", "_alignPixel", "pixel", "currentDevicePixelRatio", "halfWidth", "round", "clearCanvas", "canvas", "getContext", "resetTransform", "clearRect", "height", "drawPoint", "x", "y", "drawPointLegend", "w", "xOffset", "yOffset", "cornerRadius", "xOffsetW", "yOffsetW", "pointStyle", "rotation", "radius", "rad", "RAD_PER_DEG", "translate", "rotate", "drawImage", "beginPath", "ellipse", "arc", "closePath", "moveTo", "TWO_THIRDS_PI", "lineTo", "QUARTER_PI", "SQRT1_2", "rect", "fill", "borderWidth", "stroke", "_isPointInArea", "point", "area", "margin", "clipArea", "unclipArea", "_steppedLineTo", "previous", "flip", "midpoint", "_bezierCurveTo", "bezierCurveTo", "cp1x", "cp2x", "cp1y", "cp2y", "setRenderOpts", "opts", "translation", "fillStyle", "textAlign", "textBaseline", "decorateText", "line", "strikethrough", "underline", "metrics", "actualBoundingBoxLeft", "actualBoundingBoxRight", "actualBoundingBoxAscent", "actualBoundingBoxDescent", "yDecoration", "strokeStyle", "decorationWidth", "drawBackdrop", "oldColor", "fillRect", "renderText", "lines", "strokeWidth", "strokeColor", "backdrop", "strokeText", "maxWidth", "fillText", "Number", "addRoundedRectPath", "h", "topLeft", "bottomLeft", "bottomRight", "topRight", "LINE_HEIGHT", "FONT_STYLE", "toLineHeight", "matches", "match", "numberOrZero", "_readValueToProps", "props", "ret", "objProps", "read", "prop", "toTRBL", "toTRBLCorners", "toPadding", "obj", "toFont", "fallback", "parseInt", "console", "warn", "resolve", "inputs", "info", "cacheable", "_addGrace", "minmax", "change", "toDimension", "keepZero", "add", "createContext", "parentContext", "_createResolver", "scopes", "prefixes", "rootScopes", "getTarget", "finalRootScopes", "_resolve", "Symbol", "toStringTag", "_cacheable", "_scopes", "_rootScopes", "_getTarget", "Proxy", "deleteProperty", "_keys", "_cached", "_resolveWithPrefixes", "getOwnPropertyDescriptor", "Reflect", "getPrototypeOf", "has", "getKeysFromAllScopes", "ownKeys", "storage", "_storage", "_attachContext", "proxy", "subProxy", "descriptorDefaults", "_proxy", "_context", "_subProxy", "_stack", "Set", "setContext", "receiver", "_resolveWithContext", "allKeys", "configurable", "scriptable", "indexable", "_allKeys", "isScriptable", "isFunction", "isIndexable", "readKey", "prefix", "_capitalize", "needsSubResolver", "prototype", "hasOwnProperty", "_resolveScriptable", "_resolveArray", "getValue", "Error", "Array", "join", "delete", "createSubResolver", "arr", "filter", "item", "resolver", "resolveFallback", "parent", "resolveObjectKey", "addScopes", "parentScopes", "parentFallback", "allScopes", "addScopesFromKey", "subGetTarget", "resolveKeysFromAllScopes", "_parseObjectDataRadialScale", "_parsing", "parsed", "r", "parse", "EPSILON", "getPoint", "skip", "getValueAxis", "splineCurve", "firstPoint", "middlePoint", "afterPoint", "current", "next", "d01", "distanceBetweenPoints", "d12", "s01", "s12", "fa", "fb", "monotoneAdjust", "deltaK", "mK", "pointsLen", "alphaK", "betaK", "tauK", "squaredMagnitude", "pointCurrent", "pointAfter", "almostEquals", "monotoneCompute", "valueAxis", "pointBefore", "iPixel", "vPixel", "splineCurveMonotone", "slopeDelta", "sign", "capControlPoint", "pt", "capBezierPoints", "inArea", "inAreaPrev", "inAreaNext", "_updateBezierControlPoints", "controlPoints", "spanGaps", "cubicInterpolationMode", "prev", "tension", "_isDomSupported", "document", "_getParentNode", "domNode", "parentNode", "host", "parseMaxStyle", "styleValue", "parentProperty", "valueInPixels", "indexOf", "getComputedStyle", "element", "ownerDocument", "defaultView", "getStyle", "el", "property", "getPropertyValue", "positions", "getPositionedStyle", "styles", "suffix", "result", "pos", "parseFloat", "useOffsetPos", "shadowRoot", "getCanvasPosition", "e", "touches", "source", "offsetX", "offsetY", "box", "getBoundingClientRect", "clientX", "clientY", "getRelativePosition", "event", "borderBox", "boxSizing", "paddings", "borders", "getContainerSize", "maxHeight", "container", "clientWidth", "clientHeight", "containerStyle", "containerBorder", "containerPadding", "INFINITY", "round1", "getMaximumSize", "bbWidth", "bbHeight", "aspectRatio", "margins", "containerSize", "retinaScale", "forceRatio", "forceStyle", "pixelRatio", "deviceHeight", "deviceWidth", "setTransform", "supportsEventListenerOptions", "passiveSupported", "passive", "addEventListener", "removeEventListener", "readUsedSize", "_pointInLine", "p1", "p2", "_steppedInterpolation", "_bezierInterpolation", "cp1", "cp2", "a", "b", "c", "getRightToLeftAdapter", "rectX", "setWidth", "xPlus", "leftForLtr", "itemWidth", "getLeftToRightAdapter", "_itemWidth", "getRtlAdapter", "overrideTextDirection", "direction", "original", "getPropertyPriority", "setProperty", "prevTextDirection", "restoreTextDirection", "propertyFn", "between", "_angleBetween", "compare", "_angleDiff", "normalize", "_normalizeAngle", "_isBetween", "normalizeSegment", "getSegment", "segment", "startBound", "endBound", "_boundSegment", "inside", "subStart", "prevValue", "startIsBefore", "endIsBefore", "shouldStart", "shouldStop", "_boundSegments", "segments", "sub", "findStartAndEnd", "solidSegments", "last", "cur", "stop", "_computeSegments", "segmentOptions", "_loop", "splitByStyles", "completeLoop", "_fullLoop", "doSplitByStyles", "chartContext", "_chart", "baseStyle", "readStyle", "_datasetIndex", "datasetIndex", "prevStyle", "addStyle", "l", "st", "dir", "p0", "p0DataIndex", "p1DataIndex", "styleChanged", "borderCapStyle", "borderDash", "borderDashOffset", "borderJoinStyle", "replacer", "Animator", "constructor", "_request", "_charts", "Map", "_running", "_lastDate", "undefined", "_notify", "chart", "anims", "date", "type", "callbacks", "listeners", "numSteps", "duration", "forEach", "fn", "initial", "currentStep", "Math", "min", "start", "_refresh", "requestAnimFrame", "call", "window", "_update", "Date", "now", "remaining", "running", "items", "length", "i", "draw", "item", "_active", "_total", "tick", "pop", "_getAnims", "charts", "get", "complete", "progress", "set", "listen", "event", "cb", "push", "add", "has", "reduce", "acc", "cur", "max", "_duration", "stop", "cancel", "remove", "delete", "animator", "transparent", "interpolators", "boolean", "from", "to", "factor", "color", "c0", "helpersColor", "c1", "valid", "mix", "hexString", "number", "Animation", "cfg", "target", "prop", "currentValue", "resolve", "_fn", "_easing", "effects", "easing", "linear", "_start", "floor", "delay", "_loop", "loop", "_target", "_prop", "_from", "_to", "_promises", "active", "update", "elapsed", "remain", "wait", "promises", "Promise", "res", "rej", "resolved", "method", "Animations", "config", "_chart", "_properties", "configure", "isObject", "animationOptions", "Object", "keys", "defaults", "animation", "animatedProps", "getOwnPropertyNames", "key", "option", "isArray", "properties", "_animateOptions", "values", "newOptions", "options", "resolveTargetOptions", "animations", "_createAnimations", "$shared", "awaitAll", "$animations", "then", "props", "charAt", "value", "size", "assign", "anim", "all", "scaleClip", "scale", "allowedOverflow", "opts", "reverse", "end", "defaultClip", "xScale", "yScale", "x", "y", "top", "right", "bottom", "left", "toClip", "t", "r", "b", "l", "disabled", "getSortedDatasetIndices", "filterVisible", "metasets", "_getSortedDatasetMetas", "ilen", "index", "applyStack", "stack", "dsIndex", "singleMode", "mode", "datasetIndex", "otherValue", "isFinite", "sign", "convertObjectDataToArray", "data", "adata", "Array", "isStacked", "meta", "stacked", "getStackKey", "indexScale", "valueScale", "id", "getUserBounds", "minDefined", "maxDefined", "Number", "NEGATIVE_INFINITY", "POSITIVE_INFINITY", "getOrCreateStack", "stacks", "stackKey", "indexValue", "subStack", "getLastIndexInStack", "vScale", "positive", "getMatchingVisibleMetas", "updateStacks", "controller", "parsed", "_cachedMeta", "_stacks", "iScale", "iAxis", "axis", "vAxis", "itemStacks", "_top", "_bottom", "visualValues", "_visualValues", "getFirstScaleId", "scales", "filter", "shift", "createDatasetContext", "parent", "createContext", "dataset", "createDataContext", "element", "dataIndex", "raw", "clearStacks", "_parsed", "isDirectUpdateMode", "cloneIfNotShared", "cached", "shared", "createStack", "canStack", "hidden", "_stacked", "DatasetController", "datasetElementType", "dataElementType", "_ctx", "ctx", "_cachedDataOpts", "getMeta", "_type", "_parsing", "_data", "_objectData", "_sharedOptions", "_drawStart", "_drawCount", "enableOptionSharing", "supportsDecimation", "$context", "_syncList", "initialize", "linkScales", "addElements", "fill", "isPluginEnabled", "console", "warn", "updateIndex", "getDataset", "chooseId", "xid", "xAxisID", "valueOrDefault", "yid", "yAxisID", "rid", "rAxisID", "indexAxis", "iid", "iAxisID", "vid", "vAxisID", "getScaleForId", "rScale", "datasets", "getDatasetMeta", "scaleID", "_getOtherScale", "reset", "_destroy", "unlistenArrayEvents", "_dataCheck", "isExtensible", "listenArrayEvents", "buildOrUpdateElements", "resetNewElements", "stackChanged", "oldStacked", "_resyncElements", "scopeKeys", "datasetScopeKeys", "scopes", "getOptionScopes", "createResolver", "getContext", "parsing", "parse", "count", "sorted", "_sorted", "prev", "parseArrayData", "parseObjectData", "parsePrimitiveData", "isNotInOrderComparedToPrev", "labels", "getLabels", "singleScale", "xAxisKey", "yAxisKey", "resolveObjectKey", "getParsed", "getDataElement", "updateRangeFromParsed", "range", "parsedValue", "NaN", "getMinMax", "otherScale", "otherMin", "otherMax", "_skip", "getAllParsedValues", "getMaxOverflow", "getLabelAndValue", "label", "getLabelForValue", "_clip", "clip", "elements", "area", "chartArea", "drawActiveElementsOnTop", "getStyle", "resolveDatasetElementOptions", "resolveDataElementOptions", "context", "_resolveElementOptions", "elementType", "cache", "cacheKey", "sharing", "defined", "datasetElementScopeKeys", "prefixes", "names", "resolveNamedOptions", "freeze", "_resolveAnimations", "transition", "datasetAnimationScopeKeys", "_cacheable", "getSharedOptions", "includeOptions", "sharedOptions", "_animationsDisabled", "_getSharedOptions", "firstOpts", "previouslySharedOptions", "updateSharedOptions", "updateElement", "_setStyle", "removeHoverStyle", "setHoverStyle", "_removeDatasetHoverStyle", "_setDatasetHoverStyle", "arg1", "arg2", "numMeta", "numData", "_insertElements", "_removeElements", "move", "arr", "updateElements", "removed", "splice", "_sync", "args", "_dataChanges", "_onDataPush", "arguments", "_onDataPop", "_onDataShift", "_onDataSplice", "newCount", "_onDataUnshift", "getAllScaleValues", "_cache", "$bar", "visibleMetas", "concat", "_arrayUnique", "sort", "a", "computeMinSampleSize", "_length", "curr", "updateMinAndPrev", "abs", "getPixelForValue", "ticks", "getPixelForTick", "computeFitCategoryTraits", "ruler", "stackCount", "thickness", "barThickness", "ratio", "isNullOrUndef", "categoryPercentage", "barPercentage", "chunk", "pixels", "computeFlexCategoryTraits", "next", "percent", "parseFloatBar", "entry", "startValue", "endValue", "barStart", "barEnd", "_custom", "parseValue", "parseArrayOrPrimitive", "isFloatBar", "custom", "barSign", "actualBase", "isHorizontal", "borderProps", "horizontal", "base", "setBorderSkipped", "edge", "borderSkipped", "enableBorderRadius", "parseEdge", "swap", "startEnd", "orig", "v1", "v2", "v", "setInflateAmount", "inflateAmount", "BarController", "grouped", "numbers", "overrides", "_index_", "offset", "grid", "_value_", "beginAtZero", "iAxisKey", "vAxisKey", "obj", "bars", "getBasePixel", "_getRuler", "vpixels", "head", "_calculateBarValuePixels", "ipixels", "_calculateBarIndexPixels", "center", "height", "width", "_getStacks", "last", "skipNull", "val", "isNaN", "indexOf", "_getStackCount", "_getStackIndex", "name", "_startPixel", "_endPixel", "baseValue", "minBarLength", "floating", "getDataVisibility", "startPixel", "getPixelForDecimal", "endPixel", "getValueForPixel", "halfGrid", "getLineWidthForValue", "maxBarThickness", "Infinity", "stackIndex", "rects", "BubbleController", "radius", "points", "point", "iPixel", "vPixel", "skip", "getRatioAndOffset", "rotation", "circumference", "cutout", "ratioX", "ratioY", "offsetX", "offsetY", "TAU", "startAngle", "endAngle", "startX", "cos", "startY", "sin", "endX", "endY", "calcMax", "angle", "_angleBetween", "calcMin", "maxX", "maxY", "HALF_PI", "minX", "PI", "minY", "DoughnutController", "animateRotate", "animateScale", "spacing", "descriptors", "_scriptable", "_indexable", "startsWith", "aspectRatio", "plugins", "legend", "generateLabels", "pointStyle", "map", "style", "text", "fillStyle", "backgroundColor", "strokeStyle", "borderColor", "fontColor", "lineWidth", "borderWidth", "onClick", "e", "legendItem", "toggleDataVisibility", "innerRadius", "outerRadius", "getter", "_getRotation", "toRadians", "_getCircumference", "_getRotationExtents", "isDatasetVisible", "arcs", "getMaxBorderWidth", "getMaxOffset", "maxSize", "toPercentage", "chartWeight", "_getRingWeight", "maxWidth", "maxHeight", "maxRadius", "toDimension", "radiusLength", "_getVisibleDatasetWeightTotal", "total", "calculateTotal", "_getRingWeightOffset", "_circumference", "calculateCircumference", "animationOpts", "centerX", "centerY", "arc", "metaData", "formatNumber", "locale", "borderAlign", "hoverBorderWidth", "hoverOffset", "ringWeightOffset", "weight", "LineController", "showLine", "spanGaps", "line", "_dataset", "animationsDisabled", "_getStartAndCountOfVisiblePoints", "_scaleRangesChanged", "_datasetIndex", "_decimated", "segment", "animated", "maxGapLength", "isNumber", "directUpdate", "pointsCount", "prevParsed", "nullData", "border", "firstPoint", "lastPoint", "updateControlPoints", "PolarAreaController", "angleLines", "display", "circular", "pointLabels", "_parseObjectDataRadialScale", "bind", "_updateRadius", "minSize", "cutoutPercentage", "getVisibleDatasetCount", "xCenter", "yCenter", "datasetStartAngle", "getIndexAngle", "defaultAngle", "countVisibleElements", "_computeAngle", "getDistanceFromCenterForValue", "PieController", "RadarController", "_fullLoop", "pointPosition", "getPointPositionForValue", "ScatterController", "interaction", "registry", "getElement", "abstract", "Error", "DateAdapterBase", "override", "members", "prototype", "init", "formats", "format", "diff", "startOf", "endOf", "adapters", "_date", "binarySearch", "metaset", "intersect", "lookupMethod", "_reversePixels", "_rlookupByKey", "_lookupByKey", "el", "getRange", "lo", "hi", "evaluateInteractionItems", "position", "handler", "getSortedVisibleDatasetMetas", "j", "getDistanceMetricForAxis", "useX", "useY", "pt1", "pt2", "deltaX", "deltaY", "sqrt", "pow", "getIntersectItems", "useFinalPosition", "includeInvisible", "isPointInArea", "_isPointInArea", "inRange", "getNearestRadialItems", "evaluationFunc", "getProps", "getAngleFromPoint", "getNearestCartesianItems", "distanceMetric", "minDistance", "getCenterPoint", "distance", "getNearestItems", "getAxisItems", "rangeMethod", "intersectsItem", "Interaction", "modes", "getRelativePosition", "nearest", "STATIC_POSITIONS", "filterByPosition", "array", "pos", "filterDynamicPositionByAxis", "box", "sortByWeight", "v0", "wrapBoxes", "boxes", "layoutBoxes", "stackWeight", "buildStacks", "layouts", "wrap", "includes", "_stack", "placed", "setLayoutDims", "params", "vBoxMaxWidth", "hBoxMaxHeight", "layout", "fullSize", "availableWidth", "availableHeight", "buildLayoutBoxes", "centerHorizontal", "centerVertical", "leftAndTop", "rightAndBottom", "vertical", "getCombinedMax", "maxPadding", "updateMaxPadding", "boxPadding", "updateDims", "getPadding", "newWidth", "outerWidth", "newHeight", "outerHeight", "widthChanged", "w", "heightChanged", "h", "same", "other", "handleMaxPadding", "updatePos", "change", "getMargins", "marginForPositions", "positions", "margin", "fitBoxes", "refitBoxes", "refit", "changed", "setBoxDims", "placeBoxes", "userPadding", "padding", "addBox", "_layers", "z", "removeBox", "layoutItem", "minPadding", "toPadding", "verticalBoxes", "horizontalBoxes", "each", "beforeLayout", "visibleVerticalBoxCount", "BasePlatform", "acquireContext", "canvas", "releaseContext", "addEventListener", "listener", "removeEventListener", "getDevicePixelRatio", "getMaximumSize", "isAttached", "updateConfig", "BasicPlatform", "EXPANDO_KEY", "EVENT_TYPES", "touchstart", "touchmove", "touchend", "pointerenter", "pointerdown", "pointermove", "pointerup", "pointerleave", "pointerout", "isNullOrEmpty", "initCanvas", "renderHeight", "getAttribute", "renderWidth", "boxSizing", "displayWidth", "readUsedSize", "displayHeight", "eventListenerOptions", "supportsEventListenerOptions", "passive", "addListener", "node", "removeListener", "fromNativeEvent", "native", "nodeListContains", "nodeList", "contains", "createAttachObserver", "observer", "MutationObserver", "entries", "trigger", "addedNodes", "removedNodes", "observe", "document", "childList", "subtree", "createDetachObserver", "drpListeningCharts", "oldDevicePixelRatio", "onWindowResize", "dpr", "devicePixelRatio", "resize", "currentDevicePixelRatio", "listenDevicePixelRatioChanges", "unlistenDevicePixelRatioChanges", "createResizeObserver", "container", "_getParentNode", "throttled", "clientWidth", "ResizeObserver", "contentRect", "releaseObserver", "disconnect", "createProxyAndListen", "proxy", "DomPlatform", "removeAttribute", "setAttribute", "proxies", "$proxies", "attach", "detach", "isConnected", "_detectPlatform", "_isDomSupported", "OffscreenCanvas", "Element", "defaultRoutes", "tooltipPosition", "hasValue", "final", "ret", "autoSkip", "tickOpts", "determinedMaxTicks", "determineMaxTicks", "ticksLimit", "maxTicksLimit", "majorIndices", "major", "enabled", "getMajorIndices", "numMajorIndices", "first", "newTicks", "skipMajors", "calculateSpacing", "avgMajorSpacing", "round", "tickLength", "_tickSize", "maxScale", "maxChart", "_maxLength", "evenMajorSpacing", "getEvenSpacing", "factors", "_factorize", "result", "ceil", "majorStart", "majorEnd", "len", "reverseAlign", "align", "offsetFromEdge", "getTicksLimit", "ticksLength", "sample", "numItems", "increment", "getPixelForGridLine", "offsetGridLines", "validIndex", "epsilon", "lineValue", "garbageCollect", "caches", "gc", "gcLen", "getTickMarkLength", "drawTicks", "getTitleHeight", "fallback", "font", "toFont", "lineHeight", "createScaleContext", "createTickContext", "titleAlign", "_toLeftRightCenter", "titleArgs", "titleX", "titleY", "_alignStartEnd", "positionAxisID", "Scale", "_margins", "paddingTop", "paddingBottom", "paddingLeft", "paddingRight", "labelRotation", "_range", "_gridLineItems", "_labelItems", "_labelSizes", "_longestTextCache", "_userMax", "_userMin", "_suggestedMax", "_suggestedMin", "_ticksLength", "_borderValue", "_dataLimitsCached", "setContext", "suggestedMin", "suggestedMax", "finiteOrDefault", "metas", "getTicks", "xLabels", "yLabels", "getLabelItems", "_computeLabelItems", "beforeUpdate", "margins", "grace", "sampleSize", "beforeSetDimensions", "setDimensions", "afterSetDimensions", "beforeDataLimits", "determineDataLimits", "afterDataLimits", "_addGrace", "beforeBuildTicks", "buildTicks", "afterBuildTicks", "samplingEnabled", "_convertTicksToLabels", "beforeCalculateLabelRotation", "calculateLabelRotation", "afterCalculateLabelRotation", "source", "afterAutoSkip", "beforeFit", "fit", "afterFit", "afterUpdate", "reversePixels", "_alignToPixels", "alignToPixels", "_callHooks", "notifyPlugins", "beforeTickToLabelConversion", "generateTickLabels", "callback", "afterTickToLabelConversion", "numTicks", "minRotation", "maxRotation", "tickWidth", "maxLabelDiagonal", "_isVisible", "labelSizes", "_getLabelSizes", "maxLabelWidth", "widest", "maxLabelHeight", "highest", "_limitValue", "title", "toDegrees", "asin", "titleOpts", "gridOpts", "titleHeight", "tickPadding", "angleRadians", "labelHeight", "mirror", "labelWidth", "_calculatePadding", "_handleMargins", "isRotated", "labelsBelowTicks", "offsetLeft", "offsetRight", "isFullSize", "_computeLabelSizes", "widths", "heights", "widestLabelSize", "highestLabelSize", "jlen", "tickFont", "fontString", "nestedLabel", "_resolveTickFontOptions", "string", "_measureText", "valueAt", "idx", "pixel", "decimal", "_int16Range", "_alignPixel", "getDecimalForPixel", "getBaseValue", "optionTicks", "rot", "autoSkipPadding", "_computeGridLineItems", "tl", "borderOpts", "axisWidth", "axisHalfWidth", "alignBorderValue", "borderValue", "alignedLineValue", "tx1", "ty1", "tx2", "ty2", "x1", "y1", "x2", "y2", "limit", "step", "optsAtIndex", "optsAtIndexBorder", "lineColor", "borderDash", "dash", "borderDashOffset", "dashOffset", "tickColor", "tickBorderDash", "tickBorderDashOffset", "crossAlign", "tickAndPadding", "hTickAndPadding", "textAlign", "lineCount", "textOffset", "textBaseline", "_getXAxisLabelAlignment", "_getYAxisLabelAlignment", "labelOffset", "halfCount", "strokeColor", "textStrokeColor", "strokeWidth", "textStrokeWidth", "tickTextAlign", "showLabelBackdrop", "backdrop", "labelPadding", "backdropPadding", "backdropColor", "translation", "_computeLabelArea", "drawBackground", "save", "fillRect", "restore", "findIndex", "drawGrid", "drawLine", "p1", "p2", "setLineDash", "lineDashOffset", "beginPath", "moveTo", "lineTo", "stroke", "drawOnChartArea", "drawBorder", "lastLineWidth", "drawLabels", "clipArea", "renderTextOptions", "renderText", "unclipArea", "drawTitle", "tz", "gz", "bz", "axisID", "_maxDigits", "fontSize", "TypedRegistry", "scope", "create", "isForType", "isPrototypeOf", "register", "proto", "getPrototypeOf", "parentScope", "isIChartComponent", "registerDefaults", "unregister", "itemDefaults", "merge", "routeDefaults", "describe", "routes", "property", "propertyParts", "split", "sourceName", "sourceScope", "join", "parts", "targetName", "targetScope", "route", "Registry", "controllers", "_typedRegistries", "_each", "addControllers", "addPlugins", "addScales", "getController", "_get", "getPlugin", "getScale", "removeControllers", "removeElements", "removePlugins", "removeScales", "typedRegistry", "arg", "reg", "_getRegistryForType", "_exec", "itemReg", "component", "camelMethod", "_capitalize", "PluginService", "_init", "notify", "hook", "_createDescriptors", "_descriptors", "descriptor", "plugin", "callCallback", "cancelable", "invalidate", "_oldCache", "_notifyStateChanges", "allPlugins", "createDescriptors", "previousDescriptors", "some", "localIds", "local", "getOpts", "pluginOpts", "pluginScopeKeys", "scriptable", "indexable", "allKeys", "getIndexAxis", "datasetDefaults", "getAxisFromDefaultScaleID", "getDefaultScaleIDFromAxis", "idMatchesAxis", "axisFromPosition", "determineAxis", "scaleOptions", "toLowerCase", "getAxisFromDataset", "retrieveAxisFromDatasets", "boundDs", "d", "mergeScaleConfig", "chartDefaults", "configScales", "chartIndexAxis", "scaleConf", "error", "_proxy", "defaultId", "defaultScaleOptions", "mergeIf", "defaultID", "initOptions", "initData", "initConfig", "keyCache", "keysCached", "Set", "cachedKeys", "generate", "addIfFound", "Config", "_config", "_scopeCache", "_resolverCache", "platform", "clearCache", "clear", "datasetType", "additionalOptionScopes", "_cachedScopes", "mainScope", "resetCache", "keyLists", "chartOptionScopes", "resolver", "subPrefixes", "getResolver", "needContext", "isFunction", "subResolver", "_attachContext", "descriptorDefaults", "resolverCache", "_createResolver", "p", "hasFunction", "isScriptable", "isIndexable", "KNOWN_POSITIONS", "positionIsHorizontal", "compare2Level", "l1", "l2", "onAnimationsComplete", "onComplete", "onAnimationProgress", "onProgress", "getCanvas", "getElementById", "instances", "getChart", "c", "moveNumericKeys", "intKey", "determineLastEvent", "lastEvent", "inChartArea", "isClick", "getSizeForArea", "field", "getDatasetArea", "Chart", "version", "invalidatePlugins", "userConfig", "initialCanvas", "existingChart", "uid", "_options", "_aspectRatio", "_metasets", "_lastEvent", "_listeners", "_responsiveListeners", "_sortedMetasets", "_plugins", "_hiddenIndices", "attached", "_doResize", "debounce", "resizeDelay", "_initialize", "maintainAspectRatio", "responsive", "retinaScale", "bindEvents", "clearCanvas", "_resizeBeforeDraw", "_resize", "newSize", "newRatio", "onResize", "render", "ensureScalesHaveIDs", "scalesOptions", "axisOptions", "buildOrUpdateScales", "scaleOpts", "updated", "isRadial", "dposition", "dtype", "scaleType", "scaleClass", "hasUpdated", "_updateMetasets", "_destroyDatasetMeta", "slice", "_removeUnreferencedMetasets", "buildOrUpdateControllers", "newControllers", "order", "visible", "ControllerClass", "_resetElements", "animsDisabled", "_updateScales", "_checkEventBindings", "_updateHiddenIndices", "_minPadding", "autoPadding", "_updateLayout", "_updateDatasets", "_eventHandler", "_updateHoverStyles", "existingEvents", "newEvents", "events", "setsEqual", "unbindEvents", "changes", "_getUniformDataChanges", "datasetCount", "makeSet", "changeSet", "noArea", "_idx", "_updateDataset", "layers", "_drawDatasets", "_drawDataset", "useClip", "getElementsAtEventForMode", "setDatasetVisibility", "_updateVisibility", "hide", "show", "_stop", "destroy", "toBase64Image", "toDataURL", "bindUserEvents", "bindResponsiveEvents", "_add", "_remove", "detached", "updateHoverStyle", "prefix", "getActiveElements", "setActiveElements", "activeElements", "lastActive", "_elementsEqual", "pluginId", "replay", "hoverOptions", "hover", "deactivated", "activated", "eventFilter", "_handleEvent", "_getActiveElements", "_isClickEvent", "onHover", "clipArc", "pixelMargin", "angleMargin", "closePath", "toRadiusCorners", "_readValueToProps", "parseBorderRadius", "angleDelta", "o", "borderRadius", "halfThickness", "innerLimit", "computeOuterLimit", "outerArcLimit", "outerStart", "outerEnd", "innerStart", "innerEnd", "rThetaToXY", "theta", "pathArc", "innerR", "spacingOffset", "alpha", "noSpacingInnerRadius", "noSpacingOuterRadius", "avNogSpacingRadius", "adjustedAngle", "beta", "angleOffset", "outerStartAdjustedRadius", "outerEndAdjustedRadius", "outerStartAdjustedAngle", "outerEndAdjustedAngle", "innerStartAdjustedRadius", "innerEndAdjustedRadius", "innerStartAdjustedAngle", "innerEndAdjustedAngle", "outerMidAdjustedAngle", "pCenter", "p4", "innerMidAdjustedAngle", "p8", "outerStartX", "outerStartY", "outerEndX", "outerEndY", "drawArc", "fullCircles", "borderJoinStyle", "inner", "lineJoin", "ArcElement", "chartX", "chartY", "rAdjust", "betweenAngles", "withinRadius", "_isBetween", "halfAngle", "halfRadius", "translate", "fix", "radiusOffset", "setStyle", "lineCap", "borderCapStyle", "previous", "getLineMethod", "stepped", "_steppedLineTo", "tension", "cubicInterpolationMode", "_bezierCurveTo", "pathVars", "paramsStart", "paramsEnd", "segmentStart", "segmentEnd", "outside", "pathSegment", "lineMethod", "fastPathSegment", "avgX", "countX", "prevX", "lastY", "pointIndex", "drawX", "truncX", "_getSegmentMethod", "_getInterpolationMethod", "_steppedInterpolation", "_bezierInterpolation", "_pointInLine", "strokePathWithCache", "path", "_path", "Path2D", "strokePathDirect", "segments", "segmentMethod", "usePath2D", "LineElement", "capBezierPoints", "_points", "_segments", "_pointsUpdated", "_updateBezierControlPoints", "_computeSegments", "interpolate", "_boundSegments", "_interpolate", "interpolated", "hitRadius", "PointElement", "hoverRadius", "mouseX", "mouseY", "inXRange", "inYRange", "drawPoint", "getBarBounds", "bar", "half", "skipOrLimit", "parseBorderWidth", "maxW", "maxH", "toTRBL", "toTRBLCorners", "maxR", "enableBorder", "topLeft", "topRight", "bottomLeft", "bottomRight", "boundingRects", "bounds", "outer", "skipX", "skipY", "hasRadius", "addNormalRectPath", "rect", "inflateRect", "amount", "refRect", "BarElement", "addRectPath", "addRoundedRectPath", "BORDER_COLORS", "BACKGROUND_COLORS", "replace", "getBorderColor", "getBackgroundColor", "colorizeDefaultDataset", "colorizeDoughnutDataset", "colorizePolarAreaDataset", "getColorizer", "containsColorsDefinitions", "k", "containsColorsDefinition", "plugin_colors", "forceOverride", "_args", "chartOptions", "colorizer", "lttbDecimation", "samples", "decimated", "bucketWidth", "sampledIndex", "endIndex", "maxAreaPoint", "maxArea", "nextA", "avgY", "avgRangeStart", "avgRangeEnd", "avgRangeLength", "rangeOffs", "rangeTo", "pointAx", "pointAy", "minMaxDecimation", "minIndex", "maxIndex", "startIndex", "xMin", "dx", "lastIndex", "intermediateIndex1", "intermediateIndex2", "cleanDecimatedDataset", "defineProperty", "configurable", "enumerable", "writable", "cleanDecimatedData", "getStartAndCountOfVisiblePointsSimplified", "pointCount", "plugin_decimation", "algorithm", "beforeElementsUpdate", "xAxis", "threshold", "tpoints", "_findSegmentEnd", "_getBounds", "targetSegments", "tgt", "subBounds", "fillSources", "_boundSegment", "fillSource", "_getEdge", "_normalizeAngle", "_pointsFromSegments", "boundary", "linePoints", "_createBoundaryLine", "_shouldApplyFill", "_resolveTarget", "sources", "propagate", "visited", "_decodeFill", "parseFillOption", "parseFloat", "decodeTargetIndex", "firstCh", "_getTargetPixel", "_getTargetValue", "fillOption", "_buildStackLine", "sourcePoints", "linesBelow", "getLinesBelow", "addPointsBelow", "below", "unshift", "sourcePoint", "postponed", "findPoint", "pointValue", "firstValue", "lastValue", "simpleArc", "_getTarget", "getLineByIndex", "computeBoundary", "computeCircularBoundary", "computeLinearBoundary", "_drawfill", "lineOpts", "above", "doFill", "clipVertical", "clipY", "lineLoop", "src", "notShape", "clipBounds", "interpolatedLineTo", "targetLoop", "interpolatedPoint", "afterDatasetsUpdate", "$filler", "beforeDraw", "drawTime", "beforeDatasetsDraw", "beforeDatasetDraw", "getBoxSize", "labelOpts", "boxHeight", "boxWidth", "usePointStyle", "pointStyleWidth", "itemHeight", "itemsEqual", "Legend", "_added", "legendHitBoxes", "_hoveredItem", "doughnutMode", "legendItems", "columnSizes", "lineWidths", "buildLabels", "labelFont", "_computeTitleHeight", "_fitRows", "_fitCols", "hitboxes", "totalHeight", "row", "itemWidth", "measureText", "_itemHeight", "heightLimit", "totalWidth", "currentColWidth", "currentColHeight", "col", "calculateItemSize", "adjustHitBoxes", "rtl", "rtlHelper", "getRtlAdapter", "hitbox", "leftForLtr", "_draw", "defaultColor", "halfFontSize", "cursor", "drawLegendBox", "lineDash", "drawOptions", "SQRT2", "xPlus", "drawPointLegend", "yBoxTop", "xBoxLeft", "fillText", "strikethrough", "overrideTextDirection", "textDirection", "textWidth", "setWidth", "realX", "_textX", "fontLineHeight", "calculateLegendItemHeight", "restoreTextDirection", "titleFont", "titlePadding", "topPaddingPlusHalfFontSize", "_getLegendItemAt", "hitBox", "lh", "handleEvent", "isListened", "hoveredItem", "sameItem", "onLeave", "calculateItemWidth", "calculateItemHeight", "legendItemText", "plugin_legend", "_element", "afterEvent", "ci", "useBorderRadius", "Title", "_padding", "textSize", "_drawArgs", "fontOpts", "createTitle", "titleBlock", "plugin_title", "WeakMap", "plugin_subtitle", "positioners", "average", "eventPosition", "nearestElement", "distanceBetweenPoints", "tp", "pushOrConcat", "toPush", "apply", "splitNewlines", "str", "String", "createTooltipItem", "formattedValue", "getTooltipSize", "tooltip", "body", "footer", "bodyFont", "footerFont", "titleLineCount", "footerLineCount", "bodyLineItemCount", "combinedBodyLength", "bodyItem", "before", "lines", "after", "beforeBody", "afterBody", "titleSpacing", "titleMarginBottom", "bodyLineHeight", "displayColors", "bodySpacing", "footerMarginTop", "footerSpacing", "widthPadding", "maxLineWidth", "determineYAlign", "doesNotFitWithAlign", "xAlign", "caret", "caretSize", "caretPadding", "determineXAlign", "yAlign", "chartWidth", "determineAlignment", "alignX", "alignY", "paddingAndSize", "getBackgroundPoint", "alignment", "cornerRadius", "getAlignedX", "getBeforeAfterBodyLines", "createTooltipContext", "tooltipItems", "overrideCallbacks", "defaultCallbacks", "beforeTitle", "noop", "labelCount", "afterTitle", "beforeLabel", "tooltipItem", "labelColor", "labelTextColor", "bodyColor", "labelPointStyle", "afterLabel", "beforeFooter", "afterFooter", "invokeCallbackWithFallback", "Tooltip", "opacity", "_eventPosition", "_size", "_cachedAnimations", "_tooltipItems", "dataPoints", "caretX", "caretY", "labelColors", "labelPointStyles", "labelTextColors", "getTitle", "getBeforeBody", "getBody", "bodyItems", "scoped", "getAfterBody", "getFooter", "_createItems", "itemSort", "positionAndSize", "backgroundPoint", "external", "drawCaret", "tooltipPoint", "caretPosition", "getCaretPosition", "x3", "y3", "ptX", "ptY", "pt", "titleColor", "_drawColorBox", "colorX", "rtlColorX", "yOffSet", "colorY", "multiKeyBackground", "outerX", "innerX", "strokeRect", "drawBody", "bodyAlign", "xLinePadding", "fillLineOfText", "bodyAlignForCalculation", "textColor", "drawFooter", "footerAlign", "footerColor", "tooltipSize", "quadraticCurveTo", "_updateAnimationTarget", "animX", "animY", "_willRender", "hasTooltipContent", "globalAlpha", "positionChanged", "_positionChanged", "_ignoreReplayEvents", "plugin_tooltip", "afterInit", "afterDraw", "_fallback", "addIfString", "addedLabels", "findOrAddLabel", "lastIndexOf", "_getLabelForValue", "CategoryScale", "_startValue", "_valueRange", "_addedLabels", "added", "generateTicks", "generationOptions", "dataRange", "precision", "maxTicks", "maxDigits", "includeBounds", "unit", "maxSpaces", "rmin", "rmax", "countDefined", "minSpacing", "niceNum", "niceMin", "niceMax", "numSpaces", "MIN_SPACING", "almostWhole", "almostEquals", "decimalPlaces", "_decimalPlaces", "relativeLabelSize", "tickValue", "rad", "LinearScaleBase", "_endValue", "handleTickRangeOptions", "setMin", "setMax", "minSign", "maxSign", "getTickLimit", "stepSize", "computeTickLimit", "numericGeneratorOptions", "_setMinAndMaxByKey", "LinearScale", "Ticks", "formatters", "numeric", "log10Floor", "log10", "changeExponent", "m", "isMajor", "tickVal", "steps", "rangeExp", "rangeStep", "startExp", "minExp", "exp", "significand", "lastTick", "LogarithmicScale", "logarithmic", "_zero", "getTickBackdropHeight", "measureLabelSize", "_longestText", "determineLimits", "fitWithPointLabels", "limits", "valueCount", "_pointLabels", "pointLabelOpts", "additionalAngle", "centerPointLabels", "getPointLabelContext", "getPointPosition", "drawingArea", "plFont", "hLimits", "vLimits", "updateLimits", "setCenterPoint", "_pointLabelItems", "buildPointLabelItems", "createPointLabelItem", "itemOpts", "outerDistance", "extra", "pointLabelPosition", "yForAngle", "getTextAlignForAngle", "leftForTextAlign", "isNotOverlapped", "drawPointLabelBox", "backdropLeft", "backdropTop", "backdropWidth", "backdropHeight", "drawPointLabels", "pathRadiusLine", "drawRadiusLine", "gridLineOpts", "createPointLabelContext", "RadialLinearScale", "animate", "leftMovement", "rightMovement", "topMovement", "bottomMovement", "angleMultiplier", "scalingFactor", "getValueForDistanceFromCenter", "scaledDistance", "pointLabel", "distanceFromCenter", "getBasePosition", "getPointLabelPosition", "rotate", "INTERVALS", "millisecond", "common", "second", "minute", "hour", "day", "week", "month", "quarter", "year", "UNITS", "sorter", "input", "adapter", "_adapter", "parser", "isoWeekday", "_parseOpts", "determineUnitForAutoTicks", "minUnit", "capacity", "interval", "MAX_SAFE_INTEGER", "determineUnitForFormatting", "determineMajorUnit", "addTick", "time", "timestamps", "_lookup", "timestamp", "setMajorTicks", "majorUnit", "ticksFromTimestamps", "TimeScale", "displayFormats", "_unit", "_majorUnit", "_offsets", "_normalized", "normalized", "_applyBounds", "_getLabelBounds", "getLabelTimestamps", "timeOpts", "_generate", "_filterBetween", "_getLabelCapacity", "initOffsets", "offsetAfterAutoskip", "getDecimalForValue", "minor", "weekday", "hasWeekday", "getDataTimestamps", "tooltipFormat", "datetime", "fmt", "_tickFormatFunction", "formatter", "minorFormat", "majorFormat", "offsets", "_getLabelSize", "ticksOpts", "tickLabelWidth", "cosRotation", "sinRotation", "tickFontSize", "exampleTime", "exampleLabel", "normalize", "table", "prevSource", "nextSource", "prevTarget", "nextTarget", "span", "TimeSeriesScale", "_table", "_minPos", "_tableRange", "_getTimestampsForTable", "buildLookupTable", "registerables", "Chart", "registerables", "devicePixelRatio", "screen", "utils", "inputs", "lines", "input", "isNullOrUndef", "ctx", "font", "items", "ilen", "prev", "width", "i", "min", "value", "max", "a0", "a1", "updates", "j", "v", "orient", "point", "origin", "x0", "y0", "dx", "dy", "ln", "aligned", "x", "y", "vx", "vy", "align", "R_INSIDE", "R_LEFT", "R_RIGHT", "R_BOTTOM", "R_TOP", "region", "rect", "res", "clipped", "segment", "area", "x1", "y1", "r0", "r1", "r", "compute$1", "range", "config", "anchor", "positioners", "el", "angle", "rx", "ry", "sx", "sy", "rasterize", "boundingRects", "model", "borderWidth", "padding", "th", "tw", "tx", "ty", "getScaleOrigin", "context", "scale", "pixel", "getPositioner", "ArcElement", "PointElement", "BarElement", "drawRoundedRect", "w", "h", "radius", "HALF_PI", "left", "top", "right", "bottom", "drawFrame", "bgColor", "borderColor", "textGeometry", "drawTextLine", "text", "cfg", "shadow", "stroked", "drawText", "color", "filled", "strokeColor", "strokeWidth", "Label", "index", "me", "merge", "display", "toFont", "resolve", "defaults", "toPadding", "rects", "label", "valueOrDefault", "callback", "chart", "center", "MIN_INTEGER", "MAX_INTEGER", "rotated", "cos", "sin", "cx", "cy", "projected", "points", "axis", "pt", "dp", "toAxis", "p0", "p1", "HitBox", "rotation", "margin", "other", "axes", "pr0", "pr1", "coordinates", "geometry", "vs", "collide", "labels", "collider", "s0", "s1", "compute", "state", "proxy", "p", "h0", "h1", "layout", "datasets", "jlen", "a", "b", "sa", "sb", "dirty", "formatter", "keys", "klen", "k", "isObject", "EXPANDO_KEY", "DEFAULT_KEY", "configure", "dataset", "options", "override", "listeners", "configs", "key", "target", "each", "fn", "event", "dispatchEvent", "groups", "callback$1", "dispatchMoveEvents", "previous", "enter", "leave", "handleMoveEvents", "expando", "handleClickEvents", "handlers", "plugin", "args", "datasetIndex", "visible", "elements", "source", "actives", "update", "getOrCreateLegendList", "chart", "id", "legendContainer", "listContainer", "htmlLegendPlugin", "args", "options", "ul", "item", "li", "type", "boxSpan", "textContainer", "text", "charts_html_legend_default", "interaction", "visibleElements", "event", "filterElements", "options", "getNearestItem", "getElements", "inRangeByAxis", "element", "axis", "getPointByAxis", "center", "minDistance", "nearestItems", "evenPoint", "distance", "distanceBetweenPoints", "a", "b", "rotated", "point", "angle", "cos", "sin", "cx", "cy", "isOlderPart", "act", "req", "EPSILON", "clamp", "x", "from", "to", "inLimit", "limit", "hitSize", "clampAll", "obj", "key", "inPointRange", "radius", "inBoxRange", "y", "x2", "y2", "borderWidth", "hitTolerance", "inRangeX", "inRangeY", "inLabelRange", "rect", "rotation", "rotPoint", "toRadians", "getElementCenterPoint", "useFinalPosition", "centerX", "centerY", "requireVersion", "pkg", "min", "ver", "strict", "parts", "i", "isPercentString", "s", "toPercent", "toPositivePercent", "boxAppering", "defaultInitAnimation", "properties", "getRelativePosition", "size", "position", "getSize", "value", "positivePercent", "calculateTextAlignment", "width", "textAlign", "measureLabelRectangle", "labelSize", "xAdjust", "yAdjust", "padding", "hasPadding", "isObject", "height", "positionObj", "toPosition", "calculateLabelPosition$1", "defaultValue", "valueOrDefault", "shouldFit", "fitRatio", "toFonts", "optFont", "fonts", "isArray", "f", "font", "toFont", "isBoundToPoint", "defined", "start", "adjust", "initAnimationProperties", "chart", "initAnim", "applyDefault", "execCallback", "loadHooks", "hooks", "hooksContainer", "activated", "hook", "isFunction", "type", "result", "callback", "widthCache", "notRadius", "fontsKey", "prev", "item", "isImageOrCanvas", "content", "translate", "ctx", "setBorderStyle", "setShadowStyle", "measureLabelSize", "strokeWidth", "lines", "mapKey", "calculateLabelSize", "drawBox", "stroke", "addRoundedRectPath", "toTRBLCorners", "drawLabel", "getOpacity", "labels", "optColor", "colors", "setTextStrokeStyle", "applyLabelDecoration", "applyLabelContent", "drawPoint", "style", "rad", "RAD_PER_DEG", "drawPointStyle", "xOffset", "yOffset", "cornerRadius", "TAU", "TWO_THIRDS_PI", "QUARTER_PI", "PI", "HALF_PI", "count", "text", "lhs", "l", "lh", "c", "elementValue", "opacity", "isNumber", "positions", "drawCallout", "pointX", "pointY", "callout", "calloutPosition", "resolveCalloutPosition", "isPointInRange", "separatorStart", "separatorEnd", "getCalloutSeparatorCoord", "sideStart", "sideEnd", "getCalloutSideCoord", "rotatedPoint", "getCalloutSeparatorAdjust", "side", "getCalloutSideAdjust", "resolveCalloutAutoPosition", "xPoints", "yPoints", "index", "margin", "limitedLineScale", "scaleValue", "scale", "fallback", "isNumberFinite", "retrieveScaleID", "scales", "scaleID", "axes", "getDimensionByScale", "reverse", "end", "getChartPoint", "chartArea", "xScale", "yScale", "resolveBoxProperties", "xDim", "getChartDimensionByScale", "yDim", "resolvePointProperties", "box", "adjustCenterX", "adjustCenterY", "getChartCircle", "resolveLineProperties", "area", "resolveFullLineProperties", "resolveLimitedLineProperties", "resolveBoxAndLabelProperties", "resolveLabelElementProperties$1", "max", "scaleId", "startProp", "endProp", "dim", "calculateX", "calculatePosition", "calculateY", "boxOpts", "labelOpts", "padStart", "padEnd", "availableSize", "label", "toPadding", "moveHooks", "eventHooks", "updateListeners", "state", "scope", "handleEvent", "handleMoveEvents", "handleClickEvents", "elements", "previous", "context", "changed", "dispatchMoveEvents", "checkElements", "dispatchEvent", "listeners", "handler", "elementHooks", "updateHooks", "invokeHook", "callbackHook", "adjustScaleRange", "annotations", "range", "getScaleLimits", "changeScaleLimit", "verifyScaleOptions", "annotation", "verifyScaleIDs", "suggestedLimit", "scaleLimitDefined", "scaleOptions", "verifyProperties", "prop", "scaleIDOption", "limits", "updateLimits", "props", "raw", "BoxAnnotation", "Element", "mouseX", "mouseY", "DoughnutLabelAnnotation", "drawBackground", "meta", "getDatasetMeta", "controllerMeta", "getControllerMeta", "_fitRatio", "getFitRatio", "boxSize", "controller", "DoughnutController", "isControllerVisible", "left", "top", "right", "bottom", "innerRadius", "offsetX", "offsetY", "square", "space", "_radius", "_counterclockwise", "angles", "getAngles", "hypo", "yk2", "r2", "delta", "getAngleFromPoint", "_centerX", "_centerY", "_startAngle", "_endAngle", "LabelAnnotation", "visible", "getLabelSize", "hBorderWidth", "pointInLine", "p1", "p2", "t", "interpolateX", "interpolateY", "sqr", "v", "rangeLimit", "coordInCurve", "cp", "pointInCurve", "coordAngleInCurve", "angleInCurve", "LineAnnotation", "path", "mx", "my", "isOnLabel", "epsilon", "intersects", "inAxisRange", "length", "drawCurve", "startOpts", "endOpts", "startAdjust", "endAdjust", "getArrowHeads", "drawArrowHead", "inside", "isLineInArea", "limitLineToArea", "getControlPoint", "labelProperties", "resolveLabelElementProperties", "arrowHeadsDefaults", "limitPointToArea", "x1", "y1", "dx", "dy", "lenSq", "xx", "yy", "textSize", "calculateLabelPosition", "calculateAutoRotation", "sizes", "rotatedSize", "calculateT", "pt", "xCoordinateSizes", "yCoordinateSizes", "adjustLabelCoordinate", "toDegrees", "spaceAround", "calculateTAdjust", "lineSize", "lineW", "lineH", "r", "coordinate", "labelSizes", "halfSize", "line", "arrowStartOpts", "arrowEndOpts", "getLineAdjust", "arrowOpts", "offset", "fill", "backgroundColor", "borderColor", "arrowOffsetX", "drawArrowHeadOnCurve", "startAngle", "endAngle", "ps", "pe", "EllipseAnnotation", "pointInEllipse", "p", "ellipse", "xRadius", "yRadius", "cosAngle", "sinAngle", "PointAnnotation", "PolygonAnnotation", "pointIsInPolygon", "axisPoints", "first", "el", "sides", "elProps", "buildPointElement", "points", "isInside", "A", "B", "annotationTypes", "defaults", "directUpdater", "hooks$1", "resolve", "optDefs", "resolveObj", "isIndexable", "resolveType", "updateElements", "mode", "animations", "resolveAnimations", "resyncElements", "annotationOptions", "getOrCreateElement", "resolver", "getContext", "toSkip", "updateSubElements", "resolveAnnotationOptions", "animOpts", "Animations", "mainElement", "subElements", "definition", "subElement", "subResolver", "initProperties", "elementClass", "defs", "add", "version", "chartStates", "isNotDoughnutLabel", "Chart", "args", "_args", "draw", "opts", "caller", "clip", "clipArea", "drawableElements", "getDrawableElements", "drawElement", "unclipArea", "sub", "Chart", "plugin", "annotation", "charts_default", "MONEY", "czHorizontalBarChart", "ctx", "data", "v", "czVerticalBarChart", "czPieChart", "legend", "legend_el", "charts_html_legend_default", "czFundsBarChart", "czMiniFinanceChart", "labels", "label", "color", "import_leaflet", "import_maplibre_gl_leaflet", "import_maplibre_gl", "import_geohash", "ascending", "a", "b", "descending", "a", "b", "bisector", "f", "compare1", "compare2", "delta", "ascending", "d", "x", "descending", "zero", "left", "a", "lo", "hi", "mid", "right", "center", "i", "number", "x", "ascendingBisect", "bisector", "ascending", "bisectRight", "bisectLeft", "bisectCenter", "number", "bisect_default", "e10", "e5", "e2", "tickSpec", "start", "stop", "count", "step", "power", "error", "factor", "i1", "i2", "inc", "ticks", "reverse", "n", "i", "tickIncrement", "tickStep", "noop", "dispatch", "i", "n", "_", "t", "Dispatch", "parseTypenames", "typenames", "types", "name", "typename", "callback", "T", "get", "set", "copy", "type", "that", "args", "c", "dispatch_default", "xhtml", "namespaces_default", "namespace_default", "name", "prefix", "i", "namespaces_default", "creatorInherit", "name", "document", "uri", "xhtml", "creatorFixed", "fullname", "creator_default", "namespace_default", "none", "selector_default", "selector", "select_default", "select", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "Selection", "array", "x", "empty", "selectorAll_default", "selector", "arrayAll", "select", "array", "selectAll_default", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "Selection", "matcher_default", "selector", "childMatcher", "node", "find", "childFind", "match", "childFirst", "selectChild_default", "childMatcher", "filter", "children", "childrenFilter", "match", "selectChildren_default", "childMatcher", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Selection", "sparse_default", "update", "enter_default", "Selection", "sparse_default", "EnterNode", "parent", "datum", "child", "next", "selector", "constant_default", "x", "bindIndex", "parent", "group", "enter", "update", "exit", "data", "i", "node", "groupLength", "dataLength", "EnterNode", "bindKey", "key", "nodeByKeyValue", "keyValues", "keyValue", "datum", "data_default", "value", "bind", "parents", "groups", "constant_default", "m", "j", "arraylike", "enterGroup", "updateGroup", "exitGroup", "i0", "i1", "previous", "next", "Selection", "exit_default", "Selection", "sparse_default", "join_default", "onenter", "onupdate", "onexit", "enter", "update", "exit", "merge_default", "context", "selection", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Selection", "order_default", "groups", "j", "m", "group", "i", "next", "node", "sort_default", "compare", "ascending", "compareNode", "a", "b", "groups", "m", "sortgroups", "j", "group", "n", "sortgroup", "node", "i", "Selection", "call_default", "callback", "nodes_default", "node_default", "groups", "j", "m", "group", "i", "n", "node", "size_default", "size", "node", "empty_default", "each_default", "callback", "groups", "j", "m", "group", "i", "n", "node", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "value", "attrConstantNS", "attrFunction", "v", "attrFunctionNS", "attr_default", "namespace_default", "node", "window_default", "node", "styleRemove", "name", "styleConstant", "value", "priority", "styleFunction", "v", "style_default", "styleValue", "node", "window_default", "propertyRemove", "name", "propertyConstant", "value", "propertyFunction", "v", "property_default", "classArray", "string", "classList", "node", "ClassList", "name", "i", "classedAdd", "names", "list", "n", "classedRemove", "classedTrue", "classedFalse", "classedFunction", "value", "classed_default", "textRemove", "textConstant", "value", "textFunction", "v", "text_default", "htmlRemove", "htmlConstant", "value", "htmlFunction", "v", "html_default", "raise", "raise_default", "lower", "lower_default", "append_default", "name", "create", "creator_default", "constantNull", "insert_default", "name", "before", "create", "creator_default", "select", "selector_default", "remove", "parent", "remove_default", "selection_cloneShallow", "clone", "parent", "selection_cloneDeep", "clone_default", "deep", "datum_default", "value", "contextListener", "listener", "event", "parseTypenames", "typenames", "t", "name", "i", "onRemove", "typename", "on", "j", "m", "o", "onAdd", "value", "options", "on_default", "n", "dispatchEvent", "node", "type", "params", "window", "window_default", "event", "dispatchConstant", "dispatchFunction", "dispatch_default", "iterator_default", "groups", "j", "m", "group", "i", "n", "node", "root", "Selection", "groups", "parents", "selection", "selection_selection", "select_default", "selectAll_default", "selectChild_default", "selectChildren_default", "filter_default", "data_default", "enter_default", "exit_default", "join_default", "merge_default", "order_default", "sort_default", "call_default", "nodes_default", "node_default", "size_default", "empty_default", "each_default", "attr_default", "style_default", "property_default", "classed_default", "text_default", "html_default", "raise_default", "lower_default", "append_default", "insert_default", "remove_default", "clone_default", "datum_default", "on_default", "dispatch_default", "iterator_default", "selection_default", "define_default", "constructor", "factory", "prototype", "extend", "parent", "definition", "key", "Color", "darker", "brighter", "reI", "reN", "reP", "reHex", "reRgbInteger", "reRgbPercent", "reRgbaInteger", "reRgbaPercent", "reHslPercent", "reHslaPercent", "named", "define_default", "color", "channels", "color_formatHex", "color_formatHex8", "color_formatHsl", "color_formatRgb", "hslConvert", "format", "m", "l", "rgbn", "Rgb", "rgba", "hsla", "n", "r", "g", "b", "a", "rgbConvert", "o", "rgb", "opacity", "extend", "k", "clampi", "clampa", "rgb_formatHex", "rgb_formatHex8", "rgb_formatRgb", "hex", "value", "h", "s", "Hsl", "min", "max", "hsl", "m2", "m1", "hsl2rgb", "clamph", "clampt", "basis", "t1", "v0", "v1", "v2", "v3", "t2", "t3", "basis_default", "values", "n", "t", "i", "basisClosed_default", "values", "n", "t", "i", "v0", "v1", "v2", "v3", "basis", "constant_default", "x", "linear", "a", "d", "t", "exponential", "b", "y", "gamma", "y", "nogamma", "a", "b", "exponential", "constant_default", "d", "linear", "rgb_default", "rgbGamma", "y", "color", "gamma", "rgb", "start", "end", "r", "g", "b", "opacity", "nogamma", "t", "rgbSpline", "spline", "colors", "n", "i", "rgbBasis", "basis_default", "rgbBasisClosed", "basisClosed_default", "numberArray_default", "a", "b", "n", "c", "i", "t", "isNumberArray", "x", "genericArray", "a", "b", "nb", "na", "x", "c", "i", "value_default", "t", "date_default", "a", "b", "d", "t", "number_default", "a", "b", "t", "object_default", "a", "b", "i", "c", "k", "value_default", "t", "reA", "reB", "zero", "b", "one", "t", "string_default", "a", "bi", "am", "bm", "bs", "i", "s", "q", "number_default", "o", "value_default", "a", "b", "t", "c", "constant_default", "number_default", "color", "rgb_default", "string_default", "date_default", "isNumberArray", "numberArray_default", "genericArray", "object_default", "round_default", "a", "b", "t", "degrees", "identity", "decompose_default", "a", "b", "c", "d", "e", "f", "scaleX", "scaleY", "skewX", "svgNode", "parseCss", "value", "m", "identity", "decompose_default", "parseSvg", "interpolateTransform", "parse", "pxComma", "pxParen", "degParen", "pop", "s", "translate", "xa", "ya", "xb", "yb", "q", "i", "number_default", "rotate", "a", "b", "skewX", "scale", "t", "n", "o", "interpolateTransformCss", "parseCss", "interpolateTransformSvg", "parseSvg", "frame", "timeout", "interval", "pokeDelay", "taskHead", "taskTail", "clockLast", "clockNow", "clockSkew", "clock", "setFrame", "f", "now", "clearNow", "Timer", "timer", "callback", "delay", "time", "sleep", "t", "timerFlush", "e", "wake", "nap", "poke", "t0", "t1", "t2", "timeout_default", "callback", "delay", "time", "t", "Timer", "elapsed", "emptyOn", "dispatch_default", "emptyTween", "CREATED", "SCHEDULED", "STARTING", "STARTED", "RUNNING", "ENDING", "ENDED", "schedule_default", "node", "name", "id", "index", "group", "timing", "schedules", "create", "init", "schedule", "get", "set", "self", "tween", "timer", "elapsed", "start", "i", "j", "n", "o", "stop", "timeout_default", "tick", "t", "interrupt_default", "node", "name", "schedules", "schedule", "active", "empty", "i", "STARTING", "ENDING", "ENDED", "interrupt_default", "name", "tweenRemove", "id", "name", "tween0", "tween1", "schedule", "set", "tween", "i", "n", "tweenFunction", "value", "t", "tween_default", "get", "tweenValue", "transition", "node", "interpolate_default", "a", "b", "c", "number_default", "color", "rgb_default", "string_default", "attrRemove", "name", "attrRemoveNS", "fullname", "attrConstant", "interpolate", "value1", "string00", "string1", "interpolate0", "string0", "attrConstantNS", "attrFunction", "value", "string10", "attrFunctionNS", "attr_default", "namespace_default", "i", "interpolateTransformSvg", "interpolate_default", "tweenValue", "attrInterpolate", "name", "i", "t", "attrInterpolateNS", "fullname", "attrTweenNS", "value", "t0", "i0", "tween", "attrTween", "attrTween_default", "key", "namespace_default", "delayFunction", "id", "value", "init", "delayConstant", "delay_default", "get", "durationFunction", "id", "value", "set", "durationConstant", "duration_default", "get", "easeConstant", "id", "value", "set", "ease_default", "get", "easeVarying", "id", "value", "v", "set", "easeVarying_default", "filter_default", "match", "matcher_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "i", "Transition", "merge_default", "transition", "groups0", "groups1", "m0", "m1", "m", "merges", "j", "group0", "group1", "n", "merge", "node", "i", "Transition", "start", "name", "t", "i", "onFunction", "id", "listener", "on0", "on1", "sit", "init", "set", "schedule", "on", "on_default", "get", "removeFunction", "id", "parent", "i", "remove_default", "select_default", "select", "name", "id", "selector_default", "groups", "m", "subgroups", "j", "group", "n", "subgroup", "node", "subnode", "i", "schedule_default", "get", "Transition", "selectAll_default", "select", "name", "id", "selectorAll_default", "groups", "m", "subgroups", "parents", "j", "group", "n", "node", "i", "children", "child", "inherit", "get", "k", "l", "schedule_default", "Transition", "Selection", "selection_default", "styleNull", "name", "interpolate", "string00", "string10", "interpolate0", "string0", "styleValue", "string1", "styleRemove", "styleConstant", "value1", "styleFunction", "value", "styleMaybeRemove", "id", "on0", "on1", "listener0", "key", "event", "remove", "schedule", "set", "on", "listener", "style_default", "priority", "i", "interpolateTransformCss", "interpolate_default", "tweenValue", "styleInterpolate", "name", "i", "priority", "t", "styleTween", "value", "i0", "tween", "styleTween_default", "key", "textConstant", "value", "textFunction", "value1", "text_default", "tweenValue", "textInterpolate", "i", "t", "textTween", "value", "t0", "i0", "tween", "textTween_default", "key", "transition_default", "name", "id0", "id1", "newId", "groups", "m", "j", "group", "n", "node", "i", "inherit", "get", "schedule_default", "Transition", "end_default", "on0", "on1", "that", "id", "size", "resolve", "reject", "cancel", "end", "schedule", "set", "on", "id", "Transition", "groups", "parents", "name", "transition", "selection_default", "newId", "selection_prototype", "select_default", "selectAll_default", "filter_default", "merge_default", "transition_default", "on_default", "attr_default", "attrTween_default", "style_default", "styleTween_default", "text_default", "textTween_default", "remove_default", "tween_default", "delay_default", "duration_default", "ease_default", "easeVarying_default", "end_default", "cubicInOut", "t", "defaultTiming", "cubicInOut", "inherit", "node", "id", "timing", "transition_default", "name", "Transition", "newId", "now", "groups", "m", "j", "group", "n", "i", "schedule_default", "selection_default", "interrupt_default", "transition_default", "abs", "max", "min", "number1", "e", "number2", "X", "type", "x", "xy", "Y", "y", "XY", "type", "t", "formatDecimal_default", "x", "formatDecimalParts", "p", "i", "coefficient", "exponent_default", "x", "formatDecimalParts", "formatGroup_default", "grouping", "thousands", "value", "width", "i", "t", "j", "g", "length", "formatNumerals_default", "numerals", "value", "i", "re", "formatSpecifier", "specifier", "match", "FormatSpecifier", "formatTrim_default", "s", "out", "n", "i", "i0", "i1", "prefixExponent", "formatPrefixAuto_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "i", "n", "formatRounded_default", "x", "p", "d", "formatDecimalParts", "coefficient", "exponent", "formatTypes_default", "x", "p", "formatDecimal_default", "formatRounded_default", "formatPrefixAuto_default", "identity_default", "x", "map", "prefixes", "locale_default", "locale", "group", "identity_default", "formatGroup_default", "currencyPrefix", "currencySuffix", "decimal", "numerals", "formatNumerals_default", "percent", "minus", "nan", "newFormat", "specifier", "formatSpecifier", "fill", "align", "sign", "symbol", "zero", "width", "comma", "precision", "trim", "type", "formatTypes_default", "prefix", "suffix", "formatType", "maybeSuffix", "format", "value", "valuePrefix", "valueSuffix", "i", "n", "c", "valueNegative", "formatTrim_default", "prefixExponent", "length", "padding", "formatPrefix", "f", "e", "exponent_default", "k", "locale", "format", "formatPrefix", "defaultLocale", "definition", "locale_default", "precisionFixed_default", "step", "exponent_default", "precisionPrefix_default", "step", "value", "exponent_default", "precisionRound_default", "step", "max", "exponent_default", "initRange", "domain", "range", "constants", "x", "number", "x", "unit", "identity", "x", "normalize", "a", "b", "constants", "clamper", "t", "bimap", "domain", "range", "interpolate", "d0", "d1", "r0", "r1", "polymap", "j", "d", "r", "i", "bisect_default", "copy", "source", "target", "transformer", "value_default", "transform", "untransform", "unknown", "clamp", "piecewise", "output", "input", "rescale", "n", "scale", "y", "number_default", "_", "number", "round_default", "u", "continuous", "tickFormat", "start", "stop", "count", "specifier", "step", "tickStep", "precision", "formatSpecifier", "value", "precisionPrefix_default", "formatPrefix", "precisionRound_default", "precisionFixed_default", "format", "linearish", "scale", "domain", "count", "d", "ticks", "specifier", "tickFormat", "i0", "i1", "start", "stop", "prestep", "step", "maxIter", "tickIncrement", "linear", "continuous", "copy", "initRange", "Transform", "k", "x", "y", "point", "location", "identity", "transform", "node", "createMap", "ctx", "chart_data", "MAPSTYLE", "UK_BOUNDS", "markers", "v", "popupContent", "values", "max_value", "median_value", "a", "b", "color", "linear", "opacity", "radius_adjustment", "value", "radius", "polygon", "MAX_LENGTH", "getIncomeData", "income_data", "max_length", "sort_by", "a", "b", "ImdDecileChart", "ctx", "labels", "data", "label", "charts_default", "value", "createChart", "chart_id", "chart_data", "chart", "v", "context", "MONEY", "index", "ticks", "max_tick", "tick", "return_value", "suffix", "e", "czVerticalBarChart", "czPieChart", "czHorizontalBarChart", "el", "createMap", "src_default", "Alpine", "persist", "alias", "storage", "e", "dummy", "initialValue", "getter", "setter", "path", "key", "lookup", "initial", "storageHas", "storageGet", "value", "storageSet", "func", "target", "get", "set", "module_default", "module_default", "entries", "boxes", "checkboxes", "allValues", "el", "chart_item", "createChart", "setupAlpine_default", "import_htmx", "createToast", "message", "element", "node", "container", "event", "targetError", "createToast", "message", "evt", "e", "details", "event", "createIncomeChart", "ctx_income_chart", "czPieChart", "createSpendingChart", "ctx_spending_chart", "createFundsChart", "ctx_funds_chart", "funds_chart", "czFundsBarChart", "createCharts", "createCharts", "ctx", "finances", "prefix", "charts_default", "x", "value", "index", "values", "createMiniExpenditureChart", "ctx", "finances", "color", "czMiniFinanceChart", "x", "createMiniIncomeChart", "main", "setupCopyText", "createCharts", "createMiniExpenditureChart", "createMiniIncomeChart", "setupTables", "event", "charts_default", "setupAlpine_default"]
}
